123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?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.EvaluateObjectMapper">
- <select id="getObjectList" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateObjectListDto"
- resultType="com.xjrsoft.module.evaluate.vo.EvaluateObjectListVo">
- SELECT distinct t1.id,t1.base_grade_id as gradeId,t2.name AS grade_name,t1.object_id,ifnull(t3.name, t6.name) AS object_name
- FROM evaluate_object t1
- LEFT JOIN base_grade t2 ON t2.id = t1.base_grade_id
- LEFT JOIN xjr_user t3 ON t3.id = t1.object_id
- LEFT JOIN base_class t6 ON t6.id = t1.object_id
- LEFT JOIN xjr_user_dept_relation t4 ON t4.user_id = t1.object_id
- LEFT JOIN base_class t5 ON t5.grade_id = t2.id
- WHERE t1.delete_mark = 0 and t1.evaluate_manage_id = #{dto.evaluateManageId}
- <if test="dto.gradeId != null and dto.gradeId > 0">
- and t1.base_grade_id = #{dto.gradeId}
- </if>
- <if test="dto.deptId != null and dto.deptId > 0">
- and t4.dept_id = #{dto.deptId}
- </if>
- <if test="dto.classId != null and dto.classId > 0">
- and t5.id = #{dto.classId}
- </if>
- <if test="dto.name != null and dto.name != ''">
- and t3.name like concat("%", #{dto.name}, "%")
- </if>
- ORDER BY t1.id
- </select>
- <select id="getExecuterList" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateObjectListDto"
- resultType="com.xjrsoft.module.evaluate.vo.EvaluateExecuterVo">
- SELECT t1.id, t1.evaluate_object_id,t2.name AS executer_name,t1.user_id as executer_id FROM evaluate_executer t1
- LEFT JOIN xjr_user t2 ON t1.user_id = t2.id
- WHERE t1.delete_mark = 0 and t1.evaluate_manage_id = #{dto.evaluateManageId}
- </select>
- <select id="getNewObjectList" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateObjectListDto" resultType="com.xjrsoft.module.evaluate.vo.EvaluateObjectListVo">
- <if test="dto.evaluateType != null and dto.evaluateType.equals('stu_evaluate_headtea')">
- SELECT t1.id AS class_id,t2.id AS object_id,t2.name AS object_name,t1.grade_id
- FROM base_class t1
- LEFT JOIN xjr_user t2 ON t1.teacher_id = t2.id
- WHERE t1.delete_mark = 0
- </if>
- <if test="dto.evaluateType != null and dto.evaluateType.equals('dm_evaluate_class')">
- SELECT t1.id AS object_id,t1.name AS object_name,t1.grade_id
- FROM base_class t1
- WHERE t1.delete_mark = 0
- </if>
- <if test="dto.gradeId != null">
- and t1.grade_id = #{dto.gradeId}
- </if>
- </select>
- <select id="getNewExecuterList" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateObjectListDto" resultType="com.xjrsoft.module.evaluate.vo.EvaluateExecuterVo">
- <if test="dto.evaluateType != null and dto.evaluateType.equals('stu_evaluate_headtea')">
- SELECT t2.id as executer_id,t2.name as executer_name,t1.class_id,t1.grade_id FROM base_student_school_roll t1
- LEFT JOIN xjr_user t2 ON t1.user_id = t2.id
- WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
- <if test="dto.gradeId != null">
- and t1.grade_id = #{dto.gradeId}
- </if>
- </if>
- <if test="dto.evaluateType != null and dto.evaluateType.equals('dm_evaluate_class')">
- select
- t.id as executer_id,t.name as executer_name
- from xjr_user t
- left join xjr_user_post_relation t1 on t1.user_id = t.id
- where t1.post_id = 1742726034814464002
- and t.delete_mark = 0
- </if>
- </select>
- <delete id="objectGradeDeleteExecuter" parameterType="com.xjrsoft.module.evaluate.dto.ObjectGradeDeleteDto">
- delete t from evaluate_executer t
- left join evaluate_object t1 on t1.id = t.evaluate_object_id
- where t1.base_grade_id = #{dto.gradeId} and t.evaluate_manage_id = #{dto.evaluateManageId};
- </delete>
- <delete id="objectGradeDeleteObject" parameterType="com.xjrsoft.module.evaluate.dto.ObjectGradeDeleteDto">
- delete from evaluate_object t
- where t.base_grade_id = #{dto.gradeId} and t.evaluate_manage_id = #{dto.evaluateManageId};
- </delete>
- </mapper>
|