Procházet zdrojové kódy

20240624 会员管理

lwhhszx před 1 rokem
rodič
revize
30c03528da
20 změnil soubory, kde provedl 613 přidání a 3 odebrání
  1. 41 0
      src/main/java/com/example/xiaoshiweixinback/controller/UserManageController.java
  2. 0 1
      src/main/java/com/example/xiaoshiweixinback/controller/VIPController.java
  3. 60 0
      src/main/java/com/example/xiaoshiweixinback/controller/VoucherManageController.java
  4. 74 0
      src/main/java/com/example/xiaoshiweixinback/domain/DiscountStrategy.java
  5. 83 0
      src/main/java/com/example/xiaoshiweixinback/domain/Voucher.java
  6. 14 0
      src/main/java/com/example/xiaoshiweixinback/entity/person/PersonQueryDTO.java
  7. 18 0
      src/main/java/com/example/xiaoshiweixinback/entity/person/PersonQueryVO.java
  8. 17 0
      src/main/java/com/example/xiaoshiweixinback/entity/person/PersonVO.java
  9. 29 0
      src/main/java/com/example/xiaoshiweixinback/entity/vouchar/VoucherAddDTO.java
  10. 14 0
      src/main/java/com/example/xiaoshiweixinback/entity/vouchar/VoucherBatchUpdateDTO.java
  11. 13 0
      src/main/java/com/example/xiaoshiweixinback/entity/vouchar/VoucherQueryDTO.java
  12. 19 0
      src/main/java/com/example/xiaoshiweixinback/entity/vouchar/VoucherUpdateDTO.java
  13. 18 0
      src/main/java/com/example/xiaoshiweixinback/mapper/DiscountStrategyMapper.java
  14. 8 1
      src/main/java/com/example/xiaoshiweixinback/mapper/PersonMapper.java
  15. 18 0
      src/main/java/com/example/xiaoshiweixinback/mapper/VoucherMapper.java
  16. 0 1
      src/main/java/com/example/xiaoshiweixinback/service/AssoPersonVipService.java
  17. 20 0
      src/main/java/com/example/xiaoshiweixinback/service/DiscountStrategyService.java
  18. 20 0
      src/main/java/com/example/xiaoshiweixinback/service/PersonService.java
  19. 81 0
      src/main/java/com/example/xiaoshiweixinback/service/VoucherService.java
  20. 66 0
      src/main/resources/mapper/PersonMapper.xml

+ 41 - 0
src/main/java/com/example/xiaoshiweixinback/controller/UserManageController.java

@@ -0,0 +1,41 @@
+package com.example.xiaoshiweixinback.controller;
+
+import com.example.xiaoshiweixinback.business.common.Constants;
+import com.example.xiaoshiweixinback.business.common.Response;
+import com.example.xiaoshiweixinback.business.common.base.Records;
+import com.example.xiaoshiweixinback.checkLogin.checkLogin;
+import com.example.xiaoshiweixinback.entity.person.PersonQueryDTO;
+import com.example.xiaoshiweixinback.entity.person.PersonQueryVO;
+import com.example.xiaoshiweixinback.entity.vip.ActiveVipDTO;
+import com.example.xiaoshiweixinback.entity.vip.PersonFunctionVO;
+import com.example.xiaoshiweixinback.entity.weixinPay.FunctionRightVO;
+import com.example.xiaoshiweixinback.service.PersonService;
+import com.example.xiaoshiweixinback.service.VipService;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 用户管理模块
+ */
+@Slf4j
+@RequestMapping(Constants.XIAOSHI_WEIXINBACK + "/userManage")
+@RestController
+@RequiredArgsConstructor
+public class UserManageController {
+    private final PersonService personService;
+
+    @Operation(summary = "查询用户信息")
+    @PostMapping("/queryUser")
+    public Response queryUser(@RequestBody PersonQueryDTO personQueryDTO) {
+      Records records =  personService.queryPersons(personQueryDTO);
+
+        return Response.success(records);
+    }
+
+
+
+}

