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

84 lines
3.1 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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.WmsStockIoDetailMapper">
<resultMap type="com.klp.domain.WmsStockIoDetail" id="WmsStockIoDetailResult">
<result property="detailId" column="detail_id"/>
<result property="stockIoId" column="stock_io_id"/>
<result property="warehouseId" column="warehouse_id"/>
<result property="itemType" column="item_type"/>
<result property="itemId" column="item_id"/>
<result property="quantity" column="quantity"/>
<result property="unit" column="unit"/>
<result property="batchNo" column="batch_no"/>
<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"/>
<result property="fromWarehouseId" column="from_warehouse_id"/>
<result property="recordType" column="record_type"/>
</resultMap>
<!-- 联查库区/库位名称的明细列表SQL直接返回Map -->
<select id="selectDetailWithWarehouseName" resultType="map">
SELECT
d.detail_id,
d.stock_io_id,
d.warehouse_id,
d.item_type,
d.item_id,
d.quantity,
d.unit,
d.batch_no,
d.remark,
d.del_flag,
d.create_time,
d.create_by,
d.update_time,
d.update_by,
d.from_warehouse_id,
d.record_type,
w1.warehouse_name AS warehouseName,
w2.warehouse_name AS fromWarehouseName
FROM wms_stock_io_detail d
LEFT JOIN wms_warehouse w1 ON d.warehouse_id = w1.warehouse_id
LEFT JOIN wms_warehouse w2 ON d.from_warehouse_id = w2.warehouse_id
<where>
<if test="stockIoId != null">d.stock_io_id = #{stockIoId}</if>
<!-- 其他条件可补充 -->
</where>
</select>
<!-- 分页联查库区/库位名称的明细列表SQL支持Wrapper动态条件返回Page<WmsStockIoDetailVo> -->
<select id="selectVoPagePlus" resultType="com.klp.domain.vo.WmsStockIoDetailVo">
SELECT
d.detail_id,
d.stock_io_id,
d.warehouse_id,
d.item_type,
d.item_id,
d.quantity,
d.unit,
d.batch_no,
d.remark,
d.del_flag,
d.create_time,
d.create_by,
d.update_time,
d.update_by,
d.from_warehouse_id,
d.record_type,
w1.warehouse_name AS warehouseName,
w2.warehouse_name AS fromWarehouseName
FROM wms_stock_io_detail d
LEFT JOIN wms_warehouse w1 ON d.warehouse_id = w1.warehouse_id
LEFT JOIN wms_warehouse w2 ON d.from_warehouse_id = w2.warehouse_id
${ew.customSqlSegment}
</select>
</mapper>