admin
2020-05-20 98b1a0affd69bbe63223c21fdd2c404e8bedfccb
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponMapper.java
@@ -1,60 +1,127 @@
package com.yeshi.fanli.dao.mybatis.user;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.vo.user.UserSystemCouponVO;
public interface UserSystemCouponMapper extends BaseMapper<UserSystemCoupon> {
   List<UserSystemCoupon> getUserCouponList(@Param("start") long start, @Param("count") int count,
         @Param("uid") Long uid);
   List<UserSystemCouponVO> getUserCouponVOList(@Param("start") long start, @Param("count") int count,
         @Param("uid") Long uid);
   long countUserCouponList(@Param("uid") Long uid);
   /**
    *   根据券id查询可使用券
    * @param uid
    * @param typeList
    * @return
    */
   List<UserSystemCouponVO> getEnableListByCouponId(@Param("uid") Long uid, @Param("activated") Integer activated,
         @Param("list") List<Long> listCouponId);
   /**
    * 根据来源查询订单
    * @param uid
    * @param source
    * @return
    */
   List<UserSystemCoupon> getUserCouponBySource(@Param("uid") Long uid, @Param("source") String source);
   /**
    * 获取已经过期但状态未改变的券
    * @param uid
    * @return
    */
   List<UserSystemCoupon> getCounponNowInvalid(@Param("uid") Long uid);
   /**
    * 根据状态查询券
    * @param uid
    * @param source
    * @return
    */
   List<UserSystemCoupon> getCouponByState(@Param("uid") Long uid, @Param("state") String state);
   /**
    * 查询没有激活的券
    * @param couponId
    */
   List<UserSystemCoupon> getCouponByTypeAndNotActivated(@Param("uid") Long uid, @Param("couponId") Long couponId);
package com.yeshi.fanli.dao.mybatis.user;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.vo.user.UserSystemCouponVO;
public interface UserSystemCouponMapper extends BaseMapper<UserSystemCoupon> {
   List<UserSystemCoupon> getUserCouponList(@Param("start") long start, @Param("count") int count,
         @Param("uid") Long uid);
   List<UserSystemCouponVO> getCouponListOld(@Param("start") long start, @Param("count") int count,
         @Param("uid") Long uid);
   long countCouponOld(@Param("uid") Long uid);
   List<UserSystemCouponVO> getUserCouponVOList(@Param("start") long start, @Param("count") int count,
         @Param("uid") Long uid);
   long countUserCouponList(@Param("uid") Long uid);
   /**
    *   根据券id查询可使用券
    * @param uid
    * @param typeList
    * @return
    */
   List<UserSystemCouponVO> getEnableListByCouponId(@Param("uid") Long uid, @Param("activated") Integer activated,
         @Param("list") List<Long> listCouponId);
   /**
    * 根据来源查询订单
    * @param uid
    * @param source
    * @return
    */
   List<UserSystemCoupon> getUserCouponBySource(@Param("uid") Long uid, @Param("source") String source);
   /**
    * 根据来源查询订单
    * @param uid
    * @param source
    * @return
    */
   int countTodatyUserCouponBySource(@Param("uid") Long uid, @Param("source") String source);
   /**
    * 获取已经过期但状态未改变的券
    * @param uid
    * @return
    */
   List<UserSystemCoupon> getCounponNowInvalid(@Param("count")int count);
   /**
    * 获取已经过期但状态未改变的券
    * @param uid
    * @return
    */
   List<UserSystemCoupon> getCounponNowInvalidByUid(@Param("uid")Long uid);
   /**
    * 根据状态查询券
    * @param uid
    * @param source
    * @return
    */
   List<UserSystemCoupon> getCouponByState(@Param("uid") Long uid, @Param("state") String state);
   /**
    * 查询没有激活的券
    * @param couponId
    */
   List<UserSystemCoupon> getCouponByTypeAndNotActivated(@Param("uid") Long uid, @Param("couponId") Long couponId);
   /**
    *  根据类型查询有效券
    * @param uid
    * @param source
    * @return
    */
   List<UserSystemCouponVO> getValidByUidAndType(@Param("uid") Long uid, @Param("type") String type);
   /**
    * 查询正在使用中 超过时间仍未匹配到订单记录
    * @param uid
    * @param seconds
    * @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);
   /**
    *  查询免券
    * @param uid
    * @param source
    * @return
    */
   List<UserSystemCoupon> getFreeCouponByType(@Param("uid") Long uid, @Param("type") String type);
   /**
    *  查询需要激活的免券
    * @param uid
    * @param source
    * @return
    */
   UserSystemCoupon getNeedActivateCouponByType(@Param("uid") Long uid, @Param("type") String type);
}