+ 0 - 1
src/main/java/com/example/xiaoshiweixinback/controller/VIPController.java

@@ -44,7 +44,6 @@ public class VIPController {
         Records records = new Records();
         List<FunctionRightVO> functionRightVOList = vipService.getVipRights();
         records.setData(functionRightVOList);
-
         return Response.success(records);
     }
 

+ 60 - 0
src/main/java/com/example/xiaoshiweixinback/controller/VoucherManageController.java

@@ -0,0 +1,60 @@
+package com.example.xiaoshiweixinback.controller;
+
+import com.example.xiaoshiweixinback.business.common.Constants;
+import com.example.xiaoshiweixinback.business.common.Response;
+import com.example.xiaoshiweixinback.business.common.base.Records;
+import com.example.xiaoshiweixinback.entity.vouchar.VoucherAddDTO;
+import com.example.xiaoshiweixinback.entity.vouchar.VoucherBatchUpdateDTO;
+import com.example.xiaoshiweixinback.entity.vouchar.VoucherQueryDTO;
+import com.example.xiaoshiweixinback.entity.vouchar.VoucherUpdateDTO;
+import com.example.xiaoshiweixinback.service.VoucherService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.models.security.SecurityScheme;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 用户管理模块
+ */
+@Slf4j
+@RequestMapping(Constants.XIAOSHI_WEIXINBACK + "/voucherManage")
+@RestController
+@RequiredArgsConstructor
+public class VoucherManageController {
+    private final VoucherService voucherService;
+
+    @Operation(summary = "添加优惠券")
+    @PostMapping("/addVoucher")
+    public Response addVoucher  (@RequestBody VoucherAddDTO voucherAddDTO) {
+      Integer id=  voucherService.addVoucher(voucherAddDTO);
+        return Response.success(id);
+    }
+
+    @Operation(summary = "编辑优惠券")
+    @PostMapping("/editVoucher")
+    public Response editVoucher  (@RequestBody VoucherUpdateDTO voucherUpdateDTO) {
+     Integer id= voucherService.editVoucher(voucherUpdateDTO);
+        return Response.success(id);
+    }
+
+    @Operation(summary = "查询优惠券")
+    @PostMapping("/queryVector")
+    public Response queryVector (@RequestBody VoucherQueryDTO voucherQueryDTO) {
+      Records records = voucherService.queryVector(voucherQueryDTO);
+        return Response.success(records);
+    }
+
+
+    @Operation(summary = "下架优惠券")
+    @PostMapping("/updateBatchVoucher")
+    public Response updateBatchVoucher (@RequestBody VoucherBatchUpdateDTO voucherBatchUpdateDTO) {
+      List<Integer> ids=  voucherService.updateBatchVoucher(voucherBatchUpdateDTO);
+        return Response.success(true);
+    }
+}

+ 74 - 0
src/main/java/com/example/xiaoshiweixinback/domain/DiscountStrategy.java

@@ -0,0 +1,74 @@
+package com.example.xiaoshiweixinback.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+
+import com.example.xiaoshiweixinback.domain.BaseEntity;
+import com.example.xiaoshiweixinback.domain.Monitor;
+import lombok.Data;
+
+/**
+ * 折扣策略
+ * @TableName discount_strategy
+ */
+@TableName(value ="discount_strategy")
+@Data
+public class DiscountStrategy extends BaseEntity<DiscountStrategy> {
+    /**
+     * ID
+     */
+    private Integer id;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 类型
+0赠送金额券 1折扣 2直接减免金额
+
+     */
+    private Integer type;
+
+    /**
+     * 折扣
+
+     */
+    private Double amount;
+
+    /**
+     * 使用期限
+
+     */
+    private Date expirationTime;
+
+    /**
+     * 使用范围
+     */
+    private String useScope;
+
+    /**
+     * 0下架,1上架中
+     */
+    private Integer state;
+
+    /**
+     * 使用门槛
+     */
+    private Double threshold;
+
+    /**
+     *
+     */
+    private String createId;
+
+    /**
+     *
+     */
+    private Date createTime;
+}

