|
@@ -27,114 +27,139 @@
|
|
|
</sql>
|
|
|
<select id="listPrintTask" resultType="com.qmth.distributed.print.business.bean.dto.PrintTaskDto">
|
|
|
SELECT
|
|
|
- b.id examDetailId,
|
|
|
- b.package_code packageCode,
|
|
|
- a.id printPlanId,
|
|
|
- a.name printPlanName,
|
|
|
- b.exam_start_time examStartTime,
|
|
|
- b.exam_end_time examEndTime,
|
|
|
+ ed.id examDetailId,
|
|
|
+ ed.package_code packageCode,
|
|
|
+ epp.id printPlanId,
|
|
|
+ epp.name printPlanName,
|
|
|
+ ed.exam_start_time examStartTime,
|
|
|
+ ed.exam_end_time examEndTime,
|
|
|
c.courseNameCode,
|
|
|
c.paperNumber,
|
|
|
- b.exam_place examPlace,
|
|
|
- b.exam_room examRoom,
|
|
|
- b.total_subjects totalSubjects,
|
|
|
- ifnull(b.paper_pages, 0) paperPages,
|
|
|
- ifnull(b.card_pages, 0) cardPages,
|
|
|
- ifnull(b.pages_a4, 0) pagesA4,
|
|
|
- c.singlePagesA3,
|
|
|
- b.status,
|
|
|
- b.validate,
|
|
|
- b.print_start_time printStartTime,
|
|
|
- b.print_end_time printEndTime,
|
|
|
- b.normal,
|
|
|
- b.print_house_id as printHouseId,
|
|
|
- b.task_id taskId,
|
|
|
- e.name as printHouseName,
|
|
|
- e.code as printHouseCode,
|
|
|
- a.semester_id as semesterId,
|
|
|
- a.semester_name as semesterName,
|
|
|
- a.exam_id as examId,
|
|
|
- a.exam_name as examName
|
|
|
+ ed.exam_place examPlace,
|
|
|
+ ed.exam_room examRoom,
|
|
|
+ ed.total_subjects totalSubjects,
|
|
|
+ ed.status,
|
|
|
+ ed.validate,
|
|
|
+ ed.print_start_time printStartTime,
|
|
|
+ ed.print_end_time printEndTime,
|
|
|
+ ed.normal,
|
|
|
+ so.name AS printHouseName,
|
|
|
+ ed.exam_id AS examId
|
|
|
FROM
|
|
|
- (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>
|
|
|
- <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
|
|
|
- (select * from exam_detail
|
|
|
- <where>
|
|
|
- <if test="status != null and status != ''">
|
|
|
- and status = #{status}
|
|
|
- </if>
|
|
|
- <if test="examPlace != null and examPlace != ''">
|
|
|
- and exam_place = #{examPlace}
|
|
|
- </if>
|
|
|
- <if test="examRoom != null and examRoom != ''">
|
|
|
- and exam_room = #{examRoom}
|
|
|
- </if>
|
|
|
- <if test="examStartTime != null and examStartTime != ''">
|
|
|
- and exam_start_time > #{examStartTime}
|
|
|
- </if>
|
|
|
- <if test="examEndTime != null and examEndTime != ''">
|
|
|
- and exam_end_time < #{examEndTime}
|
|
|
- </if>
|
|
|
- <if test="printStartTime != null and printStartTime != ''">
|
|
|
- and print_start_time > #{printStartTime}
|
|
|
- </if>
|
|
|
- <if test="printEndTime != null and printEndTime != ''">
|
|
|
- and print_start_time < #{printEndTime}
|
|
|
- </if>
|
|
|
- <if test="printHouseId != null and printHouseId != ''">
|
|
|
- and print_house_id = #{printHouseId}
|
|
|
- </if>
|
|
|
- </where>) b ON a.id = b.print_plan_id
|
|
|
- JOIN
|
|
|
(SELECT
|
|
|
- exam_detail_id,
|
|
|
- GROUP_CONCAT(CONCAT(course_name, '(', course_code, ')')) courseNameCode,
|
|
|
- GROUP_CONCAT(paper_number) paperNumber,
|
|
|
- GROUP_CONCAT(ifnull(paper_pages_a3, 0) + ifnull(card_pages_a3, 0)) singlePagesA3
|
|
|
- FROM
|
|
|
- exam_detail_course
|
|
|
+ a.*
|
|
|
+ FROM
|
|
|
+ exam_detail a
|
|
|
+ LEFT JOIN basic_exam b ON a.exam_id = b.id
|
|
|
<where>
|
|
|
- <if test="courseCode != null and courseCode != ''">
|
|
|
- and course_code = #{courseCode}
|
|
|
+ <if test="schoolId != null">
|
|
|
+ and a.school_id = #{schoolId}
|
|
|
+ </if>
|
|
|
+ <if test="semesterId != null">
|
|
|
+ and b.semester_id = #{semesterId}
|
|
|
+ </if>
|
|
|
+ <if test="examId != null">
|
|
|
+ and a.exam_id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="printPlanId != null">
|
|
|
+ and a.print_plan_id = #{printPlanId}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ and a.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="examPlace != null and examPlace != ''">
|
|
|
+ and a.exam_place = #{examPlace}
|
|
|
+ </if>
|
|
|
+ <if test="examRoom != null and examRoom != ''">
|
|
|
+ and a.exam_room = #{examRoom}
|
|
|
+ </if>
|
|
|
+ <if test="examStartTime != null and examStartTime != ''">
|
|
|
+ and a.exam_start_time > #{examStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="examEndTime != null and examEndTime != ''">
|
|
|
+ and a.exam_end_time < #{examEndTime}
|
|
|
</if>
|
|
|
- <if test="paperNumber != null and paperNumber != ''">
|
|
|
- and paper_number = #{paperNumber}
|
|
|
+ <if test="printStartTime != null and printStartTime != ''">
|
|
|
+ and a.print_start_time > #{printStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="printEndTime != null and printEndTime != ''">
|
|
|
+ and a.print_start_time < #{printEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="printHouseId != null and printHouseId != ''">
|
|
|
+ and a.print_house_id = #{printHouseId}
|
|
|
</if>
|
|
|
</where>
|
|
|
- GROUP BY exam_detail_id) c ON b.id = c.exam_detail_id
|
|
|
+ ) ed
|
|
|
+ JOIN
|
|
|
+ (SELECT
|
|
|
+ edc.exam_detail_id,
|
|
|
+ GROUP_CONCAT(CONCAT(edc.course_name, '(', edc.course_code, ')')) courseNameCode,
|
|
|
+ GROUP_CONCAT(edc.paper_number) paperNumber
|
|
|
+ FROM
|
|
|
+ exam_detail_course edc
|
|
|
+ WHERE
|
|
|
+ EXISTS( SELECT
|
|
|
+ 1
|
|
|
+ FROM
|
|
|
+ exam_detail ed
|
|
|
+ WHERE
|
|
|
+ edc.exam_detail_id = ed.id
|
|
|
+ AND ed.exam_id = #{examId})
|
|
|
+ GROUP BY exam_detail_id) c ON ed.id = c.exam_detail_id
|
|
|
+ LEFT JOIN
|
|
|
+ exam_print_plan epp ON ed.print_plan_id = epp.id
|
|
|
LEFT JOIN
|
|
|
- sys_org e ON b.print_house_id = e.id
|
|
|
- ORDER BY b.id desc
|
|
|
+ sys_org so ON ed.print_house_id = so.id
|
|
|
+ WHERE
|
|
|
+ EXISTS( SELECT
|
|
|
+ 1
|
|
|
+ FROM
|
|
|
+ (SELECT
|
|
|
+ *
|
|
|
+ FROM
|
|
|
+ exam_detail_course edc
|
|
|
+ WHERE
|
|
|
+ EXISTS( SELECT
|
|
|
+ 1
|
|
|
+ FROM
|
|
|
+ exam_detail ed
|
|
|
+ WHERE
|
|
|
+ edc.exam_detail_id = ed.id
|
|
|
+ AND ed.exam_id = #{examId})) edc
|
|
|
+ JOIN
|
|
|
+ (SELECT
|
|
|
+ *
|
|
|
+ FROM
|
|
|
+ exam_task
|
|
|
+ WHERE
|
|
|
+ exam_id = #{examId}) et ON edc.course_code = et.course_code
|
|
|
+ AND edc.paper_number = et.paper_number
|
|
|
+ LEFT JOIN
|
|
|
+ sys_user su ON et.user_id = su.id
|
|
|
+ WHERE
|
|
|
+ ed.id = edc.exam_detail_id
|
|
|
+ <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="dpr != null">
|
|
|
+ <if test="dpr.requestUserId != null">
|
|
|
+ AND et.user_id = #{dpr.requestUserId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr.courseUserId != null">
|
|
|
+ AND EXISTS( SELECT 1 FROM (select course_code from teach_course where exam_id = #{examId} and user_id = #{dpr.courseUserId}) tc WHERE tc.course_code = et.course_code)
|
|
|
+ </if>
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND su.org_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ ORDER BY ed.id DESC
|
|
|
</select>
|
|
|
|
|
|
<select id="findBriefPage" resultType="com.qmth.distributed.print.business.bean.result.ExaminationResult">
|
|
@@ -376,84 +401,118 @@
|
|
|
</select>
|
|
|
<select id="taskTotalData" resultType="com.qmth.distributed.print.business.bean.dto.PrintTaskTotalDto">
|
|
|
SELECT
|
|
|
- ifnull(count(b.package_code), 0) packageCount,
|
|
|
- ifnull(sum(b.total_subjects), 0) totalSubjects,
|
|
|
- ifnull(sum(ifnull(b.paper_pages, 0)), 0)/2 paperPages,
|
|
|
- ifnull(sum(ifnull(b.card_pages, 0)), 0)/2 cardPages,
|
|
|
- ifnull(sum(ifnull(b.pages_a4, 0)), 0) /2 pagesA4,
|
|
|
- ifnull(sum(case b.status when 'FINISH' then 0 else ifnull(b.paper_pages, 0) end),0)/2 paperPagesLeft,
|
|
|
- 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
|
|
|
+ IFNULL(COUNT(ed.package_code), 0) packageCount,
|
|
|
+ IFNULL(SUM(ed.total_subjects), 0) totalSubjects,
|
|
|
+ IFNULL(SUM(IFNULL(ed.paper_pages, 0)), 0) / 2 paperPages,
|
|
|
+ IFNULL(SUM(IFNULL(ed.card_pages, 0)), 0) / 2 cardPages,
|
|
|
+ IFNULL(SUM(IFNULL(ed.pages_a4, 0)), 0) / 2 pagesA4,
|
|
|
+ IFNULL(SUM(CASE ed.status
|
|
|
+ WHEN 'FINISH' THEN 0
|
|
|
+ ELSE IFNULL(ed.paper_pages, 0)
|
|
|
+ END),
|
|
|
+ 0) / 2 paperPagesLeft,
|
|
|
+ IFNULL(SUM(CASE ed.status
|
|
|
+ WHEN 'FINISH' THEN 0
|
|
|
+ ELSE IFNULL(ed.card_pages, 0)
|
|
|
+ END),
|
|
|
+ 0) / 2 cardPagesLeft,
|
|
|
+ IFNULL(SUM(CASE ed.status
|
|
|
+ WHEN 'FINISH' THEN 0
|
|
|
+ ELSE IFNULL(ed.pages_a4, 0)
|
|
|
+ END),
|
|
|
+ 0) / 2 pagesA4Left
|
|
|
FROM
|
|
|
- (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
|
|
|
- (select * from exam_detail ed
|
|
|
- <where>
|
|
|
- <if test="status != null and status != ''">
|
|
|
- and ed.status = #{status}
|
|
|
- </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="examStartTime != null and examStartTime != ''">
|
|
|
- and ed.exam_start_time > #{examStartTime}
|
|
|
- </if>
|
|
|
- <if test="examEndTime != null and examEndTime != ''">
|
|
|
- and ed.exam_end_time < #{examEndTime}
|
|
|
- </if>
|
|
|
- <if test="printStartTime != null and printStartTime != ''">
|
|
|
- and ed.print_start_time > #{printStartTime}
|
|
|
- </if>
|
|
|
- <if test="printEndTime != null and printEndTime != ''">
|
|
|
- and ed.print_start_time < #{printEndTime}
|
|
|
- </if>
|
|
|
- <if test="printHouseId != null and printHouseId != ''">
|
|
|
- and ed.print_house_id = #{printHouseId}
|
|
|
- </if>
|
|
|
- <if test="courseCode != null or paperNumber != null">
|
|
|
- and exists (select 1 from exam_detail_course edc where ed.id = edc.exam_detail_id
|
|
|
- <if test="courseCode != null">
|
|
|
- and edc.course_code = #{courseCode}
|
|
|
- </if>
|
|
|
- <if test="paperNumber != null">
|
|
|
- and edc.paper_number = #{paperNumber}
|
|
|
- </if>
|
|
|
+ (SELECT
|
|
|
+ a.*
|
|
|
+ FROM
|
|
|
+ exam_detail a
|
|
|
+ LEFT JOIN basic_exam b ON a.exam_id = b.id
|
|
|
+ <where>
|
|
|
+ <if test="schoolId != null">
|
|
|
+ and a.school_id = #{schoolId}
|
|
|
+ </if>
|
|
|
+ <if test="semesterId != null">
|
|
|
+ and b.semester_id = #{semesterId}
|
|
|
+ </if>
|
|
|
+ <if test="examId != null">
|
|
|
+ and a.exam_id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="printPlanId != null">
|
|
|
+ and a.print_plan_id = #{printPlanId}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ and a.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="examPlace != null and examPlace != ''">
|
|
|
+ and a.exam_place = #{examPlace}
|
|
|
+ </if>
|
|
|
+ <if test="examRoom != null and examRoom != ''">
|
|
|
+ and a.exam_room = #{examRoom}
|
|
|
+ </if>
|
|
|
+ <if test="examStartTime != null and examStartTime != ''">
|
|
|
+ and a.exam_start_time > #{examStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="examEndTime != null and examEndTime != ''">
|
|
|
+ and a.exam_end_time < #{examEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="printStartTime != null and printStartTime != ''">
|
|
|
+ and a.print_start_time > #{printStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="printEndTime != null and printEndTime != ''">
|
|
|
+ and a.print_start_time < #{printEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="printHouseId != null and printHouseId != ''">
|
|
|
+ and a.print_house_id = #{printHouseId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ) ed
|
|
|
+ WHERE
|
|
|
+ EXISTS( SELECT
|
|
|
+ 1
|
|
|
+ FROM
|
|
|
+ (SELECT
|
|
|
+ *
|
|
|
+ FROM
|
|
|
+ exam_detail_course edc
|
|
|
+ WHERE
|
|
|
+ EXISTS( SELECT
|
|
|
+ 1
|
|
|
+ FROM
|
|
|
+ exam_detail ed
|
|
|
+ WHERE
|
|
|
+ edc.exam_detail_id = ed.id
|
|
|
+ AND ed.exam_id = #{examId})) edc
|
|
|
+ JOIN
|
|
|
+ (SELECT
|
|
|
+ *
|
|
|
+ FROM
|
|
|
+ exam_task
|
|
|
+ WHERE
|
|
|
+ exam_id = #{examId}) et ON edc.course_code = et.course_code
|
|
|
+ AND edc.paper_number = et.paper_number
|
|
|
+ WHERE
|
|
|
+ ed.id = edc.exam_detail_id
|
|
|
+ <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="dpr != null">
|
|
|
+ <if test="dpr.requestUserId != null">
|
|
|
+ AND et.user_id = #{dpr.requestUserId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr.courseUserId != null">
|
|
|
+ AND EXISTS( SELECT 1 FROM (select course_code from teach_course where exam_id = #{examId} and user_id = #{dpr.courseUserId}) tc WHERE tc.course_code = et.course_code)
|
|
|
+ </if>
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND su.org_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
)
|
|
|
- </if>
|
|
|
- </where>) b ON a.id = b.print_plan_id
|
|
|
</select>
|
|
|
<select id="listStudentByExamDetailCourseId" resultType="java.util.Map">
|
|
|
SELECT
|
|
@@ -479,69 +538,96 @@
|
|
|
and c.student_code >= #{studentCode}
|
|
|
</if>
|
|
|
</select>
|
|
|
- <select id="selectPaperCount" resultType="java.lang.Integer">
|
|
|
+ <select id="selectPaperCount" resultType="com.qmth.distributed.print.business.entity.ExamDetailCourse">
|
|
|
SELECT
|
|
|
- count(distinct c.paper_number, c.paper_type)
|
|
|
+ edc.*
|
|
|
FROM
|
|
|
- exam_print_plan a
|
|
|
- JOIN
|
|
|
- exam_detail b ON a.id = b.print_plan_id
|
|
|
- JOIN
|
|
|
- exam_detail_course c ON b.id = c.exam_detail_id
|
|
|
- JOIN
|
|
|
- sys_user d ON a.create_id = d.id
|
|
|
+ (SELECT
|
|
|
+ edc.exam_detail_id,
|
|
|
+ edc.course_code,
|
|
|
+ edc.paper_number,
|
|
|
+ edc.paper_type
|
|
|
+ FROM
|
|
|
+ exam_detail_course edc
|
|
|
+ WHERE
|
|
|
+ EXISTS( SELECT
|
|
|
+ 1
|
|
|
+ FROM
|
|
|
+ exam_detail ed
|
|
|
+ LEFT JOIN
|
|
|
+ basic_exam be ON ed.exam_id = be.id
|
|
|
+ WHERE
|
|
|
+ edc.exam_detail_id = ed.id
|
|
|
+ <if test="schoolId != null">
|
|
|
+ and ed.school_id = #{schoolId}
|
|
|
+ </if>
|
|
|
+ <if test="semesterId != null">
|
|
|
+ and be.semester_id = #{semesterId}
|
|
|
+ </if>
|
|
|
+ <if test="examId != null">
|
|
|
+ and ed.exam_id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="printPlanId != null">
|
|
|
+ and ed.print_plan_id = #{printPlanId}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ and ed.status = #{status}
|
|
|
+ </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="examStartTime != null and examStartTime != ''">
|
|
|
+ and ed.exam_start_time > #{examStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="examEndTime != null and examEndTime != ''">
|
|
|
+ and ed.exam_end_time < #{examEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="printStartTime != null and printStartTime != ''">
|
|
|
+ and ed.print_start_time > #{printStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="printEndTime != null and printEndTime != ''">
|
|
|
+ and ed.print_start_time < #{printEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="printHouseId != null and printHouseId != ''">
|
|
|
+ and ed.print_house_id = #{printHouseId}
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ AND edc.paper_type IS NOT NULL) edc
|
|
|
JOIN
|
|
|
- basic_exam e ON a.exam_id = e.id
|
|
|
- <where>
|
|
|
- and c.paper_type is not null and e.enable = true
|
|
|
- <if test="schoolId != null and schoolId != ''">
|
|
|
- and a.school_id = #{schoolId}
|
|
|
- </if>
|
|
|
- <if test="semesterId != null and semesterId != ''">
|
|
|
- and e.semester_id = #{semesterId}
|
|
|
- </if>
|
|
|
- <if test="examId != null and examId != ''">
|
|
|
- and e.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>
|
|
|
- <if test="courseCode != null and courseCode != ''">
|
|
|
- and c.course_code = #{courseCode}
|
|
|
- </if>
|
|
|
- <if test="paperNumber != null and paperNumber != ''">
|
|
|
- and c.paper_number = #{paperNumber}
|
|
|
- </if>
|
|
|
- <if test="examPlace != null and examPlace != ''">
|
|
|
- and b.exam_place = #{examPlace}
|
|
|
- </if>
|
|
|
- <if test="examRoom != null and examRoom != ''">
|
|
|
- and b.exam_room = #{examRoom}
|
|
|
- </if>
|
|
|
- <if test="examStartTime != null and examStartTime != ''">
|
|
|
- and b.exam_start_time > #{examStartTime}
|
|
|
- </if>
|
|
|
- <if test="examEndTime != null and examEndTime != ''">
|
|
|
- and b.exam_end_time < #{examEndTime}
|
|
|
- </if>
|
|
|
- <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}
|
|
|
+ (SELECT
|
|
|
+ *
|
|
|
+ FROM
|
|
|
+ exam_task
|
|
|
+ WHERE
|
|
|
+ exam_id = #{examId}) et ON edc.course_code = et.course_code
|
|
|
+ AND edc.paper_number = et.paper_number
|
|
|
+ LEFT JOIN
|
|
|
+ sys_user su ON et.user_id = su.id
|
|
|
+ <where>
|
|
|
+ <if test="courseCode != null and courseCode != ''">
|
|
|
+ and edc.course_code = #{courseCode}
|
|
|
</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 test="paperNumber != null and paperNumber != ''">
|
|
|
+ and edc.paper_number = #{paperNumber}
|
|
|
</if>
|
|
|
- </if>
|
|
|
- </where>
|
|
|
+ <if test="dpr != null">
|
|
|
+ <if test="dpr.requestUserId != null">
|
|
|
+ AND et.user_id = #{dpr.requestUserId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr.courseUserId != null">
|
|
|
+ AND EXISTS( SELECT 1 FROM (select course_code from teach_course where exam_id = #{examId} and user_id = #{dpr.courseUserId}) tc WHERE tc.course_code = et.course_code)
|
|
|
+ </if>
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND su.org_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
|
|
|
<select id="findPdfDownload" resultType="com.qmth.distributed.print.business.bean.dto.ExamDetailPdfDownloadDto">
|
|
@@ -592,15 +678,11 @@
|
|
|
LEFT JOIN
|
|
|
basic_semester bs on bs.id = be.semester_id
|
|
|
<where>
|
|
|
- <if test="schoolId != null and schoolId > 0">
|
|
|
+ <if test="schoolId != null">
|
|
|
AND det.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="printPlanIdList != null and printPlanIdList != '' and printPlanIdList.size() > 0">
|
|
|
AND det.print_plan_id IN
|
|
|
<foreach collection="printPlanIdList" item="item" index="index" open="(" separator="," close=")">
|