DiscountProductMapper.xml 1017 B

123456789101112131415161718192021222324
  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="cn.iocoder.yudao.module.promotion.dal.mysql.discount.DiscountProductMapper">
  4. <select id="getMatchDiscountProductList" resultType="cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountProductDO">
  5. SELECT pdp.*
  6. FROM promotion_discount_product pdp
  7. LEFT JOIN promotion_discount_activity pda
  8. ON pdp.activity_id = pda.id
  9. <where>
  10. <if test="skuIds != null and skuIds.size > 0">
  11. AND pdp.sku_id in
  12. <foreach collection="skuIds" item="skuId" index="index" open="(" close=")" separator=",">
  13. #{skuId}
  14. </foreach>
  15. </if>
  16. AND pda.start_time &lt;= CURRENT_TIME AND pda.end_time &gt;= CURRENT_TIME
  17. AND pda.`status` = 20
  18. AND pda.deleted != 1
  19. </where>
  20. </select>
  21. </mapper>