Files
klp-oa/klp-wms/src/main/resources/mapper/klp/WmsDeliveryWaybillDetailMapper.xml

134 lines
5.0 KiB
XML
Raw Normal View History

<?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.WmsDeliveryWaybillDetailMapper">
<resultMap type="com.klp.domain.WmsDeliveryWaybillDetail" id="WmsDeliveryWaybillDetailResult">
<result property="detailId" column="detail_id"/>
<result property="waybillId" column="waybill_id"/>
<result property="coilId" column="coil_id"/>
<result property="productName" column="product_name"/>
<result property="edgeType" column="edge_type"/>
<result property="packaging" column="packaging"/>
<result property="settlementType" column="settlement_type"/>
<result property="rawMaterialFactory" column="raw_material_factory"/>
<result property="coilNo" column="coil_no"/>
<result property="specification" column="specification"/>
<result property="material" column="material"/>
<result property="quantity" column="quantity"/>
<result property="weight" column="weight"/>
<result property="unitPrice" column="unit_price"/>
<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.WmsCoilBindInfoVo" id="WmsCoilBindInfoResult">
<result property="coilId" column="coil_id"/>
<result property="detailId" column="detail_id"/>
<!-- 发货计划 -->
<result property="planId" column="plan_id"/>
<result property="planName" column="plan_name"/>
<result property="planDate" column="plan_date"/>
<!-- 发货单主表 -->
<result property="waybillId" column="waybill_id"/>
<result property="waybillNo" column="waybill_no"/>
<result property="waybillName" column="waybill_name"/>
<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="waybillStatus" column="status"/>
<result property="waybillRemark" column="remark"/>
<!-- 发货单明细补充字段 -->
<result property="detailSettlementType" column="settlement_type"/>
<result property="detailUnitPrice" column="unit_price"/>
</resultMap>
<select id="selectBindInfoByCoilIds" resultMap="WmsCoilBindInfoResult">
SELECT
d.coil_id,
d.detail_id,
-- 发货单主表
w.waybill_id,
w.waybill_no,
w.waybill_name,
w.license_plate,
w.consignee_unit,
w.sender_unit,
w.delivery_time,
w.weighbridge,
w.sales_person,
w.principal,
w.principal_phone,
w.status,
w.remark,
-- 发货计划
p.plan_id,
p.plan_name,
p.plan_date,
-- 发货单明细补充字段
d.settlement_type,
d.unit_price
FROM wms_delivery_waybill_detail d
LEFT JOIN wms_delivery_waybill w ON w.waybill_id = d.waybill_id AND w.del_flag = 0
LEFT JOIN wms_delivery_plan p ON p.plan_id = w.plan_id AND p.del_flag = 0
WHERE d.del_flag = 0
AND d.coil_id IN
<foreach collection="coilIds" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
<select id="selectBindInfoByCoilId" resultMap="WmsCoilBindInfoResult">
SELECT
d.coil_id,
d.detail_id,
-- 发货单主表
w.waybill_id,
w.waybill_no,
w.waybill_name,
w.license_plate,
w.consignee_unit,
w.sender_unit,
w.delivery_time,
w.weighbridge,
w.sales_person,
w.principal,
w.principal_phone,
w.status,
w.remark,
-- 发货计划
p.plan_id,
p.plan_name,
p.plan_date,
-- 发货单明细补充字段
d.settlement_type,
d.unit_price
FROM wms_delivery_waybill_detail d
INNER JOIN wms_delivery_waybill w ON w.waybill_id = d.waybill_id AND w.del_flag = 0
INNER JOIN wms_delivery_plan p ON p.plan_id = w.plan_id AND p.del_flag = 0
WHERE d.del_flag = 0
AND d.coil_id = #{coilId}
LIMIT 1
</select>
</mapper>