|
|
@@ -49,99 +49,96 @@
|
|
|
t2.evaluate_type,
|
|
|
t4.name as evaluateTypeCn,
|
|
|
(select
|
|
|
- count(tb3.status)
|
|
|
- from evaluate_manage tb1
|
|
|
- left join evaluate_executer tb3 on tb3.evaluate_manage_id = tb1.id
|
|
|
- where tb1.delete_mark = 0
|
|
|
- and tb3.delete_mark = 0
|
|
|
- and tb1.status <> -1
|
|
|
- and tb3.status = 0
|
|
|
- and tb3.id = t3.id
|
|
|
- and tb1.id = t.id) as ratedCount
|
|
|
+ count(tb3.status)
|
|
|
+ from evaluate_manage tb1
|
|
|
+ left join evaluate_executer tb3 on tb3.evaluate_manage_id = tb1.id
|
|
|
+ where tb1.delete_mark = 0
|
|
|
+ and tb1.status <> -1
|
|
|
+ and tb3.status = 0
|
|
|
+ and tb3.user_id = t3.user_id
|
|
|
+ and tb1.id = t.id) as ratedCount
|
|
|
from evaluate_manage t
|
|
|
- left join evaluate_template t2 on t2.id = t.evaluate_template_id
|
|
|
- left join evaluate_executer t3 on t3.evaluate_manage_id = t.id
|
|
|
- left join xjr_dictionary_detail t4 on t4.code = t2.evaluate_type
|
|
|
+ left join evaluate_template t2 on t2.id = t.evaluate_template_id
|
|
|
+ left join evaluate_executer t3 on t3.evaluate_manage_id = t.id
|
|
|
+ left join xjr_dictionary_detail t4 on t4.code = t2.evaluate_type
|
|
|
where t.delete_mark = 0
|
|
|
- and t3.delete_mark = 0
|
|
|
- and t.status <> -1
|
|
|
- and t3.user_id = #{dto.loginUserId}
|
|
|
- <if test="dto.keyword != null and dto.keyword != ''">
|
|
|
- and (t.name like concat('%', #{dto.keyword}, '%')
|
|
|
- or t4.name like concat('%', #{dto.keyword}, '%'))
|
|
|
- </if>
|
|
|
+ and t.status <> -1
|
|
|
+ and t3.user_id = #{dto.loginUserId}
|
|
|
+ <if test="dto.keyword != null and dto.keyword != ''">
|
|
|
+ and (t.name like concat('%', #{dto.keyword}, '%')
|
|
|
+ or t4.name like concat('%', #{dto.keyword}, '%'))
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getMobileResultPage" parameterType="com.xjrsoft.module.evaluate.dto.MobileResultPageDto" resultType="com.xjrsoft.module.evaluate.vo.MobileResultPageVo">
|
|
|
select
|
|
|
- t1.id as evaluateManageId,
|
|
|
+ t.id as evaluateSubmitRecordId,
|
|
|
+ t.evaluate_manage_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,
|
|
|
+ t.evaluated_object_id as evaluateObjectId,
|
|
|
+ t3.object_id as objectId,
|
|
|
+ ifnull(t4.name, t5.name) as objectIdCn,
|
|
|
+ t2.id as evaluateUserId,
|
|
|
+ t2.user_id as userId,
|
|
|
+ t6.name as userIdCn,
|
|
|
t1.start_time,
|
|
|
t1.end_time,
|
|
|
- t3.status as evaluateStatus
|
|
|
- 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
|
|
|
- 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}
|
|
|
- <if test="dto.status != null">
|
|
|
- and t3.status = #{dto.status}
|
|
|
- </if>
|
|
|
- <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>
|
|
|
- order by t3.status;
|
|
|
+ t.status as evaluateStatus,
|
|
|
+ t7.evaluate_type as evaluateType,
|
|
|
+ t8.name as evaluateTypeCn
|
|
|
+ from evaluate_submit_record t
|
|
|
+ left join evaluate_manage t1 on t1.id = t.evaluate_manage_id
|
|
|
+ left join evaluate_executer t2 on t2.id = t.evaluate_executer_id
|
|
|
+ left join evaluate_object t3 on t3.id = t.evaluated_object_id
|
|
|
+ left join xjr_user t4 on t4.id = t3.object_id
|
|
|
+ left join base_class t5 on t5.id = t3.object_id
|
|
|
+ left join xjr_user t6 on t6.id = t2.user_id
|
|
|
+ left join evaluate_template t7 on t7.id = t1.evaluate_template_id
|
|
|
+ left join xjr_dictionary_detail t8 on t8.code = t7.evaluate_type
|
|
|
+ where t2.user_id = #{dto.loginUserId}
|
|
|
+ and t.evaluate_manage_id = #{dto.evaluateManageId}
|
|
|
+ <if test="dto.status != null">
|
|
|
+ and t.status = #{dto.status}
|
|
|
+ </if>
|
|
|
+ <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>
|
|
|
+ order by t.status;
|
|
|
</select>
|
|
|
|
|
|
<select id="getDrillEvaluateClassList" parameterType="com.xjrsoft.module.evaluate.dto.DrillEvaluateClassListDto" resultType="com.xjrsoft.module.evaluate.vo.DrillEvaluateClassListVo">
|
|
|
select
|
|
|
- t1.id as evaluateManageId,
|
|
|
+ t.id as evaluateSubmitRecordId,
|
|
|
+ t.evaluate_manage_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,
|
|
|
+ t.evaluated_object_id as evaluateObjectId,
|
|
|
+ t3.object_id as objectId,
|
|
|
+ ifnull(t4.name, t5.name) as objectIdCn,
|
|
|
+ t2.id as evaluateUserId,
|
|
|
+ t2.user_id as userId,
|
|
|
+ t6.name as userIdCn,
|
|
|
t1.start_time,
|
|
|
t1.end_time,
|
|
|
- t3.status as evaluateStatus
|
|
|
- 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 base_classroom t8 on t8.id = t6.classroom_id
|
|
|
- left join base_class_major_set t9 on t9.class_id = t6.id
|
|
|
- left join base_major_set t10 on t10.id = t9.major_set_id
|
|
|
- where t.delete_mark = 0
|
|
|
- and t3.delete_mark = 0
|
|
|
- and t1.status = 1
|
|
|
- and t3.user_id = #{dto.loginUserId}
|
|
|
+ t.status as evaluateStatus,
|
|
|
+ t7.evaluate_type as evaluateType,
|
|
|
+ t8.name as evaluateTypeCn
|
|
|
+ from evaluate_submit_record t
|
|
|
+ left join evaluate_manage t1 on t1.id = t.evaluate_manage_id
|
|
|
+ left join evaluate_executer t2 on t2.id = t.evaluate_executer_id
|
|
|
+ left join evaluate_object t3 on t3.id = t.evaluated_object_id
|
|
|
+ left join xjr_user t4 on t4.id = t3.object_id
|
|
|
+ left join base_class t5 on t5.id = t3.object_id
|
|
|
+ left join xjr_user t6 on t6.id = t2.user_id
|
|
|
+ left join evaluate_template t7 on t7.id = t1.evaluate_template_id
|
|
|
+ left join xjr_dictionary_detail t8 on t8.code = t7.evaluate_type
|
|
|
+ left join base_classroom t9 on t9.id = t5.classroom_id
|
|
|
+ left join base_class_major_set t10 on t10.class_id = t5.id
|
|
|
+ left join base_major_set t11 on t11.id = t10.major_set_id
|
|
|
+ where t.create_date like concat('%', #{dto.todayDate}, '%')
|
|
|
+ and t2.user_id = #{dto.loginUserId}
|
|
|
and t.evaluate_manage_id = #{dto.evaluateManageId}
|
|
|
<if test="dto.majorId != null and dto.majorId > 0">
|
|
|
and t10.major_id = #{dto.majorId}
|
|
|
@@ -149,7 +146,7 @@
|
|
|
<if test="dto.officeBuildId != null and dto.officeBuildId > 0">
|
|
|
and t8.officeBuildId = #{dto.officeBuildId}
|
|
|
</if>
|
|
|
- order by t3.status;
|
|
|
+ order by t.status;
|
|
|
</select>
|
|
|
|
|
|
<select id="getWriteInfo" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateWritePageDto" resultType="com.xjrsoft.module.evaluate.vo.EvaluateWriteVo">
|
|
|
@@ -164,36 +161,53 @@
|
|
|
SELECT * FROM evaluate_manage_item WHERE delete_mark = 0 AND evaluate_manage_id = #{id} ORDER BY sort_code
|
|
|
</select>
|
|
|
<select id="getResultList" parameterType="com.xjrsoft.module.evaluate.dto.ResultListDto" resultType="com.xjrsoft.module.evaluate.vo.EvaluateManageItemVo">
|
|
|
- SELECT t1.id,t1.sort_code,t1.evaluate_manage_id,t1.topic,t1.problem,t1.score,t2.score AS actualScore,t2.opinion,t1.input_not_null FROM evaluate_manage_item t1
|
|
|
- LEFT JOIN evaluate_result t2 ON t1.id = t2.evaluate_item_id
|
|
|
- LEFT JOIN evaluate_executer t3 ON t3.id = t2.user_id
|
|
|
+ SELECT t1.id,
|
|
|
+ t1.sort_code,
|
|
|
+ t1.evaluate_manage_id,
|
|
|
+ t1.topic,
|
|
|
+ t1.problem,
|
|
|
+ t1.score,
|
|
|
+ t2.score AS actualScore,
|
|
|
+ t2.opinion,
|
|
|
+ t1.input_not_null
|
|
|
+ FROM evaluate_submit_record t
|
|
|
+ LEFT JOIN evaluate_result t2 ON t2.submit_record_id = t.id
|
|
|
+ left join evaluate_manage_item t1 on t1.id = t2.evaluate_item_id
|
|
|
+ LEFT JOIN evaluate_executer t3 ON t3.id = t.evaluate_executer_id
|
|
|
WHERE t1.delete_mark = 0
|
|
|
- AND t2.delete_mark = 0
|
|
|
- AND t1.evaluate_manage_id = #{dto.evaluateManageId}
|
|
|
- AND t3.user_id = #{dto.loginUserId}
|
|
|
- AND t3.evaluate_object_id = #{dto.evaluateObjectId}
|
|
|
+ AND t.id = #{dto.evaluateSubmitRecordId}
|
|
|
ORDER BY t1.sort_code
|
|
|
</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
|
|
|
- <foreach item="evaluateObjectId" index="index" collection="dto.evaluateObjectIdList" open="(" close=")"
|
|
|
- separator=",">
|
|
|
- #{evaluateObjectId}
|
|
|
+ and t.submit_record_id in
|
|
|
+ <foreach item="submitRecordId" index="index" collection="dto.submitRecordIdList" open="(" close=")"
|
|
|
+ separator=",">
|
|
|
+ #{submitRecordId}
|
|
|
</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">
|
|
|
+ insert into evaluate_submit_record (id, evaluate_manage_id, evaluate_executer_id, create_date, evaluated_object, evaluated_object_id, status)
|
|
|
+ (SELECT
|
|
|
+ UUID(),
|
|
|
+ t.evaluate_manage_id,
|
|
|
+ t.id,
|
|
|
+ NOW(),
|
|
|
+ if(t2.evaluate_type='dm_evaluate_class', 'class', 'teacher'),
|
|
|
+ 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>
|