feat(crm): 更新订单VO字段并优化SQL查询

- 在CrmOrderVo中移除customerName字段,新增customerCode、contactPerson和address字段
- 修改CrmOrderMapper.xml中的SQL查询语句,为所有字段添加表别名前缀co
- 在SQL查询中增加客户编码、联系人和地址字段的映射
- 优化LEFT JOIN语句明确指定关联条件
- 更新SELECT子句字段列表以匹配新的VO结构
This commit is contained in:
2025-12-17 14:16:39 +08:00
parent c418370671
commit 2b88b03629
2 changed files with 28 additions and 21 deletions

View File

@@ -107,7 +107,12 @@ public class CrmOrderVo {
@ExcelProperty(value = "备注")
private String remark;
//联查客户名称
private String customerName;
// @ExcelProperty(value = "客户编号")
private String customerCode;
// @ExcelProperty(value = "联系人")
private String contactPerson;
// @ExcelProperty(value = "地址")
private String address;
}

View File

@@ -27,25 +27,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<select id="selectVoPagePlus" resultType="com.klp.crm.domain.vo.CrmOrderVo">
SELECT
order_id AS orderId,
order_code AS orderCode,
order_type AS orderType,
customer_id AS customerId,
order_amount AS orderAmount,
salesman,
delivery_date AS deliveryDate,
pre_order_status AS preOrderStatus,
audit_user AS auditUser,
audit_time AS auditTime,
order_status AS orderStatus,
finance_status AS financeStatus,
unpaid_amount AS unpaidAmount,
remark,
create_by AS createBy,
create_time AS createTime,
update_by AS updateBy,
update_time AS updateTime,
cu.customer_name AS customerName
co.order_id AS orderId,
co.order_code AS orderCode,
co.order_type AS orderType,
co.customer_id AS customerId,
co.order_amount AS orderAmount,
co.salesman,
co.delivery_date AS deliveryDate,
co.pre_order_status AS preOrderStatus,
co.audit_user AS auditUser,
co.audit_time AS auditTime,
co.order_status AS orderStatus,
co.finance_status AS financeStatus,
co.unpaid_amount AS unpaidAmount,
co.remark,
co.create_by AS createBy,
co.create_time AS createTime,
co.update_by AS updateBy,
co.update_time AS updateTime,
cu.customer_code AS customerCode,
cu.contact_person AS contactPerson,
cu.address AS address
FROM crm_order co
LEFT JOIN crm_customer cu ON co.customer_id = cu.customer_id
${ew.customSqlSegment}