+ 83 - 0
src/main/java/com/example/xiaoshiweixinback/domain/Voucher.java

@@ -0,0 +1,83 @@
+package com.example.xiaoshiweixinback.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+
+import com.example.xiaoshiweixinback.domain.BaseEntity;
+import com.example.xiaoshiweixinback.domain.DiscountStrategy;
+import lombok.Data;
+
+/**
+ *  优惠券
+ * @TableName voucher
+ */
+@TableName(value ="voucher")
+@Data
+public class Voucher extends BaseEntity<Voucher> {
+    /**
+     * ID
+     */
+    private Integer id;
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 可领取时间
+     */
+    private Date availableTime;
+
+    /**
+     * 使用期限
+     */
+    private Integer expirationTime;
+
+    /**
+     * 使用范围
+0开通会员,1购买券,2支付工单,以,隔开
+     */
+    private String useScope;
+
+    /**
+     * 状态
+
+     */
+    private Integer state;
+
+    /**
+     * c备注
+     */
+    private String remark;
+
+    /**
+     * 使用门槛
+     */
+    private Double threshold;
+
+    /**
+     * 售卖价格
+     */
+    private Double sellingPrice;
+
+    /**
+     * 获取方式
+0赠送 1购买
+     */
+    private Integer getWay;
+
+    /**
+     * 
+     */
+    private String createId;
+
+    /**
+     * 
+     */
+    private Date createTime;
+
+}

+ 14 - 0
src/main/java/com/example/xiaoshiweixinback/entity/person/PersonQueryDTO.java

@@ -0,0 +1,14 @@
+package com.example.xiaoshiweixinback.entity.person;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class PersonQueryDTO {
+    private Long current;
+    private Long size;
+    private String name;
+    private Integer vipType;
+    private String phoneNum;
+}

+ 18 - 0
src/main/java/com/example/xiaoshiweixinback/entity/person/PersonQueryVO.java

@@ -0,0 +1,18 @@
+package com.example.xiaoshiweixinback.entity.person;
+
+import com.example.xiaoshiweixinback.entity.vip.VipMessageVO;
+import lombok.Data;
+
+@Data
+public class PersonQueryVO {
+
+   private String name;
+    private  String fileGuid;
+    private String phoneNum;
+    private  String email;
+    private String userName;
+    private String uuid;
+    private  Integer vipType;
+   private String vipName;
+   private  String vipUuid;
+}

+ 17 - 0
src/main/java/com/example/xiaoshiweixinback/entity/person/PersonVO.java

@@ -0,0 +1,17 @@
+package com.example.xiaoshiweixinback.entity.person;
+
+import com.example.xiaoshiweixinback.entity.vip.VipMessageVO;
+import lombok.Data;
+
+@Data
+public class PersonVO {
+
+   private String name;
+    private  String fileGuid;
+    private String phoneNum;
+    private  String email;
+    private String userName;
+    private String uuid;
+    private  Integer vipType;
+    private VipMessageVO vipMessageVO;
+}

+ 29 - 0
src/main/java/com/example/xiaoshiweixinback/entity/vouchar/VoucherAddDTO.java

@@ -0,0 +1,29 @@
+package com.example.xiaoshiweixinback.entity.vouchar;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class VoucherAddDTO {
+    private String name;
+    private Integer type;
+    private Double amount;
+    @JsonFormat(
+            pattern = "yyyy-MM-dd",
+            timezone = "GMT+8"
+    )
+    private Date availableTime;
+    @JsonFormat(
+            pattern = "yyyy-MM-dd",
+            timezone = "GMT+8"
+    )
+    private Date expirationTime;
+    private String useScope;
+    private Integer state;
+    private String remark;
+    private Double threshold;
+    private Double sellingPrice;
+    private Integer getWay;
+}

+ 14 - 0
src/main/java/com/example/xiaoshiweixinback/entity/vouchar/VoucherBatchUpdateDTO.java

