|
@@ -318,48 +318,85 @@
|
|
</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
|
|
- distinct 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,
|
|
|
|
- f.status auditStatus,
|
|
|
|
- a.review_status reviewStatus,
|
|
|
|
- a.enable,
|
|
|
|
- a.create_id createId,
|
|
|
|
- a.create_time createTime,
|
|
|
|
- a.status,
|
|
|
|
- a.flow_id flowId,
|
|
|
|
- f.setup,
|
|
|
|
- f.status as flowStatus,
|
|
|
|
- a.teacher_name teacherName,
|
|
|
|
- a.lecturer_name lecturerName,
|
|
|
|
- e.name teachingRoomName
|
|
|
|
|
|
+ distinct 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,
|
|
|
|
+ f.status auditStatus,
|
|
|
|
+ a.review_status reviewStatus,
|
|
|
|
+ a.enable,
|
|
|
|
+ a.create_id createId,
|
|
|
|
+ a.create_time createTime,
|
|
|
|
+ a.status,
|
|
|
|
+ a.flow_id flowId,
|
|
|
|
+ f.setup,
|
|
|
|
+ f.status as flowStatus,
|
|
|
|
+ a.teacher_name teacherName,
|
|
|
|
+ a.lecturer_name lecturerName,
|
|
|
|
+ e.name teachingRoomName
|
|
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 t_f_flow_approve f ON
|
|
LEFT JOIN t_f_flow_approve f ON
|
|
- a.flow_id = f.flow_id
|
|
|
|
|
|
+ a.flow_id = f.flow_id
|
|
LEFT JOIN t_f_flow_approve_log tffal ON
|
|
LEFT JOIN t_f_flow_approve_log tffal ON
|
|
- a.flow_id = tffal.flow_id
|
|
|
|
|
|
+ a.flow_id = tffal.flow_id
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
- sys_org e ON a.teaching_room_id = e.id
|
|
|
|
|
|
+ sys_org e ON a.teaching_room_id = e.id
|
|
<where>
|
|
<where>
|
|
a.enable = true and a.review = true
|
|
a.enable = true and a.review = true
|
|
- and EXISTS (select distinct t.PROC_INST_ID_ from ACT_HI_TASKINST t where t.TASK_DEF_KEY_ <![CDATA[ <> ]]> 'usertask1' and t.END_TIME_ is not null and t.PROC_INST_ID_ = a.flow_id)
|
|
|
|
|
|
+ and (f.status = 'AUDITING' or f.status = 'FINISH')
|
|
|
|
+ and EXISTS (
|
|
|
|
+ select
|
|
|
|
+ aht.PROC_INST_ID_
|
|
|
|
+ from
|
|
|
|
+ ACT_HI_TASKINST aht
|
|
|
|
+ where
|
|
|
|
+ aht.TASK_DEF_KEY_ <![CDATA[ <> ]]> 'usertask1'
|
|
|
|
+ and aht.ASSIGNEE_ = cast(#{currentUserId} as char)
|
|
|
|
+ and aht.END_TIME_ is not null
|
|
|
|
+ union all
|
|
|
|
+ select
|
|
|
|
+ t.PROC_INST_ID_
|
|
|
|
+ from
|
|
|
|
+ (
|
|
|
|
+ select
|
|
|
|
+ ahi.*
|
|
|
|
+ from
|
|
|
|
+ ACT_HI_IDENTITYLINK ahi
|
|
|
|
+ where
|
|
|
|
+ ahi.TYPE_ = 'candidate'
|
|
|
|
+ and exists(
|
|
|
|
+ select
|
|
|
|
+ distinct aht.id_
|
|
|
|
+ from
|
|
|
|
+ ACT_HI_TASKINST aht
|
|
|
|
+ where
|
|
|
|
+ aht.TASK_DEF_KEY_ <![CDATA[ <> ]]> 'usertask1'
|
|
|
|
+ and aht.ASSIGNEE_ is null
|
|
|
|
+ and aht.END_TIME_ is not null
|
|
|
|
+ and ahi.TASK_ID_ = aht.id_)
|
|
|
|
+ and ahi.USER_ID_ = cast(#{currentUserId} as char)) temp
|
|
|
|
+ join ACT_HI_TASKINST t on
|
|
|
|
+ t.ID_ = temp.TASK_ID_
|
|
|
|
+ join t_f_flow_approve_log tffal on
|
|
|
|
+ tffal.flow_id = t.PROC_INST_ID_
|
|
|
|
+ where (tffal.primary_approve_id = #{currentUserId} or tffal.second_approve_id = #{currentUserId})
|
|
|
|
+ and t.PROC_INST_ID_ = a.flow_id)
|
|
<if test="schoolId != null and schoolId != ''">
|
|
<if test="schoolId != null and schoolId != ''">
|
|
and a.school_id = #{schoolId}
|
|
and a.school_id = #{schoolId}
|
|
</if>
|
|
</if>
|
|
@@ -393,12 +430,6 @@
|
|
<if test="createName != null and createName != ''">
|
|
<if test="createName != null and createName != ''">
|
|
and d.real_name like concat('%',#{createName},'%')
|
|
and d.real_name like concat('%',#{createName},'%')
|
|
</if>
|
|
</if>
|
|
- <if test="orgIds != null">
|
|
|
|
- AND a.org_id IN
|
|
|
|
- <foreach collection="orgIds" item="item" index="index" open="(" separator="," close=")">
|
|
|
|
- #{item}
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
</where>
|
|
</where>
|
|
order by a.create_time desc
|
|
order by a.create_time desc
|
|
</select>
|
|
</select>
|