|
@@ -147,13 +147,12 @@
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
- <select id="listClientPrintTask"
|
|
|
|
- resultType="com.qmth.distributed.print.business.bean.dto.ClientPrintTaskDto">
|
|
|
|
|
|
+ <select id="listClientPrintTask" resultType="com.qmth.distributed.print.business.bean.dto.ClientPrintTaskDto">
|
|
SELECT
|
|
SELECT
|
|
b.id examDetailId,
|
|
b.id examDetailId,
|
|
b.package_code packageCode,
|
|
b.package_code packageCode,
|
|
a.id printPlanId,
|
|
a.id printPlanId,
|
|
- a.name printPlanName,
|
|
|
|
|
|
+ a.NAME printPlanName,
|
|
a.print_content printContent,
|
|
a.print_content printContent,
|
|
a.variable_content variableContent,
|
|
a.variable_content variableContent,
|
|
a.ordinary_content ordinaryContent,
|
|
a.ordinary_content ordinaryContent,
|
|
@@ -162,112 +161,138 @@
|
|
c.courseNameCode,
|
|
c.courseNameCode,
|
|
c.paperNumber,
|
|
c.paperNumber,
|
|
c.classId,
|
|
c.classId,
|
|
|
|
+ c.className,
|
|
b.exam_place examPlace,
|
|
b.exam_place examPlace,
|
|
b.exam_room examRoom,
|
|
b.exam_room examRoom,
|
|
b.total_subjects totalSubjects,
|
|
b.total_subjects totalSubjects,
|
|
IFNULL(b.paper_pages, 0) paperPages,
|
|
IFNULL(b.paper_pages, 0) paperPages,
|
|
IFNULL(b.card_pages, 0) cardPages,
|
|
IFNULL(b.card_pages, 0) cardPages,
|
|
IFNULL(b.pages_a4, 0) pagesA4,
|
|
IFNULL(b.pages_a4, 0) pagesA4,
|
|
- case b.status when 'FINISH' then IFNULL(b.paper_pages, 0)+IFNULL(b.card_pages, 0)+IFNULL(b.pages_a4, 0) else 0 end totalPrint,
|
|
|
|
|
|
+ CASE b.STATUS
|
|
|
|
+ WHEN 'FINISH' THEN IFNULL(b.paper_pages, 0) + IFNULL(b.card_pages, 0) + IFNULL(b.pages_a4, 0)
|
|
|
|
+ ELSE 0
|
|
|
|
+ END totalPrint,
|
|
c.singlePagesA3,
|
|
c.singlePagesA3,
|
|
- b.status,
|
|
|
|
- ifnull(b.validate, false) validate,
|
|
|
|
- case c.isDownload when 0 then true else false end download,
|
|
|
|
|
|
+ b.STATUS,
|
|
|
|
+ IFNULL(b.validate, FALSE) validate,
|
|
|
|
+ CASE c.isDownload
|
|
|
|
+ WHEN 0 THEN TRUE
|
|
|
|
+ ELSE FALSE
|
|
|
|
+ END download,
|
|
b.print_user printUser,
|
|
b.print_user printUser,
|
|
- e.real_name printUserName,
|
|
|
|
b.print_start_time printStartTime,
|
|
b.print_start_time printStartTime,
|
|
b.print_end_time printEndTime,
|
|
b.print_end_time printEndTime,
|
|
- case c.isTry when 0 then true else false end isTry,
|
|
|
|
- case c.isPass when 0 then true else false end isPass
|
|
|
|
|
|
+ CASE c.isTry
|
|
|
|
+ WHEN 0 THEN TRUE
|
|
|
|
+ ELSE FALSE
|
|
|
|
+ END isTry,
|
|
|
|
+ CASE c.isPass
|
|
|
|
+ WHEN 0 THEN TRUE
|
|
|
|
+ ELSE FALSE
|
|
|
|
+ END isPass
|
|
FROM
|
|
FROM
|
|
- (select epp.school_id, epp.id,epp.name,epp.print_content,epp.variable_content,epp.ordinary_content,epp.status from exam_print_plan epp
|
|
|
|
- LEFT JOIN
|
|
|
|
- basic_exam be ON epp.exam_id = be.id
|
|
|
|
- <where>
|
|
|
|
- and epp.school_id = #{schoolId}
|
|
|
|
- and be.enable = true
|
|
|
|
- and be.semester_id = #{semesterId}
|
|
|
|
- <if test="examId != null">
|
|
|
|
- and be.id = #{examId}
|
|
|
|
- </if>
|
|
|
|
- <if test="printPlanId != null">
|
|
|
|
- and epp.id = #{printPlanId}
|
|
|
|
- </if>
|
|
|
|
- </where>
|
|
|
|
- ) a
|
|
|
|
|
|
+ (SELECT
|
|
|
|
+ epp.school_id,
|
|
|
|
+ epp.id,
|
|
|
|
+ epp.exam_id,
|
|
|
|
+ epp.NAME,
|
|
|
|
+ epp.print_content,
|
|
|
|
+ epp.variable_content,
|
|
|
|
+ epp.ordinary_content,
|
|
|
|
+ epp.STATUS
|
|
|
|
+ FROM
|
|
|
|
+ exam_print_plan epp
|
|
|
|
+ JOIN basic_exam be ON epp.exam_id = be.id AND be.ENABLE = TRUE
|
|
|
|
+ <where>
|
|
|
|
+ and epp.school_id = #{schoolId}
|
|
|
|
+ and be.semester_id = #{semesterId}
|
|
|
|
+ <if test="examId != null">
|
|
|
|
+ and epp.exam_id = #{examId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="printPlanId != null">
|
|
|
|
+ and epp.id = #{printPlanId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>) a
|
|
JOIN
|
|
JOIN
|
|
- exam_detail b ON a.id = b.print_plan_id
|
|
|
|
|
|
+ (SELECT *
|
|
|
|
+ from exam_detail t
|
|
|
|
+ <where>
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="status != null and status != ''">
|
|
|
|
+ and t.status = #{status}
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ AND t.status not IN
|
|
|
|
+ <foreach collection="examDetailStatus" item="item" index="index" open="(" separator="," close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ <if test="examPlace != null and examPlace != ''">
|
|
|
|
+ and t.exam_place = #{examPlace}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="examRoom != null and examRoom != ''">
|
|
|
|
+ and t.exam_room = #{examRoom}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="examStartTime != null and examStartTime != ''">
|
|
|
|
+ and t.exam_start_time > #{examStartTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="examEndTime != null and examEndTime != ''">
|
|
|
|
+ and t.exam_end_time < #{examEndTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="validate != null">
|
|
|
|
+ and ifnull(t.validate, false) = #{validate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orgId != null">
|
|
|
|
+ AND (t.print_house_id = #{orgId} or t.print_house_id is null)
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ ) b ON a.id = b.print_plan_id
|
|
JOIN
|
|
JOIN
|
|
(SELECT
|
|
(SELECT
|
|
- a.exam_detail_id,
|
|
|
|
- GROUP_CONCAT(CONCAT(a.course_name, '(', a.course_code, ')')) courseNameCode,
|
|
|
|
- GROUP_CONCAT(a.paper_number) paperNumber,
|
|
|
|
- GROUP_CONCAT(a.clazz_id) classId,
|
|
|
|
- GROUP_CONCAT(IFNULL(a.paper_pages_a3, 0) + IFNULL(a.card_pages_a3, 0)) singlePagesA3,
|
|
|
|
- SUM(CASE b.is_download
|
|
|
|
- WHEN true THEN 0
|
|
|
|
- ELSE 1
|
|
|
|
- END) isDownload,
|
|
|
|
- SUM(CASE b.is_try
|
|
|
|
- WHEN true THEN 0
|
|
|
|
- ELSE 1
|
|
|
|
- END) isTry,
|
|
|
|
- SUM(CASE b.is_pass
|
|
|
|
- WHEN true THEN 0
|
|
|
|
- ELSE 1
|
|
|
|
- END) isPass
|
|
|
|
- FROM
|
|
|
|
- exam_detail_course a
|
|
|
|
- LEFT JOIN client_status b ON a.school_id = b.school_id
|
|
|
|
- AND a.exam_detail_id = b.exam_detail_id
|
|
|
|
- AND a.course_code = b.course_code
|
|
|
|
- AND a.paper_number = b.paper_number
|
|
|
|
- AND b.machine_code = #{machineCode}
|
|
|
|
- GROUP BY a.exam_detail_id) c ON b.id = c.exam_detail_id
|
|
|
|
- LEFT JOIN
|
|
|
|
- sys_user e ON a.school_id = e.school_id and b.print_user = e.login_name
|
|
|
|
- <where>
|
|
|
|
- AND b.status not IN
|
|
|
|
- <foreach collection="examDetailStatus" item="item" index="index" open="(" separator="," close=")">
|
|
|
|
- #{item}
|
|
|
|
- </foreach>
|
|
|
|
- <if test="status != null and status != ''">
|
|
|
|
- and b.status = #{status}
|
|
|
|
- </if>
|
|
|
|
- <if test="courseCode != null and courseCode != ''">
|
|
|
|
- and c.courseNameCode like concat('%',#{courseCode},'%')
|
|
|
|
- </if>
|
|
|
|
- <if test="paperNumber != null and paperNumber != ''">
|
|
|
|
- and c.paperNumber like concat('%',#{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="validate != null">
|
|
|
|
- and ifnull(b.validate, false) = #{validate}
|
|
|
|
- </if>
|
|
|
|
- <if test="isDownload != null">
|
|
|
|
- <if test="isDownload == true">
|
|
|
|
- and c.isDownload = 0
|
|
|
|
|
|
+ a.exam_detail_id,
|
|
|
|
+ GROUP_CONCAT(CONCAT(a.course_name, '(', a.course_code, ')')) courseNameCode,
|
|
|
|
+ GROUP_CONCAT(a.paper_number) paperNumber,
|
|
|
|
+ GROUP_CONCAT(a.clazz_id) classId,
|
|
|
|
+ GROUP_CONCAT(a.clazz_name) className,
|
|
|
|
+ GROUP_CONCAT(IFNULL(a.paper_pages_a3, 0) + IFNULL(a.card_pages_a3, 0)) singlePagesA3,
|
|
|
|
+ SUM(CASE b.is_download
|
|
|
|
+ WHEN TRUE THEN 0
|
|
|
|
+ ELSE 1
|
|
|
|
+ END) isDownload,
|
|
|
|
+ SUM(CASE b.is_try
|
|
|
|
+ WHEN TRUE THEN 0
|
|
|
|
+ ELSE 1
|
|
|
|
+ END) isTry,
|
|
|
|
+ SUM(CASE b.is_pass
|
|
|
|
+ WHEN TRUE THEN 0
|
|
|
|
+ ELSE 1
|
|
|
|
+ END) isPass
|
|
|
|
+ FROM
|
|
|
|
+ exam_detail_course a
|
|
|
|
+ LEFT JOIN client_status b ON a.school_id = b.school_id
|
|
|
|
+ AND a.exam_detail_id = b.exam_detail_id
|
|
|
|
+ AND a.course_code = b.course_code
|
|
|
|
+ AND a.paper_number = b.paper_number
|
|
|
|
+ AND b.machine_code = #{machineCode}
|
|
|
|
+ GROUP BY a.exam_detail_id) c ON b.id = c.exam_detail_id
|
|
|
|
+ <where>
|
|
|
|
+ <if test="courseCode != null and courseCode != ''">
|
|
|
|
+ and c.courseNameCode like concat('%',#{courseCode},'%')
|
|
</if>
|
|
</if>
|
|
- <if test="isDownload == false">
|
|
|
|
- and c.isDownload > 0
|
|
|
|
|
|
+ <if test="paperNumber != null and paperNumber != ''">
|
|
|
|
+ and c.paperNumber like concat('%',#{paperNumber},'%')
|
|
</if>
|
|
</if>
|
|
- </if>
|
|
|
|
- <if test="orgId != null">
|
|
|
|
- AND (b.print_house_id = #{orgId} or b.print_house_id is null)
|
|
|
|
- </if>
|
|
|
|
- </where>
|
|
|
|
- order by a.id desc, b.id desc
|
|
|
|
|
|
+ <if test="isDownload != null">
|
|
|
|
+ <if test="isDownload == true">
|
|
|
|
+ and c.isDownload = 0
|
|
|
|
+ </if>
|
|
|
|
+ <if test="isDownload == false">
|
|
|
|
+ and c.isDownload > 0
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ ORDER BY a.id DESC , b.id DESC
|
|
</select>
|
|
</select>
|
|
<select id="clientTaskTotalData" resultType="com.qmth.distributed.print.business.bean.dto.ClientPrintTaskTotalDto">
|
|
<select id="clientTaskTotalData" resultType="com.qmth.distributed.print.business.bean.dto.ClientPrintTaskTotalDto">
|
|
SELECT
|
|
SELECT
|
|
@@ -282,22 +307,54 @@
|
|
GROUP_CONCAT(c.paperType) paperNumberAndType
|
|
GROUP_CONCAT(c.paperType) paperNumberAndType
|
|
FROM
|
|
FROM
|
|
(select epp.id from exam_print_plan epp
|
|
(select epp.id from exam_print_plan epp
|
|
- LEFT JOIN
|
|
|
|
- basic_exam be ON epp.exam_id = be.id
|
|
|
|
|
|
+ JOIN
|
|
|
|
+ basic_exam be ON epp.exam_id = be.id AND be.ENABLE = TRUE
|
|
<where>
|
|
<where>
|
|
and epp.school_id = #{schoolId}
|
|
and epp.school_id = #{schoolId}
|
|
- and be.enable = true
|
|
|
|
and be.semester_id = #{semesterId}
|
|
and be.semester_id = #{semesterId}
|
|
<if test="examId != null">
|
|
<if test="examId != null">
|
|
- and be.id = #{examId}
|
|
|
|
|
|
+ and epp.exam_id = #{examId}
|
|
</if>
|
|
</if>
|
|
<if test="printPlanId != null">
|
|
<if test="printPlanId != null">
|
|
and epp.id = #{printPlanId}
|
|
and epp.id = #{printPlanId}
|
|
</if>
|
|
</if>
|
|
</where>) a
|
|
</where>) a
|
|
JOIN
|
|
JOIN
|
|
- exam_detail b ON a.id = b.print_plan_id
|
|
|
|
- JOIN
|
|
|
|
|
|
+ (SELECT *
|
|
|
|
+ from exam_detail t
|
|
|
|
+ <where>
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="status != null and status != ''">
|
|
|
|
+ and t.status = #{status}
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ AND t.status not IN
|
|
|
|
+ <foreach collection="examDetailStatus" item="item" index="index" open="(" separator="," close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ <if test="examPlace != null and examPlace != ''">
|
|
|
|
+ and t.exam_place = #{examPlace}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="examRoom != null and examRoom != ''">
|
|
|
|
+ and t.exam_room = #{examRoom}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="examStartTime != null and examStartTime != ''">
|
|
|
|
+ and t.exam_start_time > #{examStartTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="examEndTime != null and examEndTime != ''">
|
|
|
|
+ and t.exam_end_time < #{examEndTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="validate != null">
|
|
|
|
+ and ifnull(t.validate, false) = #{validate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orgId != null">
|
|
|
|
+ AND (t.print_house_id = #{orgId} or t.print_house_id is null)
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ ) b ON a.id = b.print_plan_id
|
|
|
|
+ JOIN
|
|
(SELECT
|
|
(SELECT
|
|
a.exam_detail_id,
|
|
a.exam_detail_id,
|
|
GROUP_CONCAT(CONCAT(a.course_name, '(', a.course_code, ')')) courseNameCode,
|
|
GROUP_CONCAT(CONCAT(a.course_name, '(', a.course_code, ')')) courseNameCode,
|
|
@@ -325,34 +382,12 @@
|
|
AND b.machine_code = #{machineCode}
|
|
AND b.machine_code = #{machineCode}
|
|
GROUP BY a.exam_detail_id) c ON b.id = c.exam_detail_id
|
|
GROUP BY a.exam_detail_id) c ON b.id = c.exam_detail_id
|
|
<where>
|
|
<where>
|
|
- AND b.status not IN
|
|
|
|
- <foreach collection="examDetailStatus" item="item" index="index" open="(" separator="," close=")">
|
|
|
|
- #{item}
|
|
|
|
- </foreach>
|
|
|
|
- <if test="status != null and status != ''">
|
|
|
|
- and b.status = #{status}
|
|
|
|
- </if>
|
|
|
|
<if test="courseCode != null and courseCode != ''">
|
|
<if test="courseCode != null and courseCode != ''">
|
|
and c.courseNameCode like concat('%',#{courseCode},'%')
|
|
and c.courseNameCode like concat('%',#{courseCode},'%')
|
|
</if>
|
|
</if>
|
|
<if test="paperNumber != null and paperNumber != ''">
|
|
<if test="paperNumber != null and paperNumber != ''">
|
|
and c.paperNumber like concat('%',#{paperNumber},'%')
|
|
and c.paperNumber like concat('%',#{paperNumber},'%')
|
|
</if>
|
|
</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="validate != null">
|
|
|
|
- and ifnull(b.validate, false) = #{validate}
|
|
|
|
- </if>
|
|
|
|
<if test="isDownload != null">
|
|
<if test="isDownload != null">
|
|
<if test="isDownload == true">
|
|
<if test="isDownload == true">
|
|
and c.isDownload = 0
|
|
and c.isDownload = 0
|
|
@@ -361,9 +396,6 @@
|
|
and c.isDownload > 0
|
|
and c.isDownload > 0
|
|
</if>
|
|
</if>
|
|
</if>
|
|
</if>
|
|
- <if test="orgId != null">
|
|
|
|
- AND (b.print_house_id = #{orgId} or b.print_house_id is null)
|
|
|
|
- </if>
|
|
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
<select id="listClientPrintStatistics"
|
|
<select id="listClientPrintStatistics"
|