Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

142 строки
5.6 KiB

  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.iformall.mapper.WxCouponCarMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCouponCar">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
  7. <result column="park_id" jdbcType="BIGINT" property="parkId" />
  8. <result column="vendor_type" jdbcType="INTEGER" property="vendorType" />
  9. <result column="vendor_params" jdbcType="VARCHAR" property="vendorParams" />
  10. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  11. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  12. </resultMap>
  13. <sql id="allColumns">
  14. `id`,`tenant_id`,`park_id`,`vendor_type`,`vendor_params`,`create_date`,`update_date`
  15. </sql>
  16. <sql id="dynamicWhereConditions">
  17. where 1 = 1
  18. <if test=" null != id ">
  19. and `id` = #{id}
  20. </if>
  21. <if test=" null != tenantId ">
  22. and `tenant_id` = #{tenantId}
  23. </if>
  24. <if test=" null != parkId ">
  25. and `park_id` = #{parkId}
  26. </if>
  27. <if test=" null != vendorType ">
  28. and `vendor_type` = #{vendorType}
  29. </if>
  30. <if test=" null != vendorParams ">
  31. and `vendor_params` like concat('%', #{vendorParams},'%')
  32. </if>
  33. <if test=" null != createDate ">
  34. and `create_date` = #{createDate}
  35. </if>
  36. <if test=" null != updateDate ">
  37. and `update_date` = #{updateDate}
  38. </if>
  39. <if test=" null != ids ">
  40. and id in
  41. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  42. #{idItem}
  43. </foreach>
  44. </if>
  45. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  46. </sql>
  47. <select id="findList" parameterType="com.iformall.domain.po.WxCouponCar" resultMap="BaseResultMap">
  48. select <include refid="allColumns" /> from wx_coupon_car
  49. <include refid="dynamicWhereConditions" />
  50. </select>
  51. <select id="findTemplateAmtCount" parameterType="Long" resultType="Integer">
  52. select IFNULL(sum(c.inventory),0) as count
  53. from wx_coupon_car car, wx_coupon c
  54. where car.id = c.id
  55. and c.status = 0
  56. and json_extract(car.vendor_params,'$.id') = ${value}
  57. </select>
  58. <select id="findAmtCountForCouponOrderTakeOff" parameterType="Long" resultType="Integer">
  59. select count(co.id) as id_count
  60. from wx_coupon_order co, wx_coupon c, wx_coupon_car car
  61. where 1=1
  62. and c.id = co.coupon_id
  63. and (co.coupon_order_status = 0 or co.coupon_order_status = 1)
  64. and c.status = 1
  65. and car.id = c.id
  66. and json_extract(car.vendor_params,'$.id') = ${value}
  67. </select>
  68. <select id="findTemplateAvailCount" parameterType="Long" resultType="Integer">
  69. select IFNULL(sum(c.remain_inventory),0) as count
  70. from wx_coupon_car car, wx_coupon c
  71. where car.id = c.id
  72. and c.status = 0
  73. and json_extract(vendor_params,'$.id') = ${value}
  74. </select>
  75. <resultMap id="CouponCarMap" type="com.iformall.domain.vo.WxCouponCarVo">
  76. <id column="id" jdbcType="BIGINT" property="id" />
  77. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  78. <result column="type" jdbcType="INTEGER" property="type" />
  79. <result column="cover_img" jdbcType="VARCHAR" property="coverImg" />
  80. <result column="title" jdbcType="VARCHAR" property="title" />
  81. <result column="sub_title" jdbcType="VARCHAR" property="subTitle" />
  82. <result column="sale_price" jdbcType="INTEGER" property="salePrice" />
  83. <result column="use_price" jdbcType="INTEGER" property="usePrice" />
  84. <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity" />
  85. <result column="send_type" jdbcType="INTEGER" property="sendType" />
  86. <result column="valid_type" jdbcType="INTEGER" property="validType" />
  87. <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate" />
  88. <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate" />
  89. <result column="valid_days" jdbcType="INTEGER" property="validDays" />
  90. <result column="detail" jdbcType="VARCHAR" property="detail" />
  91. <result column="price" jdbcType="INTEGER" property="price" />
  92. <result column="unit" jdbcType="INTEGER" property="unit" />
  93. <result column="remain_inventory" jdbcType="INTEGER" property="remainInventory" />
  94. <result column="inventory" jdbcType="INTEGER" property="inventory" />
  95. <result column="remark" jdbcType="VARCHAR" property="remark" />
  96. <result column="status" jdbcType="INTEGER" property="status" />
  97. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  98. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  99. <result column="business" jdbcType="VARCHAR" property="business" />
  100. <result column="credit_price" jdbcType="INTEGER" property="creditPrice" />
  101. <result column="vendor_type" jdbcType="INTEGER" property="vendorType" />
  102. <result column="vendor_params" jdbcType="VARCHAR" property="vendorParams" />
  103. </resultMap>
  104. <sql id="CouponCarColumns">
  105. c.id,c.tenant_id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_quantity,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business,
  106. car.vendor_type, car.vendor_params,c.credit_price
  107. </sql>
  108. <select id="findVoDetail" parameterType="java.lang.Long" resultMap="CouponCarMap">
  109. select <include refid="CouponCarColumns" />
  110. from
  111. wx_coupon c,wx_coupon_car car
  112. where c.id = car.id
  113. and c.id = #{id}
  114. </select>
  115. </mapper>