Files
xgy-oa/klp-wms/src/main/resources/mapper/klp/WmsDeliveryWaybillMapper.xml
Joshi eb541f850c fix(delivery): 修复运单查询中的数据关联问题
- 移除了 delFlag 字段的映射配置
- 在 CRM 订单关联查询中添加了删除标记过滤条件
- 确保只查询未删除的订单数据
- 修复了可能因已删除订单导致的数据不一致问题
2026-02-03 11:28:30 +08:00

113 lines
5.1 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.mapper.WmsDeliveryWaybillMapper">
<resultMap type="com.klp.domain.WmsDeliveryWaybill" id="WmsDeliveryWaybillResult">
<result property="waybillId" column="waybill_id"/>
<result property="waybillNo" column="waybill_no"/>
<result property="waybillName" column="waybill_name"/>
<result property="planId" column="plan_id"/>
<result property="orderId" column="order_id"/>
<result property="licensePlate" column="license_plate"/>
<result property="consigneeUnit" column="consignee_unit"/>
<result property="senderUnit" column="sender_unit"/>
<result property="deliveryTime" column="delivery_time"/>
<result property="weighbridge" column="weighbridge"/>
<result property="salesPerson" column="sales_person"/>
<result property="principal" column="principal"/>
<result property="principalPhone" column="principal_phone"/>
<result property="status" column="status"/>
<result property="remark" column="remark"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
</resultMap>
<resultMap type="com.klp.domain.vo.WmsDeliveryWaybillVo" id="WmsDeliveryWaybillVoResult">
<result property="waybillId" column="waybill_id"/>
<result property="waybillNo" column="waybill_no"/>
<result property="waybillName" column="waybill_name"/>
<result property="planId" column="plan_id"/>
<result property="orderId" column="order_id"/>
<result property="orderCode" column="order_code"/>
<result property="contractCode" column="contract_code"/>
<result property="licensePlate" column="license_plate"/>
<result property="consigneeUnit" column="consignee_unit"/>
<result property="senderUnit" column="sender_unit"/>
<result property="deliveryTime" column="delivery_time"/>
<result property="weighbridge" column="weighbridge"/>
<result property="salesPerson" column="sales_person"/>
<result property="principal" column="principal"/>
<result property="principalPhone" column="principal_phone"/>
<result property="status" column="status"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
</resultMap>
<select id="selectVoPagePlus" resultMap="WmsDeliveryWaybillVoResult">
SELECT
wd.waybill_id AS waybill_id,
wd.waybill_no AS waybill_no,
wd.waybill_name AS waybill_name,
wd.plan_id AS plan_id,
wd.order_id AS order_id,
co.order_code AS order_code,
co.contract_code AS contract_code,
wd.license_plate AS license_plate,
wd.consignee_unit AS consignee_unit,
wd.sender_unit AS sender_unit,
wd.delivery_time AS delivery_time,
wd.weighbridge AS weighbridge,
wd.sales_person AS sales_person,
wd.principal AS principal,
wd.principal_phone AS principal_phone,
wd.status AS status,
wd.remark AS remark,
wd.del_flag AS del_flag,
wd.create_time AS create_time,
wd.create_by AS create_by,
wd.update_time AS update_time,
wd.update_by AS update_by
FROM wms_delivery_waybill wd
LEFT JOIN crm_order co ON wd.order_id = co.order_id and co.del_flag = 0
${ew.customSqlSegment}
</select>
<select id="selectVoListPlus" resultMap="WmsDeliveryWaybillVoResult">
SELECT
wd.waybill_id AS waybill_id,
wd.waybill_no AS waybill_no,
wd.waybill_name AS waybill_name,
wd.plan_id AS plan_id,
wd.order_id AS order_id,
co.order_code AS order_code,
co.contract_code AS contract_code,
wd.license_plate AS license_plate,
wd.consignee_unit AS consignee_unit,
wd.sender_unit AS sender_unit,
wd.delivery_time AS delivery_time,
wd.weighbridge AS weighbridge,
wd.sales_person AS sales_person,
wd.principal AS principal,
wd.principal_phone AS principal_phone,
wd.status AS status,
wd.remark AS remark,
wd.del_flag AS del_flag,
wd.create_time AS create_time,
wd.create_by AS create_by,
wd.update_time AS update_time,
wd.update_by AS update_by
FROM wms_delivery_waybill wd
LEFT JOIN crm_order co ON wd.order_id = co.order_id and co.del_flag = 0
${ew.customSqlSegment}
</select>
</mapper>