| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.template.mapper.WelcomeStudentMapper">
- <resultMap type="com.template.model.vo.StudentPageVo" id="studentPageMap">
- <result property="id" column="id"/>
- <result property="admissNum" column="admiss_num"/>
- <result property="name" column="name"/>
- <result property="cardId" column="card_id"/>
- <result property="college" column="college"/>
- <result property="major" column="major"/>
- <result property="classstr" column="classstr"/>
- <result property="trafficMethod" column="traffic_method"/>
- <result property="arrive" column="arrive"/>
- <result property="amountPayable" column="amount_payable"/>
- <result property="payAmount" column="pay_amount"/>
- <result property="dormitory" column="dormitory"/>
- <result property="accompanyNum" column="accompanyNum"/>
- </resultMap>
- <select id="queryStudentPageList" resultType="com.template.model.vo.StudentPageVo" resultMap="studentPageMap">
- select (select count(id) from welcome_accompany where student_card = ws.card_id) as accompanyNum,
- ws.id,ws.admiss_num,ws.name,ws.card_id,ws.college,ws.major,ws.classstr,
- ws.traffic_method,ws.arrive,ws.amount_payable,ws.pay_amount,
- CONCAT(wsd.building, '-', wsd.dormitory, '-', wsd.bed_num) as dormitory
- from welcome_student ws
- left join welcome_student_dormitory wsd on wsd.deleted =0 and wsd.student_card = ws.card_id
- where ws.deleted = 0
- <if test="collegeId != null and collegeId != ''">
- ws.college_id = #{collegeId}
- </if>
- <if test="majorId != null and majorId != ''">
- ws.major_id = #{majorId}
- </if>
- <if test="classstrId != null and classstrId != ''">
- ws.classstr_id = #{classstrId}
- </if>
- <if test="trafficMethod != null and trafficMethod != ''">
- ws.trafficMethod = #{trafficMethod}
- </if>
- <if test="name != null and name != ''">
- ws.name like '%' #{name} '%'
- </if>
- order by ws.update_time desc
- </select>
- <select id="studentRegister" resultType="com.template.model.vo.StudentRegisterVo">
- SELECT count(ws.id) AS count,
- wo.`name` AS collegeName
- FROM
- `welcome_student` ws
- LEFT JOIN welcome_org wo
- ON ws.college_id = wo.id AND wo.deleted = 0
- WHERE
- ws.deleted = 0
- AND ws.iden_type=1
- GROUP BY
- college_id
- </select>
- <select id="studentTraffic" resultType="com.template.model.vo.StudentTrafficVo">
- SELECT count(ws.id) AS count,
- ws.traffic_method as trafficMethod
- FROM
- `welcome_student` ws
- WHERE
- ws.deleted = 0
- AND ws.iden_type=1
- GROUP BY
- traffic_method
- </select>
- <select id="studentSexRatio" resultType="com.template.model.vo.StudentSexRatioVo">
- SELECT wo.`name` as collegeName,
- new.count AS manCount,
- new2.count AS girlCount
- FROM `welcome_student` w
- LEFT JOIN (SELECT ws.college_id AS collegeId,
- count(ws.id) AS count
- FROM
- `welcome_student` ws
- WHERE
- ws.deleted = 0
- AND ws.sex = '男'
- AND ws.iden_type=1
- GROUP BY
- college_id) new ON w.college_id = new.collegeId
- LEFT JOIN (SELECT ws.college_id AS collegeId,
- count(ws.id) AS count
- FROM
- `welcome_student` ws
- WHERE
- ws.deleted = 0
- AND ws.sex = '女'
- AND ws.iden_type=1
- GROUP BY
- college_id) new2 ON w.college_id = new2.collegeId
- LEFT JOIN welcome_org wo ON w.college_id = wo.id
- AND wo.deleted = 0
- GROUP BY w.college_id
- </select>
- </mapper>
|