BaseStudentPunishmentInfoMapper.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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.student.mapper.BaseStudentPunishmentInfoMapper">
  6. <select id="getPage" parameterType="com.xjrsoft.module.student.dto.BaseStudentPunishmentInfoPageDto"
  7. resultType="com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoPageVo">
  8. SELECT t.id,
  9. t1.name AS baseSemesterName,
  10. t2.punishment_type AS punishmentType,
  11. t3.name AS className,
  12. t.start_time,
  13. t.end_time,
  14. t.is_publicity,
  15. t.push_message_object,
  16. t.reason
  17. FROM base_student_punishment_info t
  18. INNER JOIN base_punishment_type t2 ON (t.delete_mark = 0
  19. <if test="dto.semesterId != null and dto.semesterId > 0">
  20. and t.base_semester_id = #{dto.semesterId}
  21. </if>
  22. <if test="dto.punishmentTypeId != null and dto.punishmentTypeId > 0">
  23. and t.punishment_type_id = #{dto.punishmentTypeId}
  24. </if>
  25. <if test="dto.startTime != null and dto.startTime != ''">
  26. and t.start_time = #{dto.startTime}
  27. </if>
  28. <if test="dto.endTime != null and dto.endTime != ''">
  29. and t.end_time = #{dto.endTime}
  30. </if>
  31. AND t2.id = t.punishment_type_id)
  32. LEFT JOIN base_semester t1 ON (t1.id = t.base_semester_id)
  33. LEFT JOIN base_class t3 ON (t3.id = t.class_id)
  34. ORDER BY t.id DESC;
  35. </select>
  36. <select id="getMobilePage" parameterType="com.xjrsoft.module.student.dto.BaseStudentPunishmentInfoMobilePageDto"
  37. resultType="com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoMobilePageVo">
  38. SELECT t.id,t3.name AS student_name,t3.gender,t3.credential_number,t4.punishment_type,t1.reason,t1.start_time
  39. FROM base_punishment_student_relation t
  40. INNER JOIN base_student_punishment_info t1 ON t.punishment_info_id = t1.id
  41. INNER JOIN base_student_school_roll t2 ON t.user_id = t2.user_id
  42. INNER JOIN xjr_user t3 ON t.user_id = t3.id
  43. LEFT JOIN base_punishment_type t4 ON t1.punishment_type_id = t4.id
  44. LEFT JOIN base_class t5 ON t2.class_id = t5.id
  45. WHERE t1.status = 1 AND t1.delete_mark = 0 AND t3.delete_mark = 0 AND t2.delete_mark = 0
  46. AND t5.id IN (SELECT id FROM base_class WHERE teacher_id = #{dto.teacherId})
  47. <if test="dto.punishmentTypeIds != null and dto.punishmentTypeIds.size() > 0">
  48. AND t4.id in
  49. <foreach item="punishmentTypeId" index="index" collection="dto.punishmentTypeIds" open="(" close=")"
  50. separator=",">
  51. #{punishmentTypeId}
  52. </foreach>
  53. </if>
  54. <if test="dto.startDate != null and dto.startDate != ''">
  55. and t1.start_time &gt;= #{dto.startDate}
  56. </if>
  57. <if test="dto.endDate != null and dto.endDate != ''">
  58. and t1.start_time &lt;= #{dto.endDate}
  59. </if>
  60. <if test="dto.isHandle != null">
  61. and t.adjust_type is not null
  62. </if>
  63. <if test="dto.studentName != null and dto.studentName != ''">
  64. and t.name like concat('$',#{dto.studentName},'%')
  65. </if>
  66. </select>
  67. <select id="getMobileInfo" parameterType="com.xjrsoft.module.student.dto.BaseStudentPunishmentInfoMobileDetailDto"
  68. resultType="com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoMobileDetailVo">
  69. SELECT t.id,
  70. t3.name as student_name,
  71. t3.gender,
  72. t3.credential_number,
  73. t4.punishment_type,
  74. t1.reason,
  75. t1.start_time,
  76. t5.student_id,
  77. t.adjust_date,
  78. t.adjust_type,
  79. t.adjust_reason,
  80. t.modify_date,
  81. t1.create_date,
  82. t1.is_publicity,
  83. t1.end_time,
  84. t.class_name,
  85. t.major
  86. FROM base_punishment_student_relation t
  87. INNER JOIN base_student_punishment_info t1 ON t.punishment_info_id = t1.id
  88. INNER JOIN base_student_school_roll t2 ON t.user_id = t2.user_id
  89. INNER JOIN xjr_user t3 ON t.user_id = t3.id
  90. INNER JOIN base_student t5 ON t5.user_id = t.user_id
  91. LEFT JOIN base_punishment_type t4 ON t1.punishment_type_id = t4.id
  92. WHERE t1.status = 1
  93. AND t1.delete_mark = 0
  94. AND t3.delete_mark = 0
  95. AND t2.delete_mark = 0
  96. and t.id = #{dto.id}
  97. </select>
  98. <select id="getInfo"
  99. resultType="com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoDetailVo">
  100. SELECT t.id,
  101. t1.name AS baseSemesterName,
  102. t2.punishment_type AS punishmentType,
  103. t3.name AS className,
  104. t.start_time,
  105. t.end_time,
  106. t.is_publicity,
  107. t.push_message_object,
  108. t.reason,
  109. t.file_id
  110. FROM base_student_punishment_info t
  111. INNER JOIN base_punishment_type t2 ON (t.id = #{id} AND t.delete_mark = 0 AND t2.id = t.punishment_type_id)
  112. LEFT JOIN base_semester t1 ON (t1.id = t.base_semester_id)
  113. LEFT JOIN base_class t3 ON (t3.id = t.class_id)
  114. </select>
  115. </mapper>