package com.hai.dao; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.math.BigDecimal; import java.util.List; import java.util.Map; /** * mapper扩展类 */ public interface HighCouponMapperExt { /** * 查询月销量 * @param couponId * @return */ @Select({"SELECT count(1) FROM `high_child_order` " + " where goods_type = 1 and goods_id = #{couponId} and child_order_status in (2,3,6,7) and DATE_FORMAT(pay_time,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m')"}) int getMonthlySales(@Param("couponId") Long couponId); @Select("") List> getUseCouponStatistics(@Param("param") Map param); @Select("select sales_price from high_coupon where coupon_source = #{couponSource} GROUP BY sales_price ORDER BY sales_price") List getCouponSalesPrice(@Param("couponSource") Integer couponSource); @Select(" select count(1) from high_child_order " + " where mem_id = #{userId} " + " and goods_type = 1 " + " and child_order_status in (2,3)" + " and pay_time BETWEEN CONCAT(CURDATE(),' 00:00:00') AND CONCAT(CURDATE(),' 23:59:59') " + " and goods_id in (select id from high_coupon where coupon_source = #{couponSource})") int userBuySourceLimitNumber(@Param("userId") Long userId, @Param("couponSource") Integer couponSource); }