OrderRefundMapper.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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.mdd.common.mapper.refund.OrderRefundMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.mdd.common.entity.refund.OrderRefund">
  6. <!-- <id column="id" property="id"/>
  7. <result column="create_id" property="createId"/>
  8. <result column="create_time" property="createTime"/>
  9. <result column="update_id" property="updateId"/>
  10. <result column="update_time" property="updateTime"/>
  11. <result column="company_id" property="companyId"/>
  12. <result column="account_id" property="accountId"/>
  13. <result column="account_chart_id" property="accountChartId"/>
  14. <result column="is_add_next_level" property="isAddNextLevel"/>
  15. <result column="is_reallocate" property="isReallocate"/>
  16. <result column="tenant_id" property="tenantId"/>-->
  17. </resultMap>
  18. <sql id="base_list">
  19. select a.id,
  20. a.sn as refundSn,
  21. a.order_id as orderId,
  22. a.user_id as userId,
  23. a.type,
  24. a.order_terminal as orderTerminal,
  25. a.transaction_id as transactionId,
  26. a.order_amount as orderAmount,
  27. a.refund_amount as refundAmount,
  28. a.refund_status as refund_status,
  29. a.create_time as createTime,
  30. a.update_time as updateTime,
  31. a.refund_time as refundTime,
  32. b.sn as userSn,
  33. b.avatar,
  34. b.nickname,
  35. b.username,
  36. c.sn as orderSn
  37. from la_order_refund a
  38. left join la_user b on a.user_id = b.id
  39. left join la_order c on a.order_id = c.id
  40. <where>
  41. <if test="form.refundSn != null and form.refundSn != ''">
  42. and a.sn like concat('%', #{form.refundSn}, '%')
  43. </if>
  44. <if test="form.orderSn != null and form.orderSn != ''">
  45. and c.sn like concat('%', #{form.orderSn}, '%')
  46. </if>
  47. <if test="form.type != null">
  48. and a.type = #{form.type}
  49. </if>
  50. <if test="form.userInfo != null and form.userInfo != ''">
  51. and (b.nickname like concat('%', #{form.userInfo}, '%') or
  52. b.sn like concat('%', #{form.userInfo}, '%'))
  53. </if>
  54. <if test="form.orderTimeStart != null">
  55. and a.create_time &gt;= #{form.orderTimeStart}
  56. </if>
  57. <if test="form.orderTimeEnd != null">
  58. and a.create_time &lt;= #{form.orderTimeEnd}
  59. </if>
  60. <if test="form.refundStatus != null">
  61. and a.refund_status = #{form.refundStatus}
  62. </if>
  63. </where>
  64. order by a.id desc
  65. </sql>
  66. <select id="page" resultType="com.mdd.common.dto.result.OrderRefundPageResultDto">
  67. <include refid="base_list"/>
  68. </select>
  69. <select id="selectListByParams" resultType="com.mdd.common.dto.result.OrderRefundPageResultDto">
  70. <include refid="base_list"/>
  71. </select>
  72. </mapper>