feat(wms): 添加发货单明细查询功能支持导出功能
- 在WmsDeliveryWaybillDetailMapper中新增VO查询方法 - 实现联查发货单、计划、钢卷信息的数据映射 - 更新WmsDeliveryWaybillDetailVo实体类字段结构 - 优化服务层查询逻辑并添加分页支持 - 配置MyBatis XML映射文件查询语句 - 整合多表关联数据展示完整业务信息
This commit is contained in:
@@ -130,4 +130,121 @@
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<resultMap type="com.klp.domain.vo.WmsDeliveryWaybillDetailVo" id="WmsDeliveryWaybillDetailVoResult">
|
||||
<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="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
|
||||
<!-- 钢卷信息 -->
|
||||
<result property="enterCoilNo" column="enter_coil_no"/>
|
||||
<result property="currentCoilNo" column="current_coil_no"/>
|
||||
<result property="actualWarehouseName" column="actual_warehouse_name"/>
|
||||
|
||||
<!-- 发货单信息 -->
|
||||
<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="waybill_status"/>
|
||||
<result property="waybillRemark" column="waybill_remark"/>
|
||||
|
||||
<!-- 发货计划信息 -->
|
||||
<result property="planId" column="plan_id"/>
|
||||
<result property="planName" column="plan_name"/>
|
||||
<result property="planDate" column="plan_date"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectDetailVoList" resultMap="WmsDeliveryWaybillDetailVoResult">
|
||||
SELECT
|
||||
d.*,
|
||||
|
||||
c.enter_coil_no,
|
||||
c.current_coil_no,
|
||||
aw.actual_warehouse_name,
|
||||
|
||||
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,
|
||||
(CASE w.status WHEN 0 THEN '未发货' WHEN 1 THEN '已发货' WHEN 2 THEN '已打印' WHEN 3 THEN '未打印' ELSE '未知' END) AS waybill_status,
|
||||
w.remark AS waybill_remark,
|
||||
|
||||
p.plan_id,
|
||||
p.plan_name,
|
||||
p.plan_date
|
||||
FROM wms_delivery_waybill_detail d
|
||||
LEFT JOIN wms_material_coil c ON c.coil_id = d.coil_id AND c.del_flag = 0
|
||||
LEFT JOIN wms_actual_warehouse aw ON aw.actual_warehouse_id = c.actual_warehouse_id AND aw.del_flag = 0
|
||||
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
|
||||
<if test="bo.waybillId != null">
|
||||
AND d.waybill_id = #{bo.waybillId}
|
||||
</if>
|
||||
<if test="bo.coilId != null">
|
||||
AND d.coil_id = #{bo.coilId}
|
||||
</if>
|
||||
<if test="bo.productName != null and bo.productName != ''">
|
||||
AND d.product_name LIKE CONCAT('%', #{bo.productName}, '%')
|
||||
</if>
|
||||
<if test="bo.edgeType != null and bo.edgeType != ''">
|
||||
AND d.edge_type = #{bo.edgeType}
|
||||
</if>
|
||||
<if test="bo.packaging != null and bo.packaging != ''">
|
||||
AND d.packaging = #{bo.packaging}
|
||||
</if>
|
||||
<if test="bo.settlementType != null and bo.settlementType != ''">
|
||||
AND d.settlement_type = #{bo.settlementType}
|
||||
</if>
|
||||
<if test="bo.rawMaterialFactory != null and bo.rawMaterialFactory != ''">
|
||||
AND d.raw_material_factory = #{bo.rawMaterialFactory}
|
||||
</if>
|
||||
<if test="bo.coilNo != null and bo.coilNo != ''">
|
||||
AND d.coil_no = #{bo.coilNo}
|
||||
</if>
|
||||
<if test="bo.specification != null and bo.specification != ''">
|
||||
AND d.specification = #{bo.specification}
|
||||
</if>
|
||||
<if test="bo.material != null and bo.material != ''">
|
||||
AND d.material = #{bo.material}
|
||||
</if>
|
||||
<if test="bo.quantity != null">
|
||||
AND d.quantity = #{bo.quantity}
|
||||
</if>
|
||||
<if test="bo.weight != null">
|
||||
AND d.weight = #{bo.weight}
|
||||
</if>
|
||||
<if test="bo.unitPrice != null">
|
||||
AND d.unit_price = #{bo.unitPrice}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user