|
@@ -50,12 +50,43 @@
|
|
|
b.print_house_id as printHouseId,
|
|
|
e.name as printHouseName,
|
|
|
e.code as printHouseCode,
|
|
|
- bs.id as semesterId,
|
|
|
- bs.name as semesterName,
|
|
|
- be.id as examId,
|
|
|
- be.name as examName
|
|
|
+ a.semester_id as semesterId,
|
|
|
+ a.semester_name as semesterName,
|
|
|
+ a.exam_id as examId,
|
|
|
+ a.exam_name as examName
|
|
|
FROM
|
|
|
- exam_print_plan a
|
|
|
+ (select epp.id, epp.exam_id, epp.name, be.name exam_name, bs.id semester_id, bs.name semester_name
|
|
|
+ from exam_print_plan epp
|
|
|
+ LEFT JOIN
|
|
|
+ basic_exam be ON be.id = epp.exam_id
|
|
|
+ LEFT JOIN
|
|
|
+ basic_semester bs ON bs.id = be.semester_id
|
|
|
+ <where>
|
|
|
+ and be.enable = true
|
|
|
+ <if test="schoolId != null">
|
|
|
+ and epp.school_id = #{schoolId}
|
|
|
+ </if>
|
|
|
+ <if test="semesterId != null">
|
|
|
+ and bs.id = #{semesterId}
|
|
|
+ </if>
|
|
|
+ <if test="examId != null">
|
|
|
+ and be.id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="printPlanId != null">
|
|
|
+ and epp.id = #{printPlanId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr != null">
|
|
|
+ <if test="dpr.requestUserId != null">
|
|
|
+ AND epp.create_id = #{dpr.requestUserId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND epp.org_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>) a
|
|
|
JOIN
|
|
|
exam_detail b ON a.id = b.print_plan_id
|
|
|
JOIN
|
|
@@ -76,27 +107,8 @@
|
|
|
</where>
|
|
|
GROUP BY exam_detail_id) c ON b.id = c.exam_detail_id
|
|
|
LEFT JOIN
|
|
|
- sys_user d on a.create_id = d.id
|
|
|
- LEFT JOIN
|
|
|
sys_org e ON b.print_house_id = e.id
|
|
|
- LEFT JOIN
|
|
|
- basic_exam be ON be.id = a.exam_id
|
|
|
- LEFT JOIN
|
|
|
- basic_semester bs ON bs.id = be.semester_id
|
|
|
<where>
|
|
|
- and be.enable = true
|
|
|
- <if test="schoolId != null and schoolId != ''">
|
|
|
- and a.school_id = #{schoolId}
|
|
|
- </if>
|
|
|
- <if test="semesterId != null and semesterId != ''">
|
|
|
- and bs.id = #{semesterId}
|
|
|
- </if>
|
|
|
- <if test="examId != null and examId != ''">
|
|
|
- and be.id = #{examId}
|
|
|
- </if>
|
|
|
- <if test="printPlanId != null and printPlanId != ''">
|
|
|
- and a.id = #{printPlanId}
|
|
|
- </if>
|
|
|
<if test="status != null and status != ''">
|
|
|
and b.status = #{status}
|
|
|
</if>
|
|
@@ -121,17 +133,6 @@
|
|
|
<if test="printHouseId != null and printHouseId != ''">
|
|
|
and b.print_house_id = #{printHouseId}
|
|
|
</if>
|
|
|
- <if test="dpr != null">
|
|
|
- <if test="dpr.requestUserId != null">
|
|
|
- AND a.create_id = #{dpr.requestUserId}
|
|
|
- </if>
|
|
|
- <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
- AND a.org_id IN
|
|
|
- <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- </if>
|
|
|
</where>
|
|
|
ORDER BY a.id desc, b.id desc
|
|
|
</select>
|
|
@@ -235,88 +236,94 @@
|
|
|
stu.site_number AS siteNumber,
|
|
|
stu.create_id AS createId,
|
|
|
stu.create_time AS createTime,
|
|
|
- bs.id AS semesterId,
|
|
|
- bs.name AS semesterName,
|
|
|
- be.id AS examId,
|
|
|
- be.name AS examName,
|
|
|
- CONCAT(cou.course_name,
|
|
|
+ a.exam_id AS examId,
|
|
|
+ a.exam_name AS examName,
|
|
|
+ CONCAT(a.course_name,
|
|
|
'(',
|
|
|
- cou.course_code,
|
|
|
+ a.course_code,
|
|
|
')') AS courseNameCode,
|
|
|
- cou.paper_number AS paperNumber,
|
|
|
- et.specialty,
|
|
|
- det.print_plan_id AS printPlanId,
|
|
|
- det.print_plan_name AS printPlanName,
|
|
|
- det.exam_start_time AS examStartTime,
|
|
|
- det.exam_end_time AS examEndTime,
|
|
|
- det.exam_place AS examPlace,
|
|
|
- det.exam_room AS examRoom
|
|
|
+ a.paper_number AS paperNumber,
|
|
|
+ a.print_plan_id AS printPlanId,
|
|
|
+ a.print_plan_name AS printPlanName,
|
|
|
+ a.exam_start_time AS examStartTime,
|
|
|
+ a.exam_end_time AS examEndTime,
|
|
|
+ a.exam_place AS examPlace,
|
|
|
+ a.exam_room AS examRoom
|
|
|
FROM
|
|
|
- exam_student stu
|
|
|
- INNER JOIN
|
|
|
- exam_detail_course cou ON stu.exam_detail_course_id = cou.id
|
|
|
- INNER JOIN
|
|
|
- exam_detail det ON cou.exam_detail_id = det.id
|
|
|
- LEFT JOIN
|
|
|
- exam_print_plan epp ON det.print_plan_id = epp.id
|
|
|
- LEFT JOIN
|
|
|
- exam_task et on cou.school_id = et.school_id
|
|
|
- AND et.exam_id = epp.exam_id
|
|
|
- AND cou.paper_number = et.paper_number
|
|
|
+ (select be.id exam_id,
|
|
|
+ be.name exam_name,
|
|
|
+ edc.id exam_detail_course_id,
|
|
|
+ edc.course_code,
|
|
|
+ edc.course_name,
|
|
|
+ edc.paper_number,
|
|
|
+ ed.print_plan_id,
|
|
|
+ ed.print_plan_name,
|
|
|
+ ed.exam_start_time,
|
|
|
+ ed.exam_end_time,
|
|
|
+ ed.exam_place,
|
|
|
+ ed.exam_room
|
|
|
+ from exam_detail ed
|
|
|
+ JOIN
|
|
|
+ exam_detail_course edc on ed.id = edc.exam_detail_id
|
|
|
LEFT JOIN
|
|
|
- sys_user b on det.create_id = b.id
|
|
|
+ sys_user b on ed.create_id = b.id
|
|
|
LEFT JOIN
|
|
|
- basic_exam be ON be.id = et.exam_id
|
|
|
+ basic_exam be ON be.id = ed.exam_id
|
|
|
LEFT JOIN
|
|
|
basic_semester bs ON bs.id = be.semester_id
|
|
|
- <where>
|
|
|
- and be.enable = true
|
|
|
- <if test="schoolId != null and schoolId > 0">
|
|
|
- AND det.school_id = #{schoolId}
|
|
|
- </if>
|
|
|
- <if test="semesterId != null">
|
|
|
- and bs.id = #{semesterId}
|
|
|
- </if>
|
|
|
- <if test="examId != null">
|
|
|
- and be.id = #{examId}
|
|
|
- </if>
|
|
|
- <if test="printPlanIdList != null and printPlanIdList != '' and printPlanIdList.size() > 0">
|
|
|
- AND det.print_plan_id IN
|
|
|
- <foreach collection="printPlanIdList" item="item" index="index" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="courseCode != null and courseCode != ''">
|
|
|
- AND cou.course_code = #{courseCode}
|
|
|
- </if>
|
|
|
- <if test="paperNumber != null and paperNumber != ''">
|
|
|
- AND cou.paper_number = #{paperNumber}
|
|
|
- </if>
|
|
|
- <if test="examPlace != null and examPlace != ''">
|
|
|
- AND det.exam_place = #{examPlace}
|
|
|
- </if>
|
|
|
- <if test="examRoom != null and examRoom != ''">
|
|
|
- AND det.exam_room = #{examRoom}
|
|
|
- </if>
|
|
|
- <if test="studentParams != null and studentParams != ''">
|
|
|
- AND (stu.ticket_number LIKE CONCAT('%',#{studentParams},'%') OR stu.student_code LIKE CONCAT('%',#{studentParams},'%') OR stu.student_name LIKE CONCAT('%',#{studentParams},'%'))
|
|
|
- </if>
|
|
|
- <if test="startDate != null and startDate > 0">
|
|
|
- AND det.exam_start_time >= #{startDate}
|
|
|
- </if>
|
|
|
- <if test="endDate != null and endDate > 0">
|
|
|
- AND #{endDate} >= det.exam_end_time
|
|
|
- </if>
|
|
|
- <if test="dpr != null">
|
|
|
- <if test="dpr.requestUserId != null">
|
|
|
- AND b.id = #{dpr.requestUserId}
|
|
|
+ <where>
|
|
|
+ and be.enable = true
|
|
|
+ <if test="schoolId != null">
|
|
|
+ AND ed.school_id = #{schoolId}
|
|
|
</if>
|
|
|
- <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
- AND b.org_id IN
|
|
|
- <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ <if test="semesterId != null">
|
|
|
+ and bs.id = #{semesterId}
|
|
|
+ </if>
|
|
|
+ <if test="examId != null">
|
|
|
+ and be.id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="printPlanIdList != null and printPlanIdList != '' and printPlanIdList.size() > 0">
|
|
|
+ AND ed.print_plan_id IN
|
|
|
+ <foreach collection="printPlanIdList" item="item" index="index" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
+ <if test="courseCode != null and courseCode != ''">
|
|
|
+ AND edc.course_code = #{courseCode}
|
|
|
+ </if>
|
|
|
+ <if test="paperNumber != null and paperNumber != ''">
|
|
|
+ AND edc.paper_number = #{paperNumber}
|
|
|
+ </if>
|
|
|
+ <if test="examPlace != null and examPlace != ''">
|
|
|
+ AND ed.exam_place = #{examPlace}
|
|
|
+ </if>
|
|
|
+ <if test="examRoom != null and examRoom != ''">
|
|
|
+ AND ed.exam_room = #{examRoom}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate > 0">
|
|
|
+ AND ed.exam_start_time >= #{startDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate > 0">
|
|
|
+ AND ed.exam_end_time <= #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test="dpr != null">
|
|
|
+ <if test="dpr.requestUserId != null">
|
|
|
+ AND b.id = #{dpr.requestUserId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND b.org_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>) a
|
|
|
+ join
|
|
|
+ exam_student stu ON a.exam_detail_course_id = stu.exam_detail_course_id
|
|
|
+ <where>
|
|
|
+
|
|
|
+ <if test="studentParams != null and studentParams != ''">
|
|
|
+ AND (stu.ticket_number LIKE CONCAT('%',#{studentParams},'%') OR stu.student_code LIKE CONCAT('%',#{studentParams},'%') OR stu.student_name LIKE CONCAT('%',#{studentParams},'%'))
|
|
|
</if>
|
|
|
</where>
|
|
|
order by stu.exam_detail_course_id desc, stu.id desc
|
|
@@ -376,29 +383,40 @@
|
|
|
ifnull(sum(case b.status when 'FINISH' then 0 else ifnull(b.card_pages, 0) end),0)/2 cardPagesLeft,
|
|
|
ifnull(sum(case b.status when 'FINISH' then 0 else ifnull(b.pages_a4, 0) end),0)/2 pagesA4Left
|
|
|
FROM
|
|
|
- exam_print_plan a
|
|
|
+ (select epp.id from exam_print_plan epp
|
|
|
+ LEFT JOIN
|
|
|
+ basic_exam be ON be.id = epp.exam_id
|
|
|
+ LEFT JOIN
|
|
|
+ basic_semester bs ON bs.id = be.semester_id
|
|
|
+ <where>
|
|
|
+ and be.enable = true
|
|
|
+ <if test="schoolId != null">
|
|
|
+ and epp.school_id = #{schoolId}
|
|
|
+ </if>
|
|
|
+ <if test="semesterId != null">
|
|
|
+ and bs.id = #{semesterId}
|
|
|
+ </if>
|
|
|
+ <if test="examId != null">
|
|
|
+ and be.id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="printPlanId != null">
|
|
|
+ and epp.id = #{printPlanId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr != null">
|
|
|
+ <if test="dpr.requestUserId != null">
|
|
|
+ AND epp.create_id = #{dpr.requestUserId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND epp.org_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>) a
|
|
|
JOIN
|
|
|
exam_detail b ON a.id = b.print_plan_id
|
|
|
- JOIN
|
|
|
- sys_user d on a.create_id = d.id
|
|
|
- LEFT JOIN
|
|
|
- basic_exam be ON be.id = a.exam_id
|
|
|
- LEFT JOIN
|
|
|
- basic_semester bs ON bs.id = be.semester_id
|
|
|
<where>
|
|
|
- and be.enable = true
|
|
|
- <if test="schoolId != null and schoolId != ''">
|
|
|
- and a.school_id = #{schoolId}
|
|
|
- </if>
|
|
|
- <if test="semesterId != null">
|
|
|
- and bs.id = #{semesterId}
|
|
|
- </if>
|
|
|
- <if test="examId != null">
|
|
|
- and be.id = #{examId}
|
|
|
- </if>
|
|
|
- <if test="printPlanId != null and printPlanId != ''">
|
|
|
- and a.id = #{printPlanId}
|
|
|
- </if>
|
|
|
<if test="status != null and status != ''">
|
|
|
and b.status = #{status}
|
|
|
</if>
|
|
@@ -423,17 +441,6 @@
|
|
|
<if test="printHouseId != null and printHouseId != ''">
|
|
|
and b.print_house_id = #{printHouseId}
|
|
|
</if>
|
|
|
- <if test="dpr != null">
|
|
|
- <if test="dpr.requestUserId != null">
|
|
|
- AND a.create_id = #{dpr.requestUserId}
|
|
|
- </if>
|
|
|
- <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
- AND a.org_id IN
|
|
|
- <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
<select id="listClientExamStudentPage"
|