|
@@ -4,24 +4,24 @@
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<!-- 通用查询映射结果 -->
|
|
<resultMap id="BaseResultMap" type="com.qmth.distributed.print.business.entity.ExamTask">
|
|
<resultMap id="BaseResultMap" type="com.qmth.distributed.print.business.entity.ExamTask">
|
|
- <result column="id" property="id" />
|
|
|
|
- <result column="school_id" property="schoolId" />
|
|
|
|
- <result column="course_code" property="courseCode" />
|
|
|
|
- <result column="course_name" property="courseName" />
|
|
|
|
- <result column="specialty" property="specialty" />
|
|
|
|
- <result column="paper_number" property="paperNumber" />
|
|
|
|
- <result column="start_time" property="startTime" />
|
|
|
|
- <result column="end_time" property="endTime" />
|
|
|
|
- <result column="card_rule_id" property="cardRuleId" />
|
|
|
|
- <result column="user_id" property="userId" />
|
|
|
|
- <result column="status" property="status" />
|
|
|
|
- <result column="review_status" property="reviewStatus" />
|
|
|
|
- <result column="enable" property="enable" />
|
|
|
|
- <result column="batch_no" property="batchNo" />
|
|
|
|
- <result column="create_id" property="createId" />
|
|
|
|
- <result column="create_time" property="createTime" />
|
|
|
|
- <result column="update_id" property="updateId" />
|
|
|
|
- <result column="update_time" property="updateTime" />
|
|
|
|
|
|
+ <result column="id" property="id"/>
|
|
|
|
+ <result column="school_id" property="schoolId"/>
|
|
|
|
+ <result column="course_code" property="courseCode"/>
|
|
|
|
+ <result column="course_name" property="courseName"/>
|
|
|
|
+ <result column="specialty" property="specialty"/>
|
|
|
|
+ <result column="paper_number" property="paperNumber"/>
|
|
|
|
+ <result column="start_time" property="startTime"/>
|
|
|
|
+ <result column="end_time" property="endTime"/>
|
|
|
|
+ <result column="card_rule_id" property="cardRuleId"/>
|
|
|
|
+ <result column="user_id" property="userId"/>
|
|
|
|
+ <result column="status" property="status"/>
|
|
|
|
+ <result column="review_status" property="reviewStatus"/>
|
|
|
|
+ <result column="enable" property="enable"/>
|
|
|
|
+ <result column="batch_no" property="batchNo"/>
|
|
|
|
+ <result column="create_id" property="createId"/>
|
|
|
|
+ <result column="create_time" property="createTime"/>
|
|
|
|
+ <result column="update_id" property="updateId"/>
|
|
|
|
+ <result column="update_time" property="updateTime"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
<!-- 通用查询结果列 -->
|
|
@@ -31,31 +31,31 @@
|
|
</sql>
|
|
</sql>
|
|
<select id="listPage" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDto">
|
|
<select id="listPage" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDto">
|
|
SELECT
|
|
SELECT
|
|
- a.id,
|
|
|
|
- a.school_id schoolId,
|
|
|
|
- a.course_code courseCode,
|
|
|
|
- a.course_name courseName,
|
|
|
|
- a.specialty,
|
|
|
|
- a.paper_number paperNumber,
|
|
|
|
- a.card_rule_id cardRuleId,
|
|
|
|
- case a.card_rule_id when -1 then '全部通卡' else b.name end cardRuleName,
|
|
|
|
- a.user_id userId,
|
|
|
|
- c.real_name userName,
|
|
|
|
- d.real_name createName,
|
|
|
|
- a.start_time startTime,
|
|
|
|
- a.end_time endTime,
|
|
|
|
- a.status,
|
|
|
|
- a.enable,
|
|
|
|
- a.create_id createId,
|
|
|
|
- a.create_time createTime
|
|
|
|
|
|
+ a.id,
|
|
|
|
+ a.school_id schoolId,
|
|
|
|
+ a.course_code courseCode,
|
|
|
|
+ a.course_name courseName,
|
|
|
|
+ a.specialty,
|
|
|
|
+ a.paper_number paperNumber,
|
|
|
|
+ a.card_rule_id cardRuleId,
|
|
|
|
+ case a.card_rule_id when -1 then '全部通卡' else b.name end cardRuleName,
|
|
|
|
+ a.user_id userId,
|
|
|
|
+ c.real_name userName,
|
|
|
|
+ d.real_name createName,
|
|
|
|
+ a.start_time startTime,
|
|
|
|
+ a.end_time endTime,
|
|
|
|
+ a.status,
|
|
|
|
+ a.enable,
|
|
|
|
+ a.create_id createId,
|
|
|
|
+ a.create_time createTime
|
|
FROM
|
|
FROM
|
|
- exam_task a
|
|
|
|
- LEFT JOIN
|
|
|
|
- basic_card_rule b ON a.card_rule_id = b.id
|
|
|
|
- LEFT JOIN
|
|
|
|
- sys_user c ON a.user_id = c.id
|
|
|
|
- LEFT JOIN
|
|
|
|
- sys_user d ON a.create_id = d.id
|
|
|
|
|
|
+ exam_task a
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ basic_card_rule b ON a.card_rule_id = b.id
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ sys_user c ON a.user_id = c.id
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ sys_user d ON a.create_id = d.id
|
|
<where>
|
|
<where>
|
|
<if test="schoolId != null and schoolId != ''">
|
|
<if test="schoolId != null and schoolId != ''">
|
|
and a.school_id = #{schoolId}
|
|
and a.school_id = #{schoolId}
|
|
@@ -92,11 +92,11 @@
|
|
</select>
|
|
</select>
|
|
<select id="listUser" resultType="com.qmth.teachcloud.common.bean.dto.BlurryUserDto">
|
|
<select id="listUser" resultType="com.qmth.teachcloud.common.bean.dto.BlurryUserDto">
|
|
SELECT
|
|
SELECT
|
|
- distinct a.user_id id, b.real_name name
|
|
|
|
|
|
+ distinct a.user_id id, b.real_name name
|
|
FROM
|
|
FROM
|
|
- exam_task a
|
|
|
|
- LEFT JOIN
|
|
|
|
- sys_user b ON a.user_id = b.id
|
|
|
|
|
|
+ exam_task a
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ sys_user b ON a.user_id = b.id
|
|
<where>
|
|
<where>
|
|
b.enable = true
|
|
b.enable = true
|
|
<if test="schoolId != null and schoolId != ''">
|
|
<if test="schoolId != null and schoolId != ''">
|
|
@@ -109,47 +109,47 @@
|
|
</select>
|
|
</select>
|
|
<select id="listTaskApply" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDto">
|
|
<select id="listTaskApply" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDto">
|
|
select * from (SELECT
|
|
select * from (SELECT
|
|
- a.id,
|
|
|
|
- a.school_id schoolId,
|
|
|
|
- a.course_code courseCode,
|
|
|
|
- a.course_name courseName,
|
|
|
|
- a.specialty,
|
|
|
|
- a.paper_number paperNumber,
|
|
|
|
- a.card_rule_id cardRuleId,
|
|
|
|
- case a.card_rule_id when -1 then '全部通卡' else b.name end cardRuleName,
|
|
|
|
- a.user_id userId,
|
|
|
|
- c.real_name userName,
|
|
|
|
- a.start_time startTime,
|
|
|
|
- a.end_time endTime,
|
|
|
|
- a.status,
|
|
|
|
- CASE
|
|
|
|
- WHEN a.review = 1 AND a.status = 'SUBMIT' THEN 'NOT_AUDITED'
|
|
|
|
- WHEN a.review = 1 AND a.status IN ('STAGE', 'FINISH') AND a.review_status IS NOT NULL THEN 'AUDITED'
|
|
|
|
- ELSE ''
|
|
|
|
- END auditStatus,
|
|
|
|
- CASE
|
|
|
|
- WHEN a.review_status IS NULL THEN ''
|
|
|
|
- ELSE a.review_status
|
|
|
|
- END reviewStatus,
|
|
|
|
- a.enable,
|
|
|
|
- a.create_id createId,
|
|
|
|
- a.create_time createTime
|
|
|
|
|
|
+ a.id,
|
|
|
|
+ a.school_id schoolId,
|
|
|
|
+ a.course_code courseCode,
|
|
|
|
+ a.course_name courseName,
|
|
|
|
+ a.specialty,
|
|
|
|
+ a.paper_number paperNumber,
|
|
|
|
+ a.card_rule_id cardRuleId,
|
|
|
|
+ case a.card_rule_id when -1 then '全部通卡' else b.name end cardRuleName,
|
|
|
|
+ a.user_id userId,
|
|
|
|
+ c.real_name userName,
|
|
|
|
+ a.start_time startTime,
|
|
|
|
+ a.end_time endTime,
|
|
|
|
+ a.status,
|
|
|
|
+ CASE
|
|
|
|
+ WHEN a.review = 1 AND a.status = 'SUBMIT' THEN 'NOT_AUDITED'
|
|
|
|
+ WHEN a.review = 1 AND a.status IN ('STAGE', 'FINISH') AND a.review_status IS NOT NULL THEN 'AUDITED'
|
|
|
|
+ ELSE ''
|
|
|
|
+ END auditStatus,
|
|
|
|
+ CASE
|
|
|
|
+ WHEN a.review_status IS NULL THEN ''
|
|
|
|
+ ELSE a.review_status
|
|
|
|
+ END reviewStatus,
|
|
|
|
+ a.enable,
|
|
|
|
+ a.create_id createId,
|
|
|
|
+ a.create_time createTime
|
|
FROM
|
|
FROM
|
|
- exam_task a
|
|
|
|
- LEFT JOIN
|
|
|
|
- basic_card_rule b ON a.card_rule_id = b.id
|
|
|
|
- LEFT JOIN
|
|
|
|
- sys_user c ON a.user_id = c.id
|
|
|
|
- <where>
|
|
|
|
- <if test="orgIds != null and userId != null and userId != ''">
|
|
|
|
- and a.user_id = #{userId}
|
|
|
|
- </if>
|
|
|
|
- </where>
|
|
|
|
- order by a.create_time desc) a
|
|
|
|
|
|
+ exam_task a
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ basic_card_rule b ON a.card_rule_id = b.id
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ sys_user c ON a.user_id = c.id
|
|
|
|
+ <where>
|
|
|
|
+ <if test="orgIds != null and userId != null and userId != ''">
|
|
|
|
+ and a.user_id = #{userId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ order by a.create_time desc) a
|
|
<where>
|
|
<where>
|
|
a.enable = true and a.status not in
|
|
a.enable = true and a.status not in
|
|
<foreach item="item" collection="status" separator="," open="(" close=")" index="">
|
|
<foreach item="item" collection="status" separator="," open="(" close=")" index="">
|
|
- #{item}
|
|
|
|
|
|
+ #{item}
|
|
</foreach>
|
|
</foreach>
|
|
<if test="schoolId != null and schoolId != ''">
|
|
<if test="schoolId != null and schoolId != ''">
|
|
and a.schoolId = #{schoolId}
|
|
and a.schoolId = #{schoolId}
|
|
@@ -179,42 +179,42 @@
|
|
</select>
|
|
</select>
|
|
<select id="listTaskReviewUnaudited" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDto">
|
|
<select id="listTaskReviewUnaudited" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDto">
|
|
SELECT
|
|
SELECT
|
|
- a.id,
|
|
|
|
- a.school_id schoolId,
|
|
|
|
- a.course_code courseCode,
|
|
|
|
- a.course_name courseName,
|
|
|
|
- a.specialty,
|
|
|
|
- a.paper_number paperNumber,
|
|
|
|
- a.card_rule_id cardRuleId,
|
|
|
|
- case a.card_rule_id when -1 then '全部通卡' else b.name end cardRuleName,
|
|
|
|
- a.user_id userId,
|
|
|
|
- c.real_name userName,
|
|
|
|
- d.real_name createName,
|
|
|
|
- a.start_time startTime,
|
|
|
|
- a.end_time endTime,
|
|
|
|
- a.enable,
|
|
|
|
- a.create_id createId,
|
|
|
|
- a.create_time createTime,
|
|
|
|
- a.status,
|
|
|
|
- CASE
|
|
|
|
- WHEN a.review = 1 AND a.status = 'SUBMIT' THEN 'NOT_AUDITED'
|
|
|
|
- WHEN a.review = 1 AND a.status IN ('STAGE', 'FINISH') AND a.review_status IS NOT NULL THEN 'AUDITED'
|
|
|
|
- ELSE ''
|
|
|
|
- END auditStatus,
|
|
|
|
- CASE
|
|
|
|
- WHEN a.review_status IS NULL THEN ''
|
|
|
|
- ELSE a.review_status
|
|
|
|
- END reviewStatus
|
|
|
|
|
|
+ a.id,
|
|
|
|
+ a.school_id schoolId,
|
|
|
|
+ a.course_code courseCode,
|
|
|
|
+ a.course_name courseName,
|
|
|
|
+ a.specialty,
|
|
|
|
+ a.paper_number paperNumber,
|
|
|
|
+ a.card_rule_id cardRuleId,
|
|
|
|
+ case a.card_rule_id when -1 then '全部通卡' else b.name end cardRuleName,
|
|
|
|
+ a.user_id userId,
|
|
|
|
+ c.real_name userName,
|
|
|
|
+ d.real_name createName,
|
|
|
|
+ a.start_time startTime,
|
|
|
|
+ a.end_time endTime,
|
|
|
|
+ a.enable,
|
|
|
|
+ a.create_id createId,
|
|
|
|
+ a.create_time createTime,
|
|
|
|
+ a.status,
|
|
|
|
+ CASE
|
|
|
|
+ WHEN a.review = 1 AND a.status = 'SUBMIT' THEN 'NOT_AUDITED'
|
|
|
|
+ WHEN a.review = 1 AND a.status IN ('STAGE', 'FINISH') AND a.review_status IS NOT NULL THEN 'AUDITED'
|
|
|
|
+ ELSE ''
|
|
|
|
+ END auditStatus,
|
|
|
|
+ CASE
|
|
|
|
+ WHEN a.review_status IS NULL THEN ''
|
|
|
|
+ ELSE a.review_status
|
|
|
|
+ END reviewStatus
|
|
FROM
|
|
FROM
|
|
- exam_task a
|
|
|
|
|
|
+ exam_task a
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
- basic_card_rule b ON a.card_rule_id = b.id
|
|
|
|
|
|
+ basic_card_rule b ON a.card_rule_id = b.id
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
- sys_user c ON a.user_id = c.id
|
|
|
|
|
|
+ sys_user c ON a.user_id = c.id
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
- sys_user d ON a.create_id = d.id
|
|
|
|
|
|
+ sys_user d ON a.create_id = d.id
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
- exam_task_paper_log e ON a.id = e.exam_task_id AND e.review = false
|
|
|
|
|
|
+ exam_task_paper_log e ON a.id = e.exam_task_id AND e.review = false
|
|
<where>
|
|
<where>
|
|
a.enable = true
|
|
a.enable = true
|
|
and a.review = true
|
|
and a.review = true
|
|
@@ -251,41 +251,41 @@
|
|
</select>
|
|
</select>
|
|
<select id="listTaskReviewAudited" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDto">
|
|
<select id="listTaskReviewAudited" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDto">
|
|
SELECT
|
|
SELECT
|
|
- a.id,
|
|
|
|
- a.school_id schoolId,
|
|
|
|
- a.course_code courseCode,
|
|
|
|
- a.course_name courseName,
|
|
|
|
- a.specialty,
|
|
|
|
- a.paper_number paperNumber,
|
|
|
|
- a.card_rule_id cardRuleId,
|
|
|
|
- case a.card_rule_id when -1 then '全部通卡' else b.name end cardRuleName,
|
|
|
|
- a.user_id userId,
|
|
|
|
- c.real_name userName,
|
|
|
|
- d.real_name createName,
|
|
|
|
- a.start_time startTime,
|
|
|
|
- a.end_time endTime,
|
|
|
|
- a.review_status reviewStatus,
|
|
|
|
- a.enable,
|
|
|
|
- a.create_id createId,
|
|
|
|
- a.create_time createTime,
|
|
|
|
- a.status,
|
|
|
|
- CASE
|
|
|
|
- WHEN a.review = 1 AND a.status = 'SUBMIT' THEN 'NOT_AUDITED'
|
|
|
|
- WHEN a.review = 1 AND a.status IN ('STAGE', 'FINISH') AND a.review_status IS NOT NULL THEN 'AUDITED'
|
|
|
|
- ELSE ''
|
|
|
|
- END auditStatus,
|
|
|
|
- CASE
|
|
|
|
- WHEN a.review_status IS NULL THEN ''
|
|
|
|
- ELSE a.review_status
|
|
|
|
- END reviewStatus
|
|
|
|
|
|
+ a.id,
|
|
|
|
+ a.school_id schoolId,
|
|
|
|
+ a.course_code courseCode,
|
|
|
|
+ a.course_name courseName,
|
|
|
|
+ a.specialty,
|
|
|
|
+ a.paper_number paperNumber,
|
|
|
|
+ a.card_rule_id cardRuleId,
|
|
|
|
+ case a.card_rule_id when -1 then '全部通卡' else b.name end cardRuleName,
|
|
|
|
+ a.user_id userId,
|
|
|
|
+ c.real_name userName,
|
|
|
|
+ d.real_name createName,
|
|
|
|
+ a.start_time startTime,
|
|
|
|
+ a.end_time endTime,
|
|
|
|
+ a.review_status reviewStatus,
|
|
|
|
+ a.enable,
|
|
|
|
+ a.create_id createId,
|
|
|
|
+ a.create_time createTime,
|
|
|
|
+ a.status,
|
|
|
|
+ CASE
|
|
|
|
+ WHEN a.review = 1 AND a.status = 'SUBMIT' THEN 'NOT_AUDITED'
|
|
|
|
+ WHEN a.review = 1 AND a.status IN ('STAGE', 'FINISH') AND a.review_status IS NOT NULL THEN 'AUDITED'
|
|
|
|
+ ELSE ''
|
|
|
|
+ END auditStatus,
|
|
|
|
+ CASE
|
|
|
|
+ WHEN a.review_status IS NULL THEN ''
|
|
|
|
+ ELSE a.review_status
|
|
|
|
+ END reviewStatus
|
|
FROM
|
|
FROM
|
|
- exam_task a
|
|
|
|
|
|
+ exam_task a
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
- basic_card_rule b ON a.card_rule_id = b.id
|
|
|
|
|
|
+ basic_card_rule b ON a.card_rule_id = b.id
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
- sys_user c ON a.user_id = c.id
|
|
|
|
|
|
+ sys_user c ON a.user_id = c.id
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
- sys_user d ON a.create_id = d.id
|
|
|
|
|
|
+ sys_user d ON a.create_id = d.id
|
|
<where>
|
|
<where>
|
|
a.enable = true and a.review = true and a.status in ('STAGE','FINISH') and a.review_status is not null
|
|
a.enable = true and a.review = true and a.status in ('STAGE','FINISH') and a.review_status is not null
|
|
<if test="schoolId != null and schoolId != ''">
|
|
<if test="schoolId != null and schoolId != ''">
|
|
@@ -323,38 +323,38 @@
|
|
</select>
|
|
</select>
|
|
<select id="listTaskPaper" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto">
|
|
<select id="listTaskPaper" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto">
|
|
SELECT
|
|
SELECT
|
|
- a.id,
|
|
|
|
- a.school_id schoolId,
|
|
|
|
- a.course_code courseCode,
|
|
|
|
- a.course_name courseName,
|
|
|
|
- a.specialty,
|
|
|
|
- a.paper_number paperNumber,
|
|
|
|
- a.user_id userId,
|
|
|
|
- a.card_rule_id cardRuleId,
|
|
|
|
- c.real_name userName,
|
|
|
|
- d.real_name createName,
|
|
|
|
- a.start_time startTime,
|
|
|
|
- a.end_time endTime,
|
|
|
|
- a.create_id createId,
|
|
|
|
- ifnull(e.operate_time, a.update_time) createTime,
|
|
|
|
- b.enable,
|
|
|
|
- b.paper_type paperType,
|
|
|
|
- b.exposed_paper_type exposedPaperType,
|
|
|
|
- b.unexposed_paper_type unexposedPaperType
|
|
|
|
|
|
+ a.id,
|
|
|
|
+ a.school_id schoolId,
|
|
|
|
+ a.course_code courseCode,
|
|
|
|
+ a.course_name courseName,
|
|
|
|
+ a.specialty,
|
|
|
|
+ a.paper_number paperNumber,
|
|
|
|
+ a.user_id userId,
|
|
|
|
+ a.card_rule_id cardRuleId,
|
|
|
|
+ c.real_name userName,
|
|
|
|
+ d.real_name createName,
|
|
|
|
+ a.start_time startTime,
|
|
|
|
+ a.end_time endTime,
|
|
|
|
+ a.create_id createId,
|
|
|
|
+ ifnull(e.operate_time, a.update_time) createTime,
|
|
|
|
+ b.enable,
|
|
|
|
+ b.paper_type paperType,
|
|
|
|
+ b.exposed_paper_type exposedPaperType,
|
|
|
|
+ b.unexposed_paper_type unexposedPaperType
|
|
FROM
|
|
FROM
|
|
- exam_task a
|
|
|
|
- LEFT JOIN
|
|
|
|
- exam_task_detail b ON a.id = b.exam_task_id
|
|
|
|
- LEFT JOIN
|
|
|
|
- (SELECT
|
|
|
|
- a.exam_task_id, MAX(operate_time) operate_time
|
|
|
|
- FROM
|
|
|
|
- exam_task_review_log a
|
|
|
|
- GROUP BY a.exam_task_id) e ON e.exam_task_id = a.id
|
|
|
|
- LEFT JOIN
|
|
|
|
- sys_user c ON a.user_id = c.id
|
|
|
|
- LEFT JOIN
|
|
|
|
- sys_user d ON a.create_id = d.id
|
|
|
|
|
|
+ exam_task a
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ exam_task_detail b ON a.id = b.exam_task_id
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ (SELECT
|
|
|
|
+ a.exam_task_id, MAX(operate_time) operate_time
|
|
|
|
+ FROM
|
|
|
|
+ exam_task_review_log a
|
|
|
|
+ GROUP BY a.exam_task_id) e ON e.exam_task_id = a.id
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ sys_user c ON a.user_id = c.id
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ sys_user d ON a.create_id = d.id
|
|
<where>
|
|
<where>
|
|
a.status = 'FINISH'
|
|
a.status = 'FINISH'
|
|
<if test="schoolId != null and schoolId != ''">
|
|
<if test="schoolId != null and schoolId != ''">
|
|
@@ -386,13 +386,13 @@
|
|
</select>
|
|
</select>
|
|
<select id="listPaperNumbers" resultType="com.qmth.distributed.print.business.bean.dto.RelatePaperDto">
|
|
<select id="listPaperNumbers" resultType="com.qmth.distributed.print.business.bean.dto.RelatePaperDto">
|
|
SELECT
|
|
SELECT
|
|
- id,
|
|
|
|
- school_id schoolId,
|
|
|
|
- course_code courseCode,
|
|
|
|
- course_name courseName,
|
|
|
|
- paper_number paperNumber
|
|
|
|
|
|
+ id,
|
|
|
|
+ school_id schoolId,
|
|
|
|
+ course_code courseCode,
|
|
|
|
+ course_name courseName,
|
|
|
|
+ paper_number paperNumber
|
|
FROM
|
|
FROM
|
|
- exam_task
|
|
|
|
|
|
+ exam_task
|
|
<where>
|
|
<where>
|
|
school_id = #{schoolId} and course_code = #{courseCode} and status = #{status} and enable = true
|
|
school_id = #{schoolId} and course_code = #{courseCode} and status = #{status} and enable = true
|
|
</where>
|
|
</where>
|
|
@@ -419,65 +419,65 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryByMyWork" resultType="com.qmth.distributed.print.business.bean.result.WorkResult">
|
|
<select id="queryByMyWork" resultType="com.qmth.distributed.print.business.bean.result.WorkResult">
|
|
- <include refid="myworkCommonHead" />
|
|
|
|
- <include refid="myworkCommonMiddle" />
|
|
|
|
|
|
+ <include refid="myworkCommonHead"/>
|
|
|
|
+ <include refid="myworkCommonMiddle"/>
|
|
<where>
|
|
<where>
|
|
- <include refid="myworkSubmitCommonFoot" />
|
|
|
|
|
|
+ <include refid="myworkSubmitCommonFoot"/>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryUserByMyWork" resultType="com.qmth.distributed.print.business.bean.result.WorkResult">
|
|
<select id="queryUserByMyWork" resultType="com.qmth.distributed.print.business.bean.result.WorkResult">
|
|
- <include refid="myworkCommonHead" />
|
|
|
|
- <include refid="myworkCommonMiddle" />
|
|
|
|
|
|
+ <include refid="myworkCommonHead"/>
|
|
|
|
+ <include refid="myworkCommonMiddle"/>
|
|
<where>
|
|
<where>
|
|
- <include refid="myworkCommonFoot" />
|
|
|
|
|
|
+ <include refid="myworkCommonFoot"/>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryByMyWorkSubmit" resultType="com.qmth.distributed.print.business.bean.result.WorkResult">
|
|
<select id="queryByMyWorkSubmit" resultType="com.qmth.distributed.print.business.bean.result.WorkResult">
|
|
- <include refid="myworkCommonHead" />
|
|
|
|
- <include refid="myworkCommonMiddle" />
|
|
|
|
|
|
+ <include refid="myworkCommonHead"/>
|
|
|
|
+ <include refid="myworkCommonMiddle"/>
|
|
<where>
|
|
<where>
|
|
- <include refid="myworkSubmitCommonFootNew" />
|
|
|
|
|
|
+ <include refid="myworkSubmitCommonFootNew"/>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
<select id="listClientExamTaskPage"
|
|
<select id="listClientExamTaskPage"
|
|
resultType="com.qmth.distributed.print.business.bean.dto.ClientExamTaskDto">
|
|
resultType="com.qmth.distributed.print.business.bean.dto.ClientExamTaskDto">
|
|
SELECT
|
|
SELECT
|
|
distinct a.school_id schoolId,
|
|
distinct a.school_id schoolId,
|
|
- a.id printPlanId,
|
|
|
|
- a.name printPlanName,
|
|
|
|
- c.course_code courseCode,
|
|
|
|
- c.course_name courseName,
|
|
|
|
- c.paper_number paperNumber,
|
|
|
|
- d.id examTaskId,
|
|
|
|
- d.specialty,
|
|
|
|
- d.user_id userId,
|
|
|
|
- f.real_name userName,
|
|
|
|
- ifnull(e.is_try, false) isTry,
|
|
|
|
- ifnull(e.is_pass, false) isPass,
|
|
|
|
- e.try_time tryTime
|
|
|
|
|
|
+ a.id printPlanId,
|
|
|
|
+ a.name printPlanName,
|
|
|
|
+ c.course_code courseCode,
|
|
|
|
+ c.course_name courseName,
|
|
|
|
+ c.paper_number paperNumber,
|
|
|
|
+ d.id examTaskId,
|
|
|
|
+ d.specialty,
|
|
|
|
+ d.user_id userId,
|
|
|
|
+ f.real_name userName,
|
|
|
|
+ ifnull(e.is_try, false) isTry,
|
|
|
|
+ ifnull(e.is_pass, false) isPass,
|
|
|
|
+ e.try_time tryTime
|
|
FROM
|
|
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
|
|
|
|
- exam_task d ON d.school_id = c.school_id
|
|
|
|
- AND d.course_code = c.course_code
|
|
|
|
- AND d.paper_number = c.paper_number
|
|
|
|
- LEFT JOIN
|
|
|
|
- client_status e ON e.school_id = d.school_id
|
|
|
|
- AND b.id = e.exam_detail_id
|
|
|
|
- AND a.id = e.print_plan_id
|
|
|
|
- AND e.course_code = d.course_code
|
|
|
|
- AND e.paper_number = d.paper_number
|
|
|
|
- and e.machine_code = #{machineCode}
|
|
|
|
- LEFT JOIN
|
|
|
|
- sys_user f ON d.user_id = f.id
|
|
|
|
- LEFT JOIN
|
|
|
|
- sys_user g ON a.create_id = g.id
|
|
|
|
|
|
+ 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
|
|
|
|
+ exam_task d ON d.school_id = c.school_id
|
|
|
|
+ AND d.course_code = c.course_code
|
|
|
|
+ AND d.paper_number = c.paper_number
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ client_status e ON e.school_id = d.school_id
|
|
|
|
+ AND b.id = e.exam_detail_id
|
|
|
|
+ AND a.id = e.print_plan_id
|
|
|
|
+ AND e.course_code = d.course_code
|
|
|
|
+ AND e.paper_number = d.paper_number
|
|
|
|
+ and e.machine_code = #{machineCode}
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ sys_user f ON d.user_id = f.id
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ sys_user g ON a.create_id = g.id
|
|
<where>
|
|
<where>
|
|
and a.status = #{printPlanStatus}
|
|
and a.status = #{printPlanStatus}
|
|
and d.status = 'FINISH'
|
|
and d.status = 'FINISH'
|
|
@@ -555,12 +555,12 @@
|
|
</select>
|
|
</select>
|
|
<select id="listExamTaskAuditExpire" resultMap="BaseResultMap">
|
|
<select id="listExamTaskAuditExpire" resultMap="BaseResultMap">
|
|
SELECT
|
|
SELECT
|
|
- *
|
|
|
|
|
|
+ *
|
|
FROM
|
|
FROM
|
|
- exam_task a
|
|
|
|
- LEFT JOIN
|
|
|
|
- exam_task_paper_log b ON a.id = b.exam_task_id
|
|
|
|
- AND b.review = FALSE
|
|
|
|
|
|
+ exam_task a
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ exam_task_paper_log b ON a.id = b.exam_task_id
|
|
|
|
+ AND b.review = FALSE
|
|
<where>
|
|
<where>
|
|
and a.enable = true
|
|
and a.enable = true
|
|
and a.review = true
|
|
and a.review = true
|
|
@@ -664,58 +664,130 @@
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="getFlowTaskReadyList" resultType="com.qmth.distributed.print.business.bean.result.WorkResult">
|
|
<select id="getFlowTaskReadyList" resultType="com.qmth.distributed.print.business.bean.result.WorkResult">
|
|
- SELECT
|
|
|
|
- et.id,
|
|
|
|
- et.school_id schoolId,
|
|
|
|
- et.course_code courseCode,
|
|
|
|
- et.course_name courseName,
|
|
|
|
- et.specialty,
|
|
|
|
- et.paper_number paperNumber,
|
|
|
|
- et.card_rule_id cardRuleId,
|
|
|
|
- case
|
|
|
|
- et.card_rule_id when -1 then '全部通卡'
|
|
|
|
- else b.name
|
|
|
|
- end cardRuleName,
|
|
|
|
- art.ASSIGNEE_ userId,
|
|
|
|
- c.real_name userName,
|
|
|
|
- et.start_time startTime,
|
|
|
|
- et.end_time endTime,
|
|
|
|
- tffa.status,
|
|
|
|
- et.enable,
|
|
|
|
- et.create_id createId,
|
|
|
|
- et.create_time createTime,
|
|
|
|
- art.EXECUTION_ID_ as executionId,
|
|
|
|
- et.flow_id as flowId,
|
|
|
|
- art.NAME_ as taskName,
|
|
|
|
- art.TASK_DEF_KEY_ as taskDefKey,
|
|
|
|
- art.ID_ as taskId
|
|
|
|
- FROM
|
|
|
|
- exam_task et
|
|
|
|
- LEFT JOIN
|
|
|
|
- basic_card_rule b ON
|
|
|
|
- et.card_rule_id = b.id
|
|
|
|
- LEFT JOIN
|
|
|
|
- exam_task_paper_log d ON
|
|
|
|
- et.id = d.exam_task_id
|
|
|
|
- and d.review = false
|
|
|
|
- LEFT JOIN
|
|
|
|
- sys_user c ON
|
|
|
|
- et.user_id = c.id
|
|
|
|
- left join ACT_RU_TASK art on
|
|
|
|
- art.PROC_INST_ID_ = et.flow_id
|
|
|
|
- left join t_f_flow_approve tffa
|
|
|
|
- on tffa.flow_id = et.flow_id
|
|
|
|
|
|
+ /*select
|
|
|
|
+ *
|
|
|
|
+ from
|
|
|
|
+ ACT_RU_TASK art
|
|
|
|
+ join
|
|
|
|
+ (
|
|
|
|
+ select
|
|
|
|
+ ari.USER_ID_ as userId,
|
|
|
|
+ ari.PROC_INST_ID_ as procInstId,
|
|
|
|
+ (
|
|
|
|
+ select
|
|
|
|
+ t.TASK_ID_
|
|
|
|
+ from
|
|
|
|
+ ACT_RU_IDENTITYLINK t
|
|
|
|
+ where
|
|
|
|
+ t.TYPE_ = 'candidate'
|
|
|
|
+ and t.USER_ID_ = '153080457649455104') as taskId
|
|
|
|
+ from
|
|
|
|
+ ACT_RU_IDENTITYLINK ari
|
|
|
|
+ where
|
|
|
|
+ ari.TYPE_ = 'participant'
|
|
|
|
+ and ari.USER_ID_ = '153080457649455104') temp on
|
|
|
|
+ art.PROC_INST_ID_ = temp.procInstId*/
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ select
|
|
|
|
+ et.id,
|
|
|
|
+ et.school_id schoolId,
|
|
|
|
+ et.org_id as orgId,
|
|
|
|
+ et.course_code courseCode,
|
|
|
|
+ et.course_name courseName,
|
|
|
|
+ et.specialty,
|
|
|
|
+ et.paper_number paperNumber,
|
|
|
|
+ et.card_rule_id cardRuleId,
|
|
|
|
+ case
|
|
|
|
+ et.card_rule_id when -1 then '全部通卡'
|
|
|
|
+ else b.name
|
|
|
|
+ end cardRuleName,
|
|
|
|
+ art.ASSIGNEE_ as userId,
|
|
|
|
+ c.real_name userName,
|
|
|
|
+ et.start_time startTime,
|
|
|
|
+ et.end_time endTime,
|
|
|
|
+ tffa.status,
|
|
|
|
+ et.enable,
|
|
|
|
+ et.create_time createTime,
|
|
|
|
+ art.EXECUTION_ID_ as executionId,
|
|
|
|
+ et.flow_id as flowId,
|
|
|
|
+ art.NAME_ as taskName,
|
|
|
|
+ art.TASK_DEF_KEY_ as taskDefKey,
|
|
|
|
+ art.ID_ as taskId,
|
|
|
|
+ tffa.setup
|
|
|
|
+ from
|
|
|
|
+ ACT_RU_TASK art
|
|
|
|
+ left join exam_task et on
|
|
|
|
+ et.flow_id = art.PROC_INST_ID_
|
|
|
|
+ left join basic_card_rule b ON
|
|
|
|
+ et.card_rule_id = b.id
|
|
|
|
+ left join t_f_flow_approve tffa on
|
|
|
|
+ tffa.flow_id = et.flow_id
|
|
|
|
+ left join sys_user c ON
|
|
|
|
+ art.ASSIGNEE_ = c.id
|
|
<where>
|
|
<where>
|
|
- <if test="userId != null and userId != ''">
|
|
|
|
- and art.ASSIGNEE_ = #{userId}
|
|
|
|
- </if>
|
|
|
|
- <if test="schoolId != null and schoolId != ''">
|
|
|
|
- and et.school_id = #{schoolId}
|
|
|
|
- </if>
|
|
|
|
- <if test="orgId != null and orgId != ''">
|
|
|
|
- and et.org_id = #{orgId}
|
|
|
|
- </if>
|
|
|
|
- </where>
|
|
|
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
|
+ and art.ASSIGNEE_ = #{userId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="schoolId != null and schoolId != ''">
|
|
|
|
+ and et.school_id = #{schoolId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orgId != null and orgId != ''">
|
|
|
|
+ and et.org_id = #{orgId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ UNION all
|
|
|
|
+ select
|
|
|
|
+ et.id,
|
|
|
|
+ et.school_id schoolId,
|
|
|
|
+ et.org_id as orgId,
|
|
|
|
+ et.course_code courseCode,
|
|
|
|
+ et.course_name courseName,
|
|
|
|
+ et.specialty,
|
|
|
|
+ et.paper_number paperNumber,
|
|
|
|
+ et.card_rule_id cardRuleId,
|
|
|
|
+ case
|
|
|
|
+ et.card_rule_id when -1 then '全部通卡'
|
|
|
|
+ else b.name
|
|
|
|
+ end cardRuleName,
|
|
|
|
+ ari.USER_ID_ as userId,
|
|
|
|
+ c.real_name userName,
|
|
|
|
+ et.start_time startTime,
|
|
|
|
+ et.end_time endTime,
|
|
|
|
+ tffa.status,
|
|
|
|
+ et.enable,
|
|
|
|
+ et.create_time createTime,
|
|
|
|
+ art.EXECUTION_ID_ as executionId,
|
|
|
|
+ et.flow_id as flowId,
|
|
|
|
+ art.NAME_ as taskName,
|
|
|
|
+ art.TASK_DEF_KEY_ as taskDefKey,
|
|
|
|
+ art.ID_ as taskId,
|
|
|
|
+ tffa.setup
|
|
|
|
+ from
|
|
|
|
+ ACT_RU_TASK art
|
|
|
|
+ left join exam_task et on
|
|
|
|
+ et.flow_id = art.PROC_INST_ID_
|
|
|
|
+ left join act_ru_identitylink ari on
|
|
|
|
+ ari.TASK_ID_ = art.ID_
|
|
|
|
+ left join basic_card_rule b ON
|
|
|
|
+ et.card_rule_id = b.id
|
|
|
|
+ left join t_f_flow_approve tffa on
|
|
|
|
+ tffa.flow_id = et.flow_id
|
|
|
|
+ left join sys_user c ON
|
|
|
|
+ ari.USER_ID_ = c.id
|
|
|
|
+ <where>
|
|
|
|
+ and art.ASSIGNEE_ is null
|
|
|
|
+ and ari.TYPE_ = 'candidate'
|
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
|
+ and ari.USER_ID_ = #{userId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="schoolId != null and schoolId != ''">
|
|
|
|
+ and et.school_id = #{schoolId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orgId != null and orgId != ''">
|
|
|
|
+ and et.org_id = #{orgId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|