|
|
@ -80,4 +80,62 @@
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="stockStatistics" resultType="com.glxp.api.res.inv.InvProductResponse">
|
|
|
|
|
|
|
|
select bp.cpmctymc,
|
|
|
|
|
|
|
|
bp.nameCode,
|
|
|
|
|
|
|
|
bp.ylqxzcrbarmc,
|
|
|
|
|
|
|
|
bp.zczbhhzbapzbh,
|
|
|
|
|
|
|
|
bc.name supName,
|
|
|
|
|
|
|
|
bp.ggxh,
|
|
|
|
|
|
|
|
aw.name invName,
|
|
|
|
|
|
|
|
ip.batchNo,
|
|
|
|
|
|
|
|
ip.relIdFk,
|
|
|
|
|
|
|
|
ip.productionDate,
|
|
|
|
|
|
|
|
ip.expireDate,
|
|
|
|
|
|
|
|
ip.customerId,
|
|
|
|
|
|
|
|
ip.supId,
|
|
|
|
|
|
|
|
sum(ip.inCount) inCount,
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
|
|
|
bp.diType = 1
|
|
|
|
|
|
|
|
<if test="cpmctymc != null and cpmctymc != ''">
|
|
|
|
|
|
|
|
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="nameCode != null and nameCode != ''">
|
|
|
|
|
|
|
|
AND ip.nameCode like concat('%', #{nameCode}, '%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="ggxh != null and ggxh != ''">
|
|
|
|
|
|
|
|
AND bp.ggxh like concat('%', #{ggxh}, '%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''">
|
|
|
|
|
|
|
|
AND bp.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="ylqxzcrbarmc != null and ylqxzcrbarmc != ''">
|
|
|
|
|
|
|
|
AND bp.ylqxzcrbarmc like concat('%', #{ylqxzcrbarmc}, '%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="supId != null and supId != ''">
|
|
|
|
|
|
|
|
AND ip.supId like concat('%', #{supId}, '%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="invCode != null and invCode != ''">
|
|
|
|
|
|
|
|
AND invCode = #{invCode}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="invCodes != null and invCodes.size() != 0">
|
|
|
|
|
|
|
|
AND invCode in
|
|
|
|
|
|
|
|
<foreach collection="invCodes" index="index" item="item" open="(" close=")" separator=",">
|
|
|
|
|
|
|
|
#{item}
|
|
|
|
|
|
|
|
</foreach>
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="batchNo != null and batchNo != ''">
|
|
|
|
|
|
|
|
AND batchNo like concat('%', #{batchNo}, '%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
group by ip.relIdFk, ip.batchNo
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</mapper>
|
|
|
|
</mapper>
|
|
|
|