From c6e5c48338ce6ca3f0b52f4d9a5daccec76fffb4 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 29 四月 2026 13:43:38 +0800
Subject: [PATCH] 优化营销客户相关

---
 src/main/java/com/ruoyi/sales/pojo/SalesQuotation.java                      |    3 
 src/main/resources/mapper/basic/CustomerMapper.xml                          |   54 +++++++++++++
 src/main/java/com/ruoyi/basic/mapper/CustomerMapper.java                    |    2 
 src/main/java/com/ruoyi/basic/service/impl/CustomerFollowUpServiceImpl.java |    2 
 src/main/java/com/ruoyi/basic/service/ICustomerService.java                 |    4 
 src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java         |   33 +++++--
 src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java    |    2 
 /dev/null                                                                   |  100 -------------------------
 src/main/java/com/ruoyi/basic/pojo/CustomerFollowUp.java                    |    2 
 src/main/java/com/ruoyi/basic/pojo/CustomerReturnVisit.java                 |    2 
 src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java      |    7 -
 src/main/java/com/ruoyi/basic/controller/CustomerController.java            |   17 +---
 src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java   |    4 -
 13 files changed, 92 insertions(+), 140 deletions(-)

diff --git a/src/main/java/com/ruoyi/basic/controller/CustomerController.java b/src/main/java/com/ruoyi/basic/controller/CustomerController.java
index bd303bd..ec3fb1a 100644
--- a/src/main/java/com/ruoyi/basic/controller/CustomerController.java
+++ b/src/main/java/com/ruoyi/basic/controller/CustomerController.java
@@ -45,16 +45,9 @@
      */
     @Log(title = "瀹㈡埛妗f", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, Customer customer) {
-        Long[] ids = customer.getIds();
-        List<Customer> list;
-        if (ids != null && ids.length > 0) {
-            list = customerService.selectCustomerListByIds(ids);
-        } else {
-            list = customerService.selectCustomerLists(customer);
-        }
-        ExcelUtil<Customer> util = new ExcelUtil<Customer>(Customer.class);
-        util.exportExcel(response, list, "瀹㈡埛妗f鏁版嵁");
+    public void export(HttpServletResponse response, CustomerDto customer) {
+        ExcelUtil<CustomerVo> util = new ExcelUtil<CustomerVo>(CustomerVo.class);
+        util.exportExcel(response, customerService.selectCustomerLists(customer), "瀹㈡埛妗f鏁版嵁");
     }
 
     @PostMapping("/downloadTemplate")
@@ -70,9 +63,9 @@
      */
     @Log(title = "瀹㈡埛妗f", businessType = BusinessType.IMPORT)
     @PostMapping("/importData")
-    public AjaxResult importData(MultipartFile file) throws Exception {
+    public AjaxResult importData(MultipartFile file, Integer type) throws Exception {
 
-        return customerService.importData(file);
+        return customerService.importData(file, type);
     }
 
     /**
diff --git a/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java b/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
index d10e370..2b70438 100644
--- a/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
+++ b/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
@@ -46,7 +46,7 @@
     @ApiOperation("鏌ヨ瀹㈡埛璺熻繘鍒楄〃")
     public IPage<CustomerFollowUp> list(Page<CustomerFollowUp> page, CustomerFollowUp customerFollowUp) {
         LambdaQueryWrapper<CustomerFollowUp> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(customerFollowUp.getCustomerPrivatePoolId() != null, CustomerFollowUp::getCustomerPrivatePoolId, customerFollowUp.getCustomerPrivatePoolId())
+        queryWrapper.eq(customerFollowUp.getCustomerId() != null, CustomerFollowUp::getCustomerId, customerFollowUp.getCustomerId())
                 .like(customerFollowUp.getFollowerUserName() != null, CustomerFollowUp::getFollowerUserName, customerFollowUp.getFollowerUserName())
                 .orderByDesc(CustomerFollowUp::getFollowUpTime);
         return customerFollowUpService.page(page, queryWrapper);
diff --git a/src/main/java/com/ruoyi/basic/controller/CustomerPrivateController.java b/src/main/java/com/ruoyi/basic/controller/CustomerPrivateController.java
deleted file mode 100644
index 1807ce7..0000000
--- a/src/main/java/com/ruoyi/basic/controller/CustomerPrivateController.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package com.ruoyi.basic.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.basic.dto.CustomerDto;
-import com.ruoyi.basic.dto.CustomerPrivateDto;
-import com.ruoyi.basic.dto.CustomerPrivatePoolDto;
-import com.ruoyi.basic.pojo.Customer;
-import com.ruoyi.basic.pojo.CustomerPrivate;
-import com.ruoyi.basic.service.CustomerPrivatePoolService;
-import com.ruoyi.basic.service.CustomerPrivateService;
-import com.ruoyi.basic.service.ICustomerService;
-import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.domain.R;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
-
-import static com.ruoyi.framework.web.domain.AjaxResult.success;
-
-/**
- * <p>
- * 瀹㈡埛妗f 鍓嶇鎺у埗鍣�
- * </p>
- *
- * @author 鑺杞欢锛堟睙鑻忥級鏈夐檺鍏徃
- * @since 2026-04-17 10:39:09
- */
-@RestController
-@RequestMapping("/customerPrivate")
-public class CustomerPrivateController {
-    @Autowired
-    private CustomerPrivateService customerPrivateService;
-
-    @Autowired
-    private CustomerPrivatePoolService customerPrivatePoolService;
-
-
-    @PostMapping("/add")
-    public R add(@RequestBody CustomerPrivateDto customerPrivateDto) {
-        return R.ok(customerPrivateService.add(customerPrivateDto));
-    }
-
-
-    @DeleteMapping("/delete")
-    public R delete(@RequestBody List<Long> ids) {
-        return R.ok(customerPrivateService.delete(ids));
-    }
-
-
-    /**
-     * 瀵煎叆瀹㈡埛妗f
-     */
-    @Log(title = "瀹㈡埛妗f", businessType = BusinessType.IMPORT)
-    @PostMapping("/importData")
-    public R importData(MultipartFile file) throws Exception {
-
-        return customerPrivateService.importData(file);
-    }
-
-    /**
-     * 瀵煎嚭瀹㈡埛妗f鍒楄〃
-     */
-    @Log(title = "瀹㈡埛妗f", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, CustomerPrivatePoolDto customerPrivatePoolDto) {
-        List<Long> ids = customerPrivatePoolDto.getIds();
-        List<CustomerPrivatePoolDto> list;
-        if (ids != null && ids.size() > 0) {
-            list = customerPrivatePoolService.selectCustomerPrivatePoolDtoListByIds(ids);
-        } else {
-            list = customerPrivatePoolService.selectCustomerPrivatePoolDtoLists(customerPrivatePoolDto);
-        }
-        ExcelUtil<CustomerPrivatePoolDto> util = new ExcelUtil<CustomerPrivatePoolDto>(CustomerPrivatePoolDto.class);
-        util.exportExcel(response, list, "瀹㈡埛妗f鏁版嵁");
-    }
-
-    @PostMapping("/downloadTemplate")
-    @Log(title = "瀹㈡埛妗f-涓嬭浇妯℃澘", businessType = BusinessType.EXPORT)
-    public void downloadTemplate(HttpServletResponse response) {
-        ExcelUtil<CustomerPrivatePoolDto> util = new ExcelUtil<CustomerPrivatePoolDto>(CustomerPrivatePoolDto.class);
-        util.importTemplateExcel(response, "瀹㈡埛妗f妯℃澘");
-    }
-}
diff --git a/src/main/java/com/ruoyi/basic/controller/CustomerPrivatePoolController.java b/src/main/java/com/ruoyi/basic/controller/CustomerPrivatePoolController.java
deleted file mode 100644
index 8b8edf7..0000000
--- a/src/main/java/com/ruoyi/basic/controller/CustomerPrivatePoolController.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package com.ruoyi.basic.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.basic.dto.CustomerPrivatePoolDto;
-import com.ruoyi.basic.pojo.Customer;
-import com.ruoyi.basic.pojo.CustomerPrivatePool;
-import com.ruoyi.basic.service.CustomerPrivatePoolService;
-import com.ruoyi.common.utils.SecurityUtils;
-import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.domain.R;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
-
-/**
- * <p>
- *  鍓嶇鎺у埗鍣� 瀹㈡埛锛堢娴凤級
- * </p>
- *
- * @author 鑺杞欢锛堟睙鑻忥級鏈夐檺鍏徃
- * @since 2026-04-16 04:43:00
- */
-@RestController
-@Api(tags = "瀹㈡埛锛堢娴凤級")
-@RequestMapping("/customerPrivatePool")
-public class CustomerPrivatePoolController {
-
-    @Autowired
-    private CustomerPrivatePoolService customerPrivatePoolService;
-
-
-    @GetMapping("/listPage")
-    @ApiOperation("瀹㈡埛锛堢娴凤級鍒楄〃")
-    public R listPage(CustomerPrivatePoolDto customerPrivatePoolDto, Page<CustomerPrivatePoolDto> page){
-        //鏌ヨ褰撳墠鐢ㄦ埛鐨勫鎴蜂俊鎭�
-        customerPrivatePoolDto.setBoundId(SecurityUtils.getUserId());
-        IPage<CustomerPrivatePoolDto> listPage = customerPrivatePoolService.listPage(page, customerPrivatePoolDto);
-        return R.ok(listPage);
-    }
-
-    @PostMapping("/add")
-    @ApiOperation("鍒嗛厤瀹㈡埛锛堢娴凤級")
-    public R add(@RequestBody CustomerPrivatePoolDto customerPrivatePool){
-        boolean result = customerPrivatePoolService.add(customerPrivatePool);
-        return R.ok(result);
-    }
-
-    @PutMapping("/update")
-    public R update(@RequestBody CustomerPrivatePoolDto customerPrivatePoolDto) {
-        return R.ok(customerPrivatePoolService.updateCustomerPrivatePoolDto(customerPrivatePoolDto));
-    }
-
-
-    @DeleteMapping("/delete/{id}")
-    @ApiOperation("鍒犻櫎瀹㈡埛锛堢娴凤級")
-    public R delete(@PathVariable Long id){
-        boolean result = customerPrivatePoolService.deleteCustomerPrivatePool(id);
-        return R.ok(result);
-    }
-
-    @PostMapping("/together")
-    @ApiOperation("鍏变韩")
-    public R together( @RequestBody CustomerPrivatePoolDto customerPrivatePool){
-        boolean result = customerPrivatePoolService.together(customerPrivatePool);
-        return R.ok(result);
-    }
-
-    @GetMapping("/info/{id}")
-    @ApiOperation("璇︽儏")
-    public R getInfo(@PathVariable Long id){
-        CustomerPrivatePoolDto customerPrivatePool = customerPrivatePoolService.getInfo(id);
-        return R.ok(customerPrivatePool);
-    }
-
-    @GetMapping("/getbyId/{id}")
-    @ApiOperation("璇︽儏")
-    public R getbyId(@PathVariable Long id){
-        CustomerPrivatePoolDto customerPrivatePool = customerPrivatePoolService.getbyId(id);
-        return R.ok(customerPrivatePool);
-    }
-
-
-
-
-
-}
diff --git a/src/main/java/com/ruoyi/basic/dto/CustomerPrivateDto.java b/src/main/java/com/ruoyi/basic/dto/CustomerPrivateDto.java
deleted file mode 100644
index c06ad62..0000000
--- a/src/main/java/com/ruoyi/basic/dto/CustomerPrivateDto.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.ruoyi.basic.dto;
-
-import com.ruoyi.basic.pojo.CustomerPrivate;
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class CustomerPrivateDto extends CustomerPrivate {
-
-    private List<CustomerFollowUpDto> followUpList;
-}
diff --git a/src/main/java/com/ruoyi/basic/dto/CustomerPrivatePoolDto.java b/src/main/java/com/ruoyi/basic/dto/CustomerPrivatePoolDto.java
deleted file mode 100644
index c06f542..0000000
--- a/src/main/java/com/ruoyi/basic/dto/CustomerPrivatePoolDto.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package com.ruoyi.basic.dto;
-
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.ruoyi.basic.pojo.CustomerFollowUp;
-import com.ruoyi.basic.pojo.CustomerPrivatePool;
-import com.ruoyi.framework.aspectj.lang.annotation.Excel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.util.Date;
-import java.util.List;
-
-@Data
-public class CustomerPrivatePoolDto extends CustomerPrivatePool {
-
-    /**
-     * 瀹㈡埛鍚嶇О
-     */
-    @Excel(name = "瀹㈡埛鍚嶇О")
-    private String customerName;
-    /** 瀹㈡埛鍒嗙被锛氶浂鍞鎴凤紝杩涢攢鍟嗗鎴� */
-
-    @ApiModelProperty(value = "瀹㈡埛瑕乮d")
-    private Long customerId;
-
-    /**
-     * 璺熻繘绋嬪害
-     */
-//    @Excel(name = "璺熻繘绋嬪害")
-    @TableField(exist = false)
-    private String followUpLevel;
-
-    /**
-     * 璺熻繘鏃堕棿
-     */
-//    @Excel(name = "璺熻繘鏃堕棿" , width = 30, dateFormat = "yyyy-MM-dd")
-    @TableField(exist = false)
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date followUpTime;
-
-    @Excel(name = "瀹㈡埛鍒嗙被")
-    private String customerType;
-
-
-    private  String addressPhone;
-    /**
-     * 绾崇◣浜鸿瘑鍒彿
-     */
-    @Excel(name = "绾崇◣浜鸿瘑鍒彿")
-    private String taxpayerIdentificationNumber;
-
-    /**
-     * 鍏徃鍦板潃
-     */
-    @Excel(name = "鍏徃鍦板潃")
-    private String companyAddress;
-
-    /**
-     * 鍏徃鐢佃瘽
-     */
-    @Excel(name = "鍏徃鐢佃瘽")
-    private String companyPhone;
-
-    /**
-     * 鑱旂郴浜�
-     */
-    @Excel(name = "鑱旂郴浜�")
-    private String contactPerson;
-
-    /**
-     * 鑱旂郴鐢佃瘽
-     */
-    @Excel(name = "鑱旂郴鐢佃瘽",cellType = Excel.ColumnType.STRING)
-    private String contactPhone;
-
-    /**
-     * 缁存姢浜�
-     */
-    @Excel(name = "缁存姢浜�")
-    private String maintainer;
-
-    /**
-     * 缁存姢鏃堕棿
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "缁存姢鏃堕棿" , width = 30, dateFormat = "yyyy-MM-dd")
-    private Date maintenanceTime;
-
-    @TableField(fill = FieldFill.INSERT)
-    private Long tenantId;
-
-    @ApiModelProperty(value = "閾惰鍩烘湰鎴�")
-    @Excel(name = "閾惰鍩烘湰鎴�")
-    private String basicBankAccount;
-
-    @ApiModelProperty(value = "閾惰璐﹀彿")
-    @Excel(name = "閾惰璐﹀彿")
-    private String bankAccount;
-
-    @ApiModelProperty(value = "寮�鎴疯鍙�")
-    @Excel(name = "寮�鎴疯鍙�")
-    private String bankCode;
-    @ApiModelProperty(value = "鍒涘缓鐢ㄦ埛")
-    @TableField(fill = FieldFill.INSERT)
-    private Integer createUser;
-
-
-    @ApiModelProperty(value = "璺熻繘璁板綍")
-    private List<CustomerFollowUpDto> followUpList;
-
-    @ApiModelProperty(value = "缁戝畾浜篿ds")
-    private List< Long> boundIds;
-
-    @Excel(isExport = false)
-    private List<Long> ids;
-
-
-}
diff --git a/src/main/java/com/ruoyi/basic/mapper/CustomerMapper.java b/src/main/java/com/ruoyi/basic/mapper/CustomerMapper.java
index b9e5725..2605737 100644
--- a/src/main/java/com/ruoyi/basic/mapper/CustomerMapper.java
+++ b/src/main/java/com/ruoyi/basic/mapper/CustomerMapper.java
@@ -69,4 +69,6 @@
     int deleteCustomerByIds(Long[] ids);
 
     IPage<CustomerVo> listPage(Page<CustomerDto> page, @Param("c") CustomerDto customer, @Param("loginUserId") Long loginUserId);
+
+    List<CustomerVo> list(@Param("c") CustomerDto customer, @Param("loginUserId") Long loginUserId);
 }
\ No newline at end of file
diff --git a/src/main/java/com/ruoyi/basic/mapper/CustomerPrivateMapper.java b/src/main/java/com/ruoyi/basic/mapper/CustomerPrivateMapper.java
deleted file mode 100644
index 4f1bf6d..0000000
--- a/src/main/java/com/ruoyi/basic/mapper/CustomerPrivateMapper.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.ruoyi.basic.mapper;
-
-import com.ruoyi.basic.pojo.CustomerPrivate;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * <p>
- * 瀹㈡埛妗f Mapper 鎺ュ彛
- * </p>
- *
- * @author 鑺杞欢锛堟睙鑻忥級鏈夐檺鍏徃
- * @since 2026-04-17 10:39:09
- */
-@Mapper
-public interface CustomerPrivateMapper extends BaseMapper<CustomerPrivate> {
-
-}
diff --git a/src/main/java/com/ruoyi/basic/mapper/CustomerPrivatePoolMapper.java b/src/main/java/com/ruoyi/basic/mapper/CustomerPrivatePoolMapper.java
deleted file mode 100644
index 4c6f325..0000000
--- a/src/main/java/com/ruoyi/basic/mapper/CustomerPrivatePoolMapper.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.ruoyi.basic.mapper;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.ruoyi.basic.dto.CustomerPrivatePoolDto;
-import com.ruoyi.basic.pojo.CustomerPrivatePool;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- *  Mapper 鎺ュ彛
- * </p>
- *
- * @author 鑺杞欢锛堟睙鑻忥級鏈夐檺鍏徃
- * @since 2026-04-16 04:43:00
- */
-@Mapper
-public interface CustomerPrivatePoolMapper extends BaseMapper<CustomerPrivatePool> {
-
-    IPage<CustomerPrivatePoolDto> listPage(IPage<CustomerPrivatePoolDto> page, @Param("c") CustomerPrivatePoolDto customerPrivatePoolDto);
-
-    CustomerPrivatePoolDto selectInfo(Long id);
-
-    List<CustomerPrivatePoolDto> selectInfos();
-
-}
diff --git a/src/main/java/com/ruoyi/basic/pojo/CustomerFollowUp.java b/src/main/java/com/ruoyi/basic/pojo/CustomerFollowUp.java
index 714f26c..f972d45 100644
--- a/src/main/java/com/ruoyi/basic/pojo/CustomerFollowUp.java
+++ b/src/main/java/com/ruoyi/basic/pojo/CustomerFollowUp.java
@@ -37,7 +37,7 @@
     /**
      * 鍏宠仈鐨勭娴穒d
      */
-    private Long customerPrivatePoolId;
+//    private Long customerPrivatePoolId;
 
     private Long customerId;
 
diff --git a/src/main/java/com/ruoyi/basic/pojo/CustomerPrivate.java b/src/main/java/com/ruoyi/basic/pojo/CustomerPrivate.java
deleted file mode 100644
index 85f49a5..0000000
--- a/src/main/java/com/ruoyi/basic/pojo/CustomerPrivate.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package com.ruoyi.basic.pojo;
-
-import com.baomidou.mybatisplus.annotation.FieldFill;
-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.time.LocalDate;
-import java.util.Date;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.ruoyi.framework.aspectj.lang.annotation.Excel;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * <p>
- * 瀹㈡埛妗f
- * </p>
- *
- * @author 鑺杞欢锛堟睙鑻忥級鏈夐檺鍏徃
- * @since 2026-04-17 10:39:09
- */
-@Getter
-@Setter
-@TableName("customer_private")
-@ApiModel(value = "CustomerPrivate瀵硅薄", description = "瀹㈡埛妗f")
-public class CustomerPrivate implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    @ApiModelProperty("瀹㈡埛鍚嶇О")
-    @Excel(name = "瀹㈡埛鍚嶇О")
-    private String customerName;
-
-    @ApiModelProperty("绾崇◣浜鸿瘑鍒彿")
-    @Excel(name = "绾崇◣浜鸿瘑鍒彿")
-    private String taxpayerIdentificationNumber;
-
-    @ApiModelProperty("鍏徃鍦板潃")
-    @Excel(name = "鍏徃鍦板潃")
-    private String companyAddress;
-
-    @ApiModelProperty("鍏徃鐢佃瘽")
-    @Excel(name = "鍏徃鐢佃瘽")
-    private String companyPhone;
-
-    @ApiModelProperty("鑱旂郴浜�")
-    @Excel(name = "鑱旂郴浜�")
-    private String contactPerson;
-
-    @ApiModelProperty("鑱旂郴鐢佃瘽")
-    @Excel(name = "鑱旂郴鐢佃瘽", cellType = Excel.ColumnType.STRING)
-    private String contactPhone;
-
-    @ApiModelProperty("缁存姢浜�")
-    @Excel(name = "缁存姢浜�")
-    private String maintainer;
-
-    @ApiModelProperty("缁存姢鏃堕棿")
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "缁存姢鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date maintenanceTime;
-
-    @ApiModelProperty("绉熸埛ID")
-    @TableField(fill = FieldFill.INSERT)
-    private Long tenantId;
-
-    @ApiModelProperty("閾惰鍩烘湰鎴�")
-    @Excel(name = "閾惰鍩烘湰鎴�")
-    private String basicBankAccount;
-
-    @ApiModelProperty("閾惰璐﹀彿")
-    @Excel(name = "閾惰璐﹀彿")
-    private String bankAccount;
-
-    @ApiModelProperty("寮�鎴疯鍙�")
-    @Excel(name = "寮�鎴疯鍙�")
-    private String bankCode;
-
-    @ApiModelProperty("瀹㈡埛鍒嗙被锛氶浂鍞鎴凤紝杩涢攢鍟嗗鎴�")
-    @Excel(name = "瀹㈡埛鍒嗙被")
-    private String customerType;
-
-    @ApiModelProperty("鍒涘缓浜篒D")
-    @TableField(fill = FieldFill.INSERT)
-    private Long createUser;
-
-    @ApiModelProperty("閮ㄩ棬ID")
-    @TableField(fill = FieldFill.INSERT)
-    private Long deptId;
-
-
-    @ApiModelProperty("璺熻繘绋嬪害")
-    @TableField(exist = false)
-    private String followUpLevel;
-
-    @ApiModelProperty("璺熻繘鏃堕棿")
-    @TableField(exist = false)
-    private Date followUpTime;
-
-
-    @TableField(exist = false)
-    private Long[] ids;
-
-    @TableField(exist = false)
-    private String addressPhone;
-
-}
diff --git a/src/main/java/com/ruoyi/basic/pojo/CustomerPrivatePool.java b/src/main/java/com/ruoyi/basic/pojo/CustomerPrivatePool.java
deleted file mode 100644
index edf88d7..0000000
--- a/src/main/java/com/ruoyi/basic/pojo/CustomerPrivatePool.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package com.ruoyi.basic.pojo;
-
-import com.baomidou.mybatisplus.annotation.FieldFill;
-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.time.LocalDateTime;
-
-import com.ruoyi.framework.aspectj.lang.annotation.Excel;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author 鑺杞欢锛堟睙鑻忥級鏈夐檺鍏徃
- * @since 2026-04-16 04:43:00
- */
-@Data
-@TableName("customer_private_pool")
-@ApiModel(value = "CustomerPrivatePool瀵硅薄", description = "")
-public class CustomerPrivatePool implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    @ApiModelProperty("涓婚敭id")
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    @ApiModelProperty("瀹㈡埛id")
-    private Long customerId;
-
-    @ApiModelProperty("缁戝畾浜篿d")
-    private Long boundId;
-
-    @ApiModelProperty("鍒涘缓浜�")
-    @TableField(fill = FieldFill.INSERT)
-    private Integer createUser;
-
-    @ApiModelProperty("鏇存柊浜�")
-    @TableField(fill = FieldFill.INSERT_UPDATE)
-    private Integer updateUser;
-
-    @ApiModelProperty("鍒涘缓鏃堕棿")
-    @TableField(fill = FieldFill.INSERT)
-    private LocalDateTime createTime;
-
-    @ApiModelProperty("鏇存柊鏃堕棿")
-    @TableField(fill = FieldFill.INSERT_UPDATE)
-    private LocalDateTime updateTime;
-
-    @ApiModelProperty("绫诲瀷鍖哄垎鍏捣瀹㈡埛鍜岀娴峰鎴� 榛樿鏄娴峰鎴�0 鍏捣1")
-    private Long type;
-
-    @ApiModelProperty("閮ㄩ棬id")
-    @TableField(fill = FieldFill.INSERT)
-    private Long deptId;
-
-    @ApiModelProperty("鍒犻櫎鏍囪瘑 榛樿0 1宸茬粡鍒犻櫎")
-    private Integer DeleteFlag;
-}
diff --git a/src/main/java/com/ruoyi/basic/pojo/CustomerReturnVisit.java b/src/main/java/com/ruoyi/basic/pojo/CustomerReturnVisit.java
index 88768e4..8b2b5a1 100644
--- a/src/main/java/com/ruoyi/basic/pojo/CustomerReturnVisit.java
+++ b/src/main/java/com/ruoyi/basic/pojo/CustomerReturnVisit.java
@@ -36,7 +36,7 @@
     /**
      * 鍏宠仈瀹㈡埛ID
      */
-    private Integer customerPrivatePoolId;
+//    private Integer customerPrivatePoolId;
 
     private Long customerId;
 
diff --git a/src/main/java/com/ruoyi/basic/service/CustomerPrivatePoolService.java b/src/main/java/com/ruoyi/basic/service/CustomerPrivatePoolService.java
deleted file mode 100644
index 18ca371..0000000
--- a/src/main/java/com/ruoyi/basic/service/CustomerPrivatePoolService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.ruoyi.basic.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.basic.dto.CustomerPrivatePoolDto;
-import com.ruoyi.basic.pojo.Customer;
-import com.ruoyi.basic.pojo.CustomerPrivatePool;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-import java.util.List;
-
-/**
- * <p>
- *  鏈嶅姟绫�
- * </p>
- *
- * @author 鑺杞欢锛堟睙鑻忥級鏈夐檺鍏徃
- * @since 2026-04-16 04:43:00
- */
-public interface CustomerPrivatePoolService extends IService<CustomerPrivatePool> {
-
-    IPage<CustomerPrivatePoolDto> listPage(Page<CustomerPrivatePoolDto> page, CustomerPrivatePoolDto customerPrivatePoolDto);
-
-    boolean deleteCustomerPrivatePool(Long id);
-
-    boolean together(CustomerPrivatePoolDto customerPrivatePool);
-
-    boolean add(CustomerPrivatePoolDto customerPrivatePool);
-
-    CustomerPrivatePoolDto getInfo(Long id);
-
-    Boolean updateCustomerPrivatePoolDto(CustomerPrivatePoolDto customerPrivatePoolDto);
-
-    CustomerPrivatePoolDto getbyId(Long id);
-
-    List<CustomerPrivatePoolDto> selectCustomerPrivatePoolDtoListByIds(List<Long> ids);
-
-    List<CustomerPrivatePoolDto> selectCustomerPrivatePoolDtoLists(CustomerPrivatePoolDto customerPrivatePoolDto);
-}
diff --git a/src/main/java/com/ruoyi/basic/service/CustomerPrivateService.java b/src/main/java/com/ruoyi/basic/service/CustomerPrivateService.java
deleted file mode 100644
index e758157..0000000
--- a/src/main/java/com/ruoyi/basic/service/CustomerPrivateService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.ruoyi.basic.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.basic.dto.CustomerPrivateDto;
-import com.ruoyi.basic.dto.CustomerPrivatePoolDto;
-import com.ruoyi.basic.pojo.Customer;
-import com.ruoyi.basic.pojo.CustomerPrivate;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.domain.R;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.List;
-
-/**
- * <p>
- * 瀹㈡埛妗f 鏈嶅姟绫�
- * </p>
- *
- * @author 鑺杞欢锛堟睙鑻忥級鏈夐檺鍏徃
- * @since 2026-04-17 10:39:09
- */
-public interface CustomerPrivateService extends IService<CustomerPrivate> {
-
-
-    Boolean add(CustomerPrivateDto customerPrivateDto);
-
-
-    Integer delete(List<Long> id);
-
-    R importData(MultipartFile file);
-}
diff --git a/src/main/java/com/ruoyi/basic/service/ICustomerService.java b/src/main/java/com/ruoyi/basic/service/ICustomerService.java
index 2b4c887..c120e72 100644
--- a/src/main/java/com/ruoyi/basic/service/ICustomerService.java
+++ b/src/main/java/com/ruoyi/basic/service/ICustomerService.java
@@ -75,9 +75,9 @@
      */
     List<Map<String, Object>> customerList(Customer customer);
 
-    List<Customer> selectCustomerLists(Customer customer);
+    List<CustomerVo> selectCustomerLists(CustomerDto customer);
 
-    AjaxResult importData(MultipartFile file);
+    AjaxResult importData(MultipartFile file, Integer type);
 
     IPage<CustomerVo> selectCustomerList(Page<CustomerDto> page, CustomerDto customer);
 
diff --git a/src/main/java/com/ruoyi/basic/service/impl/CustomerFollowUpServiceImpl.java b/src/main/java/com/ruoyi/basic/service/impl/CustomerFollowUpServiceImpl.java
index 12c7e06..5637307 100644
--- a/src/main/java/com/ruoyi/basic/service/impl/CustomerFollowUpServiceImpl.java
+++ b/src/main/java/com/ruoyi/basic/service/impl/CustomerFollowUpServiceImpl.java
@@ -132,7 +132,7 @@
         }
 
         List<CustomerFollowUp> followUps = list(new LambdaQueryWrapper<CustomerFollowUp>()
-                .eq(CustomerFollowUp::getCustomerPrivatePoolId, customerId));
+                .eq(CustomerFollowUp::getCustomerId, customerId));
 
         if (followUps != null && !followUps.isEmpty()) {
             for (CustomerFollowUp followUp : followUps) {
diff --git a/src/main/java/com/ruoyi/basic/service/impl/CustomerPrivatePoolServiceImpl.java b/src/main/java/com/ruoyi/basic/service/impl/CustomerPrivatePoolServiceImpl.java
deleted file mode 100644
index 0586c9b..0000000
--- a/src/main/java/com/ruoyi/basic/service/impl/CustomerPrivatePoolServiceImpl.java
+++ /dev/null
@@ -1,234 +0,0 @@
-package com.ruoyi.basic.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.basic.dto.CustomerDto;
-import com.ruoyi.basic.dto.CustomerFollowUpDto;
-import com.ruoyi.basic.dto.CustomerPrivatePoolDto;
-import com.ruoyi.basic.mapper.CustomerPrivateMapper;
-import com.ruoyi.basic.pojo.*;
-import com.ruoyi.basic.mapper.CustomerPrivatePoolMapper;
-import com.ruoyi.basic.service.*;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.sales.mapper.SalesLedgerMapper;
-import com.ruoyi.sales.pojo.SalesLedger;
-import org.checkerframework.checker.units.qual.A;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.time.ZoneId;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- * 鏈嶅姟瀹炵幇绫�
- * </p>
- *
- * @author 鑺杞欢锛堟睙鑻忥級鏈夐檺鍏徃
- * @since 2026-04-16 04:43:00
- */
-@Service
-@Transactional(rollbackFor = Exception.class)
-public class CustomerPrivatePoolServiceImpl extends ServiceImpl<CustomerPrivatePoolMapper, CustomerPrivatePool> implements CustomerPrivatePoolService {
-
-    @Autowired
-    private CustomerPrivatePoolMapper customerPrivatePoolMapper;
-
-    @Autowired
-    private CustomerFollowUpService customerFollowUpService;
-
-    @Autowired
-    private CustomerReturnVisitService customerReturnVisitService;
-
-    @Autowired
-    private ICustomerService customerService;
-
-    @Autowired
-    private CustomerFollowUpFileService customerFollowUpFileService;
-    @Autowired
-    private CustomerPrivateMapper customerPrivateMapper;
-
-
-    @Override
-    public IPage<CustomerPrivatePoolDto> listPage(Page<CustomerPrivatePoolDto> page, CustomerPrivatePoolDto customerPrivatePoolDto) {
-        IPage<CustomerPrivatePoolDto> customerPrivatePoolDtoIPage = customerPrivatePoolMapper.listPage(page, customerPrivatePoolDto);
-        List<Long> customerIds = customerPrivatePoolDtoIPage.getRecords().stream()
-                .map(CustomerPrivatePoolDto::getId )
-                .filter(Objects::nonNull)
-                .collect(Collectors.toList());
-
-        if (!org.springframework.util.CollectionUtils.isEmpty(customerIds)) {
-            Map<Long, CustomerFollowUp> latestFollowUpMap = getLatestFollowUpMap(customerIds);
-
-            customerPrivatePoolDtoIPage.getRecords().forEach(c -> {
-                String address = StringUtils.defaultString(c.getCompanyAddress(), "");
-                String phone = StringUtils.defaultString(c.getCompanyPhone(), "");
-                c.setAddressPhone(address + "(" + phone + ")");
-
-                CustomerFollowUp followUp = latestFollowUpMap.get(c.getId());
-                if (followUp != null) {
-                    c.setFollowUpLevel(followUp.getFollowUpLevel());
-                    c.setFollowUpTime(Date.from(
-                            followUp.getFollowUpTime().atZone(ZoneId.systemDefault()).toInstant()
-                    ));
-                }
-            });
-
-        }
-        return customerPrivatePoolDtoIPage;
-    }
-
-
-    private Map<Long, CustomerFollowUp> getLatestFollowUpMap(List<Long> customerIds) {
-        List<CustomerFollowUp> followUps = customerFollowUpService.list(
-                new LambdaQueryWrapper<CustomerFollowUp>()
-                        .in(CustomerFollowUp::getCustomerPrivatePoolId, customerIds)
-                        .orderByDesc(CustomerFollowUp::getFollowUpTime)
-        );
-
-        return followUps.stream()
-                .collect(Collectors.toMap(
-                        CustomerFollowUp::getCustomerPrivatePoolId,
-                        followUp -> followUp,
-                        (existing, replacement) -> existing
-                ));
-    }
-
-    @Override
-    public boolean deleteCustomerPrivatePool(Long id) {
-        List<CustomerPrivatePool> list = this.list(new QueryWrapper<CustomerPrivatePool>().lambda().eq(CustomerPrivatePool::getCustomerId, id));
-
-        for (CustomerPrivatePool customerPrivatePool : list) {
-            customerFollowUpService.remove(new QueryWrapper<CustomerFollowUp>().lambda().eq(CustomerFollowUp::getCustomerPrivatePoolId, customerPrivatePool.getId()));
-            customerReturnVisitService.remove(new QueryWrapper<CustomerReturnVisit>().lambda().eq(CustomerReturnVisit::getCustomerPrivatePoolId, customerPrivatePool.getId()));
-        }
-        Customer byId = customerService.getById(id);
-        byId.setUsageStatus(0L);
-        byId.setUsageUser(0L);
-        customerService.updateById(byId);
-        list.stream().forEach(customerPrivatePool -> {
-            customerPrivatePool.setDeleteFlag(1);
-            customerPrivatePoolMapper.updateById(customerPrivatePool);
-        });
-        return true;
-    }
-
-    @Override
-    public boolean together(CustomerPrivatePoolDto customerPrivatePoolDto) {
-        List<CustomerPrivatePool> existingPools = this.list(new QueryWrapper<CustomerPrivatePool>().lambda().eq(CustomerPrivatePool::getCustomerId, customerPrivatePoolDto.getCustomerId()));
-
-        List<Long> existingBoundIds = existingPools.stream()
-                .map(CustomerPrivatePool::getBoundId)
-                .collect(Collectors.toList());
-
-        List<Long> newBoundIds = customerPrivatePoolDto.getBoundIds().stream()
-                .filter(boundId -> !existingBoundIds.contains(boundId))
-                .collect(Collectors.toList());
-
-        if (CollectionUtils.isEmpty(newBoundIds)) {
-            return true;
-        }
-        for (Long id : customerPrivatePoolDto.getBoundIds()) {
-            CustomerPrivatePool customerPrivatePool = new CustomerPrivatePool();
-            customerPrivatePool.setCustomerId(customerPrivatePoolDto.getCustomerId());
-            customerPrivatePool.setBoundId(id);
-            customerPrivatePool.setType(1L);
-            this.save(customerPrivatePool);
-        }
-        return true;
-    }
-
-    @Override
-    public boolean add(CustomerPrivatePoolDto customerPrivatePool) {
-        customerPrivatePool.setType(1L);
-        this.save(customerPrivatePool);
-        Customer byId = customerService.getById(customerPrivatePool.getCustomerId());
-        if (byId != null) {
-            byId.setUsageStatus(1L);
-            byId.setUsageUser(customerPrivatePool.getBoundId());
-            return customerService.updateById(byId);
-        }
-        throw new RuntimeException("瀹㈡埛涓嶅瓨鍦�");
-
-    }
-
-    @Override
-    public CustomerPrivatePoolDto getInfo(Long id) {
-        CustomerPrivatePoolDto customerPrivatePool = customerPrivatePoolMapper.selectInfo(id);
-        if (customerPrivatePool == null) {
-            return null;
-        }
-
-        // 鏌ヨ璺熻繘璁板綍
-        List<CustomerFollowUp> followUpList = customerFollowUpService.list(
-                new LambdaQueryWrapper<CustomerFollowUp>()
-                        .eq(CustomerFollowUp::getCustomerPrivatePoolId, id)
-                        .orderByDesc(CustomerFollowUp::getFollowUpTime)
-        );
-        if (!CollectionUtils.isEmpty(followUpList)) {
-            List<CustomerFollowUpDto> followUpDtoList = followUpList.stream().map(followUp -> {
-                CustomerFollowUpDto followUpDto = new CustomerFollowUpDto();
-                BeanUtils.copyProperties(followUp, followUpDto);
-
-                // 鏌ヨ闄勪欢
-                List<CustomerFollowUpFile> fileList = customerFollowUpFileService.list(
-                        new LambdaQueryWrapper<CustomerFollowUpFile>()
-                                .eq(CustomerFollowUpFile::getFollowUpId, followUp.getId())
-                );
-                followUpDto.setFileList(fileList);
-
-                return followUpDto;
-            }).collect(Collectors.toList());
-
-            customerPrivatePool.setFollowUpList(followUpDtoList);
-        }
-
-        return customerPrivatePool;
-    }
-
-    @Override
-    public Boolean updateCustomerPrivatePoolDto(CustomerPrivatePoolDto customerPrivatePoolDto) {
-        if (customerPrivatePoolDto.getType() == 0L) {
-            CustomerPrivate byId = customerPrivateMapper.selectById(customerPrivatePoolDto.getCustomerId());
-            BeanUtils.copyProperties(customerPrivatePoolDto, byId);
-            byId.setId(customerPrivatePoolDto.getCustomerId());
-            customerPrivateMapper.updateById(byId);
-        } else if (customerPrivatePoolDto.getType() == 1L) {
-            Customer customer = customerService.getById(customerPrivatePoolDto.getCustomerId());
-            BeanUtils.copyProperties(customerPrivatePoolDto, customer);
-            customer.setId(customerPrivatePoolDto.getCustomerId());
-            customerService.updateById(customer);
-        }
-        return true;
-    }
-
-    @Override
-    public CustomerPrivatePoolDto getbyId(Long id) {
-        CustomerPrivatePoolDto customerPrivatePool = customerPrivatePoolMapper.selectInfo(id);
-        return customerPrivatePool;
-    }
-
-    @Override
-    public List<CustomerPrivatePoolDto> selectCustomerPrivatePoolDtoListByIds(List<Long> ids) {
-        ArrayList<CustomerPrivatePoolDto> customerPrivatePoolDtos = new ArrayList<>();
-        for (Long id : ids) {
-            CustomerPrivatePoolDto customerPrivatePoolDto = customerPrivatePoolMapper.selectInfo(id);
-            customerPrivatePoolDtos.add(customerPrivatePoolDto);
-        }
-        return customerPrivatePoolDtos;
-    }
-
-    @Override
-    public List<CustomerPrivatePoolDto> selectCustomerPrivatePoolDtoLists(CustomerPrivatePoolDto customerPrivatePoolDto) {
-
-        return customerPrivatePoolMapper.selectInfos();
-    }
-}
diff --git a/src/main/java/com/ruoyi/basic/service/impl/CustomerPrivateServiceImpl.java b/src/main/java/com/ruoyi/basic/service/impl/CustomerPrivateServiceImpl.java
deleted file mode 100644
index 95f6193..0000000
--- a/src/main/java/com/ruoyi/basic/service/impl/CustomerPrivateServiceImpl.java
+++ /dev/null
@@ -1,132 +0,0 @@
-package com.ruoyi.basic.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.basic.dto.CustomerPrivateDto;
-import com.ruoyi.basic.dto.CustomerPrivatePoolDto;
-import com.ruoyi.basic.mapper.CustomerMapper;
-import com.ruoyi.basic.mapper.CustomerPrivatePoolMapper;
-import com.ruoyi.basic.pojo.*;
-import com.ruoyi.basic.mapper.CustomerPrivateMapper;
-import com.ruoyi.basic.service.CustomerFollowUpService;
-import com.ruoyi.basic.service.CustomerPrivateService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ruoyi.basic.service.CustomerReturnVisitService;
-import com.ruoyi.common.utils.SecurityUtils;
-import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.framework.security.LoginUser;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.domain.R;
-import com.ruoyi.sales.mapper.SalesLedgerMapper;
-import com.ruoyi.sales.pojo.SalesLedger;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- * 瀹㈡埛妗f 鏈嶅姟瀹炵幇绫�
- * </p>
- *
- * @author 鑺杞欢锛堟睙鑻忥級鏈夐檺鍏徃
- * @since 2026-04-17 10:39:09
- */
-@Service
-@Transactional(rollbackFor = Exception.class)
-public class CustomerPrivateServiceImpl extends ServiceImpl<CustomerPrivateMapper, CustomerPrivate> implements CustomerPrivateService {
-
-
-    @Autowired
-    private CustomerPrivatePoolMapper customerPrivatePoolMapper;
-
-    @Autowired
-    private CustomerFollowUpService customerFollowUpService;
-
-    @Autowired
-    private CustomerReturnVisitService customerReturnVisitService;
-    @Autowired
-    private SalesLedgerMapper salesLedgerMapper;
-
-    @Autowired
-    private  CustomerPrivateMapper customerPrivateMapper;
-    @Autowired
-    private CustomerPrivateService customerPrivateService;
-
-
-    @Override
-    public Boolean add(CustomerPrivateDto customerPrivateDto) {
-        //鏂板绉佹捣 瀹㈡埛
-        this.save(customerPrivateDto);
-        //鏂板绉佹捣璁板綍
-        CustomerPrivatePool customerPrivatePool = new CustomerPrivatePool();
-        customerPrivatePool.setCustomerId(customerPrivateDto.getId());
-        customerPrivatePool.setType(0L);
-        customerPrivatePool.setBoundId(SecurityUtils.getLoginUser().getUserId());
-        customerPrivatePoolMapper.insert(customerPrivatePool);
-        return true;
-    }
-
-
-    @Override
-    public Integer delete(List<Long> ids) {
-        List<CustomerPrivatePool> customerPrivatePools = customerPrivatePoolMapper.selectList(new QueryWrapper<CustomerPrivatePool>().lambda().in(CustomerPrivatePool::getId, ids));
-        List<SalesLedger> salesLedgers = salesLedgerMapper.selectList(new QueryWrapper<SalesLedger>().lambda().in(SalesLedger::getCustomerId, customerPrivatePools.stream().map(CustomerPrivatePool::getCustomerId).collect(Collectors.toList())));
-        if (!CollectionUtils.isEmpty(salesLedgers)) {
-            throw new RuntimeException("瀹㈡埛鏈夐攢鍞悎鍚岋紝璇峰厛鍒犻櫎閿�鍞悎鍚�");
-        }
-        if (CollectionUtils.isEmpty(customerPrivatePools)) {
-            throw new RuntimeException("瀹㈡埛涓嶅瓨鍦�");
-        }
-        customerFollowUpService.remove(new QueryWrapper<CustomerFollowUp>().lambda().in(CustomerFollowUp::getCustomerPrivatePoolId, customerPrivatePools.stream().map(CustomerPrivatePool::getCustomerId).collect(Collectors.toList())));
-        customerReturnVisitService.remove(new QueryWrapper<CustomerReturnVisit>().lambda().in(CustomerReturnVisit::getCustomerPrivatePoolId, customerPrivatePools.stream().map(CustomerPrivatePool::getCustomerId).collect(Collectors.toList())));
-        customerPrivatePools.stream().forEach(customerPrivatePool -> {
-            customerPrivatePool.setDeleteFlag(1);
-            customerPrivatePoolMapper.updateById(customerPrivatePool);
-        });
-        return 1;
-
-    }
-
-    @Override
-    public R importData(MultipartFile file) {
-        try {
-            List<CustomerPrivate> existingList = customerPrivateService.list();
-            java.util.Set<String> existingCustomerNames = existingList.stream()
-                    .map(CustomerPrivate::getCustomerName)
-                    .collect(Collectors.toSet());
-
-            ExcelUtil<CustomerPrivate> util = new ExcelUtil<CustomerPrivate>(CustomerPrivate.class);
-            List<CustomerPrivate> userList = util.importExcel(file.getInputStream());
-            if (CollectionUtils.isEmpty(userList)) {
-                return R.fail("妯℃澘閿欒鎴栧鍏ユ暟鎹负绌�");
-            }
-
-            int successCount = 0;
-            int skipCount = 0;
-            for (CustomerPrivate user : userList) {
-                if (existingCustomerNames.contains(user.getCustomerName())) {
-                    skipCount++;
-                    continue;
-                }
-                CustomerPrivateDto customerPrivateDto = new CustomerPrivateDto();
-                BeanUtils.copyProperties(user, customerPrivateDto);
-                this.add(customerPrivateDto);
-                existingCustomerNames.add(user.getCustomerName());
-                successCount++;
-            }
-            return R.ok("瀵煎叆瀹屾垚锛屾垚鍔�" + successCount + "鏉★紝璺宠繃閲嶅" + skipCount + "鏉�");
-        } catch (Exception e) {
-            e.printStackTrace();
-            return R.fail("瀵煎叆澶辫触锛�" + e.getMessage());
-        }
-    }
-}
diff --git a/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java b/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
index 9c69a02..d826a94 100644
--- a/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
+++ b/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
@@ -10,7 +10,6 @@
 import com.ruoyi.basic.dto.CustomerDto;
 import com.ruoyi.basic.dto.CustomerFollowUpDto;
 import com.ruoyi.basic.mapper.CustomerMapper;
-import com.ruoyi.basic.mapper.CustomerPrivatePoolMapper;
 import com.ruoyi.basic.pojo.*;
 import com.ruoyi.basic.service.CustomerFollowUpFileService;
 import com.ruoyi.basic.service.CustomerFollowUpService;
@@ -52,8 +51,6 @@
     @Autowired
     private  SalesLedgerMapper salesLedgerMapper;
     @Autowired
-    private CustomerPrivatePoolMapper customerPrivatePoolMapper;
-    @Autowired
     private CustomerMapper customerMapper;
 
     @Autowired
@@ -62,7 +59,7 @@
     private CustomerFollowUpFileService customerFollowUpFileService;
     @Autowired
     private CustomerReturnVisitService customerReturnVisitService;
-
+    @Autowired
     private CustomerUserService customerUserService;
 
     /**
@@ -170,13 +167,13 @@
     private Map<Long, CustomerFollowUp> getLatestFollowUpMap(List<Long> customerIds) {
         List<CustomerFollowUp> followUps = customerFollowUpService.list(
                 new LambdaQueryWrapper<CustomerFollowUp>()
-                        .in(CustomerFollowUp::getCustomerPrivatePoolId, customerIds)
+                        .in(CustomerFollowUp::getCustomerId, customerIds)
                         .orderByDesc(CustomerFollowUp::getFollowUpTime)
         );
 
         return followUps.stream()
                 .collect(Collectors.toMap(
-                        CustomerFollowUp::getCustomerPrivatePoolId,
+                        CustomerFollowUp::getCustomerId,
                         followUp -> followUp,
                         (existing, replacement) -> existing
                 ));
@@ -234,13 +231,18 @@
         if (!assignedPools.isEmpty()) {
             throw new RuntimeException("瀹㈡埛妗f涓嬫湁宸插垎閰嶇殑鍏捣瀹㈡埛锛岃鍏堟敹鍥�");
         }
-        //  鍒犻櫎瀹㈡埛鐨勫悓鏃朵篃闇�瑕佸垹闄ゅ搴旂殑瀹㈡埛璺熼殢銆侀檮浠跺拰鍥炶鎻愰啋
+        // 鍒犻櫎瀹㈡埛鐨勫悓鏃朵篃闇�瑕佸垹闄ゅ搴旂殑瀹㈡埛璺熼殢銆侀檮浠跺拰鍥炶鎻愰啋
         for (Long id : ids) {
             customerFollowUpService.deleteByCustomerId(id);
             customerReturnVisitService.deleteByCustomerId(id);
+            // 鍒犻櫎瀹㈡埛鐨勫叡浜叧绯�
+            customerUserService.remove(
+                new QueryWrapper<CustomerUser>().lambda()
+                    .eq(CustomerUser::getCustomerId, id)
+            );
         }
-        customerMapper.delete(new QueryWrapper<Customer>().lambda().in(Customer::getId, idList));
 
+        // 鍒犻櫎瀹㈡埛涓昏〃鏁版嵁
         return customerMapper.deleteBatchIds(idList);
     }
 
@@ -252,18 +254,27 @@
     }
 
     @Override
-    public List<Customer> selectCustomerLists(Customer customer) {
-        return customerMapper.selectList(null);
+    public List<CustomerVo> selectCustomerLists(CustomerDto customer) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        Long loginUserId = loginUser.getUserId();
+        return customerMapper.list(customer, loginUserId);
     }
 
     @Override
-    public AjaxResult importData(MultipartFile file) {
+    public AjaxResult importData(MultipartFile file, Integer type) {
         try {
             ExcelUtil<Customer> util = new ExcelUtil<Customer>(Customer.class);
             List<Customer> userList = util.importExcel(file.getInputStream());
             if (CollectionUtils.isEmpty(userList)) {
                 return AjaxResult.warn("妯℃澘閿欒鎴栧鍏ユ暟鎹负绌�");
             }
+
+            // 鏍规嵁 type 鍙傛暟璁剧疆瀹㈡埛绫诲瀷锛堢娴�/鍏捣锛�
+            if (type != null) {
+                userList.forEach(customer -> {
+                    customer.setType(type);
+                });
+            }
             this.saveOrUpdateBatch(userList);
             return AjaxResult.success(true);
         } catch (Exception e) {
diff --git a/src/main/java/com/ruoyi/sales/pojo/SalesQuotation.java b/src/main/java/com/ruoyi/sales/pojo/SalesQuotation.java
index 2761fd7..b72b3af 100644
--- a/src/main/java/com/ruoyi/sales/pojo/SalesQuotation.java
+++ b/src/main/java/com/ruoyi/sales/pojo/SalesQuotation.java
@@ -23,6 +23,9 @@
     @Excel(name = "瀹㈡埛鍚嶇О")
     private String customer;
 
+    @ApiModelProperty(value = "瀹㈡埛id")
+    private Long customerId;
+
     @ApiModelProperty(value = "涓氬姟鍛�")
     @Excel(name = "涓氬姟鍛�")
     private String salesperson;
diff --git a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
index e2c11cf..3b0cc55 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -9,13 +9,10 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.account.service.AccountIncomeService;
-import com.ruoyi.basic.dto.CustomerPrivatePoolDto;
 import com.ruoyi.basic.mapper.CustomerMapper;
-import com.ruoyi.basic.mapper.CustomerPrivatePoolMapper;
 import com.ruoyi.basic.mapper.ProductMapper;
 import com.ruoyi.basic.mapper.ProductModelMapper;
 import com.ruoyi.basic.pojo.Customer;
-import com.ruoyi.basic.pojo.CustomerPrivatePool;
 import com.ruoyi.common.enums.FileNameType;
 import com.ruoyi.common.enums.SaleEnum;
 import com.ruoyi.common.exception.base.BaseException;
@@ -131,8 +128,6 @@
     ;
     @Autowired
     private SysUserMapper sysUserMapper;
-    @Autowired
-    private CustomerPrivatePoolMapper customerPrivatePoolMapper;
 
     @Override
     public List<SalesLedger> selectSalesLedgerList(SalesLedgerDto salesLedgerDto) {
@@ -599,7 +594,7 @@
     public int addOrUpdateSalesLedger(SalesLedgerDto salesLedgerDto) {
         try {
             // 1. 鏍¢獙瀹㈡埛淇℃伅
-            CustomerPrivatePoolDto customer = customerPrivatePoolMapper.selectInfo(salesLedgerDto.getCustomerId());
+            Customer customer = customerMapper.selectById(salesLedgerDto.getCustomerId());
             if (customer == null) {
                 throw new BaseException("瀹㈡埛涓嶅瓨鍦�");
             }
diff --git a/src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java
index f5ea4e4..1d81401 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java
@@ -7,16 +7,12 @@
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
 import com.ruoyi.approve.pojo.ApproveProcess;
-import com.ruoyi.approve.service.IApproveProcessService;
 import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl;
 import com.ruoyi.approve.bean.vo.ApproveGetAndUpdateVo;
 import com.ruoyi.approve.bean.vo.ApproveProcessVO;
-import com.ruoyi.basic.dto.CustomerPrivatePoolDto;
-import com.ruoyi.basic.mapper.CustomerPrivatePoolMapper;
 import com.ruoyi.common.utils.OrderUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.bean.BeanUtils;
-import com.ruoyi.common.utils.uuid.UUID;
 import com.ruoyi.framework.security.LoginUser;
 import com.ruoyi.sales.dto.SalesQuotationDto;
 import com.ruoyi.sales.mapper.SalesQuotationMapper;
diff --git a/src/main/resources/mapper/basic/CustomerMapper.xml b/src/main/resources/mapper/basic/CustomerMapper.xml
index 982f70f..57dea6c 100644
--- a/src/main/resources/mapper/basic/CustomerMapper.xml
+++ b/src/main/resources/mapper/basic/CustomerMapper.xml
@@ -54,5 +54,57 @@
         </where>
     </select>
 
-
+    <select id="list" resultType="com.ruoyi.basic.vo.CustomerVo">
+        select
+        c.*,
+        u.user_name usage_user_name,
+        (
+        select group_concat(u2.user_name separator ', ')
+        from customer_user cu
+        left join sys_user u2 on cu.user_id = u2.user_id
+        where cu.customer_id = c.id
+        and cu.user_id != c.usage_user
+        ) as together_user_names,
+        (
+        select group_concat(cu.user_id separator ',')
+        from customer_user cu
+        where cu.customer_id = c.id
+        and cu.user_id != c.usage_user
+        ) as user_ids_str
+        from customer c
+        left join sys_user u on c.usage_user = u.user_id
+        <where>
+            <if test="c.ids != null and c.ids.length > 0">
+                and c.id in
+                <foreach collection="c.ids" item="id" open="(" separator="," close=")">
+                    #{id}
+                </foreach>
+            </if>
+            <if test="c.customerName != null and c.customerName != ''">
+                and customer_name like concat('%', #{c.customerName}, '%')
+            </if>
+            <if test="c.customerType != null and c.customerType != ''">
+                and customer_type = #{c.customerType}
+            </if>
+            <!-- 鍏捣鏌ヨ锛歵ype = 1锛堝叕娴峰鎴凤級-->
+            <if test="c.type != null and c.type == 1">
+                and type = #{c.type}
+            </if>
+            <!-- 绉佹捣鏌ヨ锛歵ype = 0锛堢娴峰鎴凤級鎴栬�� type = 1锛堝叕娴峰鎴凤級涓斿凡琚垎閰嶏紝骞朵笖鏄嚜宸遍鐢ㄣ�佽嚜宸卞垱寤烘垨鑰呭叡浜粰鑷繁鐨勫鎴� -->
+            <if test="c.type != null and c.type == 0">
+                and (
+                    (type = #{c.type} or (type = 1 and is_assigned = 1))
+                    and (
+                        c.usage_user = #{loginUserId}
+                        or c.create_user = #{loginUserId}
+                        or exists (
+                            select 1 from customer_user cu
+                            where cu.customer_id = c.id
+                            and cu.user_id = #{loginUserId}
+                        )
+                    )
+                )
+            </if>
+        </where>
+    </select>
 </mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/basic/CustomerPrivateMapper.xml b/src/main/resources/mapper/basic/CustomerPrivateMapper.xml
deleted file mode 100644
index 9a8d68c..0000000
--- a/src/main/resources/mapper/basic/CustomerPrivateMapper.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?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.ruoyi.basic.mapper.CustomerPrivateMapper">
-
-    <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
-    <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.CustomerPrivate">
-        <id column="id" property="id" />
-        <result column="customer_name" property="customerName" />
-        <result column="taxpayer_identification_number" property="taxpayerIdentificationNumber" />
-        <result column="company_address" property="companyAddress" />
-        <result column="company_phone" property="companyPhone" />
-        <result column="contact_person" property="contactPerson" />
-        <result column="contact_phone" property="contactPhone" />
-        <result column="maintainer" property="maintainer" />
-        <result column="maintenance_time" property="maintenanceTime" />
-        <result column="tenant_id" property="tenantId" />
-        <result column="basic_bank_account" property="basicBankAccount" />
-        <result column="bank_account" property="bankAccount" />
-        <result column="bank_code" property="bankCode" />
-        <result column="customer_type" property="customerType" />
-        <result column="create_user" property="createUser" />
-        <result column="dept_id" property="deptId" />
-    </resultMap>
-
-</mapper>
diff --git a/src/main/resources/mapper/basic/CustomerPrivatePoolMapper.xml b/src/main/resources/mapper/basic/CustomerPrivatePoolMapper.xml
deleted file mode 100644
index 12c2fc6..0000000
--- a/src/main/resources/mapper/basic/CustomerPrivatePoolMapper.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?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.ruoyi.basic.mapper.CustomerPrivatePoolMapper">
-
-    <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
-    <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.CustomerPrivatePool">
-        <id column="id" property="id" />
-        <result column="customer_id" property="customerId" />
-        <result column="bound_id" property="boundId" />
-        <result column="create_user" property="createUser" />
-        <result column="update_user" property="updateUser" />
-        <result column="create_time" property="createTime" />
-        <result column="update_time" property="updateTime" />
-    </resultMap>
-    <select id="listPage" resultType="com.ruoyi.basic.dto.CustomerPrivatePoolDto">
-        select cpp.id,
-        cpp.bound_id,
-        cpp.type,
-        coalesce(c.id, cp.id) as customer_id,
-        coalesce(c.customer_name, cp.customer_name) as customer_name,
-        coalesce(c.customer_type, cp.customer_type) as customer_type,
-        coalesce(c.taxpayer_identification_number, cp.taxpayer_identification_number) as taxpayer_identification_number,
-        coalesce(c.company_address, cp.company_address) as company_address,
-        coalesce(c.company_phone, cp.company_phone) as company_phone,
-        coalesce(c.contact_person, cp.contact_person) as contact_person,
-        coalesce(c.contact_phone, cp.contact_phone) as contact_phone,
-        coalesce(c.maintainer, cp.maintainer) as maintainer,
-        coalesce(c.maintenance_time, cp.maintenance_time) as maintenance_time,
-        coalesce(c.tenant_id, cp.tenant_id) as tenant_id,
-        coalesce(c.basic_bank_account, cp.basic_bank_account) as basic_bank_account,
-        coalesce(c.bank_account, cp.bank_account) as bank_account,
-        coalesce(c.bank_code, cp.bank_code) as bank_code
-        from customer_private_pool cpp
-        left join customer c on c.id = cpp.customer_id and cpp.type = 1
-        left join customer_private cp on cp.id = cpp.customer_id and cpp.type = 0
-        <where>
-            cpp.delete_flag = 0
-            <if test="c.customerName != null and c.customerName != ''">
-                and (c.customer_name like concat('%', #{c.customerName}, '%') or cp.customer_name like concat('%', #{c.customerName}, '%'))
-            </if>
-            <if test="c.customerType != null">
-                and c.customer_type = #{c.customerType}
-            </if>
-            <if test="c.boundId != null">
-                and cpp.bound_id = #{c.boundId}
-            </if>
-        </where>
-        order by cpp.id desc
-    </select>
-    <select id="selectInfo" resultType="com.ruoyi.basic.dto.CustomerPrivatePoolDto">
-        select cpp.id,
-               cpp.bound_id,
-               cpp.type,
-               coalesce(c.id, cp.id) as customer_id,
-               coalesce(c.customer_name, cp.customer_name) as customer_name,
-               coalesce(c.customer_type, cp.customer_type) as customer_type,
-               coalesce(c.taxpayer_identification_number, cp.taxpayer_identification_number) as taxpayer_identification_number,
-               coalesce(c.company_address, cp.company_address) as company_address,
-               coalesce(c.company_phone, cp.company_phone) as company_phone,
-               coalesce(c.contact_person, cp.contact_person) as contact_person,
-               coalesce(c.contact_phone, cp.contact_phone) as contact_phone,
-               coalesce(c.maintainer, cp.maintainer) as maintainer,
-               coalesce(c.maintenance_time, cp.maintenance_time) as maintenance_time,
-               coalesce(c.tenant_id, cp.tenant_id) as tenant_id,
-               coalesce(c.basic_bank_account, cp.basic_bank_account) as basic_bank_account,
-               coalesce(c.bank_account, cp.bank_account) as bank_account,
-               coalesce(c.bank_code, cp.bank_code) as bank_code
-        from customer_private_pool cpp
-                 left join customer c on c.id = cpp.customer_id and cpp.type = 1
-                 left join customer_private cp on cp.id = cpp.customer_id and cpp.type = 0
-        <where>
-            <if test="id != null">
-                and cpp.id = #{id}
-            </if>
-        </where>
-    </select>
-    <select id="selectInfos" resultType="com.ruoyi.basic.dto.CustomerPrivatePoolDto">
-        select cpp.id,
-               cpp.bound_id,
-               cpp.type,
-               coalesce(c.id, cp.id) as customer_id,
-               coalesce(c.customer_name, cp.customer_name) as customer_name,
-               coalesce(c.customer_type, cp.customer_type) as customer_type,
-               coalesce(c.taxpayer_identification_number, cp.taxpayer_identification_number) as taxpayer_identification_number,
-               coalesce(c.company_address, cp.company_address) as company_address,
-               coalesce(c.company_phone, cp.company_phone) as company_phone,
-               coalesce(c.contact_person, cp.contact_person) as contact_person,
-               coalesce(c.contact_phone, cp.contact_phone) as contact_phone,
-               coalesce(c.maintainer, cp.maintainer) as maintainer,
-               coalesce(c.maintenance_time, cp.maintenance_time) as maintenance_time,
-               coalesce(c.tenant_id, cp.tenant_id) as tenant_id,
-               coalesce(c.basic_bank_account, cp.basic_bank_account) as basic_bank_account,
-               coalesce(c.bank_account, cp.bank_account) as bank_account,
-               coalesce(c.bank_code, cp.bank_code) as bank_code
-        from customer_private_pool cpp
-                 left join customer c on c.id = cpp.customer_id and cpp.type = 1
-                 left join customer_private cp on cp.id = cpp.customer_id and cpp.type = 0
-    </select>
-
-</mapper>

--
Gitblit v1.9.3