|
@@ -31,53 +31,53 @@
|
|
|
</sql>
|
|
|
<select id="listPage" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDto">
|
|
|
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,
|
|
|
- CASE
|
|
|
- WHEN
|
|
|
- a.status = 'SUBMIT'
|
|
|
- AND (e.status = 'START'
|
|
|
- OR e.status = 'AUDITING')
|
|
|
- THEN
|
|
|
- 'AUDITING'
|
|
|
- WHEN
|
|
|
- a.status = 'SUBMIT'
|
|
|
- AND e.status = 'REJECT'
|
|
|
- THEN
|
|
|
- 'REJECT'
|
|
|
- WHEN
|
|
|
- a.status = 'SUBMIT'
|
|
|
- AND (e.status = 'FINISH'
|
|
|
- OR e.status is null)
|
|
|
- THEN
|
|
|
- 'FINISH'
|
|
|
- ELSE
|
|
|
- a.status
|
|
|
- END 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,
|
|
|
+ CASE
|
|
|
+ WHEN
|
|
|
+ a.status = 'SUBMIT'
|
|
|
+ AND (e.status = 'START'
|
|
|
+ OR e.status = 'AUDITING')
|
|
|
+ THEN
|
|
|
+ 'AUDITING'
|
|
|
+ WHEN
|
|
|
+ a.status = 'SUBMIT'
|
|
|
+ AND e.status = 'REJECT'
|
|
|
+ THEN
|
|
|
+ 'REJECT'
|
|
|
+ WHEN
|
|
|
+ a.status = 'SUBMIT'
|
|
|
+ AND (e.status = 'FINISH'
|
|
|
+ OR e.status is null)
|
|
|
+ THEN
|
|
|
+ 'FINISH'
|
|
|
+ ELSE
|
|
|
+ a.status
|
|
|
+ END status,
|
|
|
+ a.enable,
|
|
|
+ a.create_id createId,
|
|
|
+ a.create_time createTime
|
|
|
FROM
|
|
|
- exam_task a
|
|
|
+ exam_task a
|
|
|
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
|
|
|
- sys_user c ON a.user_id = c.id
|
|
|
+ sys_user c ON a.user_id = c.id
|
|
|
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 e ON a.flow_id = e.flow_id
|
|
|
+ t_f_flow_approve e ON a.flow_id = e.flow_id
|
|
|
<where>
|
|
|
<if test="schoolId != null and schoolId != ''">
|
|
|
and a.school_id = #{schoolId}
|
|
@@ -151,54 +151,54 @@
|
|
|
</select>
|
|
|
<select id="listTaskApply" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDto">
|
|
|
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,
|
|
|
- e.setup
|
|
|
+ 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,
|
|
|
+ e.setup
|
|
|
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_org d ON a.teaching_room_id = d.id
|
|
|
- LEFT JOIN
|
|
|
- t_f_flow_approve e ON a.flow_id = e.flow_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>
|
|
|
a.enable = true
|
|
|
and (a.status = 'STAGE' or (a.status = 'SUBMIT' and e.status = 'REJECT'))
|
|
@@ -236,43 +236,133 @@
|
|
|
order by a.create_time desc
|
|
|
</select>
|
|
|
<select id="listTaskReviewUnaudited" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDto">
|
|
|
+ select
|
|
|
+ t.*
|
|
|
+ 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,
|
|
|
+ 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 flowStatus,
|
|
|
+ true 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
|
|
|
+ <where>
|
|
|
+ a.enable = true
|
|
|
+ AND a.review = true
|
|
|
+ <if test="myselfFlowIds != null and myselfFlowIds.size > 0">
|
|
|
+ AND a.flow_id IN
|
|
|
+ <foreach collection="myselfFlowIds" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <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>
|
|
|
+ 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 flowStatus
|
|
|
+ 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 flowStatus,
|
|
|
+ false as myself
|
|
|
FROM
|
|
|
- exam_task a
|
|
|
+ exam_task a
|
|
|
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
|
|
|
- sys_user c ON a.user_id = c.id
|
|
|
+ sys_user c ON a.user_id = c.id
|
|
|
LEFT JOIN
|
|
|
- sys_user d ON a.create_id = d.id
|
|
|
+ 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
|
|
|
+ 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
|
|
|
+ t_f_flow_approve f ON a.flow_id = f.flow_id
|
|
|
<where>
|
|
|
a.enable = true
|
|
|
AND a.review = true
|
|
|
- AND a.status = 'SUBMIT' and (f.status = 'AUDITING' or f.status = 'REJECT')
|
|
|
+ <if test="notMyselfFlowIds != null and notMyselfFlowIds.size > 0">
|
|
|
+ AND a.flow_id IN
|
|
|
+ <foreach collection="notMyselfFlowIds" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
<if test="schoolId != null and schoolId != ''">
|
|
|
and a.school_id = #{schoolId}
|
|
|
</if>
|
|
@@ -310,7 +400,8 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
</where>
|
|
|
- order by a.create_time desc
|
|
|
+ ) t
|
|
|
+ order by t.createTime desc
|
|
|
</select>
|
|
|
<select id="listTaskReviewAudited" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDto">
|
|
|
SELECT
|
|
@@ -393,43 +484,43 @@
|
|
|
</select>
|
|
|
<select id="listTaskPaper" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto">
|
|
|
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(g.update_time, a.update_time) createTime,
|
|
|
- b.enable,
|
|
|
- b.paper_type paperType,
|
|
|
- b.exposed_paper_type exposedPaperType,
|
|
|
- b.unexposed_paper_type unexposedPaperType,
|
|
|
- CASE a.card_rule_id
|
|
|
- WHEN - 1 THEN '全部通卡'
|
|
|
- ELSE e.name
|
|
|
- END cardRuleName,
|
|
|
- f.make_method makeMethod,
|
|
|
- g.setup
|
|
|
+ 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(g.update_time, a.update_time) createTime,
|
|
|
+ b.enable,
|
|
|
+ b.paper_type paperType,
|
|
|
+ b.exposed_paper_type exposedPaperType,
|
|
|
+ b.unexposed_paper_type unexposedPaperType,
|
|
|
+ CASE a.card_rule_id
|
|
|
+ WHEN - 1 THEN '全部通卡'
|
|
|
+ ELSE e.name
|
|
|
+ END cardRuleName,
|
|
|
+ f.make_method makeMethod,
|
|
|
+ g.setup
|
|
|
FROM
|
|
|
exam_task a
|
|
|
- LEFT JOIN
|
|
|
+ LEFT JOIN
|
|
|
exam_task_detail b ON a.id = b.exam_task_id
|
|
|
- LEFT JOIN
|
|
|
+ LEFT JOIN
|
|
|
t_f_flow_approve g ON g.flow_id = a.flow_id
|
|
|
- LEFT JOIN
|
|
|
+ LEFT JOIN
|
|
|
sys_user c ON a.user_id = c.id
|
|
|
- LEFT JOIN
|
|
|
+ LEFT JOIN
|
|
|
sys_user d ON a.create_id = d.id
|
|
|
- LEFT JOIN
|
|
|
+ LEFT JOIN
|
|
|
basic_card_rule e ON a.card_rule_id = e.id
|
|
|
- LEFT JOIN
|
|
|
+ LEFT JOIN
|
|
|
exam_card f ON b.card_id = f.id
|
|
|
<where>
|
|
|
(a.status = 'SUBMIT' and a.flow_id is null or (a.flow_id is not null and g.status = 'FINISH'))
|
|
@@ -766,7 +857,7 @@
|
|
|
et.card_rule_id when -1 then '全部通卡'
|
|
|
else b.name
|
|
|
end cardRuleName,
|
|
|
- art.ASSIGNEE_ as userId,
|
|
|
+ cast(art.ASSIGNEE_ as Decimal(24)) as userId,
|
|
|
c.real_name userName,
|
|
|
et.start_time startTime,
|
|
|
et.end_time endTime,
|
|
@@ -790,7 +881,7 @@
|
|
|
left join sys_user c ON
|
|
|
art.ASSIGNEE_ = c.id
|
|
|
where
|
|
|
- art.ASSIGNEE_ = #{userId}
|
|
|
+ art.ASSIGNEE_ = cast(#{userId} as char)
|
|
|
and et.school_id = #{schoolId}
|
|
|
UNION all
|
|
|
select
|
|
@@ -806,7 +897,7 @@
|
|
|
et.card_rule_id when -1 then '全部通卡'
|
|
|
else b.name
|
|
|
end cardRuleName,
|
|
|
- ari.USER_ID_ as userId,
|
|
|
+ cast(ari.USER_ID_ as Decimal(24)) as userId,
|
|
|
c.real_name userName,
|
|
|
et.start_time startTime,
|
|
|
et.end_time endTime,
|
|
@@ -833,7 +924,7 @@
|
|
|
ari.USER_ID_ = c.id
|
|
|
where
|
|
|
art.ASSIGNEE_ is null
|
|
|
- and ari.USER_ID_ = #{userId}
|
|
|
+ and ari.USER_ID_ = cast(#{userId} as char)
|
|
|
and ari.TYPE_ = 'candidate'
|
|
|
and et.school_id = #{schoolId}
|
|
|
union all
|
|
@@ -895,31 +986,96 @@
|
|
|
et.userId = c.id
|
|
|
</select>
|
|
|
|
|
|
+ <select id="findFlowIdToMySelf" resultType="java.lang.Long">
|
|
|
+ select cast(art.PROC_INST_ID_ as Decimal(24)) as flowId
|
|
|
+ from
|
|
|
+ ACT_RU_TASK art
|
|
|
+ where
|
|
|
+ art.ASSIGNEE_ = cast(#{userId} as char)
|
|
|
+ UNION all
|
|
|
+ select
|
|
|
+ art.PROC_INST_ID_ as flowId
|
|
|
+ from
|
|
|
+ ACT_RU_TASK art
|
|
|
+ left join act_ru_identitylink ari on
|
|
|
+ ari.TASK_ID_ = art.ID_
|
|
|
+ where
|
|
|
+ art.ASSIGNEE_ is null
|
|
|
+ and ari.USER_ID_ = cast(#{userId} as char)
|
|
|
+ and ari.TYPE_ = 'candidate'
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findFlowIdToNotMySelf" resultType="java.lang.Long">
|
|
|
+ select
|
|
|
+ cast(t.flowId as Decimal(24)) as flowId
|
|
|
+ from
|
|
|
+ (
|
|
|
+ select
|
|
|
+ art.PROC_INST_ID_ as flowId
|
|
|
+ from
|
|
|
+ ACT_RU_TASK art
|
|
|
+ UNION
|
|
|
+ select
|
|
|
+ art.PROC_INST_ID_ as flowId
|
|
|
+ from
|
|
|
+ ACT_RU_TASK art
|
|
|
+ left join act_ru_identitylink ari on
|
|
|
+ ari.TASK_ID_ = art.ID_
|
|
|
+ where
|
|
|
+ art.ASSIGNEE_ is null
|
|
|
+ and ari.TYPE_ = 'candidate') t
|
|
|
+ where
|
|
|
+ NOT EXISTS(
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from
|
|
|
+ (
|
|
|
+ select
|
|
|
+ art.PROC_INST_ID_ as flowId
|
|
|
+ from
|
|
|
+ ACT_RU_TASK art
|
|
|
+ where
|
|
|
+ art.ASSIGNEE_ = cast(#{userId} as char)
|
|
|
+ UNION all
|
|
|
+ select
|
|
|
+ art.PROC_INST_ID_ as flowId
|
|
|
+ from
|
|
|
+ ACT_RU_TASK art
|
|
|
+ left join act_ru_identitylink ari on
|
|
|
+ ari.TASK_ID_ = art.ID_
|
|
|
+ where
|
|
|
+ art.ASSIGNEE_ is null
|
|
|
+ and ari.USER_ID_ = cast(#{userId} as char)
|
|
|
+ and ari.TYPE_ = 'candidate') temp
|
|
|
+ where
|
|
|
+ t.flowId = temp.flowId)
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="findByFlowStatus" resultType="com.qmth.distributed.print.business.entity.ExamTask">
|
|
|
select
|
|
|
- et.*
|
|
|
+ et.*
|
|
|
from
|
|
|
- exam_task et
|
|
|
+ exam_task et
|
|
|
left join t_f_flow_approve tffa on
|
|
|
- tffa.flow_id = et.flow_id
|
|
|
- <where>
|
|
|
- and et.enable = true
|
|
|
- <if test="schoolId != null and schoolId != ''">
|
|
|
- and et.school_id = #{schoolId}
|
|
|
- </if>
|
|
|
- <if test="courseCode != null and courseCode != ''">
|
|
|
- and et.course_code = #{courseCode}
|
|
|
- </if>
|
|
|
- <if test="courseName != null and courseName != ''">
|
|
|
- and et.course_name = #{courseName}
|
|
|
- </if>
|
|
|
- <if test="paperNumber != null and paperNumber != ''">
|
|
|
- and et.paper_number = #{paperNumber}
|
|
|
- </if>
|
|
|
- <if test="flowStatus != null and flowStatus != ''">
|
|
|
- and tffa.status = #{flowStatus}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- order by et.paper_number asc
|
|
|
+ tffa.flow_id = et.flow_id
|
|
|
+ <where>
|
|
|
+ and et.enable = true
|
|
|
+ <if test="schoolId != null and schoolId != ''">
|
|
|
+ and et.school_id = #{schoolId}
|
|
|
+ </if>
|
|
|
+ <if test="courseCode != null and courseCode != ''">
|
|
|
+ and et.course_code = #{courseCode}
|
|
|
+ </if>
|
|
|
+ <if test="courseName != null and courseName != ''">
|
|
|
+ and et.course_name = #{courseName}
|
|
|
+ </if>
|
|
|
+ <if test="paperNumber != null and paperNumber != ''">
|
|
|
+ and et.paper_number = #{paperNumber}
|
|
|
+ </if>
|
|
|
+ <if test="flowStatus != null and flowStatus != ''">
|
|
|
+ and tffa.status = #{flowStatus}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by et.paper_number asc
|
|
|
</select>
|
|
|
</mapper>
|