StudentRepairMapper.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.ym.mec.biz.dal.dao.StudentRepairDao">
  4. <resultMap id="StudentRepair" type="com.ym.mec.biz.dal.entity.StudentRepair">
  5. <result column="id_" jdbcType="INTEGER" property="id"/>
  6. <result column="trans_no_" jdbcType="VARCHAR" property="transNo"/>
  7. <result column="organ_id_" jdbcType="INTEGER" property="organId"/>
  8. <result column="student_id_" jdbcType="INTEGER" property="studentId"/>
  9. <result column="student_name_" jdbcType="VARCHAR" property="studentName"/>
  10. <result column="student_school_" jdbcType="VARCHAR" property="studentSchool"/>
  11. <result column="employee_id_" jdbcType="INTEGER" property="employeeId"/>
  12. <result column="employee_name_" jdbcType="VARCHAR" property="employeeName"/>
  13. <result column="subject_id_" jdbcType="INTEGER" property="subjectId"/>
  14. <result column="subject_name_" jdbcType="VARCHAR" property="subjectName"/>
  15. <result column="type_" jdbcType="INTEGER" property="type"/>
  16. <result column="instrument_no_" jdbcType="VARCHAR" property="instrumentNo"/>
  17. <result column="description_" jdbcType="VARCHAR" property="description"/>
  18. <result column="amount_" jdbcType="DECIMAL" property="amount"/>
  19. <result column="finish_time_" jdbcType="TIMESTAMP" property="finishTime"/>
  20. <result column="send_type_" jdbcType="INTEGER" property="sendType"/>
  21. <result column="contact_name_" jdbcType="VARCHAR" property="contactName"/>
  22. <result column="contact_mobile_" jdbcType="VARCHAR" property="contactMobile"/>
  23. <result column="address_" jdbcType="VARCHAR" property="address"/>
  24. <result column="pay_status_" jdbcType="INTEGER" property="payStatus"/>
  25. <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
  26. <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
  27. </resultMap>
  28. <!-- 根据主键查询一条记录 -->
  29. <select id="get" resultMap="StudentRepair">
  30. SELECT *
  31. FROM school
  32. WHERE id_ = #{id}
  33. </select>
  34. <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentRepair">
  35. <!--@mbg.generated-->
  36. insert into student_repair (id_, trans_no_, organ_id_,
  37. student_id_, student_name_, student_school_,
  38. employee_id_, employee_name_, subject_id_,
  39. subject_name_, type_, instrument_no_,
  40. description_, amount_, finish_time_,
  41. send_type_, contact_name_, contact_mobile_,
  42. address_, pay_status_, create_time_,
  43. update_time_)
  44. values (#{id,jdbcType=INTEGER}, #{transNo,jdbcType=VARCHAR}, #{organId,jdbcType=INTEGER},
  45. #{studentId,jdbcType=INTEGER}, #{studentName,jdbcType=VARCHAR}, #{studentSchool,jdbcType=VARCHAR},
  46. #{employeeId,jdbcType=INTEGER}, #{employeeName,jdbcType=VARCHAR}, #{subjectId,jdbcType=INTEGER},
  47. #{subjectName,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{instrumentNo,jdbcType=VARCHAR},
  48. #{description,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{finishTime,jdbcType=TIMESTAMP},
  49. #{sendType,jdbcType=INTEGER}, #{contactName,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR},
  50. #{address,jdbcType=VARCHAR}, #{payStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
  51. #{updateTime,jdbcType=TIMESTAMP})
  52. </insert>
  53. <update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentRepair">
  54. <!--@mbg.generated-->
  55. UPDATE student_repair
  56. <set>
  57. <if test="transNo != null">
  58. trans_no_ = #{transNo},
  59. </if>
  60. <if test="organId != null">
  61. organ_id_ = ##{organId},
  62. </if>
  63. <if test="studentId != null">
  64. student_id_ = #{studentId},
  65. </if>
  66. <if test="studentName != null">
  67. student_name_ = #{studentName},
  68. </if>
  69. <if test="studentSchool != null">
  70. student_school_ = #{studentSchool},
  71. </if>
  72. <if test="employeeId != null">
  73. employee_id_ = #{employeeId},
  74. </if>
  75. <if test="employeeName != null">
  76. employee_name_ = #{employeeName},
  77. </if>
  78. <if test="subjectId != null">
  79. subject_id_ = #{subjectId},
  80. </if>
  81. <if test="subjectName != null">
  82. subject_name_ = #{subjectName},
  83. </if>
  84. <if test="type != null">
  85. type_ = #{type},
  86. </if>
  87. <if test="instrumentNo != null">
  88. instrument_no_ = #{instrumentNo},
  89. </if>
  90. <if test="description != null">
  91. description_ = #{description},
  92. </if>
  93. <if test="amount != null">
  94. amount_ = #{amount},
  95. </if>
  96. <if test="finishTime != null">
  97. finish_time_ = #{finishTime},
  98. </if>
  99. <if test="sendType != null">
  100. send_type_ #{sendType},
  101. </if>
  102. <if test="contactName != null">
  103. contact_name_ = #{contactName},
  104. </if>
  105. <if test="contactMobile != null">
  106. contact_mobile_ = #{contactName},
  107. </if>
  108. <if test="address != null">
  109. address_ = #{address},
  110. </if>
  111. <if test="payStatus != null">
  112. pay_status_ = #{payStatus},
  113. </if>
  114. <if test="updateTime != null">
  115. update_time_ = #{updateTime},
  116. </if>
  117. </set>
  118. WHERE id_ = #{id}
  119. </update>
  120. <select id="getStudents" resultType="com.ym.mec.biz.dal.dto.BasicUserDto">
  121. SELECT username_,id_ user_id_,avatar_ head_url_,gender_
  122. FROM sys_user
  123. WHERE FIND_IN_SET(organ_id_,#{organIdList})
  124. AND id_ NOT IN (
  125. SELECT cssp.user_id_
  126. FROM music_group mg
  127. LEFT JOIN course_schedule_student_payment cssp ON mg.id_ = cssp.music_group_id_
  128. WHERE cssp.group_type_ = 'MUSIC'
  129. AND mg.repair_user_id_ != #{employeeId})
  130. <include refid="global.limit"/>
  131. </select>
  132. </mapper>