QzStoreCampMinusMapper.xml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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.kmall.schedule.dao.QzStoreCampMinusMapper">
  4. <select id="queryCampMinusListByPasting" resultType="map">
  5. select
  6. `camp_minus_id` 'campMinusId', a.store_topic_id 'storeTopicId'
  7. from mk_store_camp_minus a
  8. where 1=1 AND a.camp_end_time <![CDATA[ < ]]> now() AND a.is_valid = 0 and a.is_past = 0
  9. </select>
  10. <select id="queryCampMinusListByPastNotStart" resultType="map">
  11. select
  12. `camp_minus_id` 'campMinusId', a.store_topic_id 'storeTopicId'
  13. from mk_store_camp_minus a
  14. where 1=1 AND a.camp_beg_time <![CDATA[ <= ]]> now() AND a.is_valid = 0 and a.is_past = 2
  15. </select>
  16. <update id="updateStoreCampMinus" parameterType="map">
  17. update mk_store_camp_minus set
  18. <if test="isValid != null and isValid != ''">
  19. is_valid = 1,
  20. </if>
  21. <if test="isPast != null and isPast != ''">
  22. is_past = #{isPast},
  23. </if>
  24. mod_time = now() where camp_minus_id = #{campMinusId}
  25. </update>
  26. <select id="selectAdIdByTopicId" resultType="map">
  27. select
  28. id 'adId'
  29. from mall_ad
  30. where store_topic_id = #{storeTopicId}
  31. </select>
  32. <update id="updateAd" parameterType="map">
  33. update mall_ad set enabled = #{enabled} where id = #{adId}
  34. </update>
  35. <update id="updateStoreTopic" parameterType="map">
  36. update mall_store_topic set is_valid = 1,mod_time = now() where id = #{storeTopicId}
  37. </update>
  38. </mapper>