|
@@ -409,7 +409,8 @@
|
|
|
a.ask_goods_id,
|
|
|
c.real_name as realName,
|
|
|
a.account_sleeve,
|
|
|
- f.name as accountName
|
|
|
+ f.name as accountName,
|
|
|
+ p.ask_goods_code as askGoodsCode
|
|
|
from tld_removal a
|
|
|
left join tld_material b on a.wllb_code = b.code
|
|
|
left join tld_user c on a.user_id = c.id
|
|
@@ -417,6 +418,7 @@
|
|
|
left join tld_storage_location g on a.storage_location_code = g.storage_location_code
|
|
|
left join tld_customer h on a.supplier_id = h.code
|
|
|
left join tld_company f on a.account_sleeve = f.code
|
|
|
+ left join tld_ask_goods_f p on a.ask_goods_id = p.ask_goods_id
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
and a.scrq <![CDATA[>=]]> #{startTime}
|
|
@@ -454,6 +456,9 @@
|
|
|
<if test="askGoodsId != null and askGoodsId != ''">
|
|
|
and a.ask_goods_id like CONCAT(CONCAT('%', #{askGoodsId}), '%')
|
|
|
</if>
|
|
|
+ <if test="askGoodsCode != null and askGoodsCode != ''">
|
|
|
+ and p.ask_goods_code like CONCAT(CONCAT('%', #{askGoodsCode}), '%')
|
|
|
+ </if>
|
|
|
<if test="accountSleeve != null and accountSleeve != ''">
|
|
|
and a.account_sleeve = #{accountSleeve}
|
|
|
</if>
|
|
@@ -472,7 +477,7 @@
|
|
|
g.storage_location_name as storageLocationName,
|
|
|
a.scrq,
|
|
|
a.num,
|
|
|
- a.ask_goods_id,
|
|
|
+ p.ask_goods_code,
|
|
|
c.real_name,
|
|
|
a.account_sleeve,
|
|
|
f.name as accountName
|
|
@@ -483,6 +488,7 @@
|
|
|
left join tld_storage_location g on a.storage_location_code = g.storage_location_code
|
|
|
left join tld_customer h on a.supplier_id = h.code
|
|
|
left join tld_company f on a.account_sleeve = f.code
|
|
|
+ left join tld_ask_goods_f p on a.ask_goods_id = p.ask_goods_id
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
and a.scrq <![CDATA[>=]]> #{startTime}
|
|
@@ -520,6 +526,9 @@
|
|
|
<if test="askGoodsId != null and askGoodsId != ''">
|
|
|
and a.ask_goods_id like CONCAT(CONCAT('%', #{askGoodsId}), '%')
|
|
|
</if>
|
|
|
+ <if test="askGoodsCode != null and askGoodsCode != ''">
|
|
|
+ and p.ask_goods_code like CONCAT(CONCAT('%', #{askGoodsCode}), '%')
|
|
|
+ </if>
|
|
|
<if test="accountSleeve != null and accountSleeve != ''">
|
|
|
and a.account_sleeve = #{accountSleeve}
|
|
|
</if>
|
|
@@ -606,7 +615,8 @@
|
|
|
g.name as companyName,
|
|
|
c.source_type,
|
|
|
c.move_type,
|
|
|
- c.sqrq
|
|
|
+ c.sqrq,
|
|
|
+ c.ask_goods_code
|
|
|
FROM
|
|
|
tld_ask_goods a
|
|
|
join tld_material b on a.material_id = b.tld_id
|
|
@@ -622,6 +632,9 @@
|
|
|
<if test="askGoodsId != null and askGoodsId != ''">
|
|
|
and a.ask_goods_id like CONCAT(CONCAT('%', #{askGoodsId}), '%')
|
|
|
</if>
|
|
|
+ <if test="askGoodsCode != null and askGoodsCode != ''">
|
|
|
+ and c.ask_goods_code like CONCAT(CONCAT('%', #{askGoodsCode}), '%')
|
|
|
+ </if>
|
|
|
<if test="id != null and id != ''">
|
|
|
and a.id = #{id}
|
|
|
</if>
|
|
@@ -674,12 +687,14 @@
|
|
|
a.wbs,
|
|
|
e.real_name as realName,
|
|
|
a.account_sleeve,
|
|
|
- f.name as accountName
|
|
|
+ f.name as accountName,
|
|
|
+ p.ask_goods_code as askGoodsCode
|
|
|
from tld_removal_half_product a
|
|
|
left join tld_material b on a.wllb_code = b.code
|
|
|
left join tld_department c on a.department = c.code
|
|
|
left join tld_user e on a.user_id = e.id
|
|
|
left join tld_company f on a.account_sleeve = f.code
|
|
|
+ left join tld_ask_goods_f p on a.ask_goods_id = p.ask_goods_id
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="wllbCode != null and wllbCode != ''">
|
|
|
and a.wllb_code like CONCAT(CONCAT('%', #{wllbCode}), '%')
|
|
@@ -705,6 +720,9 @@
|
|
|
<if test="askGoodsId != null and askGoodsId != ''">
|
|
|
and a.ask_goods_id like CONCAT(CONCAT('%', #{askGoodsId}), '%')
|
|
|
</if>
|
|
|
+ <if test="askGoodsCode != null and askGoodsCode != ''">
|
|
|
+ and p.ask_goods_code like CONCAT(CONCAT('%', #{askGoodsCode}), '%')
|
|
|
+ </if>
|
|
|
<if test="storageCode != null and storageCode != ''">
|
|
|
and a.storage_code like CONCAT(CONCAT('%', #{storageCode}), '%')
|
|
|
</if>
|
|
@@ -720,7 +738,7 @@
|
|
|
<!-- 查询半成品出库流水导出 -->
|
|
|
<select id="getRemovalHalfProductExcel" resultType="java.util.LinkedHashMap">
|
|
|
select
|
|
|
- if(a.ask_goods_id = '' , null , a.ask_goods_id ) as askGoodsId,
|
|
|
+ if(p.ask_goods_code = '' , null , p.ask_goods_code ) as askGoodsCode,
|
|
|
a.storage_code as storageCode,
|
|
|
a.wllb_code as wllbCode,
|
|
|
b.name as materialName,
|
|
@@ -736,6 +754,7 @@
|
|
|
left join tld_department c on a.department = c.code
|
|
|
left join tld_user e on a.user_id = e.id
|
|
|
left join tld_company f on a.account_sleeve = f.code
|
|
|
+ left join tld_ask_goods_f p on a.ask_goods_id = p.ask_goods_id
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="wllbCode != null and wllbCode != ''">
|
|
|
and a.wllb_code like CONCAT(CONCAT('%', #{wllbCode}), '%')
|
|
@@ -761,6 +780,9 @@
|
|
|
<if test="askGoodsId != null and askGoodsId != ''">
|
|
|
and a.ask_goods_id like CONCAT(CONCAT('%', #{askGoodsId}), '%')
|
|
|
</if>
|
|
|
+ <if test="askGoodsCode != null and askGoodsCode != ''">
|
|
|
+ and p.ask_goods_code like CONCAT(CONCAT('%', #{askGoodsCode}), '%')
|
|
|
+ </if>
|
|
|
<if test="storageCode != null and storageCode != ''">
|
|
|
and a.storage_code like CONCAT(CONCAT('%', #{storageCode}), '%')
|
|
|
</if>
|
|
@@ -791,12 +813,14 @@
|
|
|
b.code as materialCode,
|
|
|
a.storage_code,
|
|
|
a.wbs,
|
|
|
- c.real_name as realName
|
|
|
+ c.real_name as realName,
|
|
|
+ p.delivery_code as deliveryCode
|
|
|
from tld_removal_half a
|
|
|
left join tld_material b on a.wllb_code = b.code
|
|
|
left join tld_user c on a.user_id = c.id
|
|
|
left join tld_customer e on a.customer_code = e.code
|
|
|
left join tld_company f on a.company_number = f.code
|
|
|
+ left join tld_delivery_f p on a.delivery_id = p.delivery_id
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="wllbCode != null and wllbCode != ''">
|
|
|
and a.wllb_code like CONCAT(CONCAT('%', #{wllbCode}), '%')
|
|
@@ -813,6 +837,9 @@
|
|
|
<if test="deliveryId != null and deliveryId != ''">
|
|
|
and a.delivery_id like CONCAT(CONCAT('%', #{deliveryId}), '%')
|
|
|
</if>
|
|
|
+ <if test="deliveryCode != null and deliveryCode != ''">
|
|
|
+ and p.delivery_code like CONCAT(CONCAT('%', #{deliveryCode}), '%')
|
|
|
+ </if>
|
|
|
<if test="companyCode != null and companyCode != ''">
|
|
|
and a.company_number = #{companyCode}
|
|
|
</if>
|
|
@@ -837,6 +864,7 @@
|
|
|
<!-- 产成品导出出库流水 -->
|
|
|
<select id="getRemovalHalfExcel" resultType="java.util.LinkedHashMap">
|
|
|
select
|
|
|
+ p.delivery_code as deliveryCode,
|
|
|
b.name as materialName,
|
|
|
a.num,
|
|
|
c.user_name as userName,
|
|
@@ -851,6 +879,7 @@
|
|
|
left join tld_user c on a.user_id = c.id
|
|
|
left join tld_customer e on a.customer_code = e.code
|
|
|
left join tld_company f on a.company_number = f.tld_id
|
|
|
+ left join tld_delivery_f p on a.delivery_id = p.delivery_id
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="wllbCode != null and wllbCode != ''">
|
|
|
and a.wllb_code like CONCAT(CONCAT('%', #{wllbCode}), '%')
|
|
@@ -867,6 +896,9 @@
|
|
|
<if test="deliveryId != null and deliveryId != ''">
|
|
|
and a.delivery_id like CONCAT(CONCAT('%', #{deliveryId}), '%')
|
|
|
</if>
|
|
|
+ <if test="deliveryCode != null and deliveryCode != ''">
|
|
|
+ and p.delivery_code like CONCAT(CONCAT('%', #{deliveryCode}), '%')
|
|
|
+ </if>
|
|
|
<if test="companyCode != null and companyCode != ''">
|
|
|
and a.company_number = #{companyCode}
|
|
|
</if>
|
|
@@ -1273,6 +1305,30 @@
|
|
|
WHERE a.storage_code = #{removalCode}
|
|
|
group by b.warehouse_where
|
|
|
</select>
|
|
|
+ <!--查询其他发货补领料仓库-->
|
|
|
+ <select id="getCreateOtherDeliveryMaterialsWarehouseWhere" resultType="java.util.Map">
|
|
|
+ SELECT DISTINCT b.warehouse_where as warehouseWhere
|
|
|
+ FROM tld_return_gs_removal_z a
|
|
|
+ JOIN tld_storage_location b ON a.storage_location_code = b.storage_location_code
|
|
|
+ WHERE a.document_id = #{removalCode}
|
|
|
+ </select>
|
|
|
+ <!--查询其他发货父表信息-->
|
|
|
+ <select id="getCreateOtherDeliveryMaterialsParent" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ id as id,
|
|
|
+ ask_goods_id as askGoodsId,
|
|
|
+ ask_goods_code as askGoodsCode,
|
|
|
+ company_number as companyNumber,
|
|
|
+ sqrq as sqrq,
|
|
|
+ department as department,
|
|
|
+ request_type_number as requestTypeNumber,
|
|
|
+ request_type_name as requestType_name,
|
|
|
+ source_type as sourceType,
|
|
|
+ move_type as moveType,
|
|
|
+ if_commodity as ifCommodity,
|
|
|
+ ifnull(product_code, '') as productCode,
|
|
|
+ from tld_enquiry_f where ask_goods_id = #{documentId}
|
|
|
+ </select>
|
|
|
<!-- 修改数据传输状态 -->
|
|
|
<update id="updateRemoval">
|
|
|
update tld_removal set transmission_type = "1" where storage_code = #{removalCode}
|