Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

438 lignes
20 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.WxCouponChannelMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCouponChannel">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  9. <result column="type" jdbcType="INTEGER" property="type" />
  10. <result column="title" jdbcType="VARCHAR" property="title" />
  11. <result column="target_ad" jdbcType="INTEGER" property="targetAd" />
  12. <result column="business" jdbcType="INTEGER" property="business" />
  13. <result column="sub_business" jdbcType="INTEGER" property="subBusiness" />
  14. <result column="show_begin_time" jdbcType="TIMESTAMP" property="showBeginTime" />
  15. <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime" />
  16. <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
  17. <result column="status" jdbcType="INTEGER" property="status" />
  18. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  19. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  20. <result column="sub_target_id" jdbcType="BIGINT" property="subTargetId" />
  21. <result column="qr_code" jdbcType="VARCHAR" property="qrCode"/>
  22. <result column="tt_qr_code" jdbcType="VARCHAR" property="ttQrCode"/>
  23. </resultMap>
  24. <sql id="allColumns">
  25. distinct cc.`id`,cc.`tenant_id`,cc.`parent_tenant_id`,cc.`coupon_id`,cc.`coupon_status`,cc.`type`,cc.`title`,cc.`target_ad`,cc.`business`,cc.`sub_business`,cc.`show_begin_time`,cc.`begin_time`,cc.`end_time`,cc.`status`,cc.`create_date`,cc.`update_date`,cc.`sub_target_id`,cc.qr_code,cc.tt_qr_code
  26. </sql>
  27. <sql id="dynamicWhereConditions">
  28. where 1=1
  29. <if test="null != couponStatus">
  30. and c.status = #{couponStatus}
  31. </if>
  32. <if test="null != status ">
  33. and cc.status = #{status}
  34. </if>
  35. <if test="null == status ">
  36. and cc.status = 0
  37. </if>
  38. <if test=" null != id ">
  39. and cc.`id` = #{id}
  40. </if>
  41. <if test=" null != tenantId and '' != tenantId">
  42. and cc.`tenant_id` = #{tenantId}
  43. </if>
  44. <if test=" null != parentTenantId and '' != parentTenantId">
  45. and cc.`parent_tenant_id` = #{parentTenantId}
  46. </if>
  47. <if test=" null != couponId ">
  48. and cc.`coupon_id` = #{couponId}
  49. </if>
  50. <if test=" null != type ">
  51. and cc.`type` = #{type}
  52. </if>
  53. <if test=" null != title and ''!= title">
  54. and cc.`title` like concat('%', #{title},'%')
  55. </if>
  56. <if test=" null != targetAd ">
  57. and cc.`target_ad` = #{targetAd}
  58. </if>
  59. <if test=" null != business ">
  60. and cc.`business` = #{business}
  61. </if>
  62. <if test=" null != subBusiness ">
  63. and cc.`sub_business` = #{subBusiness}
  64. </if>
  65. <if test=" null != showBeginTime ">
  66. and cc.`show_begin_time` &lt;= #{showBeginTime}
  67. </if>
  68. <if test=" null != startdate and null!=enddate">
  69. and cc.`create_date` between #{startdate} and #{enddate}
  70. </if>
  71. <if test=" null != status ">
  72. and cc.`status` = #{status}
  73. </if>
  74. <if test=" null != createDate ">
  75. and cc.`create_date` = #{createDate}
  76. </if>
  77. <if test=" null != updateDate ">
  78. and cc.`update_date` = #{updateDate}
  79. </if>
  80. <if test=" null != subTargetId ">
  81. and cc.`sub_target_id` = #{subTargetId}
  82. </if>
  83. <if test=" null != supportTransfer ">
  84. and c.`support_transfer` = #{supportTransfer}
  85. </if>
  86. <if test=" null != userCredit ">
  87. and c.`credit_price` &lt;= #{userCredit}
  88. </if>
  89. <if test=" null != sourceType ">
  90. and c.`source_type` = #{sourceType}
  91. </if>
  92. <if test=" null != merchantId ">
  93. and cm.`merchant_id` = #{merchantId}
  94. </if>
  95. <if test=" null != ids ">
  96. and cc.id in
  97. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  98. #{idItem}
  99. </foreach>
  100. </if>
  101. <if test=" null != couponIds ">
  102. and cc.coupon_id in
  103. <foreach collection="couponIds" index="index" item="couponIdsItem" open="(" separator="," close=")">
  104. #{couponIdsItem}
  105. </foreach>
  106. </if>
  107. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  108. </sql>
  109. <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  110. select <include refid="allColumns" /> from wx_coupon_channel cc where id = #{id} and tenant_id = #{tenantId}
  111. </select>
  112. <select id="findList" parameterType="com.iformall.domain.po.WxCouponChannel" resultMap="BaseResultMap">
  113. select <include refid="allColumns" /> from wx_coupon_channel cc
  114. <include refid="dynamicWhereConditions" />
  115. </select>
  116. <update id="updateStatusByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel">
  117. update wx_coupon_channel
  118. set status=#{status}, update_date=#{updateDate}
  119. where coupon_id=#{couponId}
  120. <if test=" null != tenantId and '' != tenantId">
  121. and `tenant_id` = #{tenantId}
  122. </if>
  123. <if test=" null != parentTenantId and '' != parentTenantId">
  124. and `parent_tenant_id` = #{parentTenantId}
  125. </if>
  126. </update>
  127. <update id="updateEndTimeByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel">
  128. update wx_coupon_channel
  129. set end_time = #{endTime}
  130. where coupon_id=#{couponId}
  131. <if test=" null != tenantId and '' != tenantId">
  132. and `tenant_id` = #{tenantId}
  133. </if>
  134. <if test=" null != parentTenantId and '' != parentTenantId">
  135. and `parent_tenant_id` = #{parentTenantId}
  136. </if>
  137. </update>
  138. <sql id="CouponChannelVoColumns">
  139. <include refid="allColumns" />,
  140. c.remain_inventory,c.inventory,c.cover_img,c.sub_title,c.sale_price,c.detail,
  141. c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.use_limit_rule,c.use_limit_quantity,c.send_type,c.support_transfer,c.press_limit_num,c.auto_refund,c.conditions,
  142. c.valid_type,c.valid_start_date,c.valid_end_date,c.pick_start_date,c.pick_end_date,c.valid_days,c.credit_price,c.content_type,c.source_type
  143. </sql>
  144. <resultMap id="CouponChannelVoMap" type="com.iformall.domain.vo.WxCouponChannelVo">
  145. <id column="id" jdbcType="BIGINT" property="id" />
  146. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  147. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  148. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  149. <result column="type" jdbcType="INTEGER" property="type" />
  150. <result column="title" jdbcType="VARCHAR" property="title" />
  151. <result column="target_ad" jdbcType="INTEGER" property="targetAd" />
  152. <result column="business" jdbcType="VARCHAR" property="business" />
  153. <result column="show_begin_time" jdbcType="TIMESTAMP" property="showBeginTime" />
  154. <result column="sub_business" jdbcType="INTEGER" property="subBusiness" />
  155. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  156. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  157. <result column="sub_target_id" jdbcType="BIGINT" property="subTargetId" />
  158. <result column="remain_inventory" jdbcType="INTEGER" property="remainInventory"/>
  159. <result column="inventory" jdbcType="INTEGER" property="inventory"/>
  160. <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
  161. <result column="title" jdbcType="VARCHAR" property="title"/>
  162. <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
  163. <result column="sale_price" jdbcType="INTEGER" property="salePrice"/>
  164. <result column="use_price" jdbcType="INTEGER" property="usePrice"/>
  165. <result column="price" jdbcType="INTEGER" property="price"/>
  166. <result column="tail_price" jdbcType="INTEGER" property="tailPrice"/>
  167. <result column="orig_price" jdbcType="INTEGER" property="origPrice"/>
  168. <result column="unit" jdbcType="INTEGER" property="unit"/>
  169. <result column="detail" jdbcType="VARCHAR" property="detail"/>
  170. <result column="use_limit_rule" jdbcType="INTEGER" property="useLimitRule" />
  171. <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity"/>
  172. <result column="send_type" jdbcType="INTEGER" property="sendType"/>
  173. <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/>
  174. <result column="press_limit_num" jdbcType="INTEGER" property="pressLimitNum"/>
  175. <result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/>
  176. <result column="valid_type" jdbcType="INTEGER" property="validType"/>
  177. <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/>
  178. <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/>
  179. <result column="pick_start_date" jdbcType="TIMESTAMP" property="pickStartDate"/>
  180. <result column="pick_end_date" jdbcType="TIMESTAMP" property="pickEndDate"/>
  181. <result column="valid_days" jdbcType="INTEGER" property="validDays"/>
  182. <result column="qr_code" jdbcType="VARCHAR" property="qrCode"/>
  183. <result column="tt_qr_code" jdbcType="VARCHAR" property="ttQrCode"/>
  184. <result column="conditions" jdbcType="VARCHAR" property="conditions" />
  185. <result column="content_type" jdbcType="INTEGER" property="contentType"/>
  186. <result column="source_type" jdbcType="INTEGER" property="sourceType"/>
  187. <!--<collection column="{productId=coupon_id,tenantId=tenant_id}" property="merchantVoList"
  188. ofType="com.iformall.domain.vo.WxMerchantVo"
  189. javaType="java.util.List"
  190. select="com.iformall.mapper.WxCouponMerchantMapper.findMerchantNameList" >
  191. </collection>-->
  192. </resultMap>
  193. <select id="findVoList" parameterType="com.iformall.domain.po.WxCouponChannel" resultMap="CouponChannelVoMap">
  194. select <include refid="CouponChannelVoColumns" />
  195. from wx_coupon_channel cc
  196. left join wx_coupon c on cc.coupon_id = c.id
  197. left join wx_coupon_merchant cm on c.id = cm.product_id and cm.status = 0
  198. <include refid="dynamicWhereConditions" />
  199. </select>
  200. <select id="findVoListByMerchant" parameterType="com.iformall.domain.po.WxCouponChannel" resultMap="CouponChannelVoMap">
  201. select <include refid="CouponChannelVoColumns" />
  202. from wx_coupon_channel cc
  203. join wx_coupon_merchant cm
  204. on cm.product_id = cc.coupon_id
  205. and cm.status = 0
  206. <if test="merchantId != null">
  207. and cm.merchant_id=#{merchantId}
  208. </if>
  209. <if test=" null != merchantIds ">
  210. and cm.merchant_id in
  211. <foreach collection="merchantIds" index="index" item="item" open="(" separator="," close=")">
  212. #{item}
  213. </foreach>
  214. </if>
  215. left join wx_coupon c on cc.coupon_id = c.id
  216. left join wx_merchant mer on cm.merchant_id = mer.id
  217. where cc.`target_ad` in (1,2,5,6,7)
  218. <if test="status != null">
  219. and cc.status=#{status}
  220. </if>
  221. <if test=" null != tenantId and '' != tenantId">
  222. and cc.`tenant_id` = #{tenantId}
  223. </if>
  224. <if test=" null != parentTenantId and '' != parentTenantId">
  225. and cc.`parent_tenant_id` = #{parentTenantId}
  226. </if>
  227. <if test=" null != showBeginTime ">
  228. and cc.`show_begin_time` &lt;= #{showBeginTime}
  229. </if>
  230. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  231. </select>
  232. <sql id="WxCouponCVoColumn">
  233. cc.id,cc.coupon_id,cc.target_ad,cc.begin_time,cc.end_time,
  234. c.tenant_id,c.parent_tenant_id,c.type,c.cover_img,c.cover_picture,c.detail_picture,c.title,c.sub_title,c.sale_price,c.use_price,
  235. c.use_limit_rule,c.use_limit_quantity,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.pick_start_date,c.pick_end_date,
  236. c.valid_days,c.detail,c.price,c.tail_price,c.orig_price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,
  237. c.create_date,c.update_date,c.business,c.sub_business,c.support_transfer,c.press_limit_num, c.auto_refund,c.credit_price,c.conditions,c.content_type,
  238. cc.qr_code,cc.tt_qr_code
  239. </sql>
  240. <sql id="CVoStatusColumn">
  241. cc.id,cc.coupon_id,c.remain_inventory,c.status
  242. </sql>
  243. <resultMap id="WxCouponCVoMap" type="com.iformall.domain.vo.WxCouponCVo">
  244. <id column="id" jdbcType="BIGINT" property="id"/>
  245. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  246. <result column="type" jdbcType="INTEGER" property="type" />
  247. <result column="target_ad" jdbcType="INTEGER" property="targetAd" />
  248. <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime"/>
  249. <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
  250. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  251. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  252. <result column="type" jdbcType="INTEGER" property="type"/>
  253. <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
  254. <result column="cover_picture" jdbcType="VARCHAR" property="coverPicture"/>
  255. <result column="detail_picture" jdbcType="VARCHAR" property="detailPicture"/>
  256. <result column="title" jdbcType="VARCHAR" property="title"/>
  257. <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
  258. <result column="sale_price" jdbcType="INTEGER" property="salePrice"/>
  259. <result column="use_price" jdbcType="INTEGER" property="usePrice"/>
  260. <result column="use_limit_rule" jdbcType="INTEGER" property="useLimitRule" />
  261. <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity"/>
  262. <result column="send_type" jdbcType="INTEGER" property="sendType"/>
  263. <result column="valid_type" jdbcType="INTEGER" property="validType"/>
  264. <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/>
  265. <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/>
  266. <result column="pick_start_date" jdbcType="TIMESTAMP" property="pickStartDate"/>
  267. <result column="pick_end_date" jdbcType="TIMESTAMP" property="pickEndDate"/>
  268. <result column="valid_days" jdbcType="INTEGER" property="validDays"/>
  269. <result column="detail" jdbcType="VARCHAR" property="detail"/>
  270. <result column="price" jdbcType="INTEGER" property="price"/>
  271. <result column="tail_price" jdbcType="INTEGER" property="tailPrice"/>
  272. <result column="orig_price" jdbcType="INTEGER" property="origPrice"/>
  273. <result column="unit" jdbcType="INTEGER" property="unit"/>
  274. <result column="remain_inventory" jdbcType="INTEGER" property="remainInventory"/>
  275. <result column="inventory" jdbcType="INTEGER" property="inventory"/>
  276. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  277. <result column="status" jdbcType="INTEGER" property="status"/>
  278. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  279. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  280. <result column="business" jdbcType="INTEGER" property="business"/>
  281. <result column="subBusiness" jdbcType="INTEGER" property="subBusiness"/>
  282. <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/>
  283. <result column="press_limit_num" jdbcType="INTEGER" property="pressLimitNum"/>
  284. <result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/>
  285. <result column="qr_code" jdbcType="VARCHAR" property="qrCode"/>
  286. <result column="tt_qr_code" jdbcType="VARCHAR" property="ttQrCode"/>
  287. <result column="conditions" jdbcType="VARCHAR" property="conditions" />
  288. <result column="content_type" jdbcType="INTEGER" property="contentType"/>
  289. <collection column="{productId=coupon_id,tenantId=tenant_id}" property="merchantVoList"
  290. ofType="com.iformall.domain.vo.WxMerchantVo"
  291. javaType="java.util.List"
  292. select="com.iformall.mapper.WxCouponMerchantMapper.findMerchantVoList" >
  293. </collection>
  294. </resultMap>
  295. <resultMap id="WxCouponCVoMapL" type="com.iformall.domain.vo.WxCouponCVo">
  296. <id column="id" jdbcType="BIGINT" property="id"/>
  297. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  298. <result column="type" jdbcType="INTEGER" property="type" />
  299. <result column="target_ad" jdbcType="INTEGER" property="targetAd" />
  300. <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime"/>
  301. <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
  302. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  303. <result column="type" jdbcType="INTEGER" property="type"/>
  304. <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
  305. <result column="cover_picture" jdbcType="VARCHAR" property="coverPicture"/>
  306. <result column="detail_picture" jdbcType="VARCHAR" property="detailPicture"/>
  307. <result column="title" jdbcType="VARCHAR" property="title"/>
  308. <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
  309. <result column="sale_price" jdbcType="INTEGER" property="salePrice"/>
  310. <result column="use_price" jdbcType="INTEGER" property="usePrice"/>
  311. <result column="use_limit_rule" jdbcType="INTEGER" property="useLimitRule" />
  312. <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity"/>
  313. <result column="send_type" jdbcType="INTEGER" property="sendType"/>
  314. <result column="valid_type" jdbcType="INTEGER" property="validType"/>
  315. <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/>
  316. <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/>
  317. <result column="valid_days" jdbcType="INTEGER" property="validDays"/>
  318. <result column="detail" jdbcType="VARCHAR" property="detail"/>
  319. <result column="price" jdbcType="INTEGER" property="price"/>
  320. <result column="unit" jdbcType="INTEGER" property="unit"/>
  321. <result column="remain_inventory" jdbcType="INTEGER" property="remainInventory"/>
  322. <result column="inventory" jdbcType="INTEGER" property="inventory"/>
  323. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  324. <result column="status" jdbcType="INTEGER" property="status"/>
  325. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  326. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  327. <result column="business" jdbcType="INTEGER" property="business"/>
  328. <result column="subBusiness" jdbcType="INTEGER" property="subBusiness"/>
  329. <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/>
  330. <result column="press_limit_num" jdbcType="INTEGER" property="pressLimitNum"/>
  331. <result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/>
  332. <result column="qr_code" jdbcType="VARCHAR" property="qrCode"/>
  333. <result column="tt_qr_code" jdbcType="VARCHAR" property="ttQrCode"/>
  334. <result column="conditions" jdbcType="VARCHAR" property="conditions" />
  335. <result column="content_type" jdbcType="INTEGER" property="contentType"/>
  336. </resultMap>
  337. <select id="findVoDetail" parameterType="java.util.HashMap" resultMap="WxCouponCVoMap">
  338. select
  339. <include refid="WxCouponCVoColumn"/>
  340. from wx_coupon_channel cc
  341. left join wx_coupon c on cc.coupon_id = c.id
  342. where cc.id = #{id} and cc.tenant_id = #{tenantId}
  343. </select>
  344. <select id="findVoStatusDetail" parameterType="java.util.HashMap" resultMap="WxCouponCVoMapL">
  345. select
  346. <include refid="CVoStatusColumn"/>
  347. from wx_coupon c, wx_coupon_channel cc
  348. where cc.coupon_id = c.id and cc.id = #{id} and cc.tenant_id = #{tenantId}
  349. </select>
  350. <select id="countCoupon" parameterType="com.iformall.domain.po.WxCouponChannel" resultType="java.lang.Integer">
  351. select count(distinct coupon_id) from wx_coupon_channel cc
  352. <include refid="dynamicWhereConditions" />
  353. </select>
  354. <select id="countCouponChannel" parameterType="com.iformall.domain.po.WxCouponChannel" resultType="java.lang.Integer">
  355. select count(*) from wx_coupon_channel cc
  356. <include refid="dynamicWhereConditions" />
  357. </select>
  358. <update id="offExpiriedCouponChannelByEndTime" parameterType="String">
  359. update wx_coupon_channel SET status = 1, update_date = now()
  360. where status = 0 and tenant_id = #{tenantId} and end_time &lt; now()
  361. </update>
  362. <update id="offExpiriedCouponChannelByValidDate">
  363. update wx_coupon_channel cc, wx_coupon c SET cc.status = 1, cc.update_date = now()
  364. where cc.status = 0 and cc.tenant_id = #{tenantId} and cc.coupon_id = c.id and c.valid_type = 1 and c.valid_end_date &lt; now()
  365. </update>
  366. <update id="offExpiriedCouponChannelByCouponStatus">
  367. update wx_coupon_channel cc, wx_coupon c SET cc.status = 1, cc.update_date = now()
  368. where cc.status = 0 and cc.tenant_id = #{tenantId} and cc.coupon_id = c.id and c.status = 1
  369. </update>
  370. <update id="offExpiriedCouponChannel2ByEndTime">
  371. update wx_coupon_channel SET status = 1, update_date = now()
  372. where status = 0 and tenant_id = #{tenantId} and target_ad = 2 and end_time &lt; now()
  373. </update>
  374. <delete id="delByTopic" parameterType="com.iformall.domain.po.WxTopic">
  375. update wx_coupon_channel set status = 1 where sub_target_id = #{id}
  376. </delete>
  377. <select id="findQrcodeEmptyList" resultType="com.iformall.domain.po.WxCouponChannel">
  378. select * from wx_coupon_channel where (qr_code is null or tt_qr_code is null)
  379. </select>
  380. <update id="cardDefer">
  381. update wx_coupon_channel set end_time = #{endTime} where coupon_id = #{couponId} and tenant_id = #{tenantId} and target_ad = 5 and type = 100
  382. </update>
  383. </mapper>