@@ -0,0 +1,14 @@
+package com.example.xiaoshiweixinback.entity.vouchar;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class VoucherBatchUpdateDTO {
+    private List<Integer> ids;
+    private Integer state;
+
+}

+ 13 - 0
src/main/java/com/example/xiaoshiweixinback/entity/vouchar/VoucherQueryDTO.java

@@ -0,0 +1,13 @@
+package com.example.xiaoshiweixinback.entity.vouchar;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class VoucherQueryDTO {
+    private Long current;
+    private Long size;
+    private Integer state;
+
+}

+ 19 - 0
src/main/java/com/example/xiaoshiweixinback/entity/vouchar/VoucherUpdateDTO.java

@@ -0,0 +1,19 @@
+package com.example.xiaoshiweixinback.entity.vouchar;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class VoucherUpdateDTO {
+    @JsonFormat(
+            pattern = "yyyy-MM-dd",
+            timezone = "GMT+8"
+    )
+    private Date availableTime;
+    private Integer state;
+    private String remark;
+    private Double sellingPrice;
+    private Integer id;
+}

+ 18 - 0
src/main/java/com/example/xiaoshiweixinback/mapper/DiscountStrategyMapper.java

@@ -0,0 +1,18 @@
+package com.example.xiaoshiweixinback.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.example.xiaoshiweixinback.domain.DiscountStrategy;
+
+/**
+* @author admin
+* @description 针对表【discount_strategy(折扣策略)】的数据库操作Mapper
+* @createDate 2024-06-18 23:11:39
+* @Entity com/example/xiaoshiweixinback.domain.DiscountStrategy
+*/
+public interface DiscountStrategyMapper extends BaseMapper<DiscountStrategy> {
+
+}
+
+
+
+

+ 8 - 1
src/main/java/com/example/xiaoshiweixinback/mapper/PersonMapper.java

@@ -2,8 +2,14 @@ package com.example.xiaoshiweixinback.mapper;
 
 import com.example.xiaoshiweixinback.domain.Person;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.example.xiaoshiweixinback.entity.dto.GetProductDTO;
+import com.example.xiaoshiweixinback.entity.person.PersonQueryDTO;
+import com.example.xiaoshiweixinback.entity.person.PersonQueryVO;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 /**
 * @author admin
 * @description 针对表【person(人员表)】的数据库操作Mapper
@@ -12,7 +18,8 @@ import org.springframework.stereotype.Repository;
 */
 @Repository
 public interface PersonMapper extends BaseMapper<Person> {
-
+    public List<PersonQueryVO> queryPerson(@Param("personQueryDTO") PersonQueryDTO personQueryDTO);
+    public Long queryPersonTotal(@Param("personQueryDTO") PersonQueryDTO personQueryDTO);
 }
 
 

+ 18 - 0
src/main/java/com/example/xiaoshiweixinback/mapper/VoucherMapper.java

@@ -0,0 +1,18 @@
+package com.example.xiaoshiweixinback.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.example.xiaoshiweixinback.domain.Voucher;
+
+/**
+* @author admin
+* @description 针对表【voucher( 优惠券)】的数据库操作Mapper
+* @createDate 2024-06-18 23:06:58
+* @Entity com/example/xiaoshiweixinback.domain.Voucher
+*/
+public interface VoucherMapper extends BaseMapper<Voucher> {
+
+}
+
+
+
+

+ 0 - 1
src/main/java/com/example/xiaoshiweixinback/service/AssoPersonVipService.java

@@ -34,7 +34,6 @@ public class AssoPersonVipService extends ServiceImpl<AssoPersonVipMapper, AssoP
             if(assoPersonVip.getExpiryTime().compareTo(date)>0){
                date=assoPersonVip.getExpiryTime();
             }
-
         }
         assoPersonVip = this.addAssoPersonVip(personUuid, vip,date);
         return assoPersonVip;

+ 20 - 0
src/main/java/com/example/xiaoshiweixinback/service/DiscountStrategyService.java

