EvaluateObjectMapper.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.xjrsoft.module.evaluate.mapper.EvaluateObjectMapper">
  6. <select id="getObjectList" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateObjectListDto"
  7. resultType="com.xjrsoft.module.evaluate.vo.EvaluateObjectListVo">
  8. 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
  9. FROM evaluate_object t1
  10. LEFT JOIN base_grade t2 ON t2.id = t1.base_grade_id
  11. LEFT JOIN xjr_user t3 ON t3.id = t1.object_id
  12. LEFT JOIN base_class t6 ON t6.id = t1.object_id
  13. LEFT JOIN xjr_user_dept_relation t4 ON t4.user_id = t1.object_id
  14. LEFT JOIN base_class t5 ON t5.grade_id = t2.id
  15. WHERE t1.delete_mark = 0 and t1.evaluate_manage_id = #{dto.evaluateManageId}
  16. <if test="dto.gradeId != null and dto.gradeId > 0">
  17. and t1.base_grade_id = #{dto.gradeId}
  18. </if>
  19. <if test="dto.deptId != null and dto.deptId > 0">
  20. and t4.dept_id = #{dto.deptId}
  21. </if>
  22. <if test="dto.classId != null and dto.classId > 0">
  23. and t5.id = #{dto.classId}
  24. </if>
  25. <if test="dto.name != null and dto.name != ''">
  26. and t3.name like concat("%", #{dto.name}, "%")
  27. </if>
  28. ORDER BY t1.id
  29. </select>
  30. <select id="getExecuterList" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateObjectListDto"
  31. resultType="com.xjrsoft.module.evaluate.vo.EvaluateExecuterVo">
  32. SELECT t1.id, t1.evaluate_object_id,t2.name AS executer_name,t1.user_id as executer_id FROM evaluate_executer t1
  33. LEFT JOIN xjr_user t2 ON t1.user_id = t2.id
  34. WHERE t1.delete_mark = 0 and t1.evaluate_manage_id = #{dto.evaluateManageId}
  35. </select>
  36. <select id="getNewObjectList" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateObjectListDto" resultType="com.xjrsoft.module.evaluate.vo.EvaluateObjectListVo">
  37. <if test="dto.evaluateType != null and dto.evaluateType.equals('stu_evaluate_headtea')">
  38. SELECT t1.id AS class_id,t2.id AS object_id,t2.name AS object_name,t1.grade_id
  39. FROM base_class t1
  40. LEFT JOIN xjr_user t2 ON t1.teacher_id = t2.id
  41. WHERE t1.delete_mark = 0
  42. </if>
  43. <if test="dto.evaluateType != null and dto.evaluateType.equals('dm_evaluate_class')">
  44. SELECT t1.id AS object_id,t1.name AS object_name,t1.grade_id
  45. FROM base_class t1
  46. WHERE t1.delete_mark = 0
  47. </if>
  48. <if test="dto.gradeId != null">
  49. and t1.grade_id = #{dto.gradeId}
  50. </if>
  51. </select>
  52. <select id="getNewExecuterList" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateObjectListDto" resultType="com.xjrsoft.module.evaluate.vo.EvaluateExecuterVo">
  53. <if test="dto.evaluateType != null and dto.evaluateType.equals('stu_evaluate_headtea')">
  54. SELECT t2.id as executer_id,t2.name as executer_name,t1.class_id,t1.grade_id FROM base_student_school_roll t1
  55. LEFT JOIN xjr_user t2 ON t1.user_id = t2.id
  56. WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
  57. <if test="dto.gradeId != null">
  58. and t1.grade_id = #{dto.gradeId}
  59. </if>
  60. </if>
  61. <if test="dto.evaluateType != null and dto.evaluateType.equals('dm_evaluate_class')">
  62. select
  63. t.id as executer_id,t.name as executer_name
  64. from xjr_user t
  65. left join xjr_user_post_relation t1 on t1.user_id = t.id
  66. where t1.post_id = 1742726034814464002
  67. and t.delete_mark = 0
  68. </if>
  69. </select>
  70. <delete id="objectGradeDeleteExecuter" parameterType="com.xjrsoft.module.evaluate.dto.ObjectGradeDeleteDto">
  71. delete t from evaluate_executer t
  72. left join evaluate_object t1 on t1.id = t.evaluate_object_id
  73. where t1.base_grade_id = #{dto.gradeId} and t.evaluate_manage_id = #{dto.evaluateManageId};
  74. </delete>
  75. <delete id="objectGradeDeleteObject" parameterType="com.xjrsoft.module.evaluate.dto.ObjectGradeDeleteDto">
  76. delete from evaluate_object t
  77. where t.base_grade_id = #{dto.gradeId} and t.evaluate_manage_id = #{dto.evaluateManageId};
  78. </delete>
  79. </mapper>