KwpSettlementLogisticsMapper.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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.sckw.payment.dao.KwpSettlementLogisticsMapper">
  4. <resultMap id="BaseResultMap" type="com.sckw.payment.model.KwpSettlementLogistics">
  5. <!--@mbg.generated-->
  6. <!--@Table kwp_settlement_logistics-->
  7. <id column="id" jdbcType="BIGINT" property="id"/>
  8. <result column="ent_id" jdbcType="BIGINT" property="entId"/>
  9. <result column="l_ledger_id" jdbcType="BIGINT" property="lLedgerId"/>
  10. <result column="sl_order_no" jdbcType="VARCHAR" property="slOrderNo"/>
  11. <result column="name" jdbcType="VARCHAR" property="name"/>
  12. <result column="total_price" jdbcType="DECIMAL" property="totalPrice"/>
  13. <result column="actual_price" jdbcType="DECIMAL" property="actualPrice"/>
  14. <result column="receipt_time" jdbcType="TIMESTAMP" property="receiptTime"/>
  15. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  16. <result column="audit_user" jdbcType="VARCHAR" property="auditUser"/>
  17. <result column="audit_phone" jdbcType="VARCHAR" property="auditPhone"/>
  18. <result column="success_user" jdbcType="VARCHAR" property="successUser"/>
  19. <result column="success_phone" jdbcType="VARCHAR" property="successPhone"/>
  20. <result column="status" jdbcType="INTEGER" property="status"/>
  21. <result column="create_by" jdbcType="BIGINT" property="createBy"/>
  22. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  23. <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
  24. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  25. <result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
  26. </resultMap>
  27. <sql id="Base_Column_List">
  28. <!--@mbg.generated-->
  29. id,
  30. ent_id,
  31. l_ledger_id,
  32. sl_order_no,
  33. `name`,
  34. total_price,
  35. actual_price,
  36. receipt_time,
  37. remark,
  38. audit_user,
  39. audit_phone,
  40. success_user,
  41. success_phone,
  42. `status`,
  43. create_by,
  44. create_time,
  45. update_by,
  46. update_time,
  47. del_flag
  48. </sql>
  49. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  50. <!--@mbg.generated-->
  51. select
  52. <include refid="Base_Column_List"/>
  53. from kwp_settlement_logistics
  54. where id = #{id,jdbcType=BIGINT}
  55. </select>
  56. <select id="pageSelect" resultType="com.sckw.payment.model.dto.LedgerLogisticsDto">
  57. select s.id,
  58. s.ent_id,
  59. s.l_ledger_id,
  60. s.sl_order_no,
  61. s.`name`,
  62. s.total_price,
  63. s.actual_price,
  64. s.receipt_time,
  65. s.remark,
  66. s.audit_user,
  67. s.audit_phone,
  68. s.success_user,
  69. s.success_phone,
  70. s.`status`,
  71. s.create_by,
  72. s.create_time,
  73. s.update_by,
  74. s.update_time,
  75. s.del_flag,
  76. l.name as ledger_name
  77. from kwp_settlement_logistics s
  78. inner join kwp_ledger_logistics l
  79. on s.l_ledger_id = l.id
  80. <where>
  81. <if test="settlementReq.status != null">
  82. and s.status = #{settlementReq.status}
  83. </if>
  84. <if test="settlementReq.startCreateTime != null and settlementReq.endCreateTime != null">
  85. and s.create_time between #{settlementReq.startCreateTime,jdbcType=TIMESTAMP}
  86. and #{settlementReq.endCreateTime,jdbcType=TIMESTAMP}
  87. </if>
  88. <if test="settlementReq.startReceiptTime != null and settlementReq.endReceiptTime != null">
  89. and s.receipt_time between #{settlementReq.startReceiptTime,jdbcType=TIMESTAMP}
  90. and #{settlementReq.endReceiptTime,jdbcType=TIMESTAMP}
  91. </if>
  92. <if test="settlementReq.keywords != null and settlementReq.keywords != ''">
  93. and (
  94. l.l_ledger_no like concat('%'
  95. , #{settlementReq.keywords}
  96. , '%')
  97. )
  98. </if>
  99. </where>
  100. order by update_time desc
  101. </select>
  102. </mapper>