| | |
| | | AND TO_DAYS(uc.`usc_create_time`) = TO_DAYS(NOW())
|
| | | </select>
|
| | |
|
| | | |
| | | <select id="getCouponListOld" resultMap="ResultVOMap">
|
| | | SELECT * FROM `yeshi_ec_user_system_coupon` uc
|
| | | LEFT JOIN `yeshi_ec_system_coupon` c ON uc.`usc_coupon_id` = c.`sc_id`
|
| | | WHERE uc.`usc_uid`= #{uid} AND DATEDIFF(NOW(), uc.`usc_end_time`)<![CDATA[<=]]> 30
|
| | | AND (uc.`usc_give` IS NULL OR uc.`usc_give` = 0) AND c.`sc_type` NOT IN ('freeCoupon','freeCouponBuy','freeCouponGive')
|
| | | ORDER BY uc.`usc_state`,uc.`usc_create_time` DESC
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | | |
| | | <select id="countCouponOld" resultType="java.lang.Long">
|
| | | SELECT IFNULL(count(uc.`usc_id`),0) FROM `yeshi_ec_user_system_coupon` uc
|
| | | LEFT JOIN `yeshi_ec_system_coupon` c ON uc.`usc_coupon_id` = c.`sc_id`
|
| | | WHERE uc.`usc_uid`= #{uid} AND DATEDIFF(NOW(), uc.`usc_end_time`)<![CDATA[<=]]> 30
|
| | | AND (uc.`usc_give` IS NULL OR uc.`usc_give` = 0) AND c.`sc_type` NOT IN ('freeCoupon','freeCouponBuy','freeCouponGive')
|
| | | </select>
|
| | | |
| | | |
| | | <select id="getUserCouponVOList" resultMap="ResultVOMap">
|
| | | SELECT * FROM `yeshi_ec_user_system_coupon` uc
|
| | | WHERE uc.`usc_uid`= #{uid} AND DATEDIFF(NOW(), uc.`usc_end_time`)<![CDATA[ <= ]]> 30
|
| | |
| | | </select>
|
| | |
|
| | | <select id="getIncludeExchange" resultMap="BaseResultMap">
|
| | | SELECT * FROM yeshi_ec_user_system_coupon |
| | | WHERE usc_state_activate = 1 AND usc_state = 1
|
| | | AND usc_uid = #{uid} AND usc_source in
|
| | | <foreach collection="list" item="item" open="(" close=")"
|
| | | separator=",">#{item}</foreach>
|
| | | SELECT * FROM `yeshi_ec_user_system_coupon` t
|
| | | LEFT JOIN `yeshi_ec_system_coupon` c ON t.`usc_coupon_id` = c.`sc_id`
|
| | | WHERE t.usc_state = 1 AND t.usc_state_activate = 1 AND t.usc_uid = #{uid}
|
| | | AND c.`sc_percent` = #{num} AND c.`sc_type`= #{type} |
| | | </select>
|
| | |
|
| | | <select id="getIncludeNotExchange" resultMap="BaseResultMap">
|
| | | SELECT * FROM yeshi_ec_user_system_coupon |
| | | WHERE usc_state_activate = 1 AND usc_state = 1
|
| | | AND usc_uid = #{uid} AND usc_source not in |
| | | <foreach collection="list" item="item" open="(" close=")"
|
| | | separator=",">#{item}</foreach>
|
| | | <select id="getIncludeNotExchange" resultMap="ResultVOMap">
|
| | | SELECT * FROM `yeshi_ec_user_system_coupon` t
|
| | | LEFT JOIN `yeshi_ec_system_coupon` c ON t.`usc_coupon_id` = c.`sc_id`
|
| | | WHERE t.usc_state = 1 AND t.usc_state_activate = 1 AND t.usc_uid = #{uid}
|
| | | AND c.`sc_percent` <![CDATA[<>]]> #{num} AND c.`sc_type`= #{type} |
| | | </select>
|
| | | </mapper>
|