|
|
|
@ -38,12 +38,12 @@
|
|
|
|
|
bp.basicPrductRemak8,
|
|
|
|
|
ip.price
|
|
|
|
|
from inv_product ip
|
|
|
|
|
inner join basic_udirel on ip.relIdFk = basic_udirel.id
|
|
|
|
|
inner join basic_products bp on basic_udirel.uuid = bp.uuid
|
|
|
|
|
left join basic_corp on ip.supId = basic_corp.erpId
|
|
|
|
|
left join auth_dept on auth_dept.code = ip.deptCode
|
|
|
|
|
left join auth_warehouse on auth_warehouse.code = ip.invCode
|
|
|
|
|
left join auth_space `as` on ip.invSpaceCode = `as`.code
|
|
|
|
|
inner join basic_udirel on ip.relIdFk = basic_udirel.id
|
|
|
|
|
inner join basic_products bp on basic_udirel.uuid = bp.uuid
|
|
|
|
|
left join basic_corp on ip.supId = basic_corp.erpId
|
|
|
|
|
left join auth_dept on auth_dept.code = ip.deptCode
|
|
|
|
|
left join auth_warehouse on auth_warehouse.code = ip.invCode
|
|
|
|
|
left join auth_space `as` on ip.invSpaceCode = `as`.code
|
|
|
|
|
<where>
|
|
|
|
|
<if test="cpmctymc != null and cpmctymc != ''">
|
|
|
|
|
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
|
|
|
|
@ -135,10 +135,10 @@
|
|
|
|
|
sum(ip.outCount) outCount,
|
|
|
|
|
sum(ip.reCount) reCount
|
|
|
|
|
from inv_product ip
|
|
|
|
|
inner join basic_udirel bu on ip.relIdFk = bu.id
|
|
|
|
|
inner join basic_products bp on bu.uuid = bp.uuid
|
|
|
|
|
left join basic_corp bc on ip.supId = bc.erpId
|
|
|
|
|
left join auth_warehouse aw on aw.code = ip.invCode
|
|
|
|
|
inner join basic_udirel bu on ip.relIdFk = bu.id
|
|
|
|
|
inner join basic_products bp on bu.uuid = bp.uuid
|
|
|
|
|
left join basic_corp bc on ip.supId = bc.erpId
|
|
|
|
|
left join auth_warehouse aw on aw.code = ip.invCode
|
|
|
|
|
<where>
|
|
|
|
|
bp.diType = 1
|
|
|
|
|
<if test="cpmctymc != null and cpmctymc != ''">
|
|
|
|
@ -189,9 +189,9 @@
|
|
|
|
|
bp.manufactory,
|
|
|
|
|
bp.zczbhhzbapzbh
|
|
|
|
|
FROM inv_product_detail ip
|
|
|
|
|
LEFT JOIN basic_udirel bu ON bu.id = ip.relId
|
|
|
|
|
LEFT JOIN basic_products bp ON bu.uuid = bp.uuid
|
|
|
|
|
LEFT JOIN basic_corp ON ip.supId = basic_corp.erpId
|
|
|
|
|
LEFT JOIN basic_udirel bu ON bu.id = ip.relId
|
|
|
|
|
LEFT JOIN basic_products bp ON bu.uuid = bp.uuid
|
|
|
|
|
LEFT JOIN basic_corp ON ip.supId = basic_corp.erpId
|
|
|
|
|
<where>
|
|
|
|
|
<if test="nameCode != null and nameCode != ''">
|
|
|
|
|
AND bp.nameCode like concat('%', #{nameCode}, '%')
|
|
|
|
@ -228,10 +228,10 @@
|
|
|
|
|
<select id="selectProductInfo" resultType="com.glxp.api.entity.inv.InvProductEntity">
|
|
|
|
|
select ip.*
|
|
|
|
|
from inv_product ip
|
|
|
|
|
left join inv_product_detail ipd on ip.relIdFk = ipd.relId
|
|
|
|
|
and ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
|
|
|
|
|
and ip.deptCode = ipd.deptCode
|
|
|
|
|
and ip.invCode = ipd.invCode
|
|
|
|
|
left join inv_product_detail ipd on ip.relIdFk = ipd.relId
|
|
|
|
|
and ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
|
|
|
|
|
and ip.deptCode = ipd.deptCode
|
|
|
|
|
and ip.invCode = ipd.invCode
|
|
|
|
|
<where>
|
|
|
|
|
<if test="relId != null and relId != ''">
|
|
|
|
|
AND ip.relIdFk = #{relId}
|
|
|
|
@ -269,11 +269,11 @@
|
|
|
|
|
-- sum(inv_product.inCount - inv_product.outCount) reCount,
|
|
|
|
|
basic_products.cpmctymc
|
|
|
|
|
from inv_product_detail
|
|
|
|
|
left join inv_product on inv_product_detail.relId = inv_product.relIdFk
|
|
|
|
|
and inv_product.invCode = inv_product_detail.invCode
|
|
|
|
|
AND IFNULL(inv_product.batchNo, 'empty') = IFNULL(inv_product_detail.batchNo, 'empty')
|
|
|
|
|
left join basic_udirel on inv_product_detail.relId = basic_udirel.id
|
|
|
|
|
left join basic_products on basic_products.uuid = basic_udirel.uuid
|
|
|
|
|
left join inv_product on inv_product_detail.relId = inv_product.relIdFk
|
|
|
|
|
and inv_product.invCode = inv_product_detail.invCode
|
|
|
|
|
AND IFNULL(inv_product.batchNo, 'empty') = IFNULL(inv_product_detail.batchNo, 'empty')
|
|
|
|
|
left join basic_udirel on inv_product_detail.relId = basic_udirel.id
|
|
|
|
|
left join basic_products on basic_products.uuid = basic_udirel.uuid
|
|
|
|
|
<where>
|
|
|
|
|
<if test="invCode != null and invCode != ''">
|
|
|
|
|
AND inv_product_detail.invCode = #{invCode}
|
|
|
|
@ -307,8 +307,8 @@
|
|
|
|
|
ip.outCount,
|
|
|
|
|
ip.reCount
|
|
|
|
|
from inv_product ip
|
|
|
|
|
left join inv_product_detail ipd
|
|
|
|
|
on ip.relIdFk = ipd.relId and ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
|
|
|
|
|
left join inv_product_detail ipd
|
|
|
|
|
on ip.relIdFk = ipd.relId and ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
|
|
|
|
|
<where>
|
|
|
|
|
<if test="invCode != null and invCode != ''">
|
|
|
|
|
AND ip.invCode = #{invCode}
|
|
|
|
@ -326,10 +326,10 @@
|
|
|
|
|
<select id="filterProductNames" resultType="com.glxp.api.res.inv.InvProductResponse">
|
|
|
|
|
select ip.relIdFk, bp.cpmctymc, bp.ggxh, bp.ylqxzcrbarmc, bp.zczbhhzbapzbh
|
|
|
|
|
from inv_product ip
|
|
|
|
|
left join inv_product_detail ipd on ip.relIdFk = ipd.relId and ip.invCode = ipd.invCode and
|
|
|
|
|
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
|
|
|
|
|
left join basic_udirel bu on bu.id = ip.relIdFk
|
|
|
|
|
left join basic_products bp on bp.uuid = bu.uuid
|
|
|
|
|
left join inv_product_detail ipd on ip.relIdFk = ipd.relId and ip.invCode = ipd.invCode and
|
|
|
|
|
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
|
|
|
|
|
left join basic_udirel bu on bu.id = ip.relIdFk
|
|
|
|
|
left join basic_products bp on bp.uuid = bu.uuid
|
|
|
|
|
<where>
|
|
|
|
|
<if test="cpmctymc != null and cpmctymc != ''">
|
|
|
|
|
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
|
|
|
|
@ -368,13 +368,13 @@
|
|
|
|
|
ip.deptCode,
|
|
|
|
|
ip.invCode
|
|
|
|
|
from inv_product ip
|
|
|
|
|
inner join basic_udirel on ip.relIdFk = basic_udirel.id
|
|
|
|
|
inner join basic_products bp on basic_udirel.uuid = bp.uuid
|
|
|
|
|
left join basic_corp on ip.supId = basic_corp.erpId
|
|
|
|
|
left join auth_dept on auth_dept.code = ip.deptCode
|
|
|
|
|
left join auth_warehouse on auth_warehouse.code = ip.invCode
|
|
|
|
|
left join inv_product_detail ipd on ip.invCode = ipd.invCode and ip.relIdFk = ipd.relId and
|
|
|
|
|
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
|
|
|
|
|
inner join basic_udirel on ip.relIdFk = basic_udirel.id
|
|
|
|
|
inner join basic_products bp on basic_udirel.uuid = bp.uuid
|
|
|
|
|
left join basic_corp on ip.supId = basic_corp.erpId
|
|
|
|
|
left join auth_dept on auth_dept.code = ip.deptCode
|
|
|
|
|
left join auth_warehouse on auth_warehouse.code = ip.invCode
|
|
|
|
|
left join inv_product_detail ipd on ip.invCode = ipd.invCode and ip.relIdFk = ipd.relId and
|
|
|
|
|
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
|
|
|
|
|
<where>
|
|
|
|
|
bp.diType = 1
|
|
|
|
|
<if test="cpmctymc != null and cpmctymc != ''">
|
|
|
|
@ -458,13 +458,13 @@
|
|
|
|
|
ip.price,
|
|
|
|
|
ip.invCode
|
|
|
|
|
from inv_product ip
|
|
|
|
|
inner join basic_udirel on ip.relIdFk = basic_udirel.id
|
|
|
|
|
inner join basic_products bp on basic_udirel.uuid = bp.uuid
|
|
|
|
|
left join basic_corp on ip.supId = basic_corp.erpId
|
|
|
|
|
left join auth_dept on auth_dept.code = ip.deptCode
|
|
|
|
|
left join auth_warehouse on auth_warehouse.code = ip.invCode
|
|
|
|
|
left join basic_product_category_rel on basic_product_category_rel.relId = basic_udirel.id
|
|
|
|
|
left join basic_product_category on basic_product_category_rel.code = basic_product_category.code
|
|
|
|
|
inner join basic_udirel on ip.relIdFk = basic_udirel.id
|
|
|
|
|
inner join basic_products bp on basic_udirel.uuid = bp.uuid
|
|
|
|
|
left join basic_corp on ip.supId = basic_corp.erpId
|
|
|
|
|
left join auth_dept on auth_dept.code = ip.deptCode
|
|
|
|
|
left join auth_warehouse on auth_warehouse.code = ip.invCode
|
|
|
|
|
left join basic_product_category_rel on basic_product_category_rel.relId = basic_udirel.id
|
|
|
|
|
left join basic_product_category on basic_product_category_rel.code = basic_product_category.code
|
|
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
bp.diType = 1
|
|
|
|
@ -553,6 +553,24 @@
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectExitInv" resultType="com.glxp.api.entity.inv.InvProductEntity">
|
|
|
|
|
select *
|
|
|
|
|
from inv_product
|
|
|
|
|
<where>
|
|
|
|
|
<if test="relIdFk != null">
|
|
|
|
|
AND relIdFk = #{relIdFk}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supId != null">
|
|
|
|
|
AND supId = #{supId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invCode != null and invCode != ''">
|
|
|
|
|
AND invCode = #{invCode}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
limit 1
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="filterReCount" resultType="string">
|
|
|
|
|
select ip.supId
|
|
|
|
|
from inv_product ip
|
|
|
|
|