|
@@ -1,47 +1,64 @@
|
|
|
<?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.qmth.exam.reserve.dao.StudentApplyDao">
|
|
|
- <select id="page"
|
|
|
- resultType="com.qmth.exam.reserve.bean.stdapply.StudentApplyVO">
|
|
|
- select a.id,s.name,s.identity_number
|
|
|
- identityNumber,s.student_code
|
|
|
- studentCode,o.name teachingName,es.name
|
|
|
- agentName, p.start_time
|
|
|
- startTime,p.end_time endTime,
|
|
|
- r.name roomName, a.cancel,a.update_time
|
|
|
- updateTime,u.name userName
|
|
|
- from t_student s,t_category o,t_student_apply a
|
|
|
- left join t_exam_site es on
|
|
|
- es.id=a.exam_site_id
|
|
|
- left join t_time_period
|
|
|
- p on p.id=a.time_period_id
|
|
|
- left join t_exam_room r on
|
|
|
- r.id=a.exam_room_id
|
|
|
- left join t_user u on u.id=a.user_id
|
|
|
- where
|
|
|
- a.student_id=s.id and s.category_id=o.id
|
|
|
- <if test="req.teachingId != null">
|
|
|
- and s.category_id=#{req.teachingId}
|
|
|
- </if>
|
|
|
- <if test="req.agentId != null">
|
|
|
- and a.exam_site_id=#{req.agentId}
|
|
|
- </if>
|
|
|
- <if test="req.name != null and req.name !=''">
|
|
|
- and s.name like concat('%',#{req.name},'%')
|
|
|
- </if>
|
|
|
- <if test="req.identityNumber != null and req.identityNumber !=''">
|
|
|
- and s.identity_number=#{req.identityNumber}
|
|
|
- </if>
|
|
|
- <if test="req.studentCode != null and req.studentCode !=''">
|
|
|
- and s.student_code=#{req.studentCode}
|
|
|
- </if>
|
|
|
- order by a.id
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getHaveApplyCount" resultType="int">
|
|
|
- select count(sa.id) from t_student_apply sa, t_exam_site s where sa.exam_site_id=s.id and sa.cancel=1 and sa.exam_site_id in
|
|
|
- <foreach collection="examSiteIds" item="item" index="index" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
+ <select id="page"
|
|
|
+ resultType="com.qmth.exam.reserve.bean.stdapply.StudentApplyVO">
|
|
|
+ select a.id,s.name,s.identity_number
|
|
|
+ identityNumber,s.student_code
|
|
|
+ studentCode,o.name teachingName,es.name
|
|
|
+ agentName, p.start_time
|
|
|
+ startTime,p.end_time endTime,
|
|
|
+ r.name roomName, a.cancel,a.update_time
|
|
|
+ updateTime,u.name userName
|
|
|
+ from t_student s,t_category o,t_student_apply a
|
|
|
+ left join t_exam_site es on
|
|
|
+ es.id=a.exam_site_id
|
|
|
+ left join t_time_period
|
|
|
+ p on p.id=a.time_period_id
|
|
|
+ left join t_exam_room r on
|
|
|
+ r.id=a.exam_room_id
|
|
|
+ left join t_user u on u.id=a.user_id
|
|
|
+ where
|
|
|
+ a.student_id=s.id and s.category_id=o.id
|
|
|
+ <if test="req.teachingId != null">
|
|
|
+ and s.category_id=#{req.teachingId}
|
|
|
+ </if>
|
|
|
+ <if test="req.agentId != null">
|
|
|
+ and a.exam_site_id=#{req.agentId}
|
|
|
+ </if>
|
|
|
+ <if test="req.name != null and req.name !=''">
|
|
|
+ and s.name like concat('%',#{req.name},'%')
|
|
|
+ </if>
|
|
|
+ <if test="req.identityNumber != null and req.identityNumber !=''">
|
|
|
+ and s.identity_number=#{req.identityNumber}
|
|
|
+ </if>
|
|
|
+ <if test="req.studentCode != null and req.studentCode !=''">
|
|
|
+ and s.student_code=#{req.studentCode}
|
|
|
+ </if>
|
|
|
+ order by a.id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getHaveApplyCount" resultType="int">
|
|
|
+ select count(sa.id) from t_student_apply sa, t_exam_site s where sa.exam_site_id=s.id and sa.cancel=1 and
|
|
|
+ sa.exam_site_id in
|
|
|
+ <foreach collection="examSiteIds" item="item" index="index" separator="," open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getStudentApplyList" resultType="com.qmth.exam.reserve.bean.apply.ApplyVO">
|
|
|
+ select sa.id applyId,sa.time_period_id,sa.exam_site_id,sa.cancel,sa.ticket_number,
|
|
|
+ tp.start_time timePeriodStart,tp.end_time timePeriodEnd,
|
|
|
+ es.name examSiteName,es.address examSiteAddress,
|
|
|
+ c.id categoryId,c.name categoryName
|
|
|
+ from t_student_apply sa
|
|
|
+ inner join t_time_period tp on tp.id=sa.time_period_id
|
|
|
+ inner join t_exam_site es on es.id=sa.exam_site_id
|
|
|
+ inner join t_category c on c.id=es.category_id
|
|
|
+ where sa.student_id = #{studentId}
|
|
|
+ <if test="cancel != null">
|
|
|
+ and sa.cancel = #{cancel}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|