You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
4.3 KiB

4 months ago
<?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.LdOneOutStorageDetailMapper">
<resultMap id="ldOnePutStorageDetailResultMap" type="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDetail">
<!-- 主键 -->
<id column="id" property="id" />
<result column="one_out_detail_code" property="oneOutDetailCode" />
<result column="one_out_storage_id" property="oneOutStorageId" />
<result column="one_out_storage_no" property="oneOutStorageNo" />
<result column="ld_demand_end_id" property="ldDemandEndId" />
<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="application_quantity" property="applicationQuantity" />
<result column="outbound_quantity" property="outboundQuantity" />
<result column="outbound_sum_quantity" property="outboundSumQuantity" />
<result column="shipper_status" property="shipperStatus" />
<result column="out_storage_person" property="outStoragePerson" />
<result column="out_storage_time" property="outStorageTime" />
<result column="department" property="department" />
<result column="department_name" property="departmentName" />
<result column="department_people_id" property="departmentPeopleId" />
<result column="department_people_name" property="departmentPeopleName" />
<result column="remark" property="remark" />
</resultMap>
<!-- 基础查询SQL -->
<sql id="baseColumnList">
4 months ago
id, one_form_id, one_out_storage_id, one_out_storage_no, one_out_detail_code, ld_demand_end_id, material_id, material_name, material_code, model, type, unit, application_quantity, outbound_quantity, outbound_sum_quantity, shipper_status, out_storage_person, out_storage_time, department, department_name, department_people_id, department_people_name, remark
4 months ago
</sql>
<select id="selectById" resultMap="ldOnePutStorageDetailResultMap">
SELECT
<include refid="baseColumnList" />
FROM ld_one_out_storage_detail
WHERE id = #{id}
</select>
<select id="selectByMaterialId" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDetail">
SELECT
<include refid="baseColumnList" />
FROM ld_one_out_storage_detail
WHERE shipper_status = #{shipperStatus}
AND one_out_storage_id = #{oneOutStorageId}
AND material_id = #{materialId}
AND department = #{department}
</select>
<select id="selectByOneOutStorageIds" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDetail">
SELECT
4 months ago
material_id,
material_code,
material_name,
model,
4 months ago
`type`,
4 months ago
unit,
application_quantity,
4 months ago
ld_demand_end_id,
4 months ago
SUM(outbound_quantity) as outbound_quantity
4 months ago
FROM ld_one_out_storage_detail
where one_out_storage_id in
<foreach collection="oneOutStorageIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
4 months ago
GROUP BY material_id,material_code, material_name, model, `type`, unit, application_quantity,ld_demand_end_id
4 months ago
ORDER BY material_code;
4 months ago
</select>
<select id="selectByDemandEndId" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDetail">
select
<include refid="baseColumnList" />
from ld_one_out_storage_detail
where ld_demand_end_id = #{ldDemandEndId};
</select>
<select id="selectByOneOutStorageId" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDetail">
SELECT
<include refid="baseColumnList" />
FROM ld_one_out_storage_detail
WHERE one_out_storage_id = #{oneOutStorageId}
</select>
3 months ago
<select id="selectByOneOutId" resultType="com.nov.KgLowDurable.pojo.vo.LdOneOutStorageDetailVO">
SELECT
<include refid="baseColumnList" />
FROM ld_one_out_storage_detail
WHERE one_out_storage_id = #{oneOutStorageId}
</select>
4 months ago
</mapper>