|
@@ -185,15 +185,31 @@
|
|
|
MAX(det.create_id) AS createId,
|
|
|
MAX(det.create_time) AS createTime,
|
|
|
GROUP_CONCAT(cou.id) AS examDetailCourseIds,
|
|
|
- GROUP_CONCAT(CONCAT(bc.name, '(', bc.code, ')')) AS courseNameCode,
|
|
|
+ GROUP_CONCAT(cou.course_code_name) AS courseNameCode,
|
|
|
GROUP_CONCAT(cou.course_id) AS courseIds,
|
|
|
GROUP_CONCAT(cou.paper_number) AS paperNumber
|
|
|
FROM
|
|
|
exam_detail det
|
|
|
INNER JOIN
|
|
|
- exam_detail_course cou ON det.id = cou.exam_detail_id
|
|
|
+ (select edc.exam_detail_id,
|
|
|
+ GROUP_CONCAT(edc.id) AS id,
|
|
|
+ GROUP_CONCAT(edc.course_id) AS course_id,
|
|
|
+ GROUP_CONCAT(edc.paper_number) AS paper_number,
|
|
|
+ GROUP_CONCAT(CONCAT(bc.name, '(', bc.code, ')')) AS course_code_name
|
|
|
+ from exam_detail_course edc
|
|
|
LEFT JOIN
|
|
|
- basic_course bc ON cou.course_id = bc.id
|
|
|
+ basic_course bc ON edc.course_id = bc.id
|
|
|
+ <where>
|
|
|
+ <if test="dpr != null">
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND bc.teaching_room_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by edc.exam_detail_id) cou ON det.id = cou.exam_detail_id
|
|
|
LEFT JOIN
|
|
|
(select * from basic_exam where enable = true) be on be.id = det.exam_id
|
|
|
LEFT JOIN
|
|
@@ -233,12 +249,6 @@
|
|
|
<if test="dpr.requestUserId != null">
|
|
|
AND det.create_id = #{dpr.requestUserId}
|
|
|
</if>
|
|
|
- <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
- AND bc.teaching_room_id IN
|
|
|
- <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
</if>
|
|
|
</where>
|
|
|
GROUP BY det.id
|
|
@@ -683,9 +693,23 @@
|
|
|
FROM
|
|
|
exam_detail det
|
|
|
INNER JOIN
|
|
|
- exam_detail_course cou ON det.id = cou.exam_detail_id
|
|
|
- LEFT JOIN
|
|
|
- basic_course bc ON cou.course_id = bc.id
|
|
|
+ (select edc.exam_detail_id,
|
|
|
+ GROUP_CONCAT(edc.course_id) AS course_id,
|
|
|
+ GROUP_CONCAT(edc.paper_number) AS paper_number
|
|
|
+ from exam_detail_course edc
|
|
|
+ LEFT JOIN
|
|
|
+ basic_course bc ON edc.course_id = bc.id
|
|
|
+ <where>
|
|
|
+ <if test="dpr != null">
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND bc.teaching_room_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by exam_detail_id) cou ON det.id = cou.exam_detail_id
|
|
|
LEFT JOIN
|
|
|
exam_print_plan epp on epp.id = det.print_plan_id
|
|
|
LEFT JOIN
|
|
@@ -705,10 +729,10 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="courseId != null">
|
|
|
- AND cou.course_id = #{courseId}
|
|
|
+ AND cou.course_id like concat('%', #{courseId}, '%')
|
|
|
</if>
|
|
|
<if test="paperNumber != null and paperNumber != ''">
|
|
|
- AND cou.paper_number = #{paperNumber}
|
|
|
+ AND cou.paper_number like concat('%', #{paperNumber}, '%')
|
|
|
</if>
|
|
|
<if test="examPlace != null and examPlace != ''">
|
|
|
AND det.exam_place = #{examPlace}
|
|
@@ -729,12 +753,6 @@
|
|
|
<if test="dpr.requestUserId != null">
|
|
|
AND det.create_id = #{dpr.requestUserId}
|
|
|
</if>
|
|
|
- <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
- AND bc.teaching_room_id IN
|
|
|
- <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
</if>
|
|
|
</where>
|
|
|
GROUP BY det.school_id
|