Authored by TANLING

fix

... ... @@ -71,11 +71,11 @@
AND `business_client` LIKE CONCAT('%',#{businessClient},'%')
</select>
<sql id="query_prd_limit">
SELECT DISTINCT cpn.id FROM coupon cpn
LEFT JOIN `coupon_product_limit` cpl ON cpl.`coupon_id` = cpn.id
WHERE ((cpn.`product_limit_type` = 1 AND cpl.`product_id` = #{productId}) OR (cpn.`product_limit_type` = 3 AND cpl.`product_id` != #{productId}) OR cpn.`product_limit_type` =2)
</sql>
<!--<sql id="query_prd_limit">-->
<!--SELECT DISTINCT cpn.id FROM coupon cpn-->
<!--LEFT JOIN `coupon_product_limit` cpl ON cpl.`coupon_id` = cpn.id-->
<!--WHERE ((cpn.`product_limit_type` = 1 AND cpl.`product_id` = #{productId}) OR (cpn.`product_limit_type` = 3 AND cpl.`product_id` != #{productId}) OR cpn.`product_limit_type` =2)-->
<!--</sql>-->
<select id="selectByAssociatedPrdNCouponType" parameterType="com.yohoufo.dal.promotion.model.CouponQueryParamOfUseLimitType" resultMap="BaseResultMap">
select
... ... @@ -85,6 +85,10 @@
WHERE cpn.status = 1
<!--AND cpn.id IN-->
<!--(<include refid="query_prd_limit_coupon_use_limit_type"/> )-->
and cpn.coupon_type = #{couponType}
<if test="useLimitType != null">
and cpn.use_limit_type = #{useLimitType}
</if>
AND cpn.`coupon_num` > cpn.`send_num`
AND cdp.position_type= #{positionType} AND cdp.`visibility`=1
AND (#{currentTime} <![CDATA[ < ]]> `end_time` OR #{currentTime} <![CDATA[ < ]]> `receive_end_time`)
... ... @@ -94,14 +98,14 @@
<!-- limit #{offset},#{limit} -->
</select>
<sql id="query_prd_limit_coupon_use_limit_type">
SELECT DISTINCT cpn.id FROM coupon cpn
LEFT JOIN `coupon_product_limit` cpl ON cpl.`coupon_id` = cpn.id
WHERE coupon_type = #{couponType}
<if test="useLimitType != null">
and use_limit_type = #{useLimitType}
</if>
and ((cpn.`product_limit_type` = 1 AND cpl.`product_id` = #{productId}) OR (cpn.`product_limit_type` = 3 AND cpl.`product_id` != #{productId}) OR cpn.`product_limit_type` =2)
</sql>
<!--<sql id="query_prd_limit_coupon_use_limit_type">-->
<!--SELECT DISTINCT cpn.id FROM coupon cpn-->
<!--LEFT JOIN `coupon_product_limit` cpl ON cpl.`coupon_id` = cpn.id-->
<!--WHERE coupon_type = #{couponType}-->
<!--<if test="useLimitType != null">-->
<!--and use_limit_type = #{useLimitType}-->
<!--</if>-->
<!--and ((cpn.`product_limit_type` = 1 AND cpl.`product_id` = #{productId}) OR (cpn.`product_limit_type` = 3 AND cpl.`product_id` != #{productId}) OR cpn.`product_limit_type` =2)-->
<!--</sql>-->
</mapper>
\ No newline at end of file
... ...
... ... @@ -44,8 +44,6 @@ public class ProductLimitValueFilter {
return couponList;
}
logger.info("before filter coupon {}", couponList.stream().map(Coupon::getId).collect(Collectors.toList()));
// 获取商品的品牌、品类、系列信息
ProductInfo productInfo = proxyService.getProductInfo(productId);
ShoppingProductInfo shoppingProductInfo = ShoppingProductInfo.builder()
... ...