|
@@ -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
|
|
|
|
|
|
+ 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>
|
|
<if test="schoolId != null and schoolId != ''">
|
|
<if test="schoolId != null and schoolId != ''">
|
|
and a.school_id = #{schoolId}
|
|
and a.school_id = #{schoolId}
|
|
@@ -114,51 +114,62 @@
|
|
</where>
|
|
</where>
|
|
</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
|
|
|
|
- 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
|
|
|
|
|
|
+ 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,
|
|
|
|
+ a.teacher_name teacherName,
|
|
|
|
+ a.lecturer_name lecturerName,
|
|
|
|
+ d.name teachingRoomName,
|
|
|
|
+ CASE
|
|
|
|
+ WHEN e.status = 'FINISH' THEN 'AUDITED'
|
|
|
|
+ WHEN e.status = 'AUDITING' THEN 'AUDITING'
|
|
|
|
+ WHEN
|
|
|
|
+ e.status IS NOT NULL
|
|
|
|
+ AND e.status != 'FINISH'
|
|
|
|
+ AND e.status != 'AUDITING'
|
|
|
|
+ THEN
|
|
|
|
+ 'NOT_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
|
|
|
|
|
|
+ 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_org d ON a.teaching_room_id = d.id
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ t_f_flow_approve e ON a.flow_id = e.flow_id
|
|
<where>
|
|
<where>
|
|
- <if test="orgIds != null and userId != null and userId != ''">
|
|
|
|
|
|
+ a.enable = true
|
|
|
|
+ and a.status = #{status}
|
|
|
|
+ <if test="userId != null and userId != ''">
|
|
and a.user_id = #{userId}
|
|
and a.user_id = #{userId}
|
|
</if>
|
|
</if>
|
|
- </where>
|
|
|
|
- order by a.create_time desc) a
|
|
|
|
- <where>
|
|
|
|
- a.enable = true and a.status not in
|
|
|
|
- <foreach item="item" collection="status" separator="," open="(" close=")" index="">
|
|
|
|
- #{item}
|
|
|
|
- </foreach>
|
|
|
|
<if test="schoolId != null and schoolId != ''">
|
|
<if test="schoolId != null and schoolId != ''">
|
|
- and a.schoolId = #{schoolId}
|
|
|
|
|
|
+ and a.school_id = #{schoolId}
|
|
</if>
|
|
</if>
|
|
<if test="auditStatus != null">
|
|
<if test="auditStatus != null">
|
|
and a.auditStatus = #{auditStatus}
|
|
and a.auditStatus = #{auditStatus}
|
|
@@ -185,6 +196,7 @@
|
|
and a.userName like concat('%',#{userName},'%')
|
|
and a.userName like concat('%',#{userName},'%')
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
|
|
+ order by a.create_time desc
|
|
</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
|
|
@@ -392,7 +404,7 @@
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
exam_card f ON b.card_id = f.id
|
|
exam_card f ON b.card_id = f.id
|
|
<where>
|
|
<where>
|
|
- (a.flow_id is null or (a.flow_id is not null and g.status = 'FINISH'))
|
|
|
|
|
|
+ (a.status = 'SUBMIT' and a.flow_id is null or (a.flow_id is not null and g.status = 'FINISH'))
|
|
<if test="schoolId != null and schoolId != ''">
|
|
<if test="schoolId != null and schoolId != ''">
|
|
and a.school_id = #{schoolId}
|
|
and a.school_id = #{schoolId}
|
|
</if>
|
|
</if>
|