@@ -0,0 +1,20 @@
+package com.example.xiaoshiweixinback.service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.example.xiaoshiweixinback.domain.DiscountStrategy;
+import com.example.xiaoshiweixinback.mapper.DiscountStrategyMapper;
+import org.springframework.stereotype.Service;
+
+/**
+* @author admin
+* @description 针对表【discount_strategy(折扣策略)】的数据库操作Service实现
+* @createDate 2024-06-18 23:11:39
+*/
+@Service
+public class DiscountStrategyService extends ServiceImpl<DiscountStrategyMapper, DiscountStrategy> {
+
+}
+
+
+
+

+ 20 - 0
src/main/java/com/example/xiaoshiweixinback/service/PersonService.java

@@ -2,7 +2,10 @@ package com.example.xiaoshiweixinback.service;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.example.xiaoshiweixinback.business.common.base.Records;
 import com.example.xiaoshiweixinback.domain.Person;
+import com.example.xiaoshiweixinback.entity.person.PersonQueryDTO;
+import com.example.xiaoshiweixinback.entity.person.PersonQueryVO;
 import com.example.xiaoshiweixinback.mapper.PersonMapper;
 import org.springframework.stereotype.Service;
 
@@ -27,6 +30,23 @@ public class PersonService extends ServiceImpl<PersonMapper, Person> {
         return personList;
 
     }
+
+
+    public Records queryPersons(PersonQueryDTO personQueryDTO) {
+        Long current = personQueryDTO.getCurrent();
+        Long size = personQueryDTO.getSize();
+
+
+        List<PersonQueryVO> personQueryVOs = this.getBaseMapper().queryPerson(personQueryDTO);
+        Long total =this.getBaseMapper().queryPersonTotal(personQueryDTO);
+        Records records =new Records();
+        records.setData(personQueryVOs);
+        records.setTotal(total);
+        records.setSize(size);
+        records.setCurrent(current);
+        return records;
+
+    }
 }
 
 

+ 81 - 0
src/main/java/com/example/xiaoshiweixinback/service/VoucherService.java

@@ -0,0 +1,81 @@
+package com.example.xiaoshiweixinback.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.example.xiaoshiweixinback.business.common.base.Records;
+import com.example.xiaoshiweixinback.entity.vouchar.VoucherAddDTO;
+import com.example.xiaoshiweixinback.entity.vouchar.VoucherBatchUpdateDTO;
+import com.example.xiaoshiweixinback.entity.vouchar.VoucherQueryDTO;
+import com.example.xiaoshiweixinback.entity.vouchar.VoucherUpdateDTO;
+import com.example.xiaoshiweixinback.domain.Voucher;
+import com.example.xiaoshiweixinback.mapper.VoucherMapper;
+import io.swagger.v3.oas.models.security.SecurityScheme;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author admin
+ * @description 针对表【voucher( 优惠券)】的数据库操作Service实现
+ * @createDate 2024-06-18 23:06:58
+ */
+@Service
+public class VoucherService extends ServiceImpl<VoucherMapper, Voucher> {
+
+    public Integer addVoucher(VoucherAddDTO voucherAddDTO) {
+        Voucher voucher = new Voucher();
+        BeanUtils.copyProperties(voucherAddDTO, voucher);
+        voucher.insert();
+        return voucher.getId();
+    }
+
+    public Integer editVoucher(VoucherUpdateDTO voucherUpdateDTO) {
+        Integer id = voucherUpdateDTO.getId();
+        Voucher voucher = this.getById(id);
+        BeanUtils.copyProperties(voucherUpdateDTO, voucher);
+        voucher.updateById();
+        return id;
+    }
+
+    public Records queryVector(VoucherQueryDTO voucherQueryDTO) {
+        Records records = new Records();
+        Long size = voucherQueryDTO.getSize();
+        Long current = voucherQueryDTO.getCurrent();
+        Integer state = voucherQueryDTO.getState();
+
+        LambdaQueryWrapper<Voucher> queryWrapper = new LambdaQueryWrapper<>();
+        if (state != null) {
+            queryWrapper.eq(Voucher::getState, state);
+        }
+        if (size != null && current != null) {
+            Page<Voucher> page = this.page(new Page<>(current, size), queryWrapper);
+            List<Voucher> vouchers = page.getRecords();
+            records.setData(vouchers);
+            records.setCurrent(current);
+            records.setSize(size);
+            records.setTotal(page.getTotal());
+        } else {
+            List<Voucher> vouchers = this.list(queryWrapper);
+            records.setData(vouchers);
+        }
+        return records;
+    }
+
+    public List<Integer> updateBatchVoucher(VoucherBatchUpdateDTO voucherBatchUpdateDTO) {
+        Integer state = voucherBatchUpdateDTO.getState();
+        List<Integer> ids = voucherBatchUpdateDTO.getIds();
+        UpdateWrapper<Voucher> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.lambda().set(Voucher::getState, state)
+                .in(Voucher::getId, ids);
+        this.update(updateWrapper);
+        return ids;
+    }
+
+}
+
+
+
+

