|
|
|
|
<?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.nov.KgLowDurable.mapper.LdOnePutStorageDetailMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap id="ldOnePutStorageDetailResultMap" type="com.nov.KgLowDurable.pojo.entity.LdOnePutStorageDetail">
|
|
|
|
|
<!-- 主键 -->
|
|
|
|
|
<id column="id" property="id" />
|
|
|
|
|
<result column="inbound_detail_code" property="inboundDetailCode" />
|
|
|
|
|
<result column="one_put_storage_id" property="onePutStorageId" />
|
|
|
|
|
<result column="one_put_storage_no" property="onePutStorageNo" />
|
|
|
|
|
<result column="ld_purchase_end_id" property="ldPurchaseEndId" />
|
|
|
|
|
<result column="material_id" property="materialId" />
|
|
|
|
|
<result column="material_name" property="materialName" />
|
|
|
|
|
<result column="material_code" property="materialCode" />
|
|
|
|
|
<result column="model" property="model" />
|
|
|
|
|
<result column="type" property="type" />
|
|
|
|
|
<result column="unit" property="unit" />
|
|
|
|
|
<result column="required_quantity" property="requiredQuantity" />
|
|
|
|
|
<result column="inbound_quantity" property="inboundQuantity" />
|
|
|
|
|
<result column="unit_price" property="unitPrice" />
|
|
|
|
|
<result column="amount" property="amount" />
|
|
|
|
|
<result column="inbound_status" property="inboundStatus" />
|
|
|
|
|
<result column="inbound_person" property="inboundPerson" />
|
|
|
|
|
<result column="inbound_time" property="inboundTime" />
|
|
|
|
|
<result column="remark" property="remark" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<!-- 基础查询SQL -->
|
|
|
|
|
<sql id="baseColumnList">
|
|
|
|
|
id,
|
|
|
|
|
inbound_detail_code,
|
|
|
|
|
one_put_storage_id,
|
|
|
|
|
one_put_storage_no,
|
|
|
|
|
ld_purchase_end_id,
|
|
|
|
|
material_id,
|
|
|
|
|
material_name,
|
|
|
|
|
material_code,
|
|
|
|
|
model,
|
|
|
|
|
type,
|
|
|
|
|
unit,
|
|
|
|
|
required_quantity,
|
|
|
|
|
inbound_quantity,
|
|
|
|
|
unit_price,
|
|
|
|
|
amount,
|
|
|
|
|
inbound_status,
|
|
|
|
|
inbound_person,
|
|
|
|
|
inbound_time,
|
|
|
|
|
remark
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectById" resultMap="ldOnePutStorageDetailResultMap">
|
|
|
|
|
SELECT
|
|
|
|
|
<include refid="baseColumnList" />
|
|
|
|
|
FROM ld_one_put_storage_detail
|
|
|
|
|
WHERE id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectByMaterialId" resultType="com.nov.KgLowDurable.pojo.entity.LdOnePutStorageDetail">
|
|
|
|
|
SELECT
|
|
|
|
|
<include refid="baseColumnList" />
|
|
|
|
|
FROM ld_one_put_storage_detail
|
|
|
|
|
WHERE one_put_storage_id = #{onePutStorageId}
|
|
|
|
|
AND material_id = #{materialId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectMaxOrderNo" resultType="java.lang.String">
|
|
|
|
|
SELECT MAX(inbound_detail_code)
|
|
|
|
|
FROM ld_one_put_storage_detail
|
|
|
|
|
WHERE inbound_detail_code LIKE CONCAT(#{prefix}, #{date}, '%')
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectSummaryDat" resultType="com.nov.KgLowDurable.pojo.entity.LdOnePutStorageDetail">
|
|
|
|
|
SELECT
|
|
|
|
|
ld_purchase_end_id,
|
|
|
|
|
material_id,
|
|
|
|
|
material_name,
|
|
|
|
|
material_code,
|
|
|
|
|
model,
|
|
|
|
|
type,
|
|
|
|
|
unit,
|
|
|
|
|
unit_price,
|
|
|
|
|
required_quantity,
|
|
|
|
|
SUM(inbound_quantity) as inbound_quantity
|
|
|
|
|
FROM ld_one_put_storage_detail
|
|
|
|
|
WHERE ld_purchase_end_id IS NOT NULL
|
|
|
|
|
and one_put_storage_id in
|
|
|
|
|
<foreach collection="collect" item="id" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
GROUP BY
|
|
|
|
|
ld_purchase_end_id,
|
|
|
|
|
material_id,
|
|
|
|
|
material_name,
|
|
|
|
|
material_code,
|
|
|
|
|
model,
|
|
|
|
|
type,
|
|
|
|
|
unit,
|
|
|
|
|
unit_price,
|
|
|
|
|
required_quantity
|
|
|
|
|
ORDER BY ld_purchase_end_id, material_id;
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectByOnePutStorageId" resultType="com.nov.KgLowDurable.pojo.entity.LdOnePutStorageDetail">
|
|
|
|
|
SELECT
|
|
|
|
|
<include refid="baseColumnList" />
|
|
|
|
|
FROM ld_one_put_storage_detail
|
|
|
|
|
WHERE one_put_storage_id = #{onePutStorageId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|