DzCardsMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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.dz.mapper.DzCardsMapper">
  6. <resultMap type="DzCards" id="DzCardsResult">
  7. <result property="cardId" column="card_id" />
  8. <result property="cardNo" column="card_no" />
  9. <result property="password" column="password" />
  10. <result property="type" column="type" />
  11. <result property="status" column="status" />
  12. <result property="distributeStatus" column="distribute_status" />
  13. <result property="timeStatus" column="time_status" />
  14. <result property="payStatus" column="pay_status" />
  15. <result property="isSettlement" column="is_settlement" />
  16. <result property="deptId" column="dept_id" />
  17. <result property="agentId" column="agent_id" />
  18. <result property="leafAgentId" column="leaf_agent_id" />
  19. <result property="campusId" column="campus_id" />
  20. <result property="assignLocation" column="assign_location" />
  21. <result property="assignExamType" column="assign_exam_type" />
  22. <result property="assignSchoolId" column="assign_school_id" />
  23. <result property="schoolId" column="school_id" />
  24. <result property="classId" column="class_id" />
  25. <result property="year" column="year" />
  26. <result property="endYear" column="end_year" />
  27. <result property="openId" column="open_id" />
  28. <result property="remark" column="remark" />
  29. <result property="distributeTime" column="distribute_time" />
  30. <result property="outDate" column="out_date" />
  31. <result property="openTime" column="open_time" />
  32. <result property="payTime" column="pay_time" />
  33. <result property="activeTime" column="active_time" />
  34. <result property="settlementTime" column="settlement_time" />
  35. <result property="refundTime" column="refund_time" />
  36. <result property="closeTime" column="close_time" />
  37. <result property="createTime" column="create_time" />
  38. <result property="updateTime" column="update_time" />
  39. </resultMap>
  40. <sql id="selectDzCardsVo">
  41. select card_id, card_no, password, type, status, distribute_status, time_status, pay_status, is_settlement, dept_id, agent_id, leaf_agent_id, campus_id, assign_location,assign_exam_type,assign_school_id, school_id, class_id, year, end_year, open_id, remark, distribute_time, out_date, open_time, pay_time, active_time, settlement_time, refund_time, close_time, create_time, update_time from dz_cards
  42. </sql>
  43. <select id="selectDzCardsList" parameterType="DzCards" resultMap="DzCardsResult">
  44. <include refid="selectDzCardsVo"/>
  45. <where>
  46. <if test="cardNo != null and cardNo != ''"> and card_no = #{cardNo}</if>
  47. <if test="password != null and password != ''"> and password = #{password}</if>
  48. <if test="type != null "> and type = #{type}</if>
  49. <if test="status != null "> and status = #{status}</if>
  50. <if test="distributeStatus != null "> and distribute_status = #{distributeStatus}</if>
  51. <if test="timeStatus != null "> and time_status = #{timeStatus}</if>
  52. <if test="payStatus != null "> and pay_status = #{payStatus}</if>
  53. <if test="isSettlement != null "> and is_settlement = #{isSettlement}</if>
  54. <if test="deptId != null "> and dept_id = #{deptId}</if>
  55. <if test="agentId != null "> and agent_id = #{agentId}</if>
  56. <if test="leafAgentId != null "> and leaf_agent_id = #{leafAgentId}</if>
  57. <if test="campusId != null "> and campus_id = #{campusId}</if>
  58. <if test="assignLocation != null "> and assign_location = #{assignLocation}</if>
  59. <if test="assignExamType != null "> and assign_exam_type = #{assignExamType}</if>
  60. <if test="assignSchoolId != null "> and assign_school_id = #{assignSchoolId}</if>
  61. <if test="schoolId != null "> and school_id = #{schoolId}</if>
  62. <if test="classId != null "> and class_id = #{classId}</if>
  63. <if test="year != null "> and year = #{year}</if>
  64. <if test="endYear != null "> and end_year = #{endYear}</if>
  65. <if test="openId != null "> and open_id = #{openId}</if>
  66. <if test="distributeTime != null "> and distribute_time = #{distributeTime}</if>
  67. <if test="outDate != null "> and out_date = #{outDate}</if>
  68. <if test="openTime != null "> and open_time = #{openTime}</if>
  69. <if test="payTime != null "> and pay_time = #{payTime}</if>
  70. <if test="activeTime != null "> and active_time = #{activeTime}</if>
  71. <if test="settlementTime != null "> and settlement_time = #{settlementTime}</if>
  72. <if test="refundTime != null "> and refund_time = #{refundTime}</if>
  73. <if test="closeTime != null "> and close_time = #{closeTime}</if>
  74. </where>
  75. </select>
  76. <select id="selectDzCardsByCardId" parameterType="Long" resultMap="DzCardsResult">
  77. <include refid="selectDzCardsVo"/>
  78. where card_id = #{cardId}
  79. </select>
  80. <insert id="insertDzCards" parameterType="DzCards" useGeneratedKeys="true" keyProperty="cardId">
  81. insert into dz_cards
  82. <trim prefix="(" suffix=")" suffixOverrides=",">
  83. <if test="cardNo != null">card_no,</if>
  84. <if test="password != null">password,</if>
  85. <if test="type != null">type,</if>
  86. <if test="status != null">status,</if>
  87. <if test="distributeStatus != null">distribute_status,</if>
  88. <if test="timeStatus != null">time_status,</if>
  89. <if test="payStatus != null">pay_status,</if>
  90. <if test="isSettlement != null">is_settlement,</if>
  91. <if test="deptId != null">dept_id,</if>
  92. <if test="agentId != null">agent_id,</if>
  93. <if test="leafAgentId != null">leaf_agent_id,</if>
  94. <if test="campusId != null">campus_id,</if>
  95. assign_location,assign_exam_type,assign_school_id,
  96. <if test="schoolId != null">school_id,</if>
  97. <if test="classId != null">class_id,</if>
  98. <if test="year != null">year,</if>
  99. <if test="endYear != null">end_year,</if>
  100. <if test="openId != null">open_id,</if>
  101. <if test="remark != null">remark,</if>
  102. <if test="distributeTime != null">distribute_time,</if>
  103. <if test="outDate != null">out_date,</if>
  104. <if test="openTime != null">open_time,</if>
  105. <if test="payTime != null">pay_time,</if>
  106. <if test="activeTime != null">active_time,</if>
  107. <if test="settlementTime != null">settlement_time,</if>
  108. <if test="refundTime != null">refund_time,</if>
  109. <if test="closeTime != null">close_time,</if>
  110. <if test="createTime != null">create_time,</if>
  111. <if test="updateTime != null">update_time,</if>
  112. </trim>
  113. <trim prefix="values (" suffix=")" suffixOverrides=",">
  114. <if test="cardNo != null">#{cardNo},</if>
  115. <if test="password != null">#{password},</if>
  116. <if test="type != null">#{type},</if>
  117. <if test="status != null">#{status},</if>
  118. <if test="distributeStatus != null">#{distributeStatus},</if>
  119. <if test="timeStatus != null">#{timeStatus},</if>
  120. <if test="payStatus != null">#{payStatus},</if>
  121. <if test="isSettlement != null">#{isSettlement},</if>
  122. <if test="deptId != null">#{deptId},</if>
  123. <if test="agentId != null">#{agentId},</if>
  124. <if test="leafAgentId != null">#{leafAgentId},</if>
  125. <if test="campusId != null">#{campusId},</if>
  126. #{assignLocation},#{assignExamType},#{assignSchoolId},
  127. <if test="schoolId != null">#{schoolId},</if>
  128. <if test="classId != null">#{classId},</if>
  129. <if test="year != null">#{year},</if>
  130. <if test="endYear != null">#{endYear},</if>
  131. <if test="openId != null">#{openId},</if>
  132. <if test="remark != null">#{remark},</if>
  133. <if test="distributeTime != null">#{distributeTime},</if>
  134. <if test="outDate != null">#{outDate},</if>
  135. <if test="openTime != null">#{openTime},</if>
  136. <if test="payTime != null">#{payTime},</if>
  137. <if test="activeTime != null">#{activeTime},</if>
  138. <if test="settlementTime != null">#{settlementTime},</if>
  139. <if test="refundTime != null">#{refundTime},</if>
  140. <if test="closeTime != null">#{closeTime},</if>
  141. <if test="createTime != null">#{createTime},</if>
  142. <if test="updateTime != null">#{updateTime},</if>
  143. </trim>
  144. </insert>
  145. <update id="updateDzCards" parameterType="DzCards">
  146. update dz_cards
  147. <trim prefix="SET" suffixOverrides=",">
  148. <if test="cardNo != null">card_no = #{cardNo},</if>
  149. <if test="password != null">password = #{password},</if>
  150. <if test="type != null">type = #{type},</if>
  151. <if test="status != null">status = #{status},</if>
  152. <if test="distributeStatus != null">distribute_status = #{distributeStatus},</if>
  153. <if test="timeStatus != null">time_status = #{timeStatus},</if>
  154. <if test="payStatus != null">pay_status = #{payStatus},</if>
  155. <if test="isSettlement != null">is_settlement = #{isSettlement},</if>
  156. <if test="deptId != null">dept_id = #{deptId},</if>
  157. <if test="agentId != null">agent_id = #{agentId},</if>
  158. <if test="leafAgentId != null">leaf_agent_id = #{leafAgentId},</if>
  159. <if test="campusId != null">campus_id = #{campusId},</if>
  160. assign_location = #{assignLocation},assign_exam_type = #{assignExamType},assign_school_id = #{assignSchoolId},
  161. <if test="schoolId != null">school_id = #{schoolId},</if>
  162. <if test="classId != null">class_id = #{classId},</if>
  163. <if test="year != null">year = #{year},</if>
  164. <if test="endYear != null">end_year = #{endYear},</if>
  165. <if test="openId != null">open_id = #{openId},</if>
  166. <if test="remark != null">remark = #{remark},</if>
  167. <if test="distributeTime != null">distribute_time = #{distributeTime},</if>
  168. <if test="outDate != null">out_date = #{outDate},</if>
  169. <if test="openTime != null">open_time = #{openTime},</if>
  170. <if test="payTime != null">pay_time = #{payTime},</if>
  171. <if test="activeTime != null">active_time = #{activeTime},</if>
  172. <if test="settlementTime != null">settlement_time = #{settlementTime},</if>
  173. <if test="refundTime != null">refund_time = #{refundTime},</if>
  174. <if test="closeTime != null">close_time = #{closeTime},</if>
  175. <if test="createTime != null">create_time = #{createTime},</if>
  176. <if test="updateTime != null">update_time = #{updateTime},</if>
  177. </trim>
  178. where card_id = #{cardId}
  179. </update>
  180. <delete id="deleteDzCardsByCardId" parameterType="Long">
  181. delete from dz_cards where card_id = #{cardId}
  182. </delete>
  183. <delete id="deleteDzCardsByCardIds" parameterType="String">
  184. delete from dz_cards where card_id in
  185. <foreach item="cardId" collection="array" open="(" separator="," close=")">
  186. #{cardId}
  187. </foreach>
  188. </delete>
  189. <select id="selectListByCond" parameterType="com.ruoyi.criteria.CardCriteria" resultMap="DzCardsResult">
  190. <include refid="selectDzCardsVo"/>
  191. <where>
  192. <if test="startNo != null and startNo != ''"> and card_no &gt; #{cardNo}</if>
  193. <if test="endNo != null and endNo != ''"> and card_no &lt; #{cardNo}</if>
  194. <if test="cardNo != null and cardNo != ''"> and card_no = #{cardNo}</if>
  195. <if test="password != null and password != ''"> and password = #{password}</if>
  196. <if test="type != null "> and type = #{type}</if>
  197. <if test="status != null "> and status = #{status}</if>
  198. <if test="distributeStatus != null "> and distribute_status = #{distributeStatus}</if>
  199. <if test="timeStatus != null "> and time_status = #{timeStatus}</if>
  200. <if test="payStatus != null "> and pay_status = #{payStatus}</if>
  201. <if test="isSettlement != null "> and is_settlement = #{isSettlement}</if>
  202. <if test="deptId != null "> and dept_id = #{deptId}</if>
  203. <if test="agentId != null "> and agent_id = #{agentId}</if>
  204. <if test="leafAgentId != null "> and leaf_agent_id = #{leafAgentId}</if>
  205. <if test="campusId != null "> and campus_id = #{campusId}</if>
  206. <if test="assignLocation != null "> and assign_location = #{assignLocation}</if>
  207. <if test="assignExamType != null "> and assign_exam_type = #{assignExamType}</if>
  208. <if test="assignSchoolId != null "> and assign_school_id = #{assignSchoolId}</if>
  209. <if test="schoolId != null "> and school_id = #{schoolId}</if>
  210. <if test="classId != null "> and class_id = #{classId}</if>
  211. <if test="year != null "> and year = #{year}</if>
  212. <if test="endYear != null "> and end_year = #{endYear}</if>
  213. <if test="openId != null "> and open_id = #{openId}</if>
  214. <if test="distributeTime != null "> and distribute_time = #{distributeTime}</if>
  215. <if test="outDate != null "> and out_date = #{outDate}</if>
  216. <if test="openTime != null "> and open_time = #{openTime}</if>
  217. <if test="payTime != null "> and pay_time = #{payTime}</if>
  218. <if test="activeTime != null "> and active_time = #{activeTime}</if>
  219. <if test="settlementTime != null "> and settlement_time = #{settlementTime}</if>
  220. <if test="refundTime != null "> and refund_time = #{refundTime}</if>
  221. <if test="closeTime != null "> and close_time = #{closeTime}</if>
  222. </where>
  223. </select>
  224. <select id="selectCardsByCardIds" parameterType="String" resultMap="DzCardsResult">
  225. <include refid="selectDzCardsVo"/>
  226. where card_id in <foreach item="cardId" collection="array" open="(" separator="," close=")">#{cardId}</foreach>
  227. </select>
  228. <select id="selectMaxNo" parameterType="Integer" resultType="Long">
  229. select max(card_no) from dz_cards where type = #{type}
  230. </select>
  231. </mapper>