统计可用的免单券数量-countUsableFreeCouponForBuy
| | |
| | | * @return
|
| | | */
|
| | | List<UserSystemCoupon> getCouponByUsingTimeOut(@Param("uid") Long uid,@Param("list") List<Long> list, @Param("number") Long number);
|
| | |
|
| | |
|
| | | /**
|
| | | * 统计有效券
|
| | | * @param uid
|
| | | * @param listCouponId
|
| | | * @return
|
| | | */
|
| | | long countUsableByUid(@Param("uid") Long uid, @Param("list") List<Long> listCouponId);
|
| | |
|
| | |
|
| | | } |
| | |
| | | separator=",">#{item}</foreach>
|
| | | ORDER BY uc.usc_state_activate desc, uc.`usc_create_time`
|
| | | </select>
|
| | | |
| | | <select id="countUsableByUid" resultType="java.lang.Long">
|
| | | SELECT IFNULL(count(cp.`usc_id`),0) FROM `yeshi_ec_user_system_coupon` cp
|
| | | WHERE cp.`usc_state` = 1 AND cp.usc_state_activate = 1
|
| | | AND cp.`usc_end_time` <![CDATA[>]]> NOW() AND cp.`usc_uid`= #{uid}
|
| | | AND cp.usc_coupon_id in
|
| | | <foreach collection="list" item="item" open="(" close=")"
|
| | | separator=",">#{item}</foreach>
|
| | | </select>
|
| | | |
| | |
|
| | | <select id="getCounponNowInvalid" resultMap="BaseResultMap">
|
| | | SELECT * FROM `yeshi_ec_user_system_coupon` cp
|
| | |
| | | return list;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public long countUsableFreeCouponForBuy (Long uid) {
|
| | | if (uid == null) |
| | | return 0;
|
| | | |
| | | List<SystemCoupon> couponList = systemCouponService.getGoodsCouponList();
|
| | | if (couponList == null || couponList.size() == 0)
|
| | | return 0;
|
| | | |
| | | List<Long> listCouponId = new ArrayList<Long>();
|
| | | for (SystemCoupon systemCoupon : couponList) {
|
| | | listCouponId.add(systemCoupon.getId());
|
| | | }
|
| | | |
| | | return userSystemCouponMapper.countUsableByUid(uid, listCouponId);
|
| | | }
|
| | | |
| | | |
| | | |
| | | @Transactional
|
| | | @Override
|
| | | public void useGoodsCoupon(Long uid, Long id, Long goodId, Integer sourceType) throws UserSystemCouponException, Exception {
|
| | |
| | | */
|
| | | public void sendBackGiveUser(Long uid);
|
| | |
|
| | | /**
|
| | | * 统计可使用的免单券
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countUsableFreeCouponForBuy(Long uid);
|
| | |
|
| | | }
|