XgStudentMsgBatchMapper.xml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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="org.dromara.xg.mapper.XgStudentMsgBatchMapper">
  6. <!-- 查询学生信息完善的历史记录信息 -->
  7. <select id="selectHistoryByBatchId" parameterType="java.lang.Long" resultType="java.util.Map">
  8. SELECT
  9. xsmb.id,
  10. xsmb.name,
  11. xsmb.create_time AS createTime,
  12. xsmb.create_by AS createBy,
  13. s1.nick_name AS createByName,
  14. xsmb.last_audit_time AS auditTime,
  15. xsmb.update_by AS updateBy,
  16. s2.nick_name AS updateByName,
  17. xsmb.update_time AS updateTime,
  18. xsmb.info_status AS infoStatus,
  19. xsmb.deleted,
  20. xsmb.remark
  21. FROM xg_student_msg_batch xsmb
  22. inner join sys_user s1 on xsmb.create_by = s1.user_id
  23. inner join sys_user s2 on xsmb.update_by = s2.user_id
  24. WHERE batch_id = #{batchId}
  25. and xsmb.id = #{userId}
  26. ORDER BY xsmb.create_time DESC
  27. </select>
  28. <!-- 查询最后一次提交的信息(delete = 0的数据) -->
  29. <select id="selectCurrentByBatchId" parameterType="java.lang.Long" resultType="org.dromara.xg.domain.vo.XgStudentMsgBatchVo">
  30. SELECT * FROM xg_student_msg_batch
  31. WHERE batch_id = #{batchId} AND deleted = 0 and id = #{userId}
  32. ORDER BY create_time DESC
  33. </select>
  34. <!-- 逻辑删除当前登录人的历史数据(不更新update_by和update_time) -->
  35. <update id="logicalDeleteByUserId" parameterType="java.lang.Long">
  36. UPDATE xg_student_msg_batch
  37. SET deleted = 1
  38. WHERE id = #{userId} AND deleted = 0
  39. </update>
  40. <!-- 根据部门ID查询所有子部门ID列表(包括自己) -->
  41. <select id="selectChildDeptIds" parameterType="java.lang.Long" resultType="java.lang.Long">
  42. SELECT dept_id
  43. FROM sys_dept
  44. WHERE (dept_id = #{deptId} OR FIND_IN_SET(#{deptId}, ancestors))
  45. AND status = '0'
  46. AND del_flag = '0'
  47. </select>
  48. <!-- 根据部门ID列表和条件分页查询学生信息批次数据 -->
  49. <select id="selectPageByDeptIds" resultType="org.dromara.xg.domain.vo.XgStudentMsgBatchVo">
  50. SELECT
  51. xsmb.id,
  52. xsmb.deleted,
  53. xsmb.student_no,
  54. xsmb.id_card,
  55. xsmb.name,
  56. xsmb.name_english,
  57. xsmb.former_name,
  58. xsmb.gender,
  59. xsmb.birth_date,
  60. xsmb.nationality,
  61. xsmb.native_place,
  62. xsmb.political_status,
  63. xsmb.hukou_location,
  64. xsmb.home_address,
  65. xsmb.current_address,
  66. xsmb.postal_code,
  67. xsmb.photo_url,
  68. xsmb.photo_path,
  69. xsmb.phone,
  70. xsmb.is_boarder,
  71. xsmb.education_level,
  72. xsmb.household_register_type,
  73. xsmb.religion,
  74. xsmb.source_region,
  75. xsmb.graduate_school,
  76. xsmb.email,
  77. xsmb.qq,
  78. xsmb.wechat,
  79. xsmb.marital_status,
  80. xsmb.emergency_contact_name,
  81. xsmb.emergency_contact_phone,
  82. xsmb.emergency_contact_relation,
  83. xsmb.is_poor_student,
  84. xsmb.is_minority,
  85. xsmb.is_disabled,
  86. xsmb.is_orphan,
  87. xsmb.is_left_behind_child,
  88. xsmb.is_single_child,
  89. xsmb.is_low_income,
  90. xsmb.has_loan,
  91. xsmb.loan_amount,
  92. xsmb.specialties,
  93. xsmb.awards,
  94. xsmb.violations,
  95. xsmb.social_activities,
  96. xsmb.father_name,
  97. xsmb.father_phone,
  98. xsmb.father_work_unit,
  99. xsmb.mother_name,
  100. xsmb.mother_phone,
  101. xsmb.mother_work_unit,
  102. xsmb.guardian_name,
  103. xsmb.guardian_phone,
  104. xsmb.guardian_relation,
  105. xsmb.family_income,
  106. xsmb.per_capita_income,
  107. xsmb.income_source,
  108. xsmb.family_economic_status,
  109. xsmb.family_members,
  110. xsmb.height,
  111. xsmb.weight,
  112. xsmb.blood_type,
  113. xsmb.health_status,
  114. xsmb.special_condition,
  115. xsmb.medical_history,
  116. xsmb.allergies,
  117. xsmb.disability_type,
  118. xsmb.disability_level,
  119. xsmb.admission_category,
  120. xsmb.student_status,
  121. xsmb.enrollment_year,
  122. xsmb.enrollment_date,
  123. xsmb.bank_card_no,
  124. xsmb.bank_name,
  125. xsmb.bank_branch,
  126. xsmb.card_holder_name,
  127. xsmb.info_status,
  128. xsmb.data_source,
  129. xsmb.last_batch_id,
  130. xsmb.last_audit_time,
  131. xsmb.is_complete,
  132. xsmb.completion_rate,
  133. xsmb.school_system,
  134. xsmb.academic_level,
  135. xsmb.training_type,
  136. xsmb.major_id,
  137. xsmb.major_name,
  138. xsmb.class_id,
  139. xsmb.class_name,
  140. xsmb.grade,
  141. xsmb.college_id,
  142. xsmb.college_name,
  143. xsmb.counselor_id,
  144. xsmb.counselor_name,
  145. xsmb.class_teacher_id,
  146. xsmb.class_teacher_name,
  147. xsmb.dormitory_building,
  148. xsmb.dormitory_room,
  149. xsmb.ext_field1,
  150. xsmb.ext_field2,
  151. xsmb.ext_field3,
  152. xsmb.ext_field4,
  153. xsmb.ext_field5,
  154. xsmb.remark,
  155. xsmb.batch_id,
  156. xsmb.create_by,
  157. xsmb.create_time,
  158. xsmb.update_by,
  159. xsmb.update_time
  160. FROM xg_student_msg_batch xsmb
  161. WHERE xsmb.batch_id = #{batchId}
  162. AND xsmb.deleted = 0
  163. <if test="deptIds != null and deptIds.size() > 0">
  164. AND xsmb.class_id IN
  165. <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
  166. #{deptId}
  167. </foreach>
  168. </if>
  169. <if test="name != null and name != ''">
  170. AND xsmb.name LIKE CONCAT('%', #{name}, '%')
  171. </if>
  172. <if test="studentNo != null and studentNo != ''">
  173. AND xsmb.student_no LIKE CONCAT('%', #{studentNo} , '%')
  174. </if>
  175. <if test="phone != null and phone != ''">
  176. AND xsmb.phone LIKE CONCAT('%', #{phone}, '%')
  177. </if>
  178. <if test="infoStatus != null and infoStatus != ''">
  179. AND xsmb.info_status = #{infoStatus}
  180. </if>
  181. ORDER BY xsmb.student_no DESC, xsmb.create_time DESC
  182. </select>
  183. <!-- 驳回学生信息提交 -->
  184. <update id="rejectStudentMsgByBatchIdAndUserId">
  185. UPDATE xg_student_msg_batch
  186. SET remark = #{remark},
  187. info_status = '4',
  188. update_by = #{currentUserId},
  189. update_time = NOW()
  190. WHERE batch_id = #{batchId}
  191. AND id = #{userId}
  192. AND deleted = 0
  193. </update>
  194. <!-- 审核通过学生信息提交 -->
  195. <update id="approveStudentMsgByBatchIdAndUserId">
  196. UPDATE xg_student_msg_batch
  197. SET remark = #{remark},
  198. info_status = '5',
  199. update_by = #{currentUserId},
  200. update_time = NOW()
  201. WHERE batch_id = #{batchId}
  202. AND id = #{userId}
  203. AND deleted = 0
  204. </update>
  205. </mapper>