|
|
@@ -74,32 +74,35 @@
|
|
|
|
|
|
<select id="getMobileResultPage" parameterType="com.xjrsoft.module.evaluate.dto.MobileResultPageDto" resultType="com.xjrsoft.module.evaluate.vo.MobileResultPageVo">
|
|
|
select
|
|
|
- t1.id as evaluateManageId,
|
|
|
- t1.name,
|
|
|
- t.id as evaluateObjectId,
|
|
|
- t.object_id as objectId,
|
|
|
- ifnull(t5.name, t6.name) as objectIdCn,
|
|
|
- t3.id as evaluateUserId,
|
|
|
- t3.user_id as userId,
|
|
|
- t7.name as userIdCn,
|
|
|
- t2.evaluate_type as evaluateType,
|
|
|
- t4.name as evaluateTypeCn,
|
|
|
- t1.start_time,
|
|
|
- t1.end_time,
|
|
|
- t3.status as evaluateStatus
|
|
|
+ *
|
|
|
+ from ((select
|
|
|
+ t1.id as evaluateManageId,
|
|
|
+ t1.name,
|
|
|
+ t.id as evaluateObjectId,
|
|
|
+ t.object_id as objectId,
|
|
|
+ ifnull(t5.name, t6.name) as objectIdCn,
|
|
|
+ t3.id as evaluateUserId,
|
|
|
+ t3.user_id as userId,
|
|
|
+ t7.name as userIdCn,
|
|
|
+ t2.evaluate_type as evaluateType,
|
|
|
+ t4.name as evaluateTypeCn,
|
|
|
+ t1.start_time,
|
|
|
+ t1.end_time,
|
|
|
+ t3.status as evaluateStatus,
|
|
|
+ null as evaluateSubmitRecordId
|
|
|
from evaluate_object t
|
|
|
- left join evaluate_manage t1 on t1.id = t.evaluate_manage_id
|
|
|
- left join evaluate_template t2 on t2.id = t1.evaluate_template_id
|
|
|
- left join evaluate_executer t3 on t3.evaluate_object_id = t.id
|
|
|
- left join xjr_dictionary_detail t4 on t4.code = t2.evaluate_type
|
|
|
- left join xjr_user t5 on t5.id = t.object_id
|
|
|
- left join base_class t6 on t6.id = t.object_id
|
|
|
- left join xjr_user t7 on t7.id = t3.user_id
|
|
|
+ left join evaluate_manage t1 on t1.id = t.evaluate_manage_id
|
|
|
+ left join evaluate_template t2 on t2.id = t1.evaluate_template_id
|
|
|
+ left join evaluate_executer t3 on t3.evaluate_object_id = t.id
|
|
|
+ left join xjr_dictionary_detail t4 on t4.code = t2.evaluate_type
|
|
|
+ left join xjr_user t5 on t5.id = t.object_id
|
|
|
+ left join base_class t6 on t6.id = t.object_id
|
|
|
+ left join xjr_user t7 on t7.id = t3.user_id
|
|
|
where t.delete_mark = 0
|
|
|
- and t3.delete_mark = 0
|
|
|
- and t1.status = 1
|
|
|
- and t3.user_id = #{dto.loginUserId}
|
|
|
- and t.evaluate_manage_id = #{dto.evaluateManageId}
|
|
|
+ and t3.delete_mark = 0
|
|
|
+ and t1.status = 1
|
|
|
+ and t3.user_id = 14954808977606
|
|
|
+ and t.evaluate_manage_id = 1753257838133182465
|
|
|
<if test="dto.status != null">
|
|
|
and t3.status = #{dto.status}
|
|
|
</if>
|
|
|
@@ -108,8 +111,47 @@
|
|
|
</if>
|
|
|
<if test="dto.endTime != null and dto.startTime != ''">
|
|
|
and #{dto.endTime} >= t1.end_time
|
|
|
+ </if>)
|
|
|
+ union
|
|
|
+ (select
|
|
|
+ t1.id as evaluateManageId,
|
|
|
+ t1.name,
|
|
|
+ t.id as evaluateObjectId,
|
|
|
+ t.object_id as objectId,
|
|
|
+ ifnull(t5.name, t6.name) as objectIdCn,
|
|
|
+ t3.id as evaluateUserId,
|
|
|
+ t3.user_id as userId,
|
|
|
+ t7.name as userIdCn,
|
|
|
+ t2.evaluate_type as evaluateType,
|
|
|
+ t4.name as evaluateTypeCn,
|
|
|
+ t1.start_time,
|
|
|
+ t1.end_time,
|
|
|
+ t3.status as evaluateStatus,
|
|
|
+ t8.id as evaluateSubmitRecordId
|
|
|
+ from evaluate_object t
|
|
|
+ left join evaluate_manage t1 on t1.id = t.evaluate_manage_id
|
|
|
+ left join evaluate_template t2 on t2.id = t1.evaluate_template_id
|
|
|
+ left join evaluate_executer t3 on t3.evaluate_object_id = t.id
|
|
|
+ left join xjr_dictionary_detail t4 on t4.code = t2.evaluate_type
|
|
|
+ left join xjr_user t5 on t5.id = t.object_id
|
|
|
+ left join base_class t6 on t6.id = t.object_id
|
|
|
+ left join xjr_user t7 on t7.id = t3.user_id
|
|
|
+ left join evaluate_submit_record t8 on t8.evaluated_object_id = t.id and t8.evaluate_manage_id = t.evaluate_manage_id and t8.evaluate_executer_id = t3.id
|
|
|
+ where t.delete_mark = 0
|
|
|
+ and t3.delete_mark = 0
|
|
|
+ and t1.status = 1
|
|
|
+ and t3.user_id = 14954808977606
|
|
|
+ and t.evaluate_manage_id = 1753257838133182465
|
|
|
+ <if test="dto.status != null">
|
|
|
+ and t3.status = #{dto.status}
|
|
|
</if>
|
|
|
- order by t3.status;
|
|
|
+ <if test="dto.startTime != null and dto.startTime != ''">
|
|
|
+ and t1.start_time >= #{dto.startTime}
|
|
|
+ </if>
|
|
|
+ <if test="dto.endTime != null and dto.startTime != ''">
|
|
|
+ and #{dto.endTime} >= t1.end_time
|
|
|
+ </if>)) as t
|
|
|
+ order by evaluateStatus;
|
|
|
</select>
|
|
|
|
|
|
<select id="getDrillEvaluateClassList" parameterType="com.xjrsoft.module.evaluate.dto.DrillEvaluateClassListDto" resultType="com.xjrsoft.module.evaluate.vo.DrillEvaluateClassListVo">
|
|
|
@@ -176,24 +218,33 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getScoreList" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateManageScoreDto" resultType="com.xjrsoft.module.evaluate.vo.EvaluateManageScoreVo">
|
|
|
- select t.evaluate_manage_id,
|
|
|
- t.id as evaluateObjectId,
|
|
|
- sum(t2.score) as totalScore,
|
|
|
- count(t2.score) as itemCount
|
|
|
- from evaluate_object t
|
|
|
- left join evaluate_executer t1 on t1.evaluate_object_id = t.id
|
|
|
- left join evaluate_result t2 on t2.user_id = t1.id
|
|
|
+ select t.submit_record_id as submitRecordId,
|
|
|
+ sum(t.score) as totalScore,
|
|
|
+ count(t.score) as itemCount
|
|
|
+ from evaluate_result t
|
|
|
+ left join evaluate_submit_record t3 on t3.id = t.submit_record_id
|
|
|
where t.delete_mark = 0
|
|
|
- and t1.delete_mark = 0
|
|
|
- and t.evaluate_manage_id = #{dto.evaluateManageId}
|
|
|
- and t.id in
|
|
|
+ and t.submit_record_id in
|
|
|
<foreach item="evaluateObjectId" index="index" collection="dto.evaluateObjectIdList" open="(" close=")"
|
|
|
- separator=",">
|
|
|
+ separator=",">
|
|
|
#{evaluateObjectId}
|
|
|
</foreach>
|
|
|
- and t1.user_id = #{dto.userId}
|
|
|
- and t1.status = 1
|
|
|
- group by t.evaluate_manage_id, t.id
|
|
|
+ group by t.submit_record_id;
|
|
|
</select>
|
|
|
|
|
|
+ <insert id="insertEvaluateSubmitRecord" parameterType="java.lang.Long">
|
|
|
+ SELECT
|
|
|
+ UUID(),
|
|
|
+ t.evaluate_manage_id,
|
|
|
+ t.id,
|
|
|
+ NOW(),
|
|
|
+ t2.evaluate_type,
|
|
|
+ t.evaluate_object_id,
|
|
|
+ 0
|
|
|
+ FROM evaluate_executer t
|
|
|
+ LEFT JOIN evaluate_manage t1 ON (t1.id = t.evaluate_manage_id)
|
|
|
+ LEFT JOIN evaluate_template t2 ON (t2.id = t1.evaluate_template_id)
|
|
|
+ WHERE t.delete_mark = 0
|
|
|
+ AND t.evaluate_manage_id = #{evaluateManageId};
|
|
|
+ </insert>
|
|
|
</mapper>
|