|
@@ -104,10 +104,12 @@
|
|
|
|
|
|
<sql id="queryCondition">
|
|
|
<where>
|
|
|
- er.organ_id_ IN
|
|
|
- <foreach collection="organIds" item="organId" separator="," open="(" close=")">
|
|
|
- #{organId}
|
|
|
- </foreach>
|
|
|
+ <if test="organIds!=null">
|
|
|
+ AND er.organ_id_ IN
|
|
|
+ <foreach collection="organIds" item="organId" separator="," open="(" close=")">
|
|
|
+ #{organId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
<if test="examId!=null">
|
|
|
AND er.examination_basic_id_ = #{examId}
|
|
|
</if>
|
|
@@ -158,10 +160,13 @@
|
|
|
FROM
|
|
|
exam_registration er
|
|
|
LEFT JOIN exam_room_student_relation ersr ON ersr.student_id_ = er.student_id_
|
|
|
- WHERE ersr.organ_id_ IN
|
|
|
- <foreach collection="organIds" item="organI" separator="," open="(" close=")">
|
|
|
- #{organI}
|
|
|
- </foreach>
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="organIds!=null">
|
|
|
+ AND ersr.organ_id_ IN
|
|
|
+ <foreach collection="organIds" item="organI" separator="," open="(" close=")">
|
|
|
+ #{organI}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
AND er.examination_basic_id_ = #{examId}
|
|
|
AND ersr.id_ IS NULL
|
|
|
</select>
|
|
@@ -172,10 +177,13 @@
|
|
|
FROM
|
|
|
exam_room_student_relation ersr
|
|
|
LEFT JOIN exam_registration er ON ersr.student_id_ = er.student_id_ AND er.examination_basic_id_=ersr.examination_basic_id_
|
|
|
- WHERE er.organ_id_ IN
|
|
|
- <foreach collection="organIds" item="organI" separator="," open="(" close=")">
|
|
|
- #{organI}
|
|
|
- </foreach>
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="organIds!=null">
|
|
|
+ er.organ_id_ IN
|
|
|
+ <foreach collection="organIds" item="organI" separator="," open="(" close=")">
|
|
|
+ #{organI}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
AND ersr.examination_basic_id_ = #{examId}
|
|
|
</select>
|
|
|
|
|
@@ -196,10 +204,12 @@
|
|
|
exam_registration er
|
|
|
WHERE
|
|
|
er.examination_basic_id_ = #{examId}
|
|
|
- AND er.organ_id_ IN
|
|
|
- <foreach collection="organIds" item="organId" separator="," open="(" close=")">
|
|
|
- #{organId}
|
|
|
- </foreach>
|
|
|
+ <if test="organIds!=null">
|
|
|
+ AND er.organ_id_ IN
|
|
|
+ <foreach collection="organIds" item="organId" separator="," open="(" close=")">
|
|
|
+ #{organId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="countTotalRegistrationStudentNumWithExam" resultType="int">
|
|
@@ -207,10 +217,13 @@
|
|
|
COUNT(er.id_)
|
|
|
FROM
|
|
|
exam_registration er
|
|
|
- WHERE er.organ_id_ IN
|
|
|
- <foreach collection="organIds" item="organI" separator="," open="(" close=")">
|
|
|
- #{organI}
|
|
|
- </foreach>
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="organIds!=null">
|
|
|
+ AND er.organ_id_ IN
|
|
|
+ <foreach collection="organIds" item="organI" separator="," open="(" close=")">
|
|
|
+ #{organI}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
AND er.examination_basic_id_ = #{examId}
|
|
|
AND er.status_ != ''
|
|
|
</select>
|