123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.xjrsoft.module.evaluate.mapper.EvaluateResultMapper">
- <select id="getIndexPage" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateResultIndexPageDto" resultType="com.xjrsoft.module.evaluate.vo.EvaluateResultIndexPageVo">
- SELECT
- t.id AS evaluateManageId,
- t1.name AS semesterName,
- t2.name AS orgName,
- t4.name AS evaluateTypeCN,
- t.name,
- t.start_time,
- t.end_time
- FROM evaluate_manage t
- LEFT JOIN base_semester t1 ON (t1.id = t.base_semester_id)
- LEFT JOIN xjr_department t2 ON (t2.id = t.org_id)
- LEFT JOIN evaluate_template t3 ON (t3.id = t.evaluate_template_id)
- LEFT JOIN xjr_dictionary_detail t4 ON (t4.code = t3.evaluate_type)
- WHERE t.delete_mark = 0
- and t.status != -1
- <if test="dto.baseSemesterId != null and dto.baseSemesterId > 0">
- AND t.base_semester_id = #{dto.baseSemesterId}
- </if>
- <if test="dto.orgId != null and dto.orgId > 0">
- AND t.org_id = #{dto.orgId}
- </if>
- <if test="dto.evaluateType != null and dto.evaluateType != ''">
- AND t3.evaluate_type = #{dto.evaluateType}
- </if>
- <if test="dto.name != null and dto.name != ''">
- AND t.name like CONCAT('%',#{dto.name},'%')
- </if>
- <if test="dto.startTime != null and dto.startTime != ''">
- AND t.start_time >= #{dto.startTime}
- </if>
- <if test="dto.endTime != null and dto.endTime != ''">
- AND t.end_time <= #{dto.endTime}
- </if>
- ORDER BY t.id DESC
- </select>
- <select id="getDetailPage" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateResultDetailPageDto" resultType="com.xjrsoft.module.evaluate.vo.EvaluateResultDetailPageVo">
- select
- t.evaluate_manage_id as evaluateManageId,
- t.evaluate_object_id as evaluatedObjectId,
- t.id as evaluatedExecuterId,
- ifnull(t1.name, t2.name) as ObjectIdCN,
- t4.name as userIdCN,
- t.status,
- ifnull(t5.comprehensiveScore, 0) as comprehensiveScore
- from evaluate_executer t
- left join evaluate_object t3 on t3.id = t.evaluate_object_id
- left join xjr_user t1 on t1.id = t3.object_id
- left join base_class t2 on t2.id = t3.object_id
- left join xjr_user t4 on t4.id = t.user_id
- left join (select
- t.evaluated_object_id, t.user_id, sum(t.score) as comprehensiveScore
- from evaluate_result t
- group by t.evaluated_object_id, t.user_id) t5 on t5.evaluated_object_id = t.evaluate_object_id and t5.user_id = t.id
- where t.evaluate_manage_id = #{dto.evaluateManageId}
- <if test="dto.baseGradeId != null and dto.baseGradeId > 0">
- AND t3.base_grade_id = #{dto.baseGradeId}
- </if>
- <if test="dto.status != null">
- AND t.status = #{dto.status}
- </if>
- <if test="dto.classId != null and dto.classId > 0">
- AND t3.object_id = #{dto.classId}
- </if>
- <if test="dto.teacherId != null and dto.teacherId > 0 and (dto.checkObject == null or dto.checkObject == 0)">
- AND (t3.object_id = #{dto.teacherId}
- or t.user_id = #{dto.teacherId})
- </if>
- <if test="dto.teacherId != null and dto.teacherId > 0 and dto.checkObject != null and dto.checkObject == 1">
- AND t3.object_id = #{dto.teacherId}
- </if>
- <if test="dto.teacherId != null and dto.teacherId > 0 and dto.checkObject != null and dto.checkObject == 2">
- AND t.user_id = #{dto.teacherId}
- </if>
- <if test="dto.name != null and dto.name != '' and (dto.checkObject == null or dto.checkObject == 0)">
- AND (t1.name like CONCAT('%',#{dto.name},'%')
- or t2.name like CONCAT('%',#{dto.name},'%')
- or t4.name like CONCAT('%',#{dto.name},'%'))
- </if>
- <if test="dto.name != null and dto.name != '' and dto.checkObject != null and dto.checkObject == 1">
- AND (t1.name like CONCAT('%',#{dto.name},'%')
- or t2.name like CONCAT('%',#{dto.name},'%'))
- </if>
- <if test="dto.name != null and dto.name != '' and dto.checkObject != null and dto.checkObject == 2">
- AND t4.name like CONCAT('%',#{dto.name},'%')
- </if>
- </select>
- <select id="getDetailPageDetail" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateResultDetailPageDetailDto" resultType="com.xjrsoft.module.evaluate.vo.EvaluateResultDetailPageDetailVo">
- select
- ifnull(t1.name, t2.name) as ObjectIdCN,
- t4.name as userIdCN,
- ifnull(t5.comprehensiveScore, 0) as actulTotal,
- t6.name,
- t7.total
- from evaluate_object t
- left join xjr_user t1 on t1.id = t.object_id
- left join base_class t2 on t2.id = t.object_id
- left join evaluate_executer t3 on t3.evaluate_object_id = t.id
- left join xjr_user t4 on t4.id = t3.user_id
- left join (select
- t.evaluated_object_id, t.user_id, sum(t.score) as comprehensiveScore
- from evaluate_result t
- group by t.evaluated_object_id, t.user_id) t5 on t5.evaluated_object_id = t.id and t5.user_id = t3.id
- left join evaluate_manage t6 on t6.id = t.evaluate_manage_id
- left join evaluate_template t7 on t7.id = t6.evaluate_template_id
- where t.delete_mark = 0
- and t.evaluate_manage_id = #{dto.evaluateManageId}
- and t.id = #{dto.evaluatedObjectId}
- and t3.id = #{dto.evaluatedExecuterId}
- </select>
- <select id="getDetailPageDetailList" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateResultDetailPageDetailDto" resultType="com.xjrsoft.module.evaluate.vo.EvaluateResultDetailPageDetailList">
- select
- t.score,
- t.problem,
- t.topic,
- t1.score as actualScore,
- t1.opinion
- from evaluate_manage_item t
- left join evaluate_result t1 on t1.evaluate_item_id = t.id
- where t.delete_mark = 0
- and t.evaluate_manage_id = #{dto.evaluateManageId}
- and t1.evaluated_object_id = #{dto.evaluatedObjectId}
- and t1.user_id = #{dto.evaluatedExecuterId}
- </select>
- <select id="listByObjectIdAndEvaluateItemId" resultType="com.xjrsoft.module.evaluate.vo.ResultViewingPageVo">
- select
- sum(t.score) as sumScore,
- t.evaluate_item_id as evaluateManageItemId,
- t1.object_id as objectId
- from evaluate_result t
- left join evaluate_object t1 on t1.id = t.evaluated_object_id
- where t.evaluate_item_id in
- <foreach item="evaluateManageItemId" index="index" collection="evaluateManageItemIdList" open="(" close=")"
- separator=",">
- #{evaluateManageItemId}
- </foreach>
- and t1.object_id in
- <foreach item="evaluateObjectId" index="index" collection="evaluateObjectIdList" open="(" close=")"
- separator=",">
- #{evaluateObjectId}
- </foreach>
- group by t1.object_id, t.evaluate_item_id;
- </select>
- <select id="listTopicScoreByObjectIdAndTopic" resultType="com.xjrsoft.module.evaluate.vo.ResultViewingPageVo">
- select sum(t.score) as topicScore,
- t1.object_id as objectId,
- t2.topic
- from evaluate_result t
- left join evaluate_object t1 on t1.id = t.evaluated_object_id
- left join evaluate_manage_item t2 on t2.id = t.evaluate_item_id
- where t.evaluate_item_id in
- <foreach item="evaluateManageItemId" index="index" collection="evaluateManageItemIdList" open="(" close=")"
- separator=",">
- #{evaluateManageItemId}
- </foreach>
- and t1.object_id in
- <foreach item="evaluateObjectId" index="index" collection="evaluateObjectIdList" open="(" close=")"
- separator=",">
- #{evaluateObjectId}
- </foreach>
- group by t1.object_id, t2.topic;
- </select>
- <select id="listSynthesisScore" resultType="com.xjrsoft.module.evaluate.vo.ResultViewingPageVo">
- select sum(t.score) as synthesisScore,
- t1.object_id as objectId
- from evaluate_result t
- left join evaluate_object t1 on t1.id = t.evaluated_object_id
- where t.evaluate_item_id in
- <foreach item="evaluateManageItemId" index="index" collection="evaluateManageItemIdList" open="(" close=")"
- separator=",">
- #{evaluateManageItemId}
- </foreach>
- and t1.object_id in
- <foreach item="evaluateObjectId" index="index" collection="evaluateObjectIdList" open="(" close=")"
- separator=",">
- #{evaluateObjectId}
- </foreach>
- group by t1.object_id;
- </select>
- </mapper>
|