|
|
|
|
@ -30,20 +30,20 @@ |
|
|
|
|
|
|
|
|
|
<!-- 基础查询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 |
|
|
|
|
a.id, a.one_form_id, a.one_out_storage_id, a.one_out_storage_no, a.one_out_detail_code, a.ld_demand_end_id, a.material_id, a.material_name, a.material_code, a.model, a.type, a.unit, a.application_quantity, a.outbound_quantity, a.outbound_sum_quantity, a.shipper_status, a.out_storage_person, a.out_storage_time, a.department, a.department_name, a.department_people_id, a.department_people_name, a.remark |
|
|
|
|
</sql> |
|
|
|
|
|
|
|
|
|
<select id="selectById" resultMap="ldOnePutStorageDetailResultMap"> |
|
|
|
|
SELECT |
|
|
|
|
<include refid="baseColumnList" /> |
|
|
|
|
FROM ld_one_out_storage_detail |
|
|
|
|
FROM ld_one_out_storage_detail a |
|
|
|
|
WHERE id = #{id} |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="selectByMaterialId" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDetail"> |
|
|
|
|
SELECT |
|
|
|
|
<include refid="baseColumnList" /> |
|
|
|
|
FROM ld_one_out_storage_detail |
|
|
|
|
FROM ld_one_out_storage_detail a |
|
|
|
|
WHERE shipper_status = #{shipperStatus} |
|
|
|
|
AND one_out_storage_id = #{oneOutStorageId} |
|
|
|
|
AND material_id = #{materialId} |
|
|
|
|
@ -51,40 +51,46 @@ |
|
|
|
|
</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 |
|
|
|
|
a.material_id, |
|
|
|
|
a.material_code, |
|
|
|
|
a.material_name, |
|
|
|
|
a.model, |
|
|
|
|
a.`type`, |
|
|
|
|
a.unit, |
|
|
|
|
a.application_quantity, |
|
|
|
|
a.ld_demand_end_id, |
|
|
|
|
a.one_form_id, |
|
|
|
|
c.num, |
|
|
|
|
SUM(a.outbound_quantity) as outbound_quantity |
|
|
|
|
FROM ld_one_out_storage_detail a left join ld_one_out_storage b on a.one_out_storage_id = b.id |
|
|
|
|
left join ld_one_form c on a.one_form_id = c.id |
|
|
|
|
where b.status = 3 |
|
|
|
|
and a.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; |
|
|
|
|
GROUP BY a.material_id,a.material_code, a.material_name, a.model, a.`type`, a.unit, a.application_quantity,a.ld_demand_end_id |
|
|
|
|
ORDER BY a.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}; |
|
|
|
|
from ld_one_out_storage_detail a left join ld_one_out_storage b on a.one_out_storage_id = b.id |
|
|
|
|
where b.status = 3 |
|
|
|
|
and 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 |
|
|
|
|
FROM ld_one_out_storage_detail a |
|
|
|
|
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} |
|
|
|
|
<include refid="baseColumnList" />,b.num |
|
|
|
|
FROM ld_one_out_storage_detail a |
|
|
|
|
left join ld_one_form b on a.one_form_id = b.id |
|
|
|
|
WHERE a.one_out_storage_id = #{oneOutStorageId} |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|