|
@@ -87,35 +87,20 @@
|
|
|
</select>
|
|
|
<select id="listCourseForApply" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
|
|
|
SELECT
|
|
|
- bc.code code,
|
|
|
- bc.name name
|
|
|
+ et.course_code code,
|
|
|
+ et.course_name name
|
|
|
FROM
|
|
|
- basic_course bc
|
|
|
- <where>
|
|
|
- EXISTS ( SELECT
|
|
|
- 1
|
|
|
- FROM
|
|
|
exam_task et
|
|
|
- LEFT JOIN
|
|
|
- basic_exam be ON et.exam_id = be.id
|
|
|
- <where>
|
|
|
- bc.school_id = et.school_id
|
|
|
- AND bc.code = et.course_code
|
|
|
- <if test="semesterId != null">
|
|
|
- AND be.semester_id = #{semesterId}
|
|
|
- </if>
|
|
|
- <if test="examId != null">
|
|
|
- AND et.exam_id = #{examId}
|
|
|
- </if>
|
|
|
- <if test="userId != null">
|
|
|
- AND et.user_id = #{userId}
|
|
|
- </if>
|
|
|
- </where>)
|
|
|
- <if test="enable != null">
|
|
|
- and bc.enable = #{enable}
|
|
|
+ <where>
|
|
|
+ et.enable = true
|
|
|
+ <if test="examId != null">
|
|
|
+ and et.exam_id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="userId != null">
|
|
|
+ and et.user_id = #{userId}
|
|
|
</if>
|
|
|
</where>
|
|
|
- order by bc.code
|
|
|
+ order by et.create_time desc
|
|
|
</select>
|
|
|
<select id="listCourseForAudit" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
|
|
|
SELECT
|
|
@@ -148,24 +133,22 @@
|
|
|
</select>
|
|
|
<select id="listPaperNumberForApply" resultType="java.lang.String">
|
|
|
SELECT
|
|
|
- et.paper_number
|
|
|
+ et.paper_number paperNumber
|
|
|
FROM
|
|
|
exam_task et
|
|
|
- LEFT JOIN
|
|
|
- basic_exam be ON et.exam_id = be.id
|
|
|
<where>
|
|
|
- <if test="semesterId != null">
|
|
|
- AND be.semester_id = #{semesterId}
|
|
|
+ et.enable = true
|
|
|
+ <if test="examId != null">
|
|
|
+ and et.exam_id = #{examId}
|
|
|
</if>
|
|
|
- AND et.exam_id = #{examId}
|
|
|
<if test="courseCode != null and courseCode != ''">
|
|
|
- AND et.course_code = #{courseCode}
|
|
|
+ and et.course_code = #{courseCode}
|
|
|
</if>
|
|
|
<if test="userId != null">
|
|
|
- AND et.user_id = #{userId}
|
|
|
+ and et.user_id = #{userId}
|
|
|
</if>
|
|
|
</where>
|
|
|
- order by et.paper_number
|
|
|
+ order by et.create_time desc
|
|
|
</select>
|
|
|
<select id="listPaperNumberAudit" resultType="java.lang.String">
|
|
|
SELECT
|
|
@@ -527,4 +510,64 @@
|
|
|
</where>
|
|
|
order by a.create_time desc
|
|
|
</select>
|
|
|
+ <select id="listCourseForQuery" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
|
|
|
+ SELECT
|
|
|
+ distinct a.course_code code,
|
|
|
+ a.course_name name
|
|
|
+ FROM
|
|
|
+ exam_task a
|
|
|
+ LEFT JOIN
|
|
|
+ t_f_flow_approve g ON g.flow_id = a.flow_id
|
|
|
+ LEFT JOIN
|
|
|
+ sys_user d ON a.create_id = d.id
|
|
|
+ <where>
|
|
|
+ a.status = 'SUBMIT' and (a.flow_id is null or (a.flow_id is not null and g.status = 'FINISH'))
|
|
|
+ <if test="examId != null">
|
|
|
+ and a.exam_id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr != null">
|
|
|
+ <if test="dpr.requestUserId != null">
|
|
|
+ AND a.create_id = #{dpr.requestUserId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND d.org_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by IFNULL(g.update_time, a.update_time) desc, a.paper_number desc
|
|
|
+ </select>
|
|
|
+ <select id="listPaperNumberForQuery" resultType="java.lang.String">
|
|
|
+ SELECT
|
|
|
+ a.paper_number paperNumber
|
|
|
+ FROM
|
|
|
+ exam_task a
|
|
|
+ LEFT JOIN
|
|
|
+ t_f_flow_approve g ON g.flow_id = a.flow_id
|
|
|
+ LEFT JOIN
|
|
|
+ sys_user d ON a.create_id = d.id
|
|
|
+ <where>
|
|
|
+ a.status = 'SUBMIT' and (a.flow_id is null or (a.flow_id is not null and g.status = 'FINISH'))
|
|
|
+ <if test="examId != null">
|
|
|
+ and a.exam_id = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="courseCode != null and courseCode != ''">
|
|
|
+ and a.course_code = #{courseCode}
|
|
|
+ </if>
|
|
|
+ <if test="dpr != null">
|
|
|
+ <if test="dpr.requestUserId != null">
|
|
|
+ AND a.create_id = #{dpr.requestUserId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND d.org_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by IFNULL(g.update_time, a.update_time) desc, a.paper_number desc
|
|
|
+ </select>
|
|
|
</mapper>
|