Files
klp-oa/klp-crm/src/main/resources/mapper/CrmCustomerMapper.xml
Joshi 2559dc27cb feat(crm): 添加客户编码自动生成功能
- 新增 selectMaxCustomerCode 方法查询最大客户编码
- 实现客户编码自动生成逻辑,支持纯数字和带前缀格式
- 添加正则表达式解析编码规则并递增末尾数字
- 集成编码生成功能到客户插入业务流程中
2026-06-12 13:17:33 +08:00

31 lines
1.4 KiB
XML

<?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.klp.crm.mapper.CrmCustomerMapper">
<resultMap type="com.klp.crm.domain.CrmCustomer" id="CrmCustomerResult">
<result property="customerId" column="customer_id"/>
<result property="customerCode" column="customer_code"/>
<result property="companyName" column="company_name"/>
<result property="contactPerson" column="contact_person"/>
<result property="contactWay" column="contact_way"/>
<result property="industry" column="industry"/>
<result property="customerLevel" column="customer_level"/>
<result property="address" column="address"/>
<result property="bankInfo" column="bank_info"/>
<result property="taxNumber" column="tax_number"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<select id="selectMaxCustomerCode" resultType="String">
SELECT customer_code FROM crm_customer WHERE del_flag = 0 ORDER BY LENGTH(customer_code) DESC, customer_code DESC LIMIT 1
</select>
</mapper>