package com.bonus.core.marketing.coupon.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bonus.core.autth.config.LeNiuDataPermission;
import com.bonus.core.autth.enums.DataPermissionTypeEnum;
import com.bonus.core.marketing.coupon.model.MktCoupon;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import java.util.Set;

@Mapper
public interface MktCouponMapper extends BaseMapper<MktCoupon> {
//   @LeNiuDataPermission(
//      alias = "t2",
//      permissionType = DataPermissionTypeEnum.PERMISSION_ORG
//   )
//   Page<MktCouponVO> pageCoupon(@Param("page") Page page, @Param("param") MktCouponParam param);
//
//   @Select({"SELECT coupon_id FROM mkt_coupon WHERE coupon_state = #{couponState} AND #{localDate} BETWEEN effect_date_start AND effect_date_end "})
//   List<Long> listCouponEffectByState(@Param("couponState") Integer couponState, @Param("localDate") LocalDate localDate);
//
//   @Select({"SELECT coupon_id FROM mkt_coupon WHERE coupon_state = #{couponState}  AND effect_date_end < #{localDate}"})
//   List<Long> listCouponIdOverdueByState(@Param("couponState") Integer couponState, @Param("localDate") LocalDate localDate);
//
//   @Select({"SELECT coupon_id FROM mkt_coupon WHERE make_id = #{makeId} AND user_coupon_num = #{userNum} AND coupon_type = #{couponType}"})
//   Long getCouponIdByCouponNum(@Param("userNum") String userNum, @Param("makeId") Long makeId, @Param("couponType") Integer couponType);
//
//   @Select({"SELECT coupon_num FROM mkt_coupon WHERE make_id = #{makeId} AND user_coupon_num = #{userNum} AND coupon_type = #{couponType}"})
//   Long getRealCouponNum(@Param("makeId") Long makeId, @Param("userNum") Long userNum, @Param("couponType") Integer couponType);
//
//   List<MktCoupon> listCouponByMakeId(@Param("makeId") Long makeId, @Param("userNumSet") Set<String> userNumSet);
//
//   Integer countUserCouponNum(@Param("couponType") Integer couponType, @Param("numStart") Long numStart, @Param("numEnd") Long numEnd);
//
//   List<MktCouponStatusSumVO> getGroupByStatusCouponNum(@Param("backIds") List<Long> backIds, @Param("makeIds") List<Long> makeIds);
//
//   List<GroupByCouponStateDto> getGroupByCouponState(@Param("custId") Long custId);
//
//   List<CouponCountDto> getCouponCountByFixedAndCustId(@Param("fixedId") Long fixedId, @Param("custIds") List<Long> custIds, @Param("now") String now);
//
//   BigDecimal calculateDailyBalance();
//
//   BigDecimal calCouTotalAmout(@Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate);
//
//   BigDecimal calOverdue(@Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate);
//
//   Integer countStockByBackIds(List<Long> backIds);
//
//   Integer countStockByCouponName(@Param("couponName") String couponName);
//
//   Long selectByCouponId(@Param("couponId") Long couponId);
//
//   Long getCanteenIdByCouponId(@Param("couponId") Long couponId);
//
//   List<Long> getShopstallIdListByCouponId(@Param("couponId") Long couponId);
//
//   List<MktCouponVO> pagePaperCoupon(@Param("param") MktCouponParam param);
//
//   List<MktCoupon> selectCouponByBackId(@Param("backId") Long backId);
//
//   MktSumDto getPaperGrantSum(@Param("param") MktCouponMakeSumParam param);
//
//   CouponStateMetrics getCouponStateMetrics(@Param("param") MktCouponMakeSumParam param);
//
//   List<Long> getCouponNumsByMakeId(@Param("makeId") Long makeId);
//
//   MktPaperGrantDto getPaperGrantStatistics(@Param("param") MktCouponMakeSumParam content);
//
//   List<CouponAreaDto> getCouponAreaByCouponIds(@Param("couponIds") List<Long> couponIds);
//
//   List<CouponCanteenDto> couponCanteenByCouponIds(@Param("couponIds") List<Long> couponIds);
}
