|
@@ -156,10 +156,10 @@
|
|
|
<!-- 插入入库流水 -->
|
|
|
<insert id="addStorage">
|
|
|
insert into
|
|
|
- tld_storage(wllb_code,supplier_id,serial,produc_date,produc_batch,capacity,seq,type,user_id,department_id,storage_location_code,scrq,storage_code,wbs,order_code)
|
|
|
+ tld_storage(wllb_code,supplier_id,serial,produc_date,produc_batch,capacity,seq,type,user_id,department_id,storage_location_code,scrq,storage_code,wbs,order_code,account_sleeve,purchase_num)
|
|
|
values
|
|
|
<foreach collection="list" index="index" item="item" separator=",">
|
|
|
- (#{item.wllbCode},#{item.suppId},#{item.serial},#{item.producDate},#{item.producDate},#{item.num},#{item.seq},#{item.type},#{item.userId},#{item.departmentId},#{item.storageLocationCode},now(),#{item.storageCode},#{item.wbs},#{item.warehouseTransferId})
|
|
|
+ (#{item.wllbCode},#{item.suppId},#{item.serial},#{item.producDate},#{item.producDate},#{item.num},#{item.seq},#{item.type},#{item.userId},#{item.departmentId},#{item.storageLocationCode},now(),#{item.storageCode},#{item.wbs},#{item.warehouseTransferId},#{item.accountSleeve},#{item.purchaseNum})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
<!-- 插入库存 -->
|
|
@@ -205,30 +205,34 @@
|
|
|
<!-- 查询入库流水 -->
|
|
|
<select id="warehousingFlowing" resultType="com.tld.model.Storage">
|
|
|
select
|
|
|
- a.id,
|
|
|
- b.name as materialName,
|
|
|
- a.wllb_code,
|
|
|
- h.name as supplierName,
|
|
|
- a.serial,
|
|
|
- a.produc_date,
|
|
|
- a.produc_batch,
|
|
|
- a.capacity,
|
|
|
- a.seq,
|
|
|
- a.type,
|
|
|
- c.user_name as userName,
|
|
|
- e.name as departmentName,
|
|
|
- g.storage_location_name as storageLocationName,
|
|
|
- a.scrq,
|
|
|
- a.storage_code,
|
|
|
- a.wbs,
|
|
|
- c.real_name as realName,
|
|
|
- a.order_code as orderCode
|
|
|
+ a.id,
|
|
|
+ b.name as materialName,
|
|
|
+ a.wllb_code,
|
|
|
+ h.name as supplierName,
|
|
|
+ a.serial,
|
|
|
+ a.produc_date,
|
|
|
+ a.produc_batch,
|
|
|
+ a.capacity,
|
|
|
+ a.seq,
|
|
|
+ a.type,
|
|
|
+ c.user_name as userName,
|
|
|
+ e.name as departmentName,
|
|
|
+ g.storage_location_name as storageLocationName,
|
|
|
+ a.scrq,
|
|
|
+ a.storage_code,
|
|
|
+ a.wbs,
|
|
|
+ c.real_name as realName,
|
|
|
+ a.order_code as orderCode,
|
|
|
+ a.account_sleeve,
|
|
|
+ f.name as accountName,
|
|
|
+ a.purchase_num
|
|
|
from tld_storage 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_department e on a.department_id = e.code
|
|
|
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
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="storageCode != null and storageCode != ''">
|
|
|
and a.storage_code like CONCAT(CONCAT('%', #{storageCode}), '%')
|
|
@@ -263,6 +267,9 @@
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
and a.scrq <![CDATA[<=]]> #{endTime}
|
|
|
</if>
|
|
|
+ <if test="accountSleeve != null and accountSleeve != ''">
|
|
|
+ and a.account_sleeve = #{accountSleeve}
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
order by scrq desc
|
|
|
</select>
|
|
@@ -292,29 +299,32 @@
|
|
|
<!-- 查询导出内容 -->
|
|
|
<select id="export" resultType="java.util.LinkedHashMap">
|
|
|
select
|
|
|
- b.name as materialName,
|
|
|
- a.wllb_code as wllbCode,
|
|
|
- h.name as supplierName,
|
|
|
- if(a.serial = '', null ,a.serial) as serial,
|
|
|
- if(a.produc_date = '', null ,a.produc_date) as producDate,
|
|
|
- if(a.produc_batch = '', null ,a.produc_batch) as producbatch,
|
|
|
- a.capacity,
|
|
|
- a.seq,
|
|
|
- a.type,
|
|
|
- c.user_name as userName,
|
|
|
- e.name as departmentName,
|
|
|
- g.storage_location_name as storageLocationName,
|
|
|
- a.scrq,
|
|
|
- a.storage_code,
|
|
|
- a.wbs,
|
|
|
- c.real_name as realName,
|
|
|
- a.order_code as orderCode
|
|
|
+ b.name as materialName,
|
|
|
+ a.wllb_code as wllbCode,
|
|
|
+ h.name as supplierName,
|
|
|
+ if(a.serial = '', null ,a.serial) as serial,
|
|
|
+ if(a.produc_date = '', null ,a.produc_date) as producDate,
|
|
|
+ if(a.produc_batch = '', null ,a.produc_batch) as producbatch,
|
|
|
+ a.capacity,
|
|
|
+ a.seq,
|
|
|
+ a.type,
|
|
|
+ c.user_name as userName,
|
|
|
+ e.name as departmentName,
|
|
|
+ g.storage_location_name as storageLocationName,
|
|
|
+ a.scrq,
|
|
|
+ a.storage_code,
|
|
|
+ a.wbs,
|
|
|
+ c.real_name as realName,
|
|
|
+ a.order_code as orderCode,
|
|
|
+ f.name as accountName,
|
|
|
+ if(a.purchase_num = '', null, a.purchase_num) as purchaseNum
|
|
|
from tld_storage 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_department e on a.department_id = e.code
|
|
|
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
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="storageCode != null and storageCode != ''">
|
|
|
and a.storage_code like CONCAT(CONCAT('%', #{storageCode}), '%')
|
|
@@ -349,6 +359,9 @@
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
and a.scrq <![CDATA[<=]]> #{endTime}
|
|
|
</if>
|
|
|
+ <if test="accountSleeve != null and accountSleeve != ''">
|
|
|
+ and a.account_sleeve = #{accountSleeve}
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
order by a.scrq desc
|
|
|
</select>
|
|
@@ -542,31 +555,34 @@
|
|
|
<!-- 新增半成品入库流水 -->
|
|
|
<insert id="addProduct">
|
|
|
insert into tld_half_product(wllb_code, produc_date, produc_batch, capacity, user_id, storage_location_code,
|
|
|
- scrq, storage_code, wbs, production_code)
|
|
|
- value (#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{storageCode},#{wbs}, #{productionCode})
|
|
|
+ scrq, storage_code, wbs, production_code,account_sleeve)
|
|
|
+ value (#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{storageCode},#{wbs}, #{productionCode},#{companyNumber})
|
|
|
</insert>
|
|
|
<!-- 查询半成品入库流水-->
|
|
|
<select id="getProduct" resultType="com.tld.model.Notice">
|
|
|
select
|
|
|
- a.id,
|
|
|
- a.wllb_code,
|
|
|
- a.produc_date,
|
|
|
- a.produc_batch,
|
|
|
- a.capacity as warehousingNum,
|
|
|
- a.user_id,
|
|
|
- c.user_name,
|
|
|
- a.storage_location_code,
|
|
|
- a.scrq,
|
|
|
- b.name as materialName,
|
|
|
- b.code as materialCode,
|
|
|
- a.storage_code,
|
|
|
- a.wbs,
|
|
|
- a.production_code,
|
|
|
- c.real_name as realName,
|
|
|
- a.production_code as productionCode
|
|
|
+ a.id,
|
|
|
+ a.wllb_code,
|
|
|
+ a.produc_date,
|
|
|
+ a.produc_batch,
|
|
|
+ a.capacity as warehousingNum,
|
|
|
+ a.user_id,
|
|
|
+ c.user_name,
|
|
|
+ a.storage_location_code,
|
|
|
+ a.scrq,
|
|
|
+ b.name as materialName,
|
|
|
+ b.code as materialCode,
|
|
|
+ a.storage_code,
|
|
|
+ a.wbs,
|
|
|
+ a.production_code,
|
|
|
+ c.real_name as realName,
|
|
|
+ a.production_code as productionCode,
|
|
|
+ a.account_sleeve as companyNumber,
|
|
|
+ e.name as accountName
|
|
|
from tld_half_product 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_company e on a.account_sleeve = e.code
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
and a.scrq <![CDATA[>=]]> #{startTime}
|
|
@@ -601,25 +617,30 @@
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
+ <if test="companyNumber != null and companyNumber != ''">
|
|
|
+ and a.account_sleeve = #{companyNumber}
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
order by a.scrq desc
|
|
|
</select>
|
|
|
<!-- 查询半成品入库流水导出-->
|
|
|
<select id="productExcel" resultType="java.util.LinkedHashMap">
|
|
|
select
|
|
|
- b.name,
|
|
|
- a.wllb_code,
|
|
|
- a.produc_date,
|
|
|
- a.capacity,
|
|
|
- c.user_name,
|
|
|
- a.scrq,
|
|
|
- a.storage_code,
|
|
|
- a.wbs,
|
|
|
- c.real_name as realName,
|
|
|
- a.production_code as productionCode
|
|
|
+ b.name,
|
|
|
+ a.wllb_code,
|
|
|
+ a.produc_date,
|
|
|
+ a.capacity,
|
|
|
+ c.user_name,
|
|
|
+ a.scrq,
|
|
|
+ a.storage_code,
|
|
|
+ a.wbs,
|
|
|
+ c.real_name as realName,
|
|
|
+ a.production_code as productionCode,
|
|
|
+ e.name as accountName
|
|
|
from tld_half_product 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_company e on a.account_sleeve = e.code
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
and a.scrq <![CDATA[>=]]> #{startTime}
|
|
@@ -651,6 +672,9 @@
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
+ <if test="companyNumber != null and companyNumber != ''">
|
|
|
+ and a.account_sleeve = #{companyNumber}
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
order by a.scrq desc
|
|
|
</select>
|
|
@@ -736,8 +760,8 @@
|
|
|
<!-- 产成品入库 -->
|
|
|
<insert id="addHalf">
|
|
|
insert into tld_half(wllb_code, produc_date, produc_batch, capacity, user_id, storage_location_code, scrq,
|
|
|
- serial, seq, attribute, storage_code, wbs, production_code)
|
|
|
- value (#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{serial},#{seq},#{attribute},#{storageCode},#{wbs},#{productionCode})
|
|
|
+ serial, seq, attribute, storage_code, wbs, production_code,account_sleeve)
|
|
|
+ value (#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{serial},#{seq},#{attribute},#{storageCode},#{wbs},#{productionCode},#{accountSleeve})
|
|
|
</insert>
|
|
|
<!-- 查询虚拟表数据进行入库 -->
|
|
|
<select id="getVirtualNotice" resultType="com.tld.model.WarehousingVirtual">
|
|
@@ -755,7 +779,8 @@
|
|
|
a.user_id,
|
|
|
a.attribute,
|
|
|
a.storage_location_name,
|
|
|
- b.user_name
|
|
|
+ b.user_name,
|
|
|
+ a.account_sleeve
|
|
|
from tld_warehousing_virtual a
|
|
|
left join tld_user b on a.user_id = b.id
|
|
|
where a.unique_code = #{uniqueCode}
|
|
@@ -765,29 +790,32 @@
|
|
|
<!-- 产成品入库流水 -->
|
|
|
<select id="getHalf" resultType="com.tld.model.Notice">
|
|
|
select
|
|
|
- a.id,
|
|
|
- a.wllb_code,
|
|
|
- a.produc_date,
|
|
|
- a.produc_batch,
|
|
|
- a.capacity,
|
|
|
- a.user_id,
|
|
|
- a.storage_location_code,
|
|
|
- e.storage_location_name as storageLocationName,
|
|
|
- a.scrq,
|
|
|
- a.serial,
|
|
|
- a.seq,
|
|
|
- a.attribute,
|
|
|
- b.name as materialName,
|
|
|
- c.user_name as userName,
|
|
|
- b.code as materialCode,
|
|
|
- a.storage_code,
|
|
|
- a.wbs,
|
|
|
- c.real_name as realName,
|
|
|
- a.production_code as productionCode
|
|
|
+ a.id,
|
|
|
+ a.wllb_code,
|
|
|
+ a.produc_date,
|
|
|
+ a.produc_batch,
|
|
|
+ a.capacity,
|
|
|
+ a.user_id,
|
|
|
+ a.storage_location_code,
|
|
|
+ e.storage_location_name as storageLocationName,
|
|
|
+ a.scrq,
|
|
|
+ a.serial,
|
|
|
+ a.seq,
|
|
|
+ a.attribute,
|
|
|
+ b.name as materialName,
|
|
|
+ c.user_name as userName,
|
|
|
+ b.code as materialCode,
|
|
|
+ a.storage_code,
|
|
|
+ a.wbs,
|
|
|
+ c.real_name as realName,
|
|
|
+ a.production_code as productionCod,
|
|
|
+ a.account_sleeve as companyNumber,
|
|
|
+ f.name as accountName
|
|
|
from tld_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_storage_location e on a.storage_location_code = e.storage_location_code
|
|
|
+ left join tld_company f on a.account_sleeve = f.code
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
and a.scrq <![CDATA[>=]]> #{startTime}
|
|
@@ -819,29 +847,34 @@
|
|
|
<if test="storageLocationName != null and storageLocationName != ''">
|
|
|
and e.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
|
|
|
</if>
|
|
|
+ <if test="companyNumber != null and companyNumber != ''">
|
|
|
+ and a.account_sleeve = #{companyNumber}
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
order by a.scrq desc
|
|
|
</select>
|
|
|
<!-- 产成品导出 -->
|
|
|
<select id="getHalfExcel" resultType="java.util.LinkedHashMap">
|
|
|
select
|
|
|
- b.name as materialName,
|
|
|
- a.wllb_code,
|
|
|
- if(a.produc_batch = '' , null , a.produc_batch) as producBatch,
|
|
|
- a.capacity,
|
|
|
- c.user_name as userName,
|
|
|
- a.storage_location_code,
|
|
|
- a.scrq,
|
|
|
- a.serial,
|
|
|
- if(a.seq = '' , null , a.seq) as seq,
|
|
|
- if(a.attribute = '' , null , a.attribute) as attribute,
|
|
|
- a.storage_code,
|
|
|
- if(a.wbs = '' , null , a.wbs) as wbs,
|
|
|
- c.real_name as realName,
|
|
|
- a.production_code as productionCode
|
|
|
+ b.name as materialName,
|
|
|
+ a.wllb_code,
|
|
|
+ if(a.produc_batch = '' , null , a.produc_batch) as producBatch,
|
|
|
+ a.capacity,
|
|
|
+ c.user_name as userName,
|
|
|
+ a.storage_location_code,
|
|
|
+ a.scrq,
|
|
|
+ a.serial,
|
|
|
+ if(a.seq = '' , null , a.seq) as seq,
|
|
|
+ if(a.attribute = '' , null , a.attribute) as attribute,
|
|
|
+ a.storage_code,
|
|
|
+ if(a.wbs = '' , null , a.wbs) as wbs,
|
|
|
+ c.real_name as realName,
|
|
|
+ a.production_code as productionCode,
|
|
|
+ f.name as accountName
|
|
|
from tld_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_company f on a.account_sleeve = f.code
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
and a.scrq <![CDATA[>=]]> #{startTime}
|
|
@@ -879,6 +912,9 @@
|
|
|
<if test="productionCode != null and productionCode != ''">
|
|
|
and a.production_code like CONCAT(CONCAT('%', #{productionCode}), '%')
|
|
|
</if>
|
|
|
+ <if test="companyNumber != null and companyNumber != ''">
|
|
|
+ and a.account_sleeve = #{companyNumber}
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
order by a.scrq desc
|
|
|
</select>
|