From 6323e1efb067f80df0f848abf7062b7601f9a04a Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期一, 15 十二月 2025 14:19:28 +0800
Subject: [PATCH] 新增客户管理
---
service/src/main/java/com/ruoyi/cwgl/controller/CustomerManagementController.java | 108 ++++++++
service/src/main/java/com/ruoyi/cwgl/service/ICustomerManagementService.java | 102 +++++++
service/src/main/java/com/ruoyi/cwgl/service/impl/CustomerManagementServiceImpl.java | 182 ++++++++++++++
service/src/main/resources/mapper/cwgl/CustomerManagementMapper.xml | 170 +++++++++++++
service/src/main/java/com/ruoyi/cwgl/domain/CustomerManagement.java | 115 ++++++++
service/src/main/java/com/ruoyi/cwgl/mapper/CustomerManagementMapper.java | 87 ++++++
6 files changed, 764 insertions(+), 0 deletions(-)
diff --git a/service/src/main/java/com/ruoyi/cwgl/controller/CustomerManagementController.java b/service/src/main/java/com/ruoyi/cwgl/controller/CustomerManagementController.java
new file mode 100644
index 0000000..7383606
--- /dev/null
+++ b/service/src/main/java/com/ruoyi/cwgl/controller/CustomerManagementController.java
@@ -0,0 +1,108 @@
+package com.ruoyi.cwgl.controller;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.utils.file.DownloadExportUtil;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.cwgl.domain.CustomerManagement;
+import com.ruoyi.cwgl.service.ICustomerManagementService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 瀹㈡埛绠$悊Controller
+ *
+ * @author ruoyi
+ * @date 2025-12-15
+ */
+@RestController
+@RequestMapping("/cwgl/customerManagement")
+public class CustomerManagementController extends BaseController
+{
+ @Autowired
+ private ICustomerManagementService customerManagementService;
+
+
+
+ /**
+ * 鏌ヨ瀹㈡埛绠$悊鍒楄〃
+ */
+ @PreAuthorize("@ss.hasPermi('cwgl:customerManagement:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(CustomerManagement customerManagement)
+ {
+ startPage();
+ List<CustomerManagement> list = customerManagementService.selectCustomerManagementList(customerManagement);
+ return getDataTable(list);
+ }
+
+ /**
+ * 瀵煎嚭瀹㈡埛绠$悊鍒楄〃
+ * @param customerManagement 鏌ヨ鏉′欢瀵硅薄
+ */
+ @PreAuthorize("@ss.hasPermi('cwgl:customerManagement:export')")
+ @Log(title = "瀹㈡埛绠$悊", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(CustomerManagement customerManagement,String exportKey)
+ {
+ customerManagementService.export(customerManagement,exportKey);
+ return AjaxResult.success("瀵煎嚭璇锋眰鎴愬姛锛岃绋嶅悗鐐瑰嚮涓嬭浇...!");
+ }
+
+
+
+ /**
+ * 鑾峰彇瀹㈡埛绠$悊璇︾粏淇℃伅
+ */
+ @PreAuthorize("@ss.hasPermi('cwgl:customerManagement:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Integer id)
+ {
+ return AjaxResult.success(customerManagementService.selectCustomerManagementById(id));
+ }
+
+ /**
+ * 鏂板瀹㈡埛绠$悊
+ */
+ @PreAuthorize("@ss.hasPermi('cwgl:customerManagement:add')")
+ @Log(title = "瀹㈡埛绠$悊", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody CustomerManagement customerManagement)
+ {
+ return toAjax(customerManagementService.insertCustomerManagement(customerManagement));
+ }
+
+ /**
+ * 淇敼瀹㈡埛绠$悊
+ */
+ @PreAuthorize("@ss.hasPermi('cwgl:customerManagement:edit')")
+ @Log(title = "瀹㈡埛绠$悊", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody CustomerManagement customerManagement)
+ {
+ return toAjax(customerManagementService.updateCustomerManagement(customerManagement));
+ }
+
+ /**
+ * 鍒犻櫎瀹㈡埛绠$悊
+ */
+ @PreAuthorize("@ss.hasPermi('cwgl:customerManagement:remove')")
+ @Log(title = "瀹㈡埛绠$悊", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Integer[] ids)
+ {
+ return toAjax(customerManagementService.deleteCustomerManagementByIds(ids));
+ }
+}
diff --git a/service/src/main/java/com/ruoyi/cwgl/domain/CustomerManagement.java b/service/src/main/java/com/ruoyi/cwgl/domain/CustomerManagement.java
new file mode 100644
index 0000000..497c0d5
--- /dev/null
+++ b/service/src/main/java/com/ruoyi/cwgl/domain/CustomerManagement.java
@@ -0,0 +1,115 @@
+package com.ruoyi.cwgl.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.util.Date;
+import lombok.Data;
+/**
+ * 瀹㈡埛绠$悊瀵硅薄 customer_management
+ *
+ * @author ruoyi
+ * @date 2025-12-15
+ */
+@Data
+public class CustomerManagement{
+
+
+ /** ID */
+ @TableField("id")
+ private Integer id;
+
+
+ /** 瀹㈡埛鍏ㄧО */
+ @Excel(name = "瀹㈡埛鍏ㄧО")
+
+ @TableField("customer_full_name")
+ private String customerFullName;
+
+
+ /** 瀹㈡埛绠�绉� */
+ @Excel(name = "瀹㈡埛绠�绉�")
+
+ @TableField("customer_short_name")
+ private String customerShortName;
+
+
+ /** 瀹㈡埛绫诲瀷 */
+ @Excel(name = "瀹㈡埛绫诲瀷")
+
+ @TableField("customer_type")
+ private String customerType;
+
+
+ /** 鑱旂郴浜哄鍚� */
+ @Excel(name = "鑱旂郴浜哄鍚�")
+
+ @TableField("contact_person")
+ private String contactPerson;
+
+
+ /** 鍦板潃 */
+ @Excel(name = "鍦板潃")
+
+ @TableField("address")
+ private String address;
+
+
+ /** 鑱旂郴浜虹數璇� */
+ @Excel(name = "鑱旂郴浜虹數璇�")
+
+ @TableField("contact_phone")
+ private String contactPhone;
+
+
+ /** 瀹㈡埛缂栫爜 */
+ @Excel(name = "瀹㈡埛缂栫爜")
+
+ @TableField("customer_code")
+ private String customerCode;
+
+
+ /** 鐘舵�� */
+ @Excel(name = "鐘舵��")
+
+ @TableField("status")
+ private Integer status;
+
+
+ /** 澶囨敞 */
+ @Excel(name = "澶囨敞")
+
+ @TableField("remark")
+ private String remark;
+
+
+ /** 鍒涘缓浜� */
+ @TableField("create_by")
+ private String createBy;
+
+
+ /** 鏇存柊浜� */
+ @TableField("update_by")
+ private String updateBy;
+
+
+ /** 鍒涘缓鏃堕棿 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @TableField("create_time")
+ private Date createTime;
+
+
+ /** 鏇存柊鏃堕棿 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @TableField("update_time")
+ private Date updateTime;
+
+
+ /** 鍒犻櫎鏍囪(0:姝e父;1:鍒犻櫎) */
+ @Excel(name = "鍒犻櫎鏍囪(0:姝e父;1:鍒犻櫎)")
+
+ @TableField("deleted")
+ private Integer deleted;
+
+
+}
diff --git a/service/src/main/java/com/ruoyi/cwgl/mapper/CustomerManagementMapper.java b/service/src/main/java/com/ruoyi/cwgl/mapper/CustomerManagementMapper.java
new file mode 100644
index 0000000..ed7c695
--- /dev/null
+++ b/service/src/main/java/com/ruoyi/cwgl/mapper/CustomerManagementMapper.java
@@ -0,0 +1,87 @@
+package com.ruoyi.cwgl.mapper;
+
+import java.util.List;
+import com.ruoyi.cwgl.domain.CustomerManagement;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+
+/**
+ * 瀹㈡埛绠$悊Mapper鎺ュ彛
+ *
+ * @author ruoyi
+ * @date 2025-12-15
+ */
+public interface CustomerManagementMapper extends BaseMapper<CustomerManagement>
+{
+ /**
+ * 鏌ヨ瀹㈡埛绠$悊
+ *
+ * @param id 瀹㈡埛绠$悊ID
+ * @return 瀹㈡埛绠$悊
+ */
+ public CustomerManagement selectCustomerManagementById(Integer id);
+
+ /**
+ * 鏌ヨ瀹㈡埛绠$悊 璁板綍鏁�
+ *
+ * @param customerManagement 瀹㈡埛绠$悊
+ * @return 瀹㈡埛绠$悊闆嗗悎
+ */
+ public int selectCustomerManagementCount(CustomerManagement customerManagement);
+
+ /**
+ * 鏌ヨ瀹㈡埛绠$悊鍒楄〃
+ *
+ * @param customerManagement 瀹㈡埛绠$悊
+ * @return 瀹㈡埛绠$悊闆嗗悎
+ */
+ public List<CustomerManagement> selectCustomerManagementList(CustomerManagement customerManagement);
+
+ /**
+ * 鏂板瀹㈡埛绠$悊
+ *
+ * @param customerManagement 瀹㈡埛绠$悊
+ * @return 缁撴灉
+ */
+ public int insertCustomerManagement(CustomerManagement customerManagement);
+
+ /**
+ * 鏂板瀹㈡埛绠$悊[鎵归噺]
+ *
+ * @param customerManagements 瀹㈡埛绠$悊
+ * @return 缁撴灉
+ */
+ public int insertCustomerManagementBatch(List<CustomerManagement> customerManagements);
+
+ /**
+ * 淇敼瀹㈡埛绠$悊
+ *
+ * @param customerManagement 瀹㈡埛绠$悊
+ * @return 缁撴灉
+ */
+ public int updateCustomerManagement(CustomerManagement customerManagement);
+
+ /**
+ * 淇敼瀹㈡埛绠$悊[鎵归噺]
+ *
+ * @param customerManagements 瀹㈡埛绠$悊
+ * @return 缁撴灉
+ */
+ public int updateCustomerManagementBatch(List<CustomerManagement> customerManagements);
+
+ /**
+ * 鍒犻櫎瀹㈡埛绠$悊
+ *
+ * @param id 瀹㈡埛绠$悊ID
+ * @return 缁撴灉
+ */
+ public int deleteCustomerManagementById(Integer id);
+
+ /**
+ * 鎵归噺鍒犻櫎瀹㈡埛绠$悊
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁ID
+ * @return 缁撴灉
+ */
+ public int deleteCustomerManagementByIds(Integer[] ids);
+}
diff --git a/service/src/main/java/com/ruoyi/cwgl/service/ICustomerManagementService.java b/service/src/main/java/com/ruoyi/cwgl/service/ICustomerManagementService.java
new file mode 100644
index 0000000..4b92918
--- /dev/null
+++ b/service/src/main/java/com/ruoyi/cwgl/service/ICustomerManagementService.java
@@ -0,0 +1,102 @@
+package com.ruoyi.cwgl.service;
+
+import java.util.List;
+import com.ruoyi.cwgl.domain.CustomerManagement;
+import com.baomidou.mybatisplus.extension.service.IService;
+/**
+ * 瀹㈡埛绠$悊Service鎺ュ彛
+ *
+ * @author ruoyi
+ * @date 2025-12-15
+ */
+public interface ICustomerManagementService extends IService<CustomerManagement>
+{
+ /**
+ * 鏌ヨ瀹㈡埛绠$悊
+ *
+ * @param id 瀹㈡埛绠$悊ID
+ * @return 瀹㈡埛绠$悊
+ */
+ public CustomerManagement selectCustomerManagementById(Integer id);
+
+ /**
+ * 鏌ヨ瀹㈡埛绠$悊 璁板綍鏁�
+ *
+ * @param customerManagement 瀹㈡埛绠$悊
+ * @return 瀹㈡埛绠$悊闆嗗悎
+ */
+ public int selectCustomerManagementCount(CustomerManagement customerManagement);
+
+ /**
+ * 鏌ヨ瀹㈡埛绠$悊鍒楄〃
+ *
+ * @param customerManagement 瀹㈡埛绠$悊
+ * @return 瀹㈡埛绠$悊闆嗗悎
+ */
+ public List<CustomerManagement> selectCustomerManagementList(CustomerManagement customerManagement);
+
+ /**
+ * 鏌ヨ瀹㈡埛绠$悊鍒楄〃 寮傛 瀵煎嚭
+ *
+ * @param customerManagement 瀹㈡埛绠$悊
+ * @param exportKey 瀵煎嚭鍔熻兘鐨勫敮涓�鏍囪瘑
+ * @return 瀹㈡埛绠$悊闆嗗悎
+ */
+ public void export(CustomerManagement customerManagement, String exportKey) ;
+
+
+ /**
+ * 鏂板瀹㈡埛绠$悊
+ *
+ * @param customerManagement 瀹㈡埛绠$悊
+ * @return 缁撴灉
+ */
+ public int insertCustomerManagement(CustomerManagement customerManagement);
+
+ /**
+ * 鏂板瀹㈡埛绠$悊[鎵归噺]
+ *
+ * @param customerManagements 瀹㈡埛绠$悊
+ * @return 缁撴灉
+ */
+ public int insertCustomerManagementBatch(List<CustomerManagement> customerManagements);
+
+ /**
+ * 淇敼瀹㈡埛绠$悊
+ *
+ * @param customerManagement 瀹㈡埛绠$悊
+ * @return 缁撴灉
+ */
+ public int updateCustomerManagement(CustomerManagement customerManagement);
+
+ /**
+ * 淇敼瀹㈡埛绠$悊[鎵归噺]
+ *
+ * @param customerManagements 瀹㈡埛绠$悊
+ * @return 缁撴灉
+ */
+ public int updateCustomerManagementBatch(List<CustomerManagement> customerManagements);
+ /**
+ * 鎵归噺鍒犻櫎瀹㈡埛绠$悊
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁ID
+ * @return 缁撴灉
+ */
+ public int deleteCustomerManagementByIds(String ids);
+
+ /**
+ * 鎵归噺鍒犻櫎瀹㈡埛绠$悊
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁ID
+ * @return 缁撴灉
+ */
+ public int deleteCustomerManagementByIds(Integer[] ids);
+
+ /**
+ * 鍒犻櫎瀹㈡埛绠$悊淇℃伅
+ *
+ * @param id 瀹㈡埛绠$悊ID
+ * @return 缁撴灉
+ */
+ public int deleteCustomerManagementById(Integer id);
+}
diff --git a/service/src/main/java/com/ruoyi/cwgl/service/impl/CustomerManagementServiceImpl.java b/service/src/main/java/com/ruoyi/cwgl/service/impl/CustomerManagementServiceImpl.java
new file mode 100644
index 0000000..9d41faf
--- /dev/null
+++ b/service/src/main/java/com/ruoyi/cwgl/service/impl/CustomerManagementServiceImpl.java
@@ -0,0 +1,182 @@
+package com.ruoyi.cwgl.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.utils.DateUtils;
+import javax.annotation.Resource;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.stereotype.Service;
+import org.springframework.scheduling.annotation.Async;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.ruoyi.common.utils.PageUtils;
+import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.annotation.DataSource;
+import com.ruoyi.common.enums.DataSourceType;
+import com.ruoyi.common.core.service.BaseService;
+
+import com.ruoyi.cwgl.mapper.CustomerManagementMapper;
+import com.ruoyi.cwgl.domain.CustomerManagement;
+import com.ruoyi.cwgl.service.ICustomerManagementService;
+import com.ruoyi.common.core.text.Convert;
+
+/**
+ * 瀹㈡埛绠$悊Service涓氬姟灞傚鐞�
+ *
+ * @author ruoyi
+ * @date 2025-12-15
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class CustomerManagementServiceImpl extends BaseService<CustomerManagementMapper, CustomerManagement> implements ICustomerManagementService
+{
+ protected final Logger logger = LoggerFactory.getLogger(getClass());
+ @Resource
+ private CustomerManagementMapper customerManagementMapper;
+
+
+ /**
+ * 鏌ヨ瀹㈡埛绠$悊
+ *
+ * @param id 瀹㈡埛绠$悊ID
+ * @return 瀹㈡埛绠$悊
+ */
+ @DataSource(DataSourceType.SLAVE)
+ @Override
+ public CustomerManagement selectCustomerManagementById(Integer id)
+ {
+ return customerManagementMapper.selectCustomerManagementById(id);
+ }
+
+ /**
+ * 鏌ヨ瀹㈡埛绠$悊 璁板綍鏁�
+ *
+ * @param customerManagement 瀹㈡埛绠$悊
+ * @return 瀹㈡埛绠$悊闆嗗悎
+ */
+ @DataSource(DataSourceType.SLAVE)
+ @Override
+ public int selectCustomerManagementCount(CustomerManagement customerManagement)
+ {
+ return customerManagementMapper.selectCustomerManagementCount(customerManagement);
+ }
+
+ /**
+ * 鏌ヨ瀹㈡埛绠$悊鍒楄〃
+ *
+ * @param customerManagement 瀹㈡埛绠$悊
+ * @return 瀹㈡埛绠$悊
+ */
+ @DataSource(DataSourceType.SLAVE)
+ @Override
+ public List<CustomerManagement> selectCustomerManagementList(CustomerManagement customerManagement)
+ {
+ return customerManagementMapper.selectCustomerManagementList(customerManagement);
+ }
+
+ /**
+ * 鏌ヨ瀹㈡埛绠$悊鍒楄〃 寮傛 瀵煎嚭
+ *
+ * @param customerManagement 瀹㈡埛绠$悊
+ * @param exportKey 瀵煎嚭鍔熻兘鐨勫敮涓�鏍囪瘑
+ * @return 瀹㈡埛绠$悊闆嗗悎
+ */
+ @DataSource(DataSourceType.SLAVE)
+ @Async
+ @Override
+ public void export(CustomerManagement customerManagement,String exportKey) {
+
+ super.export(CustomerManagement.class,exportKey,"customerManagementData",(pageNum)->{
+ PageUtils.startPage(pageNum, Constants.EXPORT_PATE_SIZE);
+ return selectCustomerManagementList(customerManagement);
+ });
+ }
+
+
+ /**
+ * 鏂板瀹㈡埛绠$悊
+ *
+ * @param customerManagement 瀹㈡埛绠$悊
+ * @return 缁撴灉
+ */
+ @Override
+ public int insertCustomerManagement(CustomerManagement customerManagement)
+ {
+ customerManagement.setCreateTime(DateUtils.getNowDate());
+ return customerManagementMapper.insertCustomerManagement(customerManagement);
+ }
+
+ /**
+ * 鏂板瀹㈡埛绠$悊[鎵归噺]
+ *
+ * @param customerManagements 瀹㈡埛绠$悊
+ * @return 缁撴灉
+ */
+ @Override
+ public int insertCustomerManagementBatch(List<CustomerManagement> customerManagements)
+ {
+ int rows = customerManagementMapper.insertCustomerManagementBatch(customerManagements);
+ return rows;
+ }
+
+ /**
+ * 淇敼瀹㈡埛绠$悊
+ *
+ * @param customerManagement 瀹㈡埛绠$悊
+ * @return 缁撴灉
+ */
+ @Override
+ public int updateCustomerManagement(CustomerManagement customerManagement)
+ {
+ customerManagement.setUpdateTime(DateUtils.getNowDate());
+ return customerManagementMapper.updateCustomerManagement(customerManagement);
+ }
+
+ /**
+ * 淇敼瀹㈡埛绠$悊[鎵归噺]
+ *
+ * @param customerManagements 瀹㈡埛绠$悊
+ * @return 缁撴灉
+ */
+ @Override
+ public int updateCustomerManagementBatch(List<CustomerManagement> customerManagements){
+ return customerManagementMapper.updateCustomerManagementBatch(customerManagements);
+ }
+
+ /**
+ * 鍒犻櫎瀹㈡埛绠$悊瀵硅薄
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁ID
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteCustomerManagementByIds(String ids)
+ {
+ return deleteCustomerManagementByIds(Convert.toIntArray(ids));
+ }
+
+ /**
+ * 鍒犻櫎瀹㈡埛绠$悊瀵硅薄
+ *
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁ID
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteCustomerManagementByIds(Integer[] ids)
+ {
+ return customerManagementMapper.deleteCustomerManagementByIds(ids);
+ }
+
+ /**
+ * 鍒犻櫎瀹㈡埛绠$悊淇℃伅
+ *
+ * @param id 瀹㈡埛绠$悊ID
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteCustomerManagementById(Integer id)
+ {
+ return customerManagementMapper.deleteCustomerManagementById(id);
+ }
+}
diff --git a/service/src/main/resources/mapper/cwgl/CustomerManagementMapper.xml b/service/src/main/resources/mapper/cwgl/CustomerManagementMapper.xml
new file mode 100644
index 0000000..97fe5f5
--- /dev/null
+++ b/service/src/main/resources/mapper/cwgl/CustomerManagementMapper.xml
@@ -0,0 +1,170 @@
+<?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.cwgl.mapper.CustomerManagementMapper">
+
+ <resultMap type="com.ruoyi.cwgl.domain.CustomerManagement" id="CustomerManagementResult">
+ <result property="id" column="id" />
+ <result property="customerFullName" column="customer_full_name" />
+ <result property="customerShortName" column="customer_short_name" />
+ <result property="customerType" column="customer_type" />
+ <result property="contactPerson" column="contact_person" />
+ <result property="address" column="address" />
+ <result property="contactPhone" column="contact_phone" />
+ <result property="customerCode" column="customer_code" />
+ <result property="status" column="status" />
+ <result property="remark" column="remark" />
+ <result property="createBy" column="create_by" />
+ <result property="updateBy" column="update_by" />
+ <result property="createTime" column="create_time" />
+ <result property="updateTime" column="update_time" />
+ <result property="deleted" column="deleted" />
+ </resultMap>
+
+ <sql id="selectCustomerManagementVo">
+ select thisTab.id, thisTab.customer_full_name, thisTab.customer_short_name, thisTab.customer_type, thisTab.contact_person, thisTab.address, thisTab.contact_phone, thisTab.customer_code, thisTab.status, thisTab.remark, thisTab.create_by, thisTab.update_by, thisTab.create_time, thisTab.update_time, thisTab.deleted from customer_management AS thisTab
+ </sql>
+ <sql id="selectCustomerManagementVoCount">
+ select count(0) from customer_management as thisTab
+ </sql>
+
+ <sql id="whereCondition">
+ <if test="customerFullName != null and customerFullName != ''"> and thisTab.customer_full_name like concat('%', #{customerFullName}, '%')</if>
+ <if test="customerShortName != null and customerShortName != ''"> and thisTab.customer_short_name like concat('%', #{customerShortName}, '%')</if>
+ <if test="customerType != null and customerType != ''"> and thisTab.customer_type = #{customerType}</if>
+ <if test="contactPerson != null and contactPerson != ''"> and thisTab.contact_person = #{contactPerson}</if>
+ <if test="address != null and address != ''"> and thisTab.address = #{address}</if>
+ <if test="contactPhone != null and contactPhone != ''"> and thisTab.contact_phone = #{contactPhone}</if>
+ <if test="customerCode != null and customerCode != ''"> and thisTab.customer_code = #{customerCode}</if>
+ <if test="status != null "> and thisTab.status = #{status}</if>
+ <if test="deleted != null "> and thisTab.deleted = #{deleted}</if>
+ </sql>
+
+ <!--鏌ヨ-->
+ <select id="selectCustomerManagementById" parameterType="Integer" resultMap="CustomerManagementResult">
+ <include refid="selectCustomerManagementVo"/>
+ where id = #{id}
+ </select>
+
+ <select id="selectCustomerManagementCount" parameterType="com.ruoyi.cwgl.domain.CustomerManagement" resultType="int">
+ <include refid="selectCustomerManagementVoCount"/>
+ <where>
+ <include refid="whereCondition"/>
+ </where>
+ </select>
+
+ <select id="selectCustomerManagementList" parameterType="com.ruoyi.cwgl.domain.CustomerManagement" resultMap="CustomerManagementResult">
+ <include refid="selectCustomerManagementVo"/>
+ <where>
+ <include refid="whereCondition"/>
+ </where>
+ order by thisTab.id desc
+ </select>
+
+ <!-- 鏂板 -->
+ <insert id="insertCustomerManagement" parameterType="com.ruoyi.cwgl.domain.CustomerManagement" useGeneratedKeys="true" keyProperty="id">
+ insert into customer_management
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="customerFullName != null and customerFullName != ''">customer_full_name,</if>
+ <if test="customerShortName != null">customer_short_name,</if>
+ <if test="customerType != null">customer_type,</if>
+ <if test="contactPerson != null">contact_person,</if>
+ <if test="address != null">address,</if>
+ <if test="contactPhone != null">contact_phone,</if>
+ <if test="customerCode != null">customer_code,</if>
+ <if test="status != null">status,</if>
+ <if test="remark != null">remark,</if>
+ <if test="createBy != null">create_by,</if>
+ <if test="updateBy != null">update_by,</if>
+ <if test="createTime != null">create_time,</if>
+ <if test="updateTime != null">update_time,</if>
+ <if test="deleted != null">deleted,</if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="customerFullName != null and customerFullName != ''">#{customerFullName},</if>
+ <if test="customerShortName != null">#{customerShortName},</if>
+ <if test="customerType != null">#{customerType},</if>
+ <if test="contactPerson != null">#{contactPerson},</if>
+ <if test="address != null">#{address},</if>
+ <if test="contactPhone != null">#{contactPhone},</if>
+ <if test="customerCode != null">#{customerCode},</if>
+ <if test="status != null">#{status},</if>
+ <if test="remark != null">#{remark},</if>
+ <if test="createBy != null">#{createBy},</if>
+ <if test="updateBy != null">#{updateBy},</if>
+ <if test="createTime != null">#{createTime},</if>
+ <if test="updateTime != null">#{updateTime},</if>
+ <if test="deleted != null">#{deleted},</if>
+ </trim>
+ </insert>
+
+ <insert id="insertCustomerManagementBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
+ insert into customer_management
+ <trim prefix="(" suffix=") values" suffixOverrides=",">
+ id,customer_full_name,customer_short_name,customer_type,contact_person,address,contact_phone,customer_code,status,remark,create_by,update_by,create_time,update_time,deleted,
+ </trim>
+ <foreach item="item" index="index" collection="list" separator=",">
+ <trim prefix="(" suffix=") " suffixOverrides=",">
+ #{item.id},#{item.customerFullName},#{item.customerShortName},#{item.customerType},#{item.contactPerson},#{item.address},#{item.contactPhone},#{item.customerCode},#{item.status},#{item.remark},#{item.createBy},#{item.updateBy},#{item.createTime},#{item.updateTime},#{item.deleted},
+ </trim>
+ </foreach>
+ </insert>
+
+ <!-- 淇敼 -->
+ <update id="updateCustomerManagement" parameterType="com.ruoyi.cwgl.domain.CustomerManagement">
+ update customer_management
+ <trim prefix="SET" suffixOverrides=",">
+ <if test="customerFullName != null and customerFullName != ''">customer_full_name = #{customerFullName},</if>
+ <if test="customerShortName != null">customer_short_name = #{customerShortName},</if>
+ <if test="customerType != null">customer_type = #{customerType},</if>
+ <if test="contactPerson != null">contact_person = #{contactPerson},</if>
+ <if test="address != null">address = #{address},</if>
+ <if test="contactPhone != null">contact_phone = #{contactPhone},</if>
+ <if test="customerCode != null">customer_code = #{customerCode},</if>
+ <if test="status != null">status = #{status},</if>
+ <if test="remark != null">remark = #{remark},</if>
+ <if test="createBy != null">create_by = #{createBy},</if>
+ <if test="updateBy != null">update_by = #{updateBy},</if>
+ <if test="createTime != null">create_time = #{createTime},</if>
+ <if test="updateTime != null">update_time = #{updateTime},</if>
+ <if test="deleted != null">deleted = #{deleted},</if>
+ </trim>
+ where id = #{id}
+ </update>
+ <!-- 淇敼 -->
+ <update id="updateCustomerManagementBatch" parameterType="java.util.List">
+ <foreach collection="list" item="item" index="index" separator=";">
+ update customer_management
+ <trim prefix="SET" suffixOverrides=",">
+ <if test="item.customerFullName != null and item.customerFullName != ''">customer_full_name = #{item.customerFullName},</if>
+ <if test="item.customerShortName != null">customer_short_name = #{item.customerShortName},</if>
+ <if test="item.customerType != null">customer_type = #{item.customerType},</if>
+ <if test="item.contactPerson != null">contact_person = #{item.contactPerson},</if>
+ <if test="item.address != null">address = #{item.address},</if>
+ <if test="item.contactPhone != null">contact_phone = #{item.contactPhone},</if>
+ <if test="item.customerCode != null">customer_code = #{item.customerCode},</if>
+ <if test="item.status != null">status = #{item.status},</if>
+ <if test="item.remark != null">remark = #{item.remark},</if>
+ <if test="item.createBy != null">create_by = #{item.createBy},</if>
+ <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
+ <if test="item.createTime != null">create_time = #{item.createTime},</if>
+ <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
+ <if test="item.deleted != null">deleted = #{item.deleted},</if>
+ </trim>
+ where id = #{item.id}
+ </foreach>
+ </update>
+
+ <!--鍒犻櫎-->
+ <delete id="deleteCustomerManagementById" parameterType="Integer">
+ delete from customer_management where id = #{id}
+ </delete>
+ <delete id="deleteCustomerManagementByIds" parameterType="Integer">
+ delete from customer_management where id in
+ <foreach item="id" collection="array" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </delete>
+
+</mapper>
\ No newline at end of file
--
Gitblit v1.8.0