You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
2.4 KiB
51 lines
2.4 KiB
package com.hai.dao;
|
|
|
|
import com.hai.model.HighOrderPreModel;
|
|
import com.hai.model.HighUserDiscountUnicomModel;
|
|
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* mapper扩展类
|
|
*/
|
|
public interface HighDiscountUserRelMapperExt {
|
|
|
|
|
|
@Select({"<script>" +
|
|
" SELECT" +
|
|
" hdur.id id , " +
|
|
" hd.using_range usingAttribution , " +
|
|
" hdur.use_time useTime , " +
|
|
" hdur.use_end_time useEndTime , " +
|
|
" hdur.status status , " +
|
|
" hdur.create_time createTime , " +
|
|
" hd.discount_name discountName , " +
|
|
" hd.discount_img discountImg , " +
|
|
" hd.discount_condition discountCondition , " +
|
|
" hd.discount_price discountPrice , " +
|
|
" hd.discount_type discountType " +
|
|
" FROM" +
|
|
" high_discount_user_rel hdur join high_discount hd on hdur.discount_id = hd.id " +
|
|
" WHERE" +
|
|
" 1=1" +
|
|
" <if test='map.useScope != null'> and hd.use_scope = #{map.useScope} </if> " +
|
|
" <if test='map.userId != null'> and hdur.user_id = #{map.userId} </if>",
|
|
" <if test='map.status != null'> and hdur.status = #{map.status} </if>",
|
|
" <if test='map.createTimeS != null'> <![CDATA[ and hdur.create_time >= #{map.createTimeS} ]]> </if>",
|
|
" <if test='map.createTimeE != null'> <![CDATA[ and hdur.create_time <= #{map.createTimeE} ]]> </if>",
|
|
" ORDER BY hdur.create_time desc" +
|
|
"</script>"})
|
|
List<HighUserDiscountUnicomModel> getUserCouponsList(@Param("map") Map<String,Object> map);
|
|
|
|
|
|
@Select({"<script> select count(1) count from high_discount_user_rel where user_id = #{userId} and discount_id = #{discountId} and `status` <![CDATA[ <> 100 ]]> </script>"})
|
|
Integer receiveDiscountCount(@Param("userId") Long userId, @Param("discountId") Long discountId);
|
|
|
|
@Select(" select count(1) from high_discount_user_rel " +
|
|
" where user_id = #{userId} and discount_id in (select id from high_discount where using_range = #{usingRange}) " +
|
|
" and create_time BETWEEN CONCAT(CURDATE(),' 00:00:00') AND CONCAT(CURDATE(),' 23:59:59') ")
|
|
Integer userReceiveLimitNumber(@Param("userId") Long userId,@Param("usingRange") Integer usingRange);
|
|
}
|
|
|