+ 66 - 0
src/main/resources/mapper/PersonMapper.xml

@@ -0,0 +1,66 @@
+<?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.example.xiaoshiweixinback.mapper.PersonMapper">
+
+    <select id="queryPerson" resultType="com.example.xiaoshiweixinback.entity.person.PersonQueryVO">
+        select p.uuid     as uuid,
+               p.name     as name,
+               p.file_guid as fileGuid,
+               p.phone_num as phoneNum,
+               p.email    as email,
+               p.user_name as userName,
+               vm.vip_uuid as vipUuid,
+               vm.name as vipName
+        from ecs.person as p
+            left join (select person_uuid, name, vip_uuid
+            from (select v.name, apv.person_uuid, v.vip_uuid
+            from ecs.asso_person_vip as apv
+            left join ecs.vip as v
+            on apv.vip_uuid = v.vip_uuid
+            where apv.expiry_time > now()
+            order by v.vip_type desc) as tem
+            group by person_uuid, name, v.vip_uuid) as vm
+        on p.uuid = vm.person_uuid
+           <where>
+               <if test="personQueryDTO.vipType!=null and personQueryDTO.vipType.equals(0)">
+              and vm.vip_uuid is null
+               </if>
+               <if test="personQueryDTO.vipType!=null and personQueryDTO.vipType.equals(1)">
+                   and vm.vip_uuid is not null
+               </if>
+
+               <if test="personQueryDTO.phoneNum!=null">
+                   and p.phone_num like CONCAT('%',#{personQueryDTO.phoneNum},'%')
+               </if>
+               <if test="personQueryDTO.current!=null and personQueryDTO.size!=null">
+                   limit ${(personQueryDTO.current -1)*personQueryDTO.size},${personQueryDTO.size}
+               </if>
+           </where>
+    </select>
+
+    <select id="queryPersonTotal" resultType="java.lang.Long">
+        select count(*)
+        from ecs.person as p
+        left join (select person_uuid, name, vip_uuid
+        from (select v.name, apv.person_uuid, v.vip_uuid
+        from ecs.asso_person_vip as apv
+        left join ecs.vip as v
+        on apv.vip_uuid = v.vip_uuid
+        where apv.expiry_time > now()
+        order by v.vip_type desc) as tem
+        group by person_uuid, name, v.vip_uuid) as vm
+        on p.uuid = vm.person_uuid
+        <where>
+            <if test="personQueryDTO.vipType!=null and personQueryDTO.vipType.equals(0)">
+                and vm.vip_uuid is null
+            </if>
+            <if test="personQueryDTO.vipType!=null and personQueryDTO.vipType.equals(1)">
+                and vm.vip_uuid is not null
+            </if>
+
+            <if test="personQueryDTO.phoneNum!=null">
+                and p.phone_num like CONCAT('%',#{personQueryDTO.phoneNum},'%')
+            </if>
+        </where>
+    </select>
+</mapper>