TOrderRefundMapper.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  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.goafanti.common.dao.TOrderRefundMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderRefund">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  12. <result column="refund_status" jdbcType="INTEGER" property="refundStatus" />
  13. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  14. <result column="initiate" jdbcType="VARCHAR" property="initiate" />
  15. <result column="accept" jdbcType="VARCHAR" property="accept" />
  16. <result column="reason" jdbcType="VARCHAR" property="reason" />
  17. <result column="result" jdbcType="VARCHAR" property="result" />
  18. </resultMap>
  19. <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.TOrderRefundWithBLOBs">
  20. <!--
  21. WARNING - @mbg.generated
  22. This element is automatically generated by MyBatis Generator, do not modify.
  23. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  24. -->
  25. <result column="reason_attachment_url" jdbcType="LONGVARCHAR" property="reasonAttachmentUrl" />
  26. <result column="contract_url" jdbcType="LONGVARCHAR" property="contractUrl" />
  27. <result column="application_url" jdbcType="LONGVARCHAR" property="applicationUrl" />
  28. </resultMap>
  29. <sql id="Example_Where_Clause">
  30. <!--
  31. WARNING - @mbg.generated
  32. This element is automatically generated by MyBatis Generator, do not modify.
  33. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  34. -->
  35. <where>
  36. <foreach collection="oredCriteria" item="criteria" separator="or">
  37. <if test="criteria.valid">
  38. <trim prefix="(" prefixOverrides="and" suffix=")">
  39. <foreach collection="criteria.criteria" item="criterion">
  40. <choose>
  41. <when test="criterion.noValue">
  42. and ${criterion.condition}
  43. </when>
  44. <when test="criterion.singleValue">
  45. and ${criterion.condition} #{criterion.value}
  46. </when>
  47. <when test="criterion.betweenValue">
  48. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  49. </when>
  50. <when test="criterion.listValue">
  51. and ${criterion.condition}
  52. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  53. #{listItem}
  54. </foreach>
  55. </when>
  56. </choose>
  57. </foreach>
  58. </trim>
  59. </if>
  60. </foreach>
  61. </where>
  62. </sql>
  63. <sql id="Update_By_Example_Where_Clause">
  64. <!--
  65. WARNING - @mbg.generated
  66. This element is automatically generated by MyBatis Generator, do not modify.
  67. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  68. -->
  69. <where>
  70. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  71. <if test="criteria.valid">
  72. <trim prefix="(" prefixOverrides="and" suffix=")">
  73. <foreach collection="criteria.criteria" item="criterion">
  74. <choose>
  75. <when test="criterion.noValue">
  76. and ${criterion.condition}
  77. </when>
  78. <when test="criterion.singleValue">
  79. and ${criterion.condition} #{criterion.value}
  80. </when>
  81. <when test="criterion.betweenValue">
  82. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  83. </when>
  84. <when test="criterion.listValue">
  85. and ${criterion.condition}
  86. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  87. #{listItem}
  88. </foreach>
  89. </when>
  90. </choose>
  91. </foreach>
  92. </trim>
  93. </if>
  94. </foreach>
  95. </where>
  96. </sql>
  97. <sql id="Base_Column_List">
  98. <!--
  99. WARNING - @mbg.generated
  100. This element is automatically generated by MyBatis Generator, do not modify.
  101. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  102. -->
  103. id, order_no, refund_status, create_time, initiate, accept, reason, result
  104. </sql>
  105. <sql id="Blob_Column_List">
  106. <!--
  107. WARNING - @mbg.generated
  108. This element is automatically generated by MyBatis Generator, do not modify.
  109. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  110. -->
  111. reason_attachment_url, contract_url, application_url
  112. </sql>
  113. <select id="selectByExampleWithBLOBs" parameterType="com.goafanti.common.model.TOrderRefundExample" resultMap="ResultMapWithBLOBs">
  114. <!--
  115. WARNING - @mbg.generated
  116. This element is automatically generated by MyBatis Generator, do not modify.
  117. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  118. -->
  119. select
  120. <if test="distinct">
  121. distinct
  122. </if>
  123. <include refid="Base_Column_List" />
  124. ,
  125. <include refid="Blob_Column_List" />
  126. from t_order_refund
  127. <if test="_parameter != null">
  128. <include refid="Example_Where_Clause" />
  129. </if>
  130. <if test="orderByClause != null">
  131. order by ${orderByClause}
  132. </if>
  133. </select>
  134. <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderRefundExample" resultMap="BaseResultMap">
  135. <!--
  136. WARNING - @mbg.generated
  137. This element is automatically generated by MyBatis Generator, do not modify.
  138. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  139. -->
  140. select
  141. <if test="distinct">
  142. distinct
  143. </if>
  144. <include refid="Base_Column_List" />
  145. from t_order_refund
  146. <if test="_parameter != null">
  147. <include refid="Example_Where_Clause" />
  148. </if>
  149. <if test="orderByClause != null">
  150. order by ${orderByClause}
  151. </if>
  152. </select>
  153. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
  154. <!--
  155. WARNING - @mbg.generated
  156. This element is automatically generated by MyBatis Generator, do not modify.
  157. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  158. -->
  159. select
  160. <include refid="Base_Column_List" />
  161. ,
  162. <include refid="Blob_Column_List" />
  163. from t_order_refund
  164. where id = #{id,jdbcType=INTEGER}
  165. </select>
  166. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  167. <!--
  168. WARNING - @mbg.generated
  169. This element is automatically generated by MyBatis Generator, do not modify.
  170. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  171. -->
  172. delete from t_order_refund
  173. where id = #{id,jdbcType=INTEGER}
  174. </delete>
  175. <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderRefundExample">
  176. <!--
  177. WARNING - @mbg.generated
  178. This element is automatically generated by MyBatis Generator, do not modify.
  179. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  180. -->
  181. delete from t_order_refund
  182. <if test="_parameter != null">
  183. <include refid="Example_Where_Clause" />
  184. </if>
  185. </delete>
  186. <insert id="insert" parameterType="com.goafanti.common.model.TOrderRefundWithBLOBs">
  187. <!--
  188. WARNING - @mbg.generated
  189. This element is automatically generated by MyBatis Generator, do not modify.
  190. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  191. -->
  192. insert into t_order_refund (id, order_no, refund_status,
  193. create_time, initiate, accept,
  194. reason, result, reason_attachment_url,
  195. contract_url, application_url)
  196. values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{refundStatus,jdbcType=INTEGER},
  197. #{createTime,jdbcType=TIMESTAMP}, #{initiate,jdbcType=VARCHAR}, #{accept,jdbcType=VARCHAR},
  198. #{reason,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR}, #{reasonAttachmentUrl,jdbcType=LONGVARCHAR},
  199. #{contractUrl,jdbcType=LONGVARCHAR}, #{applicationUrl,jdbcType=LONGVARCHAR})
  200. </insert>
  201. <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderRefundWithBLOBs">
  202. <!--
  203. WARNING - @mbg.generated
  204. This element is automatically generated by MyBatis Generator, do not modify.
  205. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  206. -->
  207. insert into t_order_refund
  208. <trim prefix="(" suffix=")" suffixOverrides=",">
  209. <if test="id != null">
  210. id,
  211. </if>
  212. <if test="orderNo != null">
  213. order_no,
  214. </if>
  215. <if test="refundStatus != null">
  216. refund_status,
  217. </if>
  218. <if test="createTime != null">
  219. create_time,
  220. </if>
  221. <if test="initiate != null">
  222. initiate,
  223. </if>
  224. <if test="accept != null">
  225. accept,
  226. </if>
  227. <if test="reason != null">
  228. reason,
  229. </if>
  230. <if test="result != null">
  231. result,
  232. </if>
  233. <if test="reasonAttachmentUrl != null">
  234. reason_attachment_url,
  235. </if>
  236. <if test="contractUrl != null">
  237. contract_url,
  238. </if>
  239. <if test="applicationUrl != null">
  240. application_url,
  241. </if>
  242. </trim>
  243. <trim prefix="values (" suffix=")" suffixOverrides=",">
  244. <if test="id != null">
  245. #{id,jdbcType=INTEGER},
  246. </if>
  247. <if test="orderNo != null">
  248. #{orderNo,jdbcType=VARCHAR},
  249. </if>
  250. <if test="refundStatus != null">
  251. #{refundStatus,jdbcType=INTEGER},
  252. </if>
  253. <if test="createTime != null">
  254. #{createTime,jdbcType=TIMESTAMP},
  255. </if>
  256. <if test="initiate != null">
  257. #{initiate,jdbcType=VARCHAR},
  258. </if>
  259. <if test="accept != null">
  260. #{accept,jdbcType=VARCHAR},
  261. </if>
  262. <if test="reason != null">
  263. #{reason,jdbcType=VARCHAR},
  264. </if>
  265. <if test="result != null">
  266. #{result,jdbcType=VARCHAR},
  267. </if>
  268. <if test="reasonAttachmentUrl != null">
  269. #{reasonAttachmentUrl,jdbcType=LONGVARCHAR},
  270. </if>
  271. <if test="contractUrl != null">
  272. #{contractUrl,jdbcType=LONGVARCHAR},
  273. </if>
  274. <if test="applicationUrl != null">
  275. #{applicationUrl,jdbcType=LONGVARCHAR},
  276. </if>
  277. </trim>
  278. </insert>
  279. <select id="countByExample" parameterType="com.goafanti.common.model.TOrderRefundExample" resultType="java.lang.Long">
  280. <!--
  281. WARNING - @mbg.generated
  282. This element is automatically generated by MyBatis Generator, do not modify.
  283. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  284. -->
  285. select count(*) from t_order_refund
  286. <if test="_parameter != null">
  287. <include refid="Example_Where_Clause" />
  288. </if>
  289. </select>
  290. <update id="updateByExampleSelective" parameterType="map">
  291. <!--
  292. WARNING - @mbg.generated
  293. This element is automatically generated by MyBatis Generator, do not modify.
  294. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  295. -->
  296. update t_order_refund
  297. <set>
  298. <if test="record.id != null">
  299. id = #{record.id,jdbcType=INTEGER},
  300. </if>
  301. <if test="record.orderNo != null">
  302. order_no = #{record.orderNo,jdbcType=VARCHAR},
  303. </if>
  304. <if test="record.refundStatus != null">
  305. refund_status = #{record.refundStatus,jdbcType=INTEGER},
  306. </if>
  307. <if test="record.createTime != null">
  308. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  309. </if>
  310. <if test="record.initiate != null">
  311. initiate = #{record.initiate,jdbcType=VARCHAR},
  312. </if>
  313. <if test="record.accept != null">
  314. accept = #{record.accept,jdbcType=VARCHAR},
  315. </if>
  316. <if test="record.reason != null">
  317. reason = #{record.reason,jdbcType=VARCHAR},
  318. </if>
  319. <if test="record.result != null">
  320. result = #{record.result,jdbcType=VARCHAR},
  321. </if>
  322. <if test="record.reasonAttachmentUrl != null">
  323. reason_attachment_url = #{record.reasonAttachmentUrl,jdbcType=LONGVARCHAR},
  324. </if>
  325. <if test="record.contractUrl != null">
  326. contract_url = #{record.contractUrl,jdbcType=LONGVARCHAR},
  327. </if>
  328. <if test="record.applicationUrl != null">
  329. application_url = #{record.applicationUrl,jdbcType=LONGVARCHAR},
  330. </if>
  331. </set>
  332. <if test="_parameter != null">
  333. <include refid="Update_By_Example_Where_Clause" />
  334. </if>
  335. </update>
  336. <update id="updateByExampleWithBLOBs" parameterType="map">
  337. <!--
  338. WARNING - @mbg.generated
  339. This element is automatically generated by MyBatis Generator, do not modify.
  340. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  341. -->
  342. update t_order_refund
  343. set id = #{record.id,jdbcType=INTEGER},
  344. order_no = #{record.orderNo,jdbcType=VARCHAR},
  345. refund_status = #{record.refundStatus,jdbcType=INTEGER},
  346. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  347. initiate = #{record.initiate,jdbcType=VARCHAR},
  348. accept = #{record.accept,jdbcType=VARCHAR},
  349. reason = #{record.reason,jdbcType=VARCHAR},
  350. result = #{record.result,jdbcType=VARCHAR},
  351. reason_attachment_url = #{record.reasonAttachmentUrl,jdbcType=LONGVARCHAR},
  352. contract_url = #{record.contractUrl,jdbcType=LONGVARCHAR},
  353. application_url = #{record.applicationUrl,jdbcType=LONGVARCHAR}
  354. <if test="_parameter != null">
  355. <include refid="Update_By_Example_Where_Clause" />
  356. </if>
  357. </update>
  358. <update id="updateByExample" parameterType="map">
  359. <!--
  360. WARNING - @mbg.generated
  361. This element is automatically generated by MyBatis Generator, do not modify.
  362. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  363. -->
  364. update t_order_refund
  365. set id = #{record.id,jdbcType=INTEGER},
  366. order_no = #{record.orderNo,jdbcType=VARCHAR},
  367. refund_status = #{record.refundStatus,jdbcType=INTEGER},
  368. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  369. initiate = #{record.initiate,jdbcType=VARCHAR},
  370. accept = #{record.accept,jdbcType=VARCHAR},
  371. reason = #{record.reason,jdbcType=VARCHAR},
  372. result = #{record.result,jdbcType=VARCHAR}
  373. <if test="_parameter != null">
  374. <include refid="Update_By_Example_Where_Clause" />
  375. </if>
  376. </update>
  377. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderRefundWithBLOBs">
  378. <!--
  379. WARNING - @mbg.generated
  380. This element is automatically generated by MyBatis Generator, do not modify.
  381. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  382. -->
  383. update t_order_refund
  384. <set>
  385. <if test="orderNo != null">
  386. order_no = #{orderNo,jdbcType=VARCHAR},
  387. </if>
  388. <if test="refundStatus != null">
  389. refund_status = #{refundStatus,jdbcType=INTEGER},
  390. </if>
  391. <if test="createTime != null">
  392. create_time = #{createTime,jdbcType=TIMESTAMP},
  393. </if>
  394. <if test="initiate != null">
  395. initiate = #{initiate,jdbcType=VARCHAR},
  396. </if>
  397. <if test="accept != null">
  398. accept = #{accept,jdbcType=VARCHAR},
  399. </if>
  400. <if test="reason != null">
  401. reason = #{reason,jdbcType=VARCHAR},
  402. </if>
  403. <if test="result != null">
  404. result = #{result,jdbcType=VARCHAR},
  405. </if>
  406. <if test="reasonAttachmentUrl != null">
  407. reason_attachment_url = #{reasonAttachmentUrl,jdbcType=LONGVARCHAR},
  408. </if>
  409. <if test="contractUrl != null">
  410. contract_url = #{contractUrl,jdbcType=LONGVARCHAR},
  411. </if>
  412. <if test="applicationUrl != null">
  413. application_url = #{applicationUrl,jdbcType=LONGVARCHAR},
  414. </if>
  415. </set>
  416. where id = #{id,jdbcType=INTEGER}
  417. </update>
  418. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.TOrderRefundWithBLOBs">
  419. <!--
  420. WARNING - @mbg.generated
  421. This element is automatically generated by MyBatis Generator, do not modify.
  422. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  423. -->
  424. update t_order_refund
  425. set order_no = #{orderNo,jdbcType=VARCHAR},
  426. refund_status = #{refundStatus,jdbcType=INTEGER},
  427. create_time = #{createTime,jdbcType=TIMESTAMP},
  428. initiate = #{initiate,jdbcType=VARCHAR},
  429. accept = #{accept,jdbcType=VARCHAR},
  430. reason = #{reason,jdbcType=VARCHAR},
  431. result = #{result,jdbcType=VARCHAR},
  432. reason_attachment_url = #{reasonAttachmentUrl,jdbcType=LONGVARCHAR},
  433. contract_url = #{contractUrl,jdbcType=LONGVARCHAR},
  434. application_url = #{applicationUrl,jdbcType=LONGVARCHAR}
  435. where id = #{id,jdbcType=INTEGER}
  436. </update>
  437. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderRefund">
  438. <!--
  439. WARNING - @mbg.generated
  440. This element is automatically generated by MyBatis Generator, do not modify.
  441. This element was generated on Tue Nov 20 15:20:39 CST 2018.
  442. -->
  443. update t_order_refund
  444. set order_no = #{orderNo,jdbcType=VARCHAR},
  445. refund_status = #{refundStatus,jdbcType=INTEGER},
  446. create_time = #{createTime,jdbcType=TIMESTAMP},
  447. initiate = #{initiate,jdbcType=VARCHAR},
  448. accept = #{accept,jdbcType=VARCHAR},
  449. reason = #{reason,jdbcType=VARCHAR},
  450. result = #{result,jdbcType=VARCHAR}
  451. where id = #{id,jdbcType=INTEGER}
  452. </update>
  453. <!-- 财务专员查看自己处理的退款数据 -->
  454. <select id="getRefundList" parameterType="Map" resultType="com.goafanti.order.bo.OrderRefundBo">
  455. select r.id as id , r.create_time as createTime, r.order_no as orderNo, u.nickname as buyName, u.id as buyid, o.order_status as orderStatus,
  456. a.name as saleName, a.id as saleId, o.liquidation_status as liquidationStatus ,reason as reason,refund_status as refundStatus,
  457. o.refund_amount as refundAmount, o.contract_no as contractNo
  458. from t_order_refund r
  459. left join t_order_new o on r.order_no = o.order_no
  460. left join `user` u on o.buyer_id = u.id
  461. left join admin a on o.salesman_id = a.id
  462. where accept = #{r.accept,jdbcType=VARCHAR}
  463. <if test='r.refundStatus != null and r.refundStatus != ""'>
  464. and r.refund_status = #{r.refundStatus,jdbcType=INTEGER} - 1
  465. </if>
  466. <if test='r.refundStatus == null or r.refundStatus == ""'>
  467. and refund_status &lt; 2
  468. </if>
  469. <if test='r.departmentId != null and r.departmentId != ""'>
  470. and a.department_id = #{r.departmentId,jdbcType=INTEGER}
  471. </if>
  472. <if test='r.id != null and r.id != ""'>
  473. and r.id= #{r.id,jdbcType=INTEGER}
  474. </if>
  475. <if test='r.orderNo != null and r.orderNo != ""'>
  476. and r.order_no = #{r.orderNo,jdbcType=VARCHAR}
  477. </if>
  478. <if test='r.buyName != null and r.buyName != ""'>
  479. <bind name="a" value="'%' + r.buyName + '%'"/>
  480. and u.nickname like #{a,jdbcType=VARCHAR}
  481. </if>
  482. <if test='r.startTime != null and r.startTime != "" and r.endTime != null and r.endTime != ""'>
  483. and o.sign_time between #{r.startTime,jdbcType=VARCHAR} and #{r.endTime,jdbcType=VARCHAR}
  484. </if>
  485. order by r.refund_status, o.order_status
  486. <if test="page_sql!=null">
  487. ${page_sql}
  488. </if>
  489. </select>
  490. <select id="getRefundCount" parameterType="Map" resultType="java.lang.Integer">
  491. select count(*)
  492. from t_order_refund r
  493. left join t_order_new o on r.order_no = o.order_no
  494. left join `user` u on o.buyer_id = u.id
  495. left join admin a on o.salesman_id = a.id
  496. where accept = #{r.accept,jdbcType=VARCHAR}
  497. <if test='r.refundStatus != null and r.refundStatus != ""'>
  498. and r.refund_status = #{r.refundStatus,jdbcType=INTEGER}
  499. </if>
  500. <if test='r.refundStatus == null or r.refundStatus == ""'>
  501. and r.refund_status &lt; 2
  502. </if>
  503. <if test='r.departmentId != null and r.departmentId != ""'>
  504. and a.department_id = #{r.departmentId,jdbcType=INTEGER}
  505. </if>
  506. <if test='r.id != null and r.id != ""'>
  507. and r.id= #{r.id,jdbcType=INTEGER}
  508. </if>
  509. <if test='r.orderNo != null and r.orderNo != ""'>
  510. and r.order_no = #{r.orderNo,jdbcType=VARCHAR}
  511. </if>
  512. <if test='r.buyName != null and r.buyName != ""'>
  513. <bind name="a" value="'%' + r.buyName + '%'"/>
  514. and u.nickname like #{a,jdbcType=VARCHAR}
  515. </if>
  516. <if test='r.startTime != null and r.startTime != "" and r.endTime != null and r.endTime != ""'>
  517. and o.sign_time between #{r.startTime,jdbcType=VARCHAR} and #{r.endTime,jdbcType=VARCHAR}
  518. </if>
  519. </select>
  520. <!-- 修改退款数据 -->
  521. <update id="updateRefundById" parameterType="com.goafanti.common.model.TOrderRefund">
  522. update t_order_refund
  523. <set>
  524. <if test="orderNo != null">
  525. order_no = #{orderNo,jdbcType=VARCHAR},
  526. </if>
  527. <if test="refundStatus != null">
  528. refund_status = #{refundStatus,jdbcType=INTEGER},
  529. </if>
  530. <if test="initiate != null">
  531. initiate = #{initiate,jdbcType=VARCHAR},
  532. </if>
  533. <if test="accept != null">
  534. accept = #{accept,jdbcType=VARCHAR},
  535. </if>
  536. <if test="reason != null">
  537. reason = #{reason,jdbcType=VARCHAR},
  538. </if>
  539. <if test="result != null">
  540. result = #{result,jdbcType=VARCHAR},
  541. </if>
  542. </set>
  543. where id = #{id,jdbcType=INTEGER}
  544. </update>
  545. <select id="checkOrderNo" resultType="java.lang.Integer">
  546. select count(*) from t_order_refund
  547. where refund_status=0
  548. and order_no= #{orderNo,jdbcType=VARCHAR}
  549. </select>
  550. </mapper>