|
|
|
@ -135,4 +135,85 @@
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="findGroupBySpace" resultType="com.glxp.api.res.inv.InvPreinProductResponse">
|
|
|
|
|
select
|
|
|
|
|
ipp.id,
|
|
|
|
|
ipp.nameCode,
|
|
|
|
|
bp.cpmctymc,
|
|
|
|
|
ipp.relId,
|
|
|
|
|
bp.ggxh,
|
|
|
|
|
ipp.batchNo,
|
|
|
|
|
ipp.produceDate,
|
|
|
|
|
ipp.expireDate,
|
|
|
|
|
bp.ylqxzcrbarmc,
|
|
|
|
|
bp.zczbhhzbapzbh,
|
|
|
|
|
sum(ipp.inCount) as inCount,
|
|
|
|
|
sum(ipp.outCount) as outCount,
|
|
|
|
|
sum(ipp.reCount) as reCount,
|
|
|
|
|
basic_corp.name supName,
|
|
|
|
|
ipp.supId,
|
|
|
|
|
auth_dept.name deptName,
|
|
|
|
|
auth_warehouse.name invName,
|
|
|
|
|
asp.name spaceName,
|
|
|
|
|
ipp.deptCode,
|
|
|
|
|
ipp.invCode
|
|
|
|
|
from inv_prein_product_detail ipp
|
|
|
|
|
inner join basic_udirel on ipp.relId = basic_udirel.id
|
|
|
|
|
inner join basic_products bp on basic_udirel.uuid = bp.uuid
|
|
|
|
|
left join basic_corp on ipp.supId = basic_corp.erpId
|
|
|
|
|
left join auth_dept on auth_dept.code = ipp.deptCode
|
|
|
|
|
left join auth_warehouse on auth_warehouse.code = ipp.invCode
|
|
|
|
|
left join auth_space `asp` on ipp.invSpaceCode = `asp`.code
|
|
|
|
|
<where>
|
|
|
|
|
<if test="cpmctymc != null and cpmctymc != ''">
|
|
|
|
|
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="nameCode != null and nameCode != ''">
|
|
|
|
|
AND ipp.nameCode like concat('%', #{nameCode}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="relIdFk != null and relIdFk != ''">
|
|
|
|
|
AND ipp.relId = #{relIdFk}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ggxh != null and ggxh != ''">
|
|
|
|
|
AND bp.ggxh like concat('%', #{ggxh}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="batchNo != null and batchNo != ''">
|
|
|
|
|
AND ipp.batchNo like concat('%', #{batchNo}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="productionDate != null and productionDate != ''">
|
|
|
|
|
AND ipp.produceDate = #{productionDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="expireDate != null and expireDate != ''">
|
|
|
|
|
AND ipp.expireDate = #{expireDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ylqxzcrbarmc != null and ylqxzcrbarmc != ''">
|
|
|
|
|
AND bp.ylqxzcrbarmc like concat('%', #{ylqxzcrbarmc}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''">
|
|
|
|
|
AND bp.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supId != null and supId != ''">
|
|
|
|
|
AND ipp.supId = #{supId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="deptCode != null and deptCode != ''">
|
|
|
|
|
AND ipp.deptCode = #{deptCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invCode != null and invCode != ''">
|
|
|
|
|
AND ipp.invCode = #{invCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invSpaceCode != null and invSpaceCode != ''">
|
|
|
|
|
AND ipp.invSpaceCode = #{invSpaceCode}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="invCodes != null and invCodes.size() != 0">
|
|
|
|
|
AND ipp.invCode in
|
|
|
|
|
<foreach collection="invCodes" item="item" index="index" open="(" close=")" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
GROUP BY ipp.relId, ipp.batchNo
|
|
|
|
|
order by ipp.updateTime desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
|