|
|
@ -27,7 +27,94 @@
|
|
|
|
expireDate, supId, inCount, outCount, createTime, updateTime, remark
|
|
|
|
expireDate, supId, inCount, outCount, createTime, updateTime, remark
|
|
|
|
</sql>
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="filterList" parameterType="com.glxp.api.req.inout.IoSplitFifoInvRequest" resultType="com.glxp.api.res.inout.IoSplitInvResponse">
|
|
|
|
<select id="filterList" parameterType="com.glxp.api.req.inout.IoSplitFifoInvRequest" resultType="com.glxp.api.res.inout.IoSplitInvResponse">
|
|
|
|
|
|
|
|
select isfi.*,
|
|
|
|
|
|
|
|
bp.cpmctymc,
|
|
|
|
|
|
|
|
bp.ggxh,
|
|
|
|
|
|
|
|
bp.bzgg,
|
|
|
|
|
|
|
|
bu.useLevelUnit,
|
|
|
|
|
|
|
|
bp.ylqxzcrbarmc,
|
|
|
|
|
|
|
|
bp.nameCode,
|
|
|
|
|
|
|
|
bp.manufactory,
|
|
|
|
|
|
|
|
bp.measname,
|
|
|
|
|
|
|
|
bp.zczbhhzbapzbh,
|
|
|
|
|
|
|
|
bp.ybbm,
|
|
|
|
|
|
|
|
bp.zxxsdycpbs,
|
|
|
|
|
|
|
|
bc.name supName,
|
|
|
|
|
|
|
|
sw.workPlaceName,
|
|
|
|
|
|
|
|
swd.busName,
|
|
|
|
|
|
|
|
swd.monopoly
|
|
|
|
|
|
|
|
from io_split_fifo_inv isfi
|
|
|
|
|
|
|
|
LEFT JOIN basic_udirel bu ON bu.id = isfi.relId
|
|
|
|
|
|
|
|
LEFT JOIN basic_products bp ON bu.uuid = bp.uuid
|
|
|
|
|
|
|
|
left join basic_corp bc on bc.erpId = isfi.supId
|
|
|
|
|
|
|
|
left join sys_workplace sw on sw.workplaceId = isfi.workPlaceCode
|
|
|
|
|
|
|
|
left join sys_workplace_document swd on swd.documentTypeCode = isfi.busType
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="relId != null">
|
|
|
|
|
|
|
|
AND isfi.relId = #{relId}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="nameCode != '' and nameCode != null">
|
|
|
|
|
|
|
|
AND bp.nameCode = #{nameCode}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
|
|
|
|
|
|
|
|
AND bp.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
|
|
|
|
|
|
|
|
AND (
|
|
|
|
|
|
|
|
bp.ylqxzcrbarmc like concat('%', #{ylqxzcrbarmc}, '%')
|
|
|
|
|
|
|
|
or bp.manufactory like concat('%', #{ylqxzcrbarmc}, '%'))
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="batchNo != '' and batchNo != null">
|
|
|
|
|
|
|
|
AND isfi.batchNo = #{batchNo}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="invCode != null">
|
|
|
|
|
|
|
|
AND isfi.invCode = #{invCode}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="supId != null">
|
|
|
|
|
|
|
|
AND isfi.supId = #{supId}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="fifoSplit != null">
|
|
|
|
|
|
|
|
AND isfi.fifoSplit = #{fifoSplit}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="productType != null">
|
|
|
|
|
|
|
|
AND isfi.productType = #{productType}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="workPlaceCode != null">
|
|
|
|
|
|
|
|
AND isfi.workPlaceCode = #{workPlaceCode}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="busType != null and busType != ''">
|
|
|
|
|
|
|
|
AND isfi.busType = #{busType}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="cpmctymc != null and cpmctymc != ''">
|
|
|
|
|
|
|
|
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="keyWords != null and keyWords != ''">
|
|
|
|
|
|
|
|
AND (
|
|
|
|
|
|
|
|
isfi.workPlaceCode like concat('%', #{keyWords}, '%')
|
|
|
|
|
|
|
|
or bp.nameCode like concat('%', #{keyWords}, '%')
|
|
|
|
|
|
|
|
or isfi.batchNo like concat('%', #{keyWords}, '%')
|
|
|
|
|
|
|
|
or bp.cpmctymc like concat('%', #{keyWords}, '%')
|
|
|
|
|
|
|
|
or bp.ggxh like concat('%', #{keyWords}, '%')
|
|
|
|
|
|
|
|
or bp.bzgg like concat('%', #{keyWords}, '%')
|
|
|
|
|
|
|
|
or bp.nameCode like concat('%', #{keyWords}, '%')
|
|
|
|
|
|
|
|
or bp.zczbhhzbapzbh like concat('%', #{keyWords}, '%')
|
|
|
|
|
|
|
|
or bp.ylqxzcrbarmc like concat('%', #{keyWords}, '%')
|
|
|
|
|
|
|
|
or bp.manufactory like concat('%',#{keyWords},'%')
|
|
|
|
|
|
|
|
or bc.name like concat('%',#{keyWords},'%')
|
|
|
|
|
|
|
|
or swd.busName like concat('%',#{keyWords},'%')
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="remind != null and remind == 'yj' ">
|
|
|
|
|
|
|
|
AND not exists(select 1 from io_split_fifo_inv t where t.enableRemind = 0 and (t.reCount - t.invRemindCount) <![CDATA[ >= ]]> 0 and t.id = isfi.id )
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
GROUP BY id
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="filterKcyjList" parameterType="com.glxp.api.req.inout.IoSplitFifoInvRequest" resultType="com.glxp.api.res.inout.IoSplitInvResponse">
|
|
|
|
select isfi.*,
|
|
|
|
select isfi.*,
|
|
|
|
bp.cpmctymc,
|
|
|
|
bp.cpmctymc,
|
|
|
|
CASE WHEN bp.ggxh IS NULL THEN bp.bzgg ELSE bp.ggxh END AS ggxh,
|
|
|
|
CASE WHEN bp.ggxh IS NULL THEN bp.bzgg ELSE bp.ggxh END AS ggxh,
|
|
|
@ -51,7 +138,7 @@
|
|
|
|
swf.freightRow,
|
|
|
|
swf.freightRow,
|
|
|
|
(ifnull(swq.maxDrugCount,0) - ifnull(isfi.reCount,0)) as suggestOutCount
|
|
|
|
(ifnull(swq.maxDrugCount,0) - ifnull(isfi.reCount,0)) as suggestOutCount
|
|
|
|
from
|
|
|
|
from
|
|
|
|
(select relId,sum(reCount) as reCount,sum(availableCount) as availableCount,supId,workPlaceQueueCode,workPlaceCode,busType from io_split_fifo_inv
|
|
|
|
(select relId,sum(reCodeCount) as reCount,sum(availableCount) as availableCount,supId,workPlaceQueueCode,workPlaceCode,busType from io_split_fifo_inv
|
|
|
|
group by relId,supId,workPlaceQueueCode,workPlaceCode,busType
|
|
|
|
group by relId,supId,workPlaceQueueCode,workPlaceCode,busType
|
|
|
|
) as isfi
|
|
|
|
) as isfi
|
|
|
|
LEFT JOIN basic_udirel bu ON bu.id = isfi.relId
|
|
|
|
LEFT JOIN basic_udirel bu ON bu.id = isfi.relId
|
|
|
|