KwpLedgerLogisticsMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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.KwpLedgerLogisticsMapper">
  4. <resultMap id="BaseResultMap" type="com.sckw.payment.model.KwpLedgerLogistics">
  5. <!--@mbg.generated-->
  6. <!--@Table kwp_ledger_logistics-->
  7. <id column="id" jdbcType="BIGINT" property="id" />
  8. <result column="ent_id" jdbcType="BIGINT" property="entId" />
  9. <result column="l_ledger_no" jdbcType="VARCHAR" property="lLedgerNo" />
  10. <result column="name" jdbcType="VARCHAR" property="name" />
  11. <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
  12. <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
  13. <result column="tax_rate" jdbcType="INTEGER" property="taxRate" />
  14. <result column="trading" jdbcType="INTEGER" property="trading" />
  15. <result column="unload_amount" jdbcType="DECIMAL" property="unloadAmount" />
  16. <result column="load_amount" jdbcType="DECIMAL" property="loadAmount" />
  17. <result column="deficit_amount" jdbcType="DECIMAL" property="deficitAmount" />
  18. <result column="lose_amount" jdbcType="DECIMAL" property="loseAmount" />
  19. <result column="total_price" jdbcType="DECIMAL" property="totalPrice" />
  20. <result column="settle_price" jdbcType="DECIMAL" property="settlePrice" />
  21. <result column="actual_price" jdbcType="DECIMAL" property="actualPrice" />
  22. <result column="audit_user" jdbcType="VARCHAR" property="auditUser" />
  23. <result column="audit_phone" jdbcType="VARCHAR" property="auditPhone" />
  24. <result column="url" jdbcType="VARCHAR" property="url" />
  25. <result column="generate_time" jdbcType="TIMESTAMP" property="generateTime" />
  26. <result column="remark" jdbcType="VARCHAR" property="remark" />
  27. <result column="status" jdbcType="INTEGER" property="status" />
  28. <result column="create_by" jdbcType="BIGINT" property="createBy" />
  29. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  30. <result column="update_by" jdbcType="BIGINT" property="updateBy" />
  31. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  32. <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
  33. </resultMap>
  34. <sql id="Base_Column_List">
  35. <!--@mbg.generated-->
  36. id, ent_id, l_ledger_no, `name`, start_time, end_time, tax_rate, trading, unload_amount,
  37. load_amount, deficit_amount, lose_amount, total_price, settle_price, actual_price,
  38. audit_user, audit_phone, url, generate_time, remark, `status`, create_by, create_time,
  39. update_by, update_time, del_flag
  40. </sql>
  41. <select id="pageSelect" resultType="com.sckw.payment.model.dto.LedgerLogisticsDto">
  42. select kll.id,
  43. kll.l_ledger_no lLedgerNo,
  44. kll.name,
  45. kll.start_time startTime,
  46. kll.end_time endTime,
  47. kll.tax_rate taxRate,
  48. kll.trading,
  49. kll.unload_amount unloadAmount,
  50. kll.load_amount loadAmount,
  51. kll.deficit_amount deficitAmount,
  52. kll.lose_amount loseAmount,
  53. kll.total_price totalPrice,
  54. kll.settle_price settlePrice,
  55. kll.actual_price actualPrice,
  56. kll.url,
  57. kll.generate_time generateTime,
  58. kll.remark,
  59. kll.status,
  60. count(kllo.id) orderCount
  61. from kwp_ledger_logistics kll
  62. inner join kwp_ledger_logistics_order kllo on kll.id = kllo.l_ledger_id
  63. <where>
  64. <choose>
  65. <when test="ids != null and ids.size() != 0">
  66. kll.id in
  67. <foreach close=")" collection="ids" item="id" open="" separator=",">
  68. #{id,jdbcType=BIGINT}
  69. </foreach>
  70. </when>
  71. <otherwise>
  72. kll.del_flag = 0
  73. and kllo.del_flag = 0
  74. <if test="logisticsReq.status != null">
  75. and kll.status = #{logisticsReq.status}
  76. </if>
  77. <if test="logisticsReq.trading != null">
  78. and kll.trading = #{logisticsReq.trading,jdbcType=INTEGER}
  79. </if>
  80. <if test="logisticsReq.startCreateTime != null and logisticsReq.endCreateTime != null">
  81. and kll.generate_time between #{logisticsReq.startCreateTime,jdbcType=TIMESTAMP}
  82. and #{logisticsReq.endCreateTime,jdbcType=TIMESTAMP}
  83. </if>
  84. <if test="logisticsReq.keywords != null and logisticsReq.keywords != ''">
  85. and (
  86. kll.l_ledger_no like concat('%'
  87. , #{logisticsReq.keywords}
  88. , '%')
  89. or kll.check_user like concat('%'
  90. , #{logisticsReq.keywords}
  91. , '%')
  92. <if test="ids != null and ids.size() != 0">
  93. or kll.check_ent_id in
  94. <foreach close=")" collection="ids" item="item" open="(" separator=",">
  95. #{item,jdbcType=BIGINT}
  96. </foreach>
  97. </if>
  98. )
  99. </if>
  100. </otherwise>
  101. </choose>
  102. </where>
  103. group by kll.id, kll.check_ent_id, kll.carrier_ent_id, kll.l_ledger_no, kll.name, kll.start_time, kll.end_time,
  104. kll.tax_rate, kll.trading, kll.unload_amount, kll.load_amount, kll.deficit_amount, kll.lose_amount,
  105. kll.total_price, kll.settle_price, kll.actual_price, kll.check_phone, kll.check_user,
  106. kll.carrier_phone, kll.carrier_user, kll.url, kll.generate_time, kll.remark, kll.status
  107. order by kll.generate_time desc
  108. </select>
  109. </mapper>