<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
~
|
~ Copyright (c) 2018-2025, ztt All rights reserved.
|
~
|
~ Redistribution and use in source and binary forms, with or without
|
~ modification, are permitted provided that the following conditions are met:
|
~
|
~ Redistributions of source code must retain the above copyright notice,
|
~ this list of conditions and the following disclaimer.
|
~ Redistributions in binary form must reproduce the above copyright
|
~ notice, this list of conditions and the following disclaimer in the
|
~ documentation and/or other materials provided with the distribution.
|
~ Neither the name of the pig4cloud.com developer nor the names of its
|
~ contributors may be used to endorse or promote products derived from
|
~ this software without specific prior written permission.
|
~ Author: ztt
|
~
|
-->
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.chinaztt.mes.warehouse.mapper.ReserveDetailMapper">
|
|
<resultMap id="reserveDetailMap" type="com.chinaztt.mes.warehouse.entity.ReserveDetail">
|
<id property="id" column="id"/>
|
<result property="warehouseMainId" column="warehouse_main_id"/>
|
<result property="partId" column="part_id"/>
|
<result property="resQty" column="res_qty"/>
|
<result property="ppoQty" column="ppo_qty"/>
|
<result property="outQty" column="out_qty"/>
|
<result property="recvQty" column="recv_qty"/>
|
<result property="autoReceiveTime" column="auto_receive_time"/>
|
<result property="locationId" column="location_id"/>
|
<result property="status" column="status"/>
|
</resultMap>
|
<resultMap id="getReserveDetailMap" type="com.chinaztt.mes.warehouse.dto.ReserveDetailDTO">
|
<id property="id" column="id"/>
|
<result property="warehouseMainId" column="warehouse_main_id"/>
|
<result property="partId" column="part_id"/>
|
<result property="resQty" column="res_qty"/>
|
<result property="ppoQty" column="ppo_qty"/>
|
<result property="outQty" column="out_qty"/>
|
<result property="recvQty" column="recv_qty"/>
|
<result property="unit" column="unit"/>
|
<result property="partNo" column="part_no"/>
|
<result property="partName" column="part_name"/>
|
<result property="specs" column="specs"/>
|
<result property="autoReceiveTime" column="auto_receive_time"/>
|
<result property="resNo" column="res_no"/>
|
<result property="partBatchNo" column="part_batch_no"/>
|
<result property="locNo" column="loc_no"/>
|
</resultMap>
|
<select id="getReservePage" resultMap="getReserveDetailMap">
|
SELECT
|
wrd."id",
|
wrd.out_qty,
|
wrd.ppo_qty,
|
wrd.recv_qty,
|
wrd.res_qty,
|
wrd.part_id,
|
wrd.location_id,
|
wrd.status,
|
bp.part_no,
|
bp.part_name,
|
bp.unit,
|
bp.specs,
|
bl.loc_no
|
FROM
|
warehouse_reserve_detail wrd
|
LEFT JOIN basic_part bp ON bp."id" = wrd.part_id
|
LEFT JOIN basic_location bl ON bl."id" = wrd.location_id
|
<if test="ew.emptyOfWhere == false">
|
${ew.customSqlSegment}
|
</if>
|
</select>
|
<select id="getByReserveId" resultType="com.chinaztt.mes.warehouse.dto.ReserveDetailDTO">
|
SELECT
|
wrd."id",
|
wrd.status,
|
wrd.out_qty,
|
wrd.ppo_qty,
|
wrd.recv_qty,
|
wrd.res_qty,
|
wrd.part_id,
|
bp.part_no,
|
bp.part_name description,
|
bp.unit,
|
bp.specs
|
FROM
|
warehouse_reserve_detail wrd
|
LEFT JOIN basic_part bp ON bp."id" = wrd.part_id
|
WHERE wrd."id" = #{id}
|
</select>
|
<select id="getPage" resultMap="getReserveDetailMap">
|
select
|
wrd."id",
|
wrd.out_qty,
|
wrd.ppo_qty,
|
wrd.recv_qty,
|
wrd.res_qty,
|
wrd.part_id,
|
wrd.status,
|
wrm.res_no,
|
wpd.location_id,
|
wpd.part_batch_no,
|
wrd.auto_receive_time,
|
bp.part_no,
|
bp.part_name,
|
wl.loc_no
|
from
|
warehouse_reserve_main wrm
|
LEFT JOIN warehouse_reserve_detail wrd ON wrm."id" = wrd.warehouse_main_id
|
LEFT JOIN warehouse_prepare_detail wpd ON wpd.warehouse_reserve_detail_id = wrd."id"
|
LEFT JOIN basic_part bp ON bp."id" = wrd.part_id
|
LEFT join basic_location wl ON wl."id"= wpd.location_id
|
where wrd.status IN ('已拣料','已交接')
|
<if test="ew.emptyOfWhere == false">
|
${ew.customSqlSegment}
|
</if>
|
</select>
|
<select id="getByReserveDetail" resultType="com.chinaztt.mes.warehouse.dto.PrepareDetailDTO">
|
SELECT
|
wrd.warehouse_main_id,
|
wpd."id",
|
wpd.location_id,
|
wpd.out_qty,
|
wpd.part_batch_no,
|
wpd.prepare_qty,
|
wpd.part_id,
|
wpd.warehouse_reserve_detail_id,
|
wpd.update_time,
|
bp.part_no,
|
wl.loc_no,
|
wrm.res_no,
|
wrd.recv_qty
|
FROM
|
warehouse_reserve_main wrm
|
LEFT JOIN warehouse_reserve_detail wrd ON wrm."id" = wrd.warehouse_main_id
|
LEFT JOIN warehouse_prepare_detail wpd ON wpd.warehouse_reserve_detail_id = wrd."id"
|
LEFT JOIN basic_part bp ON bp."id" = wpd.part_id
|
LEFT JOIN basic_location wl ON wl."id" = wpd.location_id
|
WHERE
|
wpd."id" = #{ew.id}
|
</select>
|
</mapper>
|