电子券
This commit is contained in:
parent
38957b49a6
commit
7e322b15db
|
|
@ -1,4 +1,4 @@
|
|||
package com.bonus.canteen.core.marketing.dto;
|
||||
package com.bonus.canteen.core.marketing.coupon.dto;
|
||||
|
||||
public class GroupByCouponStateDto {
|
||||
private Integer couponState;
|
||||
|
|
@ -1,18 +1,12 @@
|
|||
package com.bonus.canteen.core.marketing.coupon.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bonus.canteen.core.autth.config.LeNiuDataPermission;
|
||||
import com.bonus.canteen.core.autth.enums.DataPermissionTypeEnum;
|
||||
import com.bonus.canteen.core.marketing.coupon.model.MktCoupon;
|
||||
import com.bonus.canteen.core.marketing.coupon.dto.GroupByCouponStateDto;
|
||||
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> {
|
||||
|
|
@ -39,9 +33,9 @@ public interface MktCouponMapper extends BaseMapper<MktCoupon> {
|
|||
// 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<GroupByCouponStateDto> getGroupByCouponState(@Param("custId") Long custId);
|
||||
|
||||
// List<CouponCountDto> getCouponCountByFixedAndCustId(@Param("fixedId") Long fixedId, @Param("custIds") List<Long> custIds, @Param("now") String now);
|
||||
//
|
||||
// BigDecimal calculateDailyBalance();
|
||||
|
|
|
|||
|
|
@ -3,12 +3,10 @@ package com.bonus.canteen.core.marketing.coupon.service.impl;
|
|||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bonus.canteen.core.marketing.dto.GroupByCouponStateDto;
|
||||
import com.bonus.canteen.core.marketing.coupon.dto.GroupByCouponStateDto;
|
||||
import com.bonus.canteen.core.marketing.dto.GroupCuponDto;
|
||||
import com.bonus.canteen.core.marketing.vo.MktCouponMobileVO;
|
||||
import com.bonus.canteen.core.marketing.vo.MktCouponTmplBackVO;
|
||||
|
|
@ -28,7 +26,6 @@ import com.bonus.canteen.core.marketing.coupon.service.MktCouponService;
|
|||
import com.bonus.canteen.core.marketing.coupon.vo.MktCouponMobileUsableVO;
|
||||
import com.bonus.canteen.core.order.common.constants.OrderTypeEnum;
|
||||
import com.bonus.common.houqin.i18n.I18n;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
|
@ -36,11 +33,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.invoke.SerializedLambda;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class MktCouponServiceImpl extends ServiceImpl<MktCouponMapper, MktCoupon> implements MktCouponService {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.bonus.canteen.core.marketing.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bonus.canteen.core.marketing.dto.GroupByCouponStateDto;
|
||||
import com.bonus.canteen.core.marketing.coupon.dto.GroupByCouponStateDto;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,116 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.bonus.canteen.core.marketing.coupon.mapper.MktCouponMapper">
|
||||
|
||||
<!-- <!– 分页查询电子餐券 –>-->
|
||||
<!-- <select id="pageCoupon" parameterType="com.bonus.canteen.core.marketing.coupon.param.MktCouponParam"-->
|
||||
<!-- resultType="com.bonus.canteen.core.marketing.coupon.vo.MktCouponVO">-->
|
||||
<!-- SELECT-->
|
||||
<!-- t1.coupon_id, t1.coupon_amount,t1.coupon_num, t1.coupon_name, t1.coupon_type, t2.org_full_name, t1.cust_name,-->
|
||||
<!-- t1.phone,-->
|
||||
<!-- t1.coupon_amount,t2.cust_num,-->
|
||||
<!-- t1.coupon_need_amount, t1.pay_amount, t1.coupon_img_url, t1.limit_times, t1.used_times,-->
|
||||
<!-- t1.effect_date_start, t1.effect_date_end, t1.coupon_state, t1.pay_state, t1.pay_type, t1.pay_time,-->
|
||||
<!-- t1.upby, t1.uptime, t3.company_name,t1.write_off_date-->
|
||||
<!-- FROM-->
|
||||
<!-- mkt_coupon t1 LEFT JOIN cust_info t2 ON t1.cust_id = t2.cust_id-->
|
||||
<!-- LEFT JOIN mkt_coupon_tmpl_back t3 ON t1.back_id = t3.back_id-->
|
||||
<!-- WHERE-->
|
||||
<!-- <if test="param.couponType != null">-->
|
||||
<!-- t1.coupon_type like #{param.couponType}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="param.couponId != null">-->
|
||||
<!-- AND t1.coupon_id like #{param.couponId}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="param.couponName != null and param.couponName != ''">-->
|
||||
<!-- AND t1.coupon_name like #{param.couponName}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="param.companyName != null and param.companyName != ''">-->
|
||||
<!-- AND t3.company_name like #{param.companyName}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="param.custName != null and param.custName != ''">-->
|
||||
<!-- AND t1.cust_name = #{param.custName,typeHandler=com.bonus.canteen.core.common.encrypt.SM4EncDecHandler}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="param.phone != null and param.phone != ''">-->
|
||||
<!-- AND t1.phone like #{param.phone}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="param.effectDateStart != null and param.effectDateEnd != null">-->
|
||||
<!-- AND (#{param.effectDateStart} BETWEEN t1.effect_date_start AND t1.effect_date_end-->
|
||||
<!-- OR #{param.effectDateEnd} BETWEEN t1.effect_date_start AND t1.effect_date_end)-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="param.orgIdList != null and param.orgIdList.size() > 0">-->
|
||||
<!-- AND t2.org_id in-->
|
||||
<!-- <foreach collection="param.orgIdList" item="orgId" separator="," open="(" close=")">-->
|
||||
<!-- #{orgId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="param.payStateList != null and param.payStateList.size() > 0">-->
|
||||
<!-- AND t1.pay_state in-->
|
||||
<!-- <foreach collection="param.payStateList" item="payState" separator="," open="(" close=")">-->
|
||||
<!-- #{payState}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="param.couponStateList != null and param.couponStateList.size() > 0">-->
|
||||
<!-- AND t1.coupon_state in-->
|
||||
<!-- <foreach collection="param.couponStateList" item="couponState" separator="," open="(" close=")">-->
|
||||
<!-- #{couponState}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- order by-->
|
||||
<!-- t1.uptime desc-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <!– 同一模板下,校验餐券号段是否存在 –>-->
|
||||
<!-- <select id="listCouponByMakeId" resultType="com.bonus.canteen.core.marketing.coupon.model.MktCoupon">-->
|
||||
<!-- SELECT-->
|
||||
<!-- t1.coupon_id, t1.user_coupon_num, t1.cust_id-->
|
||||
<!-- FROM mkt_coupon t1 LEFT JOIN mkt_coupon_make t2-->
|
||||
<!-- ON t1.make_id = t2.make_id-->
|
||||
<!-- WHERE-->
|
||||
<!-- t1.make_id = #{makeId}-->
|
||||
<!-- AND t1.user_coupon_num IN-->
|
||||
<!-- <foreach collection="userNumSet" item="num" separator="," open="(" close=")">-->
|
||||
<!-- #{num}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <!– 根据号段范围查询用户输入号段数量 –>-->
|
||||
<!-- <select id="countUserCouponNum" resultType="java.lang.Integer">-->
|
||||
<!-- SELECT count(*)-->
|
||||
<!-- FROM mkt_coupon-->
|
||||
<!-- WHERE coupon_type = #{couponType}-->
|
||||
<!-- AND user_coupon_num BETWEEN #{numStart} AND #{numEnd};-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="getGroupByStatusCouponNum" resultType="com.bonus.canteen.core.marketing.coupon.vo.MktCouponStatusSumVO">-->
|
||||
<!-- SELECT back_id,-->
|
||||
<!-- coupon_state,-->
|
||||
<!-- count(1) totalNumber-->
|
||||
<!-- FROM mkt_coupon-->
|
||||
<!-- <where>-->
|
||||
<!-- <if test="backIds!= null and backIds.size() > 0">-->
|
||||
<!-- AND back_id in-->
|
||||
<!-- <foreach collection="backIds" separator="," open="(" close=")" item="backId">-->
|
||||
<!-- #{backId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="makeIds!= null and makeIds.size() > 0">-->
|
||||
<!-- AND make_id in-->
|
||||
<!-- <foreach collection="makeIds" separator="," open="(" close=")" item="makeId">-->
|
||||
<!-- #{makeId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- </where>-->
|
||||
<!-- GROUP BY back_id,-->
|
||||
<!-- coupon_state;-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="getGroupByCouponState" resultType="com.bonus.canteen.core.marketing.coupon.dto.GroupByCouponStateDto">
|
||||
SELECT coupon_state,
|
||||
count(1) as num
|
||||
FROM mkt_coupon
|
||||
WHERE cust_id = #{custId}
|
||||
and coupon_type = 2
|
||||
GROUP BY coupon_state
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue