Files
klp-oa/klp-wms/src/main/resources/mapper/klp/WmsSchedulePlanDetailMapper.xml
JR 7665649567 feat(klp-wms): 在 WmsSchedulePlanDetailVo 中添加批次号字段并更新相关 Mapper
- 在 WmsSchedulePlanDetailVo 类中添加 batchNo 字段,用于存储批次号
- 更新 WmsSchedulePlanDetailMapper.xml,加入与 wms_batch 表的关联查询,获取批次号信息
2025-08-15 09:21:10 +08:00

50 lines
1.9 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.WmsSchedulePlanDetailMapper">
<resultMap type="com.klp.domain.WmsSchedulePlanDetail" id="WmsSchedulePlanDetailResult">
<result property="detailId" column="detail_id"/>
<result property="planId" column="plan_id"/>
<result property="lineId" column="line_id"/>
<result property="batchId" column="batch_id"/>
<result property="productId" column="product_id"/>
<result property="quantity" column="quantity"/>
<result property="startDate" column="start_date"/>
<result property="endDate" column="end_date"/>
<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>
<select id="selectPlanTimeAgg" resultType="com.klp.domain.vo.PlanTimeAgg">
SELECT
plan_id,
MIN(start_date) AS startDate,
MAX(end_date) AS endDate
FROM
wms_schedule_plan_detail
WHERE
plan_id IN
<foreach collection="planIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
GROUP BY
plan_id
</select>
<select id="selectVoPagePlus" resultType="com.klp.domain.vo.WmsSchedulePlanDetailVo">
SELECT *,
wpl.line_name AS lineName,
wbt.batch_no AS batchNo
FROM wms_schedule_plan_detail wspd
left join wms_production_line wpl on wspd.line_id = wpl.line_id
left join wms_batch wbt on wspd.batch_id = wbt.batch_id
${ew.customSqlSegment}
</select>
</mapper>