|
@@ -151,44 +151,44 @@
|
|
</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
|
|
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,
|
|
|
|
- e.status auditStatus,
|
|
|
|
- a.enable,
|
|
|
|
- a.create_id createId,
|
|
|
|
- a.create_time createTime,
|
|
|
|
- e.setup,
|
|
|
|
- a.flow_id flowId
|
|
|
|
|
|
+ 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,
|
|
|
|
+ e.status auditStatus,
|
|
|
|
+ a.enable,
|
|
|
|
+ a.create_id createId,
|
|
|
|
+ a.create_time createTime,
|
|
|
|
+ e.setup,
|
|
|
|
+ a.flow_id flowId
|
|
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_org d ON a.teaching_room_id = d.id
|
|
|
|
|
|
+ sys_org d ON a.teaching_room_id = d.id
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
- t_f_flow_approve e ON a.flow_id = e.flow_id
|
|
|
|
|
|
+ t_f_flow_approve e ON a.flow_id = e.flow_id
|
|
<where>
|
|
<where>
|
|
a.enable = true
|
|
a.enable = true
|
|
- and (a.status = 'STAGE' or (a.status = 'SUBMIT' and e.status = 'REJECT'))
|
|
|
|
|
|
+ and (a.status = 'STAGE' or (a.status = 'SUBMIT' and e.status is not null and e.status != 'FINISH'))
|
|
<if test="userId != null and userId != ''">
|
|
<if test="userId != null and userId != ''">
|
|
and a.user_id = #{userId}
|
|
and a.user_id = #{userId}
|
|
</if>
|
|
</if>
|
|
@@ -307,92 +307,6 @@
|
|
</foreach>
|
|
</foreach>
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
- union all
|
|
|
|
- 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,
|
|
|
|
- a.flow_id flowId,
|
|
|
|
- f.setup,
|
|
|
|
- f.status as auditStatus,
|
|
|
|
- f.status as flowStatus,
|
|
|
|
- a.teacher_name teacherName,
|
|
|
|
- a.lecturer_name lecturerName,
|
|
|
|
- so.name teachingRoomName,
|
|
|
|
- false as myself
|
|
|
|
- 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
|
|
|
|
- LEFT JOIN
|
|
|
|
- exam_task_paper_log e ON a.id = e.exam_task_id AND e.review = false
|
|
|
|
- LEFT JOIN
|
|
|
|
- t_f_flow_approve f ON a.flow_id = f.flow_id
|
|
|
|
- LEFT JOIN
|
|
|
|
- sys_org so ON a.teaching_room_id = so.id
|
|
|
|
- <where>
|
|
|
|
- a.enable = true
|
|
|
|
- AND a.review = true
|
|
|
|
- AND a.status = 'SUBMIT' and (f.status = 'AUDITING' or f.status = 'REJECT')
|
|
|
|
- and EXISTS(
|
|
|
|
- select * from(
|
|
|
|
- <include refid="findFlowIdToNotMySelfSql" />
|
|
|
|
- ) t where t.flowId = a.flow_id)
|
|
|
|
- <if test="schoolId != null and schoolId != ''">
|
|
|
|
- and a.school_id = #{schoolId}
|
|
|
|
- </if>
|
|
|
|
- <if test="courseCode != null and courseCode != ''">
|
|
|
|
- and a.course_code = #{courseCode}
|
|
|
|
- </if>
|
|
|
|
- <if test="paperNumber != null and paperNumber != ''">
|
|
|
|
- and a.paper_number = #{paperNumber}
|
|
|
|
- </if>
|
|
|
|
- <if test="userId != null and userId != ''">
|
|
|
|
- and a.user_id = #{userId}
|
|
|
|
- </if>
|
|
|
|
- <if test="cardRuleId != null and cardRuleId != ''">
|
|
|
|
- and a.card_rule_id = #{cardRuleId}
|
|
|
|
- </if>
|
|
|
|
- <if test="startTime != null and startTime != ''">
|
|
|
|
- and a.start_time >= #{startTime}
|
|
|
|
- </if>
|
|
|
|
- <if test="endTime != null and endTime != ''">
|
|
|
|
- and a.start_time <= #{endTime}
|
|
|
|
- </if>
|
|
|
|
- <if test="startCreateTime != null and startCreateTime > 0">
|
|
|
|
- and a.create_time >= #{startCreateTime}
|
|
|
|
- </if>
|
|
|
|
- <if test="endCreateTime != null and endCreateTime > 0">
|
|
|
|
- and #{endCreateTime} >= a.create_time
|
|
|
|
- </if>
|
|
|
|
- <if test="createName != null and createName != ''">
|
|
|
|
- and d.real_name like concat('%',#{createName},'%')
|
|
|
|
- </if>
|
|
|
|
- <if test="orgIds != null">
|
|
|
|
- AND d.org_id IN
|
|
|
|
- <foreach collection="orgIds" item="item" index="index" open="(" separator="," close=")">
|
|
|
|
- #{item}
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
- </where>
|
|
|
|
) t
|
|
) t
|
|
order by t.createTime desc
|
|
order by t.createTime desc
|
|
</select>
|
|
</select>
|