StudentInfoOldMapper.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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.ruoyi.system.mapper.StudentInfoOldMapper">
  6. <resultMap type="StudentInfoOld" id="StudentInfoOldResult">
  7. <result property="oldId" column="old_id" />
  8. <result property="studentId" column="student_id" />
  9. <result property="name" column="name" />
  10. <result property="sex" column="sex" />
  11. <result property="age" column="age" />
  12. <result property="school" column="school" />
  13. <result property="studentNumber" column="student_number" />
  14. <result property="idCard" column="id_card" />
  15. <result property="isNearsightedness" column="is_nearsightedness" />
  16. <result property="degreeMyopia" column="degree_myopia" />
  17. <result property="height" column="height" />
  18. <result property="weight" column="weight" />
  19. <result property="bloodType" column="blood_type" />
  20. <result property="politicalStatus" column="political_status" />
  21. <result property="health" column="health" />
  22. <result property="identificationPhoto" column="identification_photo" />
  23. <result property="mind" column="mind" />
  24. <result property="entrancePermit" column="entrance_permit" />
  25. <result property="fatherName" column="father_name" />
  26. <result property="fatherTelephone" column="father_telephone" />
  27. <result property="motherName" column="mother_name" />
  28. <result property="motherTelephone" column="mother_telephone" />
  29. <result property="address" column="address" />
  30. <result property="longitude" column="longitude" />
  31. <result property="latitude" column="latitude" />
  32. <result property="createBy" column="create_by" />
  33. <result property="createTime" column="create_time" />
  34. <result property="updateBy" column="update_by" />
  35. <result property="updateTime" column="update_time" />
  36. <result property="remark" column="remark" />
  37. <result property="isMedicalHistory" column="is_medical_history" />
  38. <result property="medicalDescription" column="medical_description" />
  39. <result property="psychologicalDescription" column="psychological_description" />
  40. <result property="isLset" column="is_lset" />
  41. <result property="isPoverty" column="is_poverty" />
  42. <result property="emergencyContact" column="emergency_contact" />
  43. <result property="emergencyContactTelephone" column="emergency_contact_telephone" />
  44. </resultMap>
  45. <sql id="selectStudentInfoOldVo">
  46. select old_id, student_id, name, sex, age, school, student_number, id_card, is_nearsightedness, degree_myopia, height, weight, blood_type, political_status, health, identification_photo, mind, entrance_permit, father_name, father_telephone, mother_name, mother_telephone, address, longitude, latitude, create_by, create_time, update_by, update_time, remark,is_medical_history,medical_description,psychological_description,is_lset,is_poverty,emergency_contact,emergency_contact_telephone from student_info_old
  47. </sql>
  48. <select id="selectStudentInfoOldList" parameterType="StudentInfoOld" resultMap="StudentInfoOldResult">
  49. <include refid="selectStudentInfoOldVo"/>
  50. <where>
  51. <if test="studentId != null "> and student_id = #{studentId}</if>
  52. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  53. <if test="sex != null and sex != ''"> and sex = #{sex}</if>
  54. <if test="age != null and age != ''"> and age = #{age}</if>
  55. <if test="school != null and school != ''"> and school = #{school}</if>
  56. <if test="studentNumber != null and studentNumber != ''"> and student_number = #{studentNumber}</if>
  57. <if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
  58. <if test="isNearsightedness != null and isNearsightedness != ''"> and is_nearsightedness = #{isNearsightedness}</if>
  59. <if test="degreeMyopia != null and degreeMyopia != ''"> and degree_myopia = #{degreeMyopia}</if>
  60. <if test="height != null and height != ''"> and height = #{height}</if>
  61. <if test="weight != null and weight != ''"> and weight = #{weight}</if>
  62. <if test="bloodType != null and bloodType != ''"> and blood_type = #{bloodType}</if>
  63. <if test="politicalStatus != null and politicalStatus != ''"> and political_status = #{politicalStatus}</if>
  64. <if test="health != null and health != ''"> and health = #{health}</if>
  65. <if test="identificationPhoto != null and identificationPhoto != ''"> and identification_photo = #{identificationPhoto}</if>
  66. <if test="mind != null and mind != ''"> and mind = #{mind}</if>
  67. <if test="entrancePermit != null and entrancePermit != ''"> and entrance_permit = #{entrancePermit}</if>
  68. <if test="fatherName != null and fatherName != ''"> and father_name like concat('%', #{fatherName}, '%')</if>
  69. <if test="fatherTelephone != null and fatherTelephone != ''"> and father_telephone = #{fatherTelephone}</if>
  70. <if test="motherName != null and motherName != ''"> and mother_name like concat('%', #{motherName}, '%')</if>
  71. <if test="motherTelephone != null and motherTelephone != ''"> and mother_telephone = #{motherTelephone}</if>
  72. <if test="address != null and address != ''"> and address = #{address}</if>
  73. <if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
  74. <if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
  75. <if test="emergencyContact != null and emergencyContact != ''"> and s.emergency_contact = #{emergencyContact}</if>
  76. <if test="emergencyContactTelephone != null and emergencyContactTelephone != ''"> and s.emergency_contact_telephone = #{emergencyContactTelephone}</if>
  77. </where>
  78. order by create_time desc
  79. </select>
  80. <select id="selectStudentInfoOldById" parameterType="Long" resultMap="StudentInfoOldResult">
  81. <include refid="selectStudentInfoOldVo"/>
  82. where old_id = #{id}
  83. </select>
  84. <select id="selectStudentInfoOldListEcharts" resultMap="StudentInfoOldResult">
  85. <include refid="selectStudentInfoOldVo"/>
  86. <where>
  87. <if test="studentId != null "> and student_id = #{studentId}</if>
  88. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  89. <if test="sex != null and sex != ''"> and sex = #{sex}</if>
  90. <if test="age != null and age != ''"> and age = #{age}</if>
  91. <if test="school != null and school != ''"> and school = #{school}</if>
  92. <if test="studentNumber != null and studentNumber != ''"> and student_number = #{studentNumber}</if>
  93. <if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
  94. <if test="isNearsightedness != null and isNearsightedness != ''"> and is_nearsightedness = #{isNearsightedness}</if>
  95. <if test="degreeMyopia != null and degreeMyopia != ''"> and degree_myopia = #{degreeMyopia}</if>
  96. <if test="height != null and height != ''"> and height = #{height}</if>
  97. <if test="weight != null and weight != ''"> and weight = #{weight}</if>
  98. <if test="bloodType != null and bloodType != ''"> and blood_type = #{bloodType}</if>
  99. <if test="politicalStatus != null and politicalStatus != ''"> and political_status = #{politicalStatus}</if>
  100. <if test="health != null and health != ''"> and health = #{health}</if>
  101. <if test="identificationPhoto != null and identificationPhoto != ''"> and identification_photo = #{identificationPhoto}</if>
  102. <if test="mind != null and mind != ''"> and mind = #{mind}</if>
  103. <if test="entrancePermit != null and entrancePermit != ''"> and entrance_permit = #{entrancePermit}</if>
  104. <if test="fatherName != null and fatherName != ''"> and father_name like concat('%', #{fatherName}, '%')</if>
  105. <if test="fatherTelephone != null and fatherTelephone != ''"> and father_telephone = #{fatherTelephone}</if>
  106. <if test="motherName != null and motherName != ''"> and mother_name like concat('%', #{motherName}, '%')</if>
  107. <if test="motherTelephone != null and motherTelephone != ''"> and mother_telephone = #{motherTelephone}</if>
  108. <if test="address != null and address != ''"> and address = #{address}</if>
  109. <if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
  110. <if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
  111. </where>
  112. order by create_time asc
  113. </select>
  114. <insert id="insertStudentInfoOld" parameterType="StudentInfoOld" useGeneratedKeys="true" keyProperty="oldId">
  115. insert into student_info_old
  116. <trim prefix="(" suffix=")" suffixOverrides=",">
  117. <if test="studentId != null">student_id,</if>
  118. <if test="name != null">name,</if>
  119. <if test="sex != null">sex,</if>
  120. <if test="age != null">age,</if>
  121. <if test="school != null">school,</if>
  122. <if test="studentNumber != null">student_number,</if>
  123. <if test="idCard != null">id_card,</if>
  124. <if test="isNearsightedness != null">is_nearsightedness,</if>
  125. <if test="degreeMyopia != null">degree_myopia,</if>
  126. <if test="height != null">height,</if>
  127. <if test="weight != null">weight,</if>
  128. <if test="bloodType != null">blood_type,</if>
  129. <if test="politicalStatus != null">political_status,</if>
  130. <if test="health != null">health,</if>
  131. <if test="identificationPhoto != null">identification_photo,</if>
  132. <if test="mind != null">mind,</if>
  133. <if test="entrancePermit != null">entrance_permit,</if>
  134. <if test="fatherName != null">father_name,</if>
  135. <if test="fatherTelephone != null">father_telephone,</if>
  136. <if test="motherName != null">mother_name,</if>
  137. <if test="motherTelephone != null">mother_telephone,</if>
  138. <if test="address != null">address,</if>
  139. <if test="longitude != null">longitude,</if>
  140. <if test="latitude != null">latitude,</if>
  141. <if test="createBy != null">create_by,</if>
  142. <if test="createTime != null">create_time,</if>
  143. <if test="updateBy != null">update_by,</if>
  144. <if test="updateTime != null">update_time,</if>
  145. <if test="remark != null">remark,</if>
  146. <if test="isMedicalHistory != null">is_medical_history,</if>
  147. <if test="medicalDescription != null">medical_description,</if>
  148. <if test="psychologicalDescription != null">psychological_description,</if>
  149. <if test="isLset != null">is_lset,</if>
  150. <if test="isPoverty != null">is_poverty,</if>
  151. <if test="emergencyContact != null">emergency_contact,</if>
  152. <if test="emergencyContactTelephone != null">emergency_contact_telephone,</if>
  153. </trim>
  154. <trim prefix="values (" suffix=")" suffixOverrides=",">
  155. <if test="studentId != null">#{studentId},</if>
  156. <if test="name != null">#{name},</if>
  157. <if test="sex != null">#{sex},</if>
  158. <if test="age != null">#{age},</if>
  159. <if test="school != null">#{school},</if>
  160. <if test="studentNumber != null">#{studentNumber},</if>
  161. <if test="idCard != null">#{idCard},</if>
  162. <if test="isNearsightedness != null">#{isNearsightedness},</if>
  163. <if test="degreeMyopia != null">#{degreeMyopia},</if>
  164. <if test="height != null">#{height},</if>
  165. <if test="weight != null">#{weight},</if>
  166. <if test="bloodType != null">#{bloodType},</if>
  167. <if test="politicalStatus != null">#{politicalStatus},</if>
  168. <if test="health != null">#{health},</if>
  169. <if test="identificationPhoto != null">#{identificationPhoto},</if>
  170. <if test="mind != null">#{mind},</if>
  171. <if test="entrancePermit != null">#{entrancePermit},</if>
  172. <if test="fatherName != null">#{fatherName},</if>
  173. <if test="fatherTelephone != null">#{fatherTelephone},</if>
  174. <if test="motherName != null">#{motherName},</if>
  175. <if test="motherTelephone != null">#{motherTelephone},</if>
  176. <if test="address != null">#{address},</if>
  177. <if test="longitude != null">#{longitude},</if>
  178. <if test="latitude != null">#{latitude},</if>
  179. <if test="createBy != null">#{createBy},</if>
  180. <if test="createTime != null">#{createTime},</if>
  181. <if test="updateBy != null">#{updateBy},</if>
  182. <if test="updateTime != null">#{updateTime},</if>
  183. <if test="remark != null">#{remark},</if>
  184. <if test="isMedicalHistory != null">#{isMedicalHistory},</if>
  185. <if test="medicalDescription != null">#{medicalDescription},</if>
  186. <if test="psychologicalDescription != null">#{psychologicalDescription},</if>
  187. <if test="isLset != null">#{isLset},</if>
  188. <if test="isPoverty != null">#{isPoverty},</if>
  189. <if test="emergencyContact != null">#{emergencyContact},</if>
  190. <if test="emergencyContactTelephone != null">#{emergencyContactTelephone},</if>
  191. </trim>
  192. </insert>
  193. <update id="updateStudentInfoOld" parameterType="StudentInfoOld">
  194. update student_info_old
  195. <trim prefix="SET" suffixOverrides=",">
  196. <if test="studentId != null">student_id = #{studentId},</if>
  197. <if test="name != null">name = #{name},</if>
  198. <if test="sex != null">sex = #{sex},</if>
  199. <if test="age != null">age = #{age},</if>
  200. <if test="school != null">school = #{school},</if>
  201. <if test="studentNumber != null">student_number = #{studentNumber},</if>
  202. <if test="idCard != null">id_card = #{idCard},</if>
  203. <if test="isNearsightedness != null">is_nearsightedness = #{isNearsightedness},</if>
  204. <if test="degreeMyopia != null">degree_myopia = #{degreeMyopia},</if>
  205. <if test="height != null">height = #{height},</if>
  206. <if test="weight != null">weight = #{weight},</if>
  207. <if test="bloodType != null">blood_type = #{bloodType},</if>
  208. <if test="politicalStatus != null">political_status = #{politicalStatus},</if>
  209. <if test="health != null">health = #{health},</if>
  210. <if test="identificationPhoto != null">identification_photo = #{identificationPhoto},</if>
  211. <if test="mind != null">mind = #{mind},</if>
  212. <if test="entrancePermit != null">entrance_permit = #{entrancePermit},</if>
  213. <if test="fatherName != null">father_name = #{fatherName},</if>
  214. <if test="fatherTelephone != null">father_telephone = #{fatherTelephone},</if>
  215. <if test="motherName != null">mother_name = #{motherName},</if>
  216. <if test="motherTelephone != null">mother_telephone = #{motherTelephone},</if>
  217. <if test="address != null">address = #{address},</if>
  218. <if test="longitude != null">longitude = #{longitude},</if>
  219. <if test="latitude != null">latitude = #{latitude},</if>
  220. <if test="createBy != null">create_by = #{createBy},</if>
  221. <if test="createTime != null">create_time = #{createTime},</if>
  222. <if test="updateBy != null">update_by = #{updateBy},</if>
  223. <if test="updateTime != null">update_time = #{updateTime},</if>
  224. <if test="remark != null">remark = #{remark},</if>
  225. <if test="isMedicalHistory != null">is_medical_history = #{isMedicalHistory},</if>
  226. <if test="medicalDescription != null">medical_description = #{medicalDescription},</if>
  227. <if test="psychologicalDescription != null">psychological_description = #{psychologicalDescription},</if>
  228. <if test="isLset != null">is_lset= #{isLset},</if>
  229. <if test="isPoverty != null">is_poverty= #{isPoverty},</if>
  230. <if test="emergencyContact != null">emergency_contact= #{emergencyContact},</if>
  231. <if test="emergencyContactTelephone != null">emergency_contact_telephone= #{emergencyContactTelephone},</if>
  232. </trim>
  233. where old_id = #{oldId}
  234. </update>
  235. <delete id="deleteStudentInfoOldById" parameterType="Long">
  236. delete from student_info_old where old_id = #{id}
  237. </delete>
  238. <delete id="deleteStudentInfoOldByIds" parameterType="String">
  239. delete from student_info_old where old_id in
  240. <foreach item="id" collection="array" open="(" separator="," close=")">
  241. #{id}
  242. </foreach>
  243. </delete>
  244. </mapper>