|
|
|
@ -2,10 +2,10 @@
|
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
|
|
|
|
|
|
|
<mapper namespace="com.glxp.api.admin.dao.inventory.InvPreInProductDao">
|
|
|
|
|
|
|
|
|
|
<select id="filterInvProduct" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductRequest"
|
|
|
|
|
resultType="com.glxp.api.admin.entity.inventory.InvProductEntity">
|
|
|
|
|
SELECT * FROM inv_prein_product
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM inv_prein_product
|
|
|
|
|
<where>
|
|
|
|
|
<if test="productsName != '' and productsName != null">
|
|
|
|
|
AND productsName = #{productsName}
|
|
|
|
@ -69,7 +69,6 @@
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM inv_prein_product
|
|
|
|
|
WHERE id = #{id}
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -86,7 +85,7 @@
|
|
|
|
|
AND supId is NULL
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="batchNo != '' and batchNo != null and batchNo!='empty'">
|
|
|
|
|
<if test="batchNo != '' and batchNo != null and batchNo != 'empty'">
|
|
|
|
|
AND batchNo = #{batchNo}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="batchNo == 'empty'">
|
|
|
|
@ -102,7 +101,6 @@
|
|
|
|
|
AND invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectExit" parameterType="Map"
|
|
|
|
|
resultType="com.glxp.api.admin.entity.inventory.InvProductEntity">
|
|
|
|
@ -113,37 +111,56 @@
|
|
|
|
|
</where>
|
|
|
|
|
limit 1
|
|
|
|
|
</select>
|
|
|
|
|
<!-- and supId = #{supId}-->
|
|
|
|
|
<!-- and supId = #{supId}
|
|
|
|
|
sum(inv_prein_product.inCount) as inCount,
|
|
|
|
|
sum(inv_prein_product.outCount) as outCount,
|
|
|
|
|
sum(inv_prein_product.reCount) as reCount,
|
|
|
|
|
-->
|
|
|
|
|
<select id="filterJoinInvProduct" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductRequest"
|
|
|
|
|
resultType="com.glxp.api.admin.res.inventory.InvProductResponse">
|
|
|
|
|
SELECT
|
|
|
|
|
inv_prein_product.id,
|
|
|
|
|
basic_products.cpmctymc,basic_products.nameCode,inv_prein_product.relIdFk,basic_products.ggxh,
|
|
|
|
|
inv_prein_product.batchNo
|
|
|
|
|
,inv_prein_product.productionDate,inv_prein_product.expireDate,
|
|
|
|
|
basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,
|
|
|
|
|
sum(inv_prein_product.inCount) as inCount,
|
|
|
|
|
sum(inv_prein_product.outCount) as outCount,
|
|
|
|
|
sum(inv_prein_product.reCount) as reCount, inv_prein_product.customerId,
|
|
|
|
|
basic_corp.name companyName,inv_prein_product.supId,inv_prein_product.unitFk ,inv_warehouse.name
|
|
|
|
|
invStorageName,inv_prein_product.invStorageCode,inv_prein_product.price,inv_warehouse_sub.name invSubStorageName
|
|
|
|
|
,inv_prein_product.invWarehouseCode,inv_prein_product.orderIdFk
|
|
|
|
|
SELECT inv_prein_product.id,
|
|
|
|
|
basic_products.cpmctymc,
|
|
|
|
|
basic_products.nameCode,
|
|
|
|
|
inv_prein_product.relIdFk,
|
|
|
|
|
basic_products.ggxh,
|
|
|
|
|
inv_prein_product.batchNo,
|
|
|
|
|
inv_prein_product.productionDate,
|
|
|
|
|
inv_prein_product.expireDate,
|
|
|
|
|
basic_products.ylqxzcrbarmc,
|
|
|
|
|
basic_products.zczbhhzbapzbh,
|
|
|
|
|
|
|
|
|
|
inv_prein_product.customerId,
|
|
|
|
|
basic_corp.name companyName,
|
|
|
|
|
inv_prein_product.supId,
|
|
|
|
|
inv_prein_product.unitFk,
|
|
|
|
|
inv_warehouse.name
|
|
|
|
|
invStorageName,
|
|
|
|
|
inv_prein_product.invStorageCode,
|
|
|
|
|
inv_prein_product.price,
|
|
|
|
|
inv_warehouse_sub.name
|
|
|
|
|
invSubStorageName,
|
|
|
|
|
inv_prein_product.invWarehouseCode,
|
|
|
|
|
inv_prein_product.orderIdFk,
|
|
|
|
|
io_order.createTime,
|
|
|
|
|
io_order.auditTime
|
|
|
|
|
FROM inv_prein_product
|
|
|
|
|
inner join basic_udirel on inv_prein_product.relIdFk = basic_udirel.id
|
|
|
|
|
inner join basic_products on basic_udirel.uuid = basic_products.uuid
|
|
|
|
|
left join basic_corp on inv_prein_product.supId=basic_corp.erpId
|
|
|
|
|
left join inv_warehouse on inv_warehouse.code=inv_prein_product.invStorageCode
|
|
|
|
|
left join inv_warehouse_sub on inv_warehouse_sub.code = inv_prein_product.invWarehouseCode
|
|
|
|
|
inner join basic_udirel on inv_prein_product.relIdFk = basic_udirel.id
|
|
|
|
|
inner join basic_products on basic_udirel.uuid = basic_products.uuid
|
|
|
|
|
left join basic_corp on inv_prein_product.supId = basic_corp.erpId
|
|
|
|
|
left join inv_warehouse on inv_warehouse.code = inv_prein_product.invStorageCode
|
|
|
|
|
left join inv_warehouse_sub on inv_warehouse_sub.code = inv_prein_product.invWarehouseCode
|
|
|
|
|
left join io_order on inv_prein_product.orderIdFk = io_order.id
|
|
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
basic_products.diType=1
|
|
|
|
|
basic_products.diType = 1
|
|
|
|
|
<if test="cpmctymc != '' and cpmctymc != null">
|
|
|
|
|
AND basic_products.cpmctymc like concat('%',#{cpmctymc},'%')
|
|
|
|
|
AND basic_products.cpmctymc like concat('%', #{cpmctymc}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="productsName != null and productsName != ''">
|
|
|
|
|
AND basic_products.cpmctymc like concat('%',#{productsName},'%')
|
|
|
|
|
AND basic_products.cpmctymc like concat('%', #{productsName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="nameCode != '' and nameCode != null">
|
|
|
|
|
AND basic_products.nameCode like concat('%',#{nameCode},'%')
|
|
|
|
|
AND basic_products.nameCode like concat('%', #{nameCode}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="relIdFk != '' and relIdFk != null">
|
|
|
|
|
AND inv_prein_product.relIdFk = #{relIdFk}
|
|
|
|
@ -156,10 +173,10 @@
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="ggxh != '' and ggxh != null">
|
|
|
|
|
AND basic_products.ggxh like concat('%',#{ggxh},'%')
|
|
|
|
|
AND basic_products.ggxh like concat('%', #{ggxh}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="batchNo != '' and batchNo != null">
|
|
|
|
|
AND inv_prein_product.batchNo like concat('%',#{batchNo},'%')
|
|
|
|
|
AND inv_prein_product.batchNo like concat('%', #{batchNo}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="productionDate != '' and productionDate != null">
|
|
|
|
|
AND inv_prein_product.productionDate = #{productionDate}
|
|
|
|
@ -202,21 +219,22 @@
|
|
|
|
|
GROUP BY #{groupType}
|
|
|
|
|
</if>
|
|
|
|
|
group by inv_prein_product.orderIdFk
|
|
|
|
|
order by inv_prein_product.updateTime desc
|
|
|
|
|
order by inv_prein_product.updateTime desc
|
|
|
|
|
</select>
|
|
|
|
|
<insert id="insertInvProduct" keyProperty="id"
|
|
|
|
|
parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity">
|
|
|
|
|
insert INTO inv_prein_product
|
|
|
|
|
(productsName, nameCode, relIdFk, ggxh, batchNo,
|
|
|
|
|
productionDate, expireDate, ylqxzcrbarmc, zczbhhzbapzbh,
|
|
|
|
|
inCount, outCount, reCount, customerId, supId, unitFk, invStorageCode, invWarehouseCode, price, updateTime,
|
|
|
|
|
orderIdFk)
|
|
|
|
|
(productsName, nameCode, relIdFk, ggxh, batchNo,
|
|
|
|
|
productionDate, expireDate, ylqxzcrbarmc, zczbhhzbapzbh,
|
|
|
|
|
inCount, outCount, reCount, customerId, supId, unitFk, invStorageCode, invWarehouseCode, price,
|
|
|
|
|
updateTime,
|
|
|
|
|
orderIdFk)
|
|
|
|
|
values (#{productsName}, #{nameCode},
|
|
|
|
|
#{relIdFk}, #{ggxh}, #{batchNo},
|
|
|
|
|
#{productionDate}, #{expireDate},
|
|
|
|
|
#{ylqxzcrbarmc}, #{zczbhhzbapzbh},
|
|
|
|
|
#{inCount}, #{outCount}, #{reCount}, #{customerId}, #{supId}, #{unitFk}
|
|
|
|
|
, #{invStorageCode}, #{invWarehouseCode}, #{price}, #{updateTime}, #{orderIdFk})
|
|
|
|
|
, #{invStorageCode}, #{invWarehouseCode}, #{price}, #{updateTime}, #{orderIdFk})
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -241,29 +259,67 @@
|
|
|
|
|
<update id="updateInvProduct" parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity">
|
|
|
|
|
UPDATE inv_prein_product
|
|
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
|
|
<if test="productsName != null">productsName=#{productsName},</if>
|
|
|
|
|
<if test="nameCode != null">nameCode=#{nameCode},</if>
|
|
|
|
|
<if test="relIdFk != null">relIdFk=#{relIdFk},</if>
|
|
|
|
|
<if test="ggxh != null">ggxh=#{ggxh},</if>
|
|
|
|
|
<if test="batchNo != null">batchNo=#{batchNo},</if>
|
|
|
|
|
<if test="productionDate != null">productionDate=#{productionDate},</if>
|
|
|
|
|
<if test="expireDate != null">expireDate=#{expireDate},</if>
|
|
|
|
|
<if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
|
|
|
|
|
<if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if>
|
|
|
|
|
<if test="inCount != null">inCount=#{inCount},</if>
|
|
|
|
|
<if test="outCount != null">outCount=#{outCount},</if>
|
|
|
|
|
<if test="reCount != null">reCount=#{reCount},</if>
|
|
|
|
|
<if test="customerId != null">customerId=#{customerId},</if>
|
|
|
|
|
<if test="supId != null">supId=#{supId},</if>
|
|
|
|
|
<if test="unitFk != null">unitFk=#{unitFk},</if>
|
|
|
|
|
<if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if>
|
|
|
|
|
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
|
|
|
|
|
<if test="price != null">price=#{price},</if>
|
|
|
|
|
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
|
|
|
|
<if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if>
|
|
|
|
|
|
|
|
|
|
<if test="productsName != null">
|
|
|
|
|
productsName=#{productsName},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="nameCode != null">
|
|
|
|
|
nameCode=#{nameCode},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="relIdFk != null">
|
|
|
|
|
relIdFk=#{relIdFk},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ggxh != null">
|
|
|
|
|
ggxh=#{ggxh},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="batchNo != null">
|
|
|
|
|
batchNo=#{batchNo},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="productionDate != null">
|
|
|
|
|
productionDate=#{productionDate},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="expireDate != null">
|
|
|
|
|
expireDate=#{expireDate},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ylqxzcrbarmc != null">
|
|
|
|
|
ylqxzcrbarmc=#{ylqxzcrbarmc},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="zczbhhzbapzbh != null">
|
|
|
|
|
zczbhhzbapzbh=#{zczbhhzbapzbh},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="inCount != null">
|
|
|
|
|
inCount=#{inCount},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="outCount != null">
|
|
|
|
|
outCount=#{outCount},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="reCount != null">
|
|
|
|
|
reCount=#{reCount},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="customerId != null">
|
|
|
|
|
customerId=#{customerId},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supId != null">
|
|
|
|
|
supId=#{supId},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="unitFk != null">
|
|
|
|
|
unitFk=#{unitFk},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invStorageCode != null">
|
|
|
|
|
invStorageCode=#{invStorageCode},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invWarehouseCode != null">
|
|
|
|
|
invWarehouseCode=#{invWarehouseCode},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="price != null">
|
|
|
|
|
price=#{price},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
updateTime=#{updateTime},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderIdFk != null">
|
|
|
|
|
orderIdFk=#{orderIdFk},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
WHERE id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
|
</mapper>
|
|
|
|
|