|
|
|
@ -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.InvProductDao">
|
|
|
|
|
|
|
|
|
|
<select id="filterInvProduct" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductRequest"
|
|
|
|
|
resultType="com.glxp.api.admin.entity.inventory.InvProductEntity">
|
|
|
|
|
SELECT * FROM inv_product
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM inv_product
|
|
|
|
|
<where>
|
|
|
|
|
<if test="productsName != '' and productsName != null">
|
|
|
|
|
AND inv_product.productsName like concat('%', #{productsName}, '%')
|
|
|
|
@ -56,7 +56,6 @@
|
|
|
|
|
<if test="groupType != '' and groupType != null">
|
|
|
|
|
GROUP BY #{groupType}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectById" parameterType="Map"
|
|
|
|
@ -64,7 +63,6 @@
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM inv_product
|
|
|
|
|
WHERE id = #{id}
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectByUuid" parameterType="Map"
|
|
|
|
@ -96,7 +94,6 @@
|
|
|
|
|
AND invWarehouseCode is NULL
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -112,16 +109,31 @@
|
|
|
|
|
|
|
|
|
|
<select id="filterJoinInvProduct" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductRequest"
|
|
|
|
|
resultType="com.glxp.api.admin.res.inventory.InvProductResponse">
|
|
|
|
|
SELECT
|
|
|
|
|
inv_product.id,
|
|
|
|
|
basic_products.cpmctymc,basic_products.nameCode,inv_product.relIdFk,basic_products.ggxh,
|
|
|
|
|
SELECT inv_product.id,
|
|
|
|
|
basic_products.cpmctymc,
|
|
|
|
|
basic_products.nameCode,
|
|
|
|
|
inv_product.relIdFk,
|
|
|
|
|
basic_products.ggxh,
|
|
|
|
|
inv_product.batchNo
|
|
|
|
|
,inv_product.productionDate,inv_product.expireDate,
|
|
|
|
|
basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,
|
|
|
|
|
inv_product.inCount,inv_product.outCount
|
|
|
|
|
,inv_product.reCount,inv_product.customerId,basic_corp.name companyName,inv_product.unitFk,inv_product.supId
|
|
|
|
|
,inv_warehouse.name invStorageName,inv_product.invStorageCode,inv_product.price,
|
|
|
|
|
inv_warehouse_sub.name invSubStorageName,inv_product.invWarehouseCode
|
|
|
|
|
,
|
|
|
|
|
inv_product.productionDate,
|
|
|
|
|
inv_product.expireDate,
|
|
|
|
|
basic_products.ylqxzcrbarmc,
|
|
|
|
|
basic_products.zczbhhzbapzbh,
|
|
|
|
|
inv_product.inCount,
|
|
|
|
|
inv_product.outCount
|
|
|
|
|
,
|
|
|
|
|
inv_product.reCount,
|
|
|
|
|
inv_product.customerId,
|
|
|
|
|
basic_corp.name companyName,
|
|
|
|
|
inv_product.unitFk,
|
|
|
|
|
inv_product.supId
|
|
|
|
|
,
|
|
|
|
|
inv_warehouse.name invStorageName,
|
|
|
|
|
inv_product.invStorageCode,
|
|
|
|
|
inv_product.price,
|
|
|
|
|
inv_warehouse_sub.name invSubStorageName,
|
|
|
|
|
inv_product.invWarehouseCode
|
|
|
|
|
FROM inv_product
|
|
|
|
|
inner join basic_udirel on inv_product.relIdFk = basic_udirel.id
|
|
|
|
|
inner join basic_products on basic_udirel.uuid = basic_products.uuid
|
|
|
|
@ -182,7 +194,6 @@
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
<if test="groupType != '' and groupType != null">
|
|
|
|
|
GROUP BY #{groupType}
|
|
|
|
@ -206,7 +217,8 @@
|
|
|
|
|
ip.customerId,
|
|
|
|
|
bc.name companyName,
|
|
|
|
|
ip.unitFk,
|
|
|
|
|
ip.supId,ip.price,
|
|
|
|
|
ip.supId,
|
|
|
|
|
ip.price,
|
|
|
|
|
iw.name invStorageName,
|
|
|
|
|
inCount,
|
|
|
|
|
outCount
|
|
|
|
@ -272,32 +284,70 @@
|
|
|
|
|
<update id="updateInvProduct" parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity">
|
|
|
|
|
UPDATE inv_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="unitFk != null">unitFk=#{unitFk},</if>
|
|
|
|
|
<if test="supId != null">supId=#{supId},</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="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="unitFk != null">
|
|
|
|
|
unitFk=#{unitFk},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supId != null">
|
|
|
|
|
supId=#{supId},
|
|
|
|
|
</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>
|
|
|
|
|
</trim>
|
|
|
|
|
WHERE id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<select id="countByWarehouseCode" resultType="java.lang.Integer">
|
|
|
|
|
select count(*) from inv_product
|
|
|
|
|
select count(*)
|
|
|
|
|
from inv_product
|
|
|
|
|
<where>
|
|
|
|
|
<if test="warehouseCode != null and warehouseCode != ''">
|
|
|
|
|
AND invStorageCode = #{warehouseCode}
|
|
|
|
@ -308,4 +358,12 @@
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectProductInfo" resultType="com.glxp.api.admin.entity.inventory.InvProductEntity">
|
|
|
|
|
select *
|
|
|
|
|
from inv_product
|
|
|
|
|
where relIdFk = #{productId}
|
|
|
|
|
and batchNo = #{batchNo}
|
|
|
|
|
and invStorageCode = #{invStorageCode}
|
|
|
|
|
and invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|