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.
91 lines
4.3 KiB
91 lines
4.3 KiB
<?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"> |
|
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 |
|
</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 |
|
material_id, |
|
material_code, |
|
material_name, |
|
model, |
|
`type`, |
|
unit, |
|
application_quantity, |
|
ld_demand_end_id, |
|
SUM(outbound_quantity) as outbound_quantity |
|
FROM ld_one_out_storage_detail |
|
where one_out_storage_id in |
|
<foreach collection="oneOutStorageIds" item="id" open="(" separator="," close=")"> |
|
#{id} |
|
</foreach> |
|
GROUP BY material_id,material_code, material_name, model, `type`, unit, application_quantity,ld_demand_end_id |
|
ORDER BY material_code; |
|
</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> |
|
<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> |
|
|
|
|
|
</mapper>
|
|
|