RefundMessageMapper.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  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.izouma.awesomeadmin.dao.RefundMessageMapper" >
  4. <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.RefundMessage" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="del_flag" property="delFlag" jdbcType="CHAR" />
  7. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  8. <result column="update_user" property="updateUser" jdbcType="VARCHAR" />
  9. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  10. <result column="create_user" property="createUser" jdbcType="VARCHAR" />
  11. <result column="refund_id" property="refundId" jdbcType="INTEGER" />
  12. <result column="remark" property="remark" jdbcType="VARCHAR" />
  13. <result column="type_flag" property="typeFlag" jdbcType="INTEGER" />
  14. <result column="user_id" property="userId" jdbcType="INTEGER" />
  15. <result column="store_id" property="storeId" jdbcType="INTEGER" />
  16. </resultMap>
  17. <sql id="Base_Column_List" >
  18. <trim suffixOverrides="," >
  19. id,
  20. del_flag,
  21. update_time,
  22. update_user,
  23. create_time,
  24. create_user,
  25. refund_id,
  26. remark,
  27. type_flag,
  28. user_id,
  29. store_id,
  30. </trim>
  31. </sql>
  32. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  33. select
  34. <include refid="Base_Column_List" />
  35. from refund_message
  36. where id = #{id,jdbcType=INTEGER}
  37. </select>
  38. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  39. delete from refund_message
  40. where id = #{id,jdbcType=INTEGER}
  41. </delete>
  42. <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.RefundMessage" useGeneratedKeys="true" keyProperty="id">
  43. insert into refund_message
  44. <trim prefix="(" suffix=")" suffixOverrides="," >
  45. <if test="id!= null" >
  46. id,
  47. </if>
  48. <if test="delFlag!= null" >
  49. del_flag,
  50. </if>
  51. <if test="updateTime!= null" >
  52. update_time,
  53. </if>
  54. <if test="updateUser!= null" >
  55. update_user,
  56. </if>
  57. <if test="createTime!= null" >
  58. create_time,
  59. </if>
  60. <if test="createUser!= null" >
  61. create_user,
  62. </if>
  63. <if test="refundId!= null" >
  64. refund_id,
  65. </if>
  66. <if test="remark!= null" >
  67. remark,
  68. </if>
  69. <if test="typeFlag!= null" >
  70. type_flag,
  71. </if>
  72. <if test="userId!= null" >
  73. user_id,
  74. </if>
  75. <if test="storeId!= null" >
  76. store_id,
  77. </if>
  78. </trim>
  79. <trim prefix="values (" suffix=")" suffixOverrides="," >
  80. <if test="id != null" >
  81. #{id,jdbcType=INTEGER},
  82. </if>
  83. <if test="delFlag != null" >
  84. #{delFlag,jdbcType=CHAR},
  85. </if>
  86. <if test="updateTime != null" >
  87. #{updateTime,jdbcType=TIMESTAMP},
  88. </if>
  89. <if test="updateUser != null" >
  90. #{updateUser,jdbcType=VARCHAR},
  91. </if>
  92. <if test="createTime != null" >
  93. #{createTime,jdbcType=TIMESTAMP},
  94. </if>
  95. <if test="createUser != null" >
  96. #{createUser,jdbcType=VARCHAR},
  97. </if>
  98. <if test="refundId != null" >
  99. #{refundId,jdbcType=INTEGER},
  100. </if>
  101. <if test="remark != null" >
  102. #{remark,jdbcType=VARCHAR},
  103. </if>
  104. <if test="typeFlag != null" >
  105. #{typeFlag,jdbcType=INTEGER},
  106. </if>
  107. <if test="userId != null" >
  108. #{userId,jdbcType=INTEGER},
  109. </if>
  110. <if test="storeId != null" >
  111. #{storeId,jdbcType=INTEGER},
  112. </if>
  113. </trim>
  114. </insert>
  115. <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.RefundMessage" >
  116. update refund_message
  117. <set >
  118. <if test="id != null" >
  119. id= #{id,jdbcType=INTEGER},
  120. </if>
  121. <if test="delFlag != null" >
  122. del_flag= #{delFlag,jdbcType=CHAR},
  123. </if>
  124. <if test="updateTime != null" >
  125. update_time= #{updateTime,jdbcType=TIMESTAMP},
  126. </if>
  127. <if test="updateUser != null" >
  128. update_user= #{updateUser,jdbcType=VARCHAR},
  129. </if>
  130. <if test="createTime != null" >
  131. create_time= #{createTime,jdbcType=TIMESTAMP},
  132. </if>
  133. <if test="createUser != null" >
  134. create_user= #{createUser,jdbcType=VARCHAR},
  135. </if>
  136. <if test="refundId != null" >
  137. refund_id= #{refundId,jdbcType=INTEGER},
  138. </if>
  139. <if test="remark != null" >
  140. remark= #{remark,jdbcType=VARCHAR},
  141. </if>
  142. <if test="typeFlag != null" >
  143. type_flag= #{typeFlag,jdbcType=INTEGER},
  144. </if>
  145. <if test="userId != null" >
  146. user_id= #{userId,jdbcType=INTEGER},
  147. </if>
  148. <if test="storeId != null" >
  149. store_id= #{storeId,jdbcType=INTEGER},
  150. </if>
  151. </set>
  152. where
  153. <if test="id != null and !&quot;&quot;.equals(id)">
  154. id = #{id,jdbcType=INTEGER}
  155. </if>
  156. <if test="idStr != null and !&quot;&quot;.equals(idStr)">
  157. id in (${idStr})
  158. </if>
  159. </update>
  160. <select id="queryRefundMessageByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.RefundMessage">
  161. select <include refid="Base_Column_List"/> from refund_message
  162. <where>
  163. and del_flag = 'N'
  164. <if test="record.idStr != null and !&quot;&quot;.equals(record.idStr)">
  165. and id in (${record.idStr})
  166. </if>
  167. <if test="record.id != null and !&quot;&quot;.equals(record.id)">
  168. and id = #{record.id}
  169. </if>
  170. <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
  171. and del_flag = #{record.delFlag}
  172. </if>
  173. <if test="record.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
  174. and update_time = #{record.updateTime}
  175. </if>
  176. <if test="record.updateUser != null and !&quot;&quot;.equals(record.updateUser)">
  177. and update_user = #{record.updateUser}
  178. </if>
  179. <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
  180. and create_time = #{record.createTime}
  181. </if>
  182. <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
  183. and create_user = #{record.createUser}
  184. </if>
  185. <if test="record.refundId != null and !&quot;&quot;.equals(record.refundId)">
  186. and refund_id = #{record.refundId}
  187. </if>
  188. <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
  189. and remark = #{record.remark}
  190. </if>
  191. <if test="record.typeFlag != null and !&quot;&quot;.equals(record.typeFlag)">
  192. and type_flag = #{record.typeFlag}
  193. </if>
  194. <if test="record.userId != null and !&quot;&quot;.equals(record.userId)">
  195. and user_id = #{record.userId}
  196. </if>
  197. <if test="record.storeId != null and !&quot;&quot;.equals(record.storeId)">
  198. and store_id = #{record.storeId}
  199. </if>
  200. <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
  201. <trim prefix="and (" suffix=")" prefixOverrides="OR" >
  202. OR refund_id LIKE concat('%',#{record.searchKey},'%')
  203. OR remark LIKE concat('%',#{record.searchKey},'%')
  204. OR type_flag LIKE concat('%',#{record.searchKey},'%')
  205. OR user_id LIKE concat('%',#{record.searchKey},'%')
  206. OR store_id LIKE concat('%',#{record.searchKey},'%')
  207. </trim>
  208. </if>
  209. <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
  210. <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
  211. <choose>
  212. <when test="item.indexOf('like') != -1">
  213. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  214. <if test="detailIndex == 3">
  215. concat('%',#{itemDetail},'%')
  216. </if>
  217. <if test="detailIndex &lt; 3">
  218. ${itemDetail}
  219. </if>
  220. </foreach>
  221. </when>
  222. <otherwise>
  223. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  224. <if test="detailIndex == 3">
  225. #{itemDetail}
  226. </if>
  227. <if test="detailIndex &lt; 3">
  228. ${itemDetail}
  229. </if>
  230. </foreach>
  231. </otherwise>
  232. </choose>
  233. </foreach>
  234. </if>
  235. </where>
  236. order by
  237. <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
  238. <trim suffixOverrides=",">
  239. <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
  240. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  241. ${itemDetail}
  242. </foreach>
  243. </foreach>
  244. </trim>
  245. ,
  246. </if>
  247. id desc
  248. </select>
  249. <select id="queryAllRefundMessage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.RefundMessage">
  250. select <include refid="Base_Column_List"/> from refund_message
  251. <where>
  252. and del_flag = 'N'
  253. <if test="idStr != null and !&quot;&quot;.equals(idStr)">
  254. and id in (${idStr})
  255. </if>
  256. <if test="id != null and !&quot;&quot;.equals(id)">
  257. and id = #{id}
  258. </if>
  259. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  260. and del_flag = #{delFlag}
  261. </if>
  262. <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
  263. and update_time = #{updateTime}
  264. </if>
  265. <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
  266. and update_user = #{updateUser}
  267. </if>
  268. <if test="createTime != null and !&quot;&quot;.equals(createTime)">
  269. and create_time = #{createTime}
  270. </if>
  271. <if test="createUser != null and !&quot;&quot;.equals(createUser)">
  272. and create_user = #{createUser}
  273. </if>
  274. <if test="refundId != null and !&quot;&quot;.equals(refundId)">
  275. and refund_id = #{refundId}
  276. </if>
  277. <if test="remark != null and !&quot;&quot;.equals(remark)">
  278. and remark = #{remark}
  279. </if>
  280. <if test="typeFlag != null and !&quot;&quot;.equals(typeFlag)">
  281. and type_flag = #{typeFlag}
  282. </if>
  283. <if test="userId != null and !&quot;&quot;.equals(userId)">
  284. and user_id = #{userId}
  285. </if>
  286. <if test="storeId != null and !&quot;&quot;.equals(storeId)">
  287. and store_id = #{storeId}
  288. </if>
  289. <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
  290. <trim prefix="and (" suffix=")" prefixOverrides="OR" >
  291. OR refund_id LIKE concat('%',#{searchKey},'%')
  292. OR remark LIKE concat('%',#{searchKey},'%')
  293. OR type_flag LIKE concat('%',#{searchKey},'%')
  294. OR user_id LIKE concat('%',#{searchKey},'%')
  295. OR store_id LIKE concat('%',#{searchKey},'%')
  296. </trim>
  297. </if>
  298. <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
  299. <foreach item="item" index="index" collection="advancedQuery.split('_;')">
  300. <choose>
  301. <when test="item.indexOf('like') != -1">
  302. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  303. <if test="detailIndex == 3">
  304. concat('%',#{itemDetail},'%')
  305. </if>
  306. <if test="detailIndex &lt; 3">
  307. ${itemDetail}
  308. </if>
  309. </foreach>
  310. </when>
  311. <otherwise>
  312. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  313. <if test="detailIndex == 3">
  314. #{itemDetail}
  315. </if>
  316. <if test="detailIndex &lt; 3">
  317. ${itemDetail}
  318. </if>
  319. </foreach>
  320. </otherwise>
  321. </choose>
  322. </foreach>
  323. </if>
  324. </where>
  325. order by
  326. <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
  327. <trim suffixOverrides=",">
  328. <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
  329. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  330. ${itemDetail}
  331. </foreach>
  332. </foreach>
  333. </trim>
  334. ,
  335. </if>
  336. id desc
  337. </select>
  338. <select id="queryRefundMessage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.RefundMessage">
  339. select <include refid="Base_Column_List"/> from refund_message
  340. <where>
  341. and del_flag = 'N'
  342. <if test="id != null and !&quot;&quot;.equals(id)">
  343. and id = #{id}
  344. </if>
  345. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  346. and del_flag = #{delFlag}
  347. </if>
  348. <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
  349. and update_time = #{updateTime}
  350. </if>
  351. <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
  352. and update_user = #{updateUser}
  353. </if>
  354. <if test="createTime != null and !&quot;&quot;.equals(createTime)">
  355. and create_time = #{createTime}
  356. </if>
  357. <if test="createUser != null and !&quot;&quot;.equals(createUser)">
  358. and create_user = #{createUser}
  359. </if>
  360. <if test="refundId != null and !&quot;&quot;.equals(refundId)">
  361. and refund_id = #{refundId}
  362. </if>
  363. <if test="remark != null and !&quot;&quot;.equals(remark)">
  364. and remark = #{remark}
  365. </if>
  366. <if test="typeFlag != null and !&quot;&quot;.equals(typeFlag)">
  367. and type_flag = #{typeFlag}
  368. </if>
  369. <if test="userId != null and !&quot;&quot;.equals(userId)">
  370. and user_id = #{userId}
  371. </if>
  372. <if test="storeId != null and !&quot;&quot;.equals(storeId)">
  373. and store_id = #{storeId}
  374. </if>
  375. </where>
  376. LIMIT 1
  377. </select>
  378. <update id="delete">
  379. UPDATE refund_message SET del_flag = 'Y'
  380. where
  381. <if test="id != null and !&quot;&quot;.equals(id)">
  382. id = #{id,jdbcType=INTEGER}
  383. </if>
  384. <if test="idStr != null and !&quot;&quot;.equals(idStr)">
  385. id in (${idStr})
  386. </if>
  387. </update>
  388. <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.RefundMessage">
  389. select <include refid="Base_Column_List"/> from refund_message
  390. <where>
  391. and del_flag = 'N'
  392. </where>
  393. order by id desc
  394. </select>
  395. </mapper>