|
|
@@ -8,7 +8,6 @@ import shop.alien.entity.store.LifeDiscountCouponFriendRuleDetail;
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
import shop.alien.entity.store.vo.LifeDiscountCouponFriendRuleDetailVo;
|
|
|
import shop.alien.entity.store.vo.LifeDiscountCouponFriendRuleVo;
|
|
|
-import shop.alien.entity.store.vo.LifeGroupBuyThaliVo;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -22,7 +21,7 @@ public interface LifeDiscountCouponFriendRuleDetailMapper extends BaseMapper<Lif
|
|
|
|
|
|
void insertList(List<LifeDiscountCouponFriendRuleDetail> lifeDiscountCouponFriendRuleDetailList);
|
|
|
|
|
|
- @Select("select si.store_name storeName,ldc.name couponName,ldc.id couponId,sum(ldcsf.single_qty) couponNum,ldcsf.friend_store_user_id friendStoreUserId from life_discount_coupon_store_friend ldcsf left join life_discount_coupon ldc on ldcsf.coupon_id = ldc.id left join store_user su on ldcsf.friend_store_user_id = su.id left join store_info si on su.store_id = si.id ${ew.customSqlSegment}")
|
|
|
+ @Select("select si.store_name storeName,ldc.name couponName,ldc.id couponId,ldc.coupon_type couponType,sum(ldcsf.single_qty) couponNum,ldcsf.friend_store_user_id friendStoreUserId from life_discount_coupon_store_friend ldcsf left join life_discount_coupon ldc on ldcsf.coupon_id = ldc.id left join store_user su on ldcsf.friend_store_user_id = su.id left join store_info si on su.store_id = si.id ${ew.customSqlSegment}")
|
|
|
List<LifeDiscountCouponFriendRuleDetailVo> getReceivedFriendCouponList(@Param(Constants.WRAPPER) QueryWrapper<LifeDiscountCouponFriendRuleDetailVo> queryWrapper);
|
|
|
|
|
|
/** 查询收到的代金券列表(life_coupon,voucher_id 不为空) */
|
|
|
@@ -36,7 +35,7 @@ public interface LifeDiscountCouponFriendRuleDetailMapper extends BaseMapper<Lif
|
|
|
"COALESCE(c.name, v.name) AS couponName, " +
|
|
|
"c.id AS couponId, " +
|
|
|
"d.voucher_id AS voucherId, " +
|
|
|
- "c.coupon_type AS couponType, " +
|
|
|
+ "COALESCE(a.coupon_type, c.coupon_type) AS couponType, " +
|
|
|
"c.discount_rate AS discountRate " +
|
|
|
"FROM life_discount_coupon_friend_rule a " +
|
|
|
"INNER JOIN life_discount_coupon_friend_rule_detail d ON d.rule_id = a.id " +
|
|
|
@@ -47,6 +46,7 @@ public interface LifeDiscountCouponFriendRuleDetailMapper extends BaseMapper<Lif
|
|
|
List<LifeDiscountCouponFriendRuleVo> getRuleList(@Param("storeId") String storeId);
|
|
|
|
|
|
@Select("SELECT a.*, c.name as couponName, c.id as couponId, " +
|
|
|
+ "c.coupon_type as couponType, " +
|
|
|
"si_friend.store_name AS storeName, " +
|
|
|
"(SELECT sum(single_qty) FROM life_discount_coupon_store_friend b " +
|
|
|
"WHERE b.friend_store_user_id = a.friend_store_user_id AND b.coupon_id = a.coupon_id AND b.store_user_id = a.store_id) couponNum " +
|