|
|
|
@ -181,12 +181,15 @@
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invWarehouseCode != '' and invWarehouseCode!=null">
|
|
|
|
|
and invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
and
|
|
|
|
|
stock_order.billType in
|
|
|
|
|
(select basic_bussiness_type.localAction from inv_bustype_user INNER JOIN basic_bussiness_type on
|
|
|
|
|
inv_bustype_user.scAction = basic_bussiness_type.action
|
|
|
|
|
WHERE userId =#{userId} and invWarehouseCode =#{invWarehouseCode}
|
|
|
|
|
GROUP BY inv_bustype_user.id)
|
|
|
|
|
|
|
|
|
|
<if test="userId != '' and userId!=null">
|
|
|
|
|
and
|
|
|
|
|
stock_order.billType in
|
|
|
|
|
(select basic_bussiness_type.localAction from inv_bustype_user INNER JOIN basic_bussiness_type on
|
|
|
|
|
inv_bustype_user.scAction = basic_bussiness_type.action
|
|
|
|
|
WHERE userId =#{userId} and invWarehouseCode =#{invWarehouseCode}
|
|
|
|
|
GROUP BY inv_bustype_user.id)
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createUser!=null">
|
|
|
|
|
and createUser = #{createUser}
|
|
|
|
@ -317,7 +320,8 @@
|
|
|
|
|
select io_codes.code udiCode,basic_udirel.id productId,basic_products.cpmctymc productName,basic_products.ggxh
|
|
|
|
|
spec,io_codes.batchNo,io_codes.produceDate productDate,io_codes.expireDate ,io_codes.serialNo,io_codes.count,
|
|
|
|
|
basic_products.ylqxzcrbarmc,basic_udirel.manufactory,basic_udirel.measname,basic_products.zczbhhzbapzbh,
|
|
|
|
|
inv_warehouse.name locInv, inv_warehouse_sub.name subInv, basic_products.spmc, basic_products.cpms
|
|
|
|
|
inv_warehouse.name locInv, inv_warehouse_sub.name subInv, basic_products.spmc,
|
|
|
|
|
basic_products.cpms,io_codes.nameCode,io_codes.relId
|
|
|
|
|
from io_codes
|
|
|
|
|
INNER JOIN basic_udirel on io_codes.relId = basic_udirel.id
|
|
|
|
|
INNER JOIN basic_products on basic_products.uuid = basic_udirel.uuid
|
|
|
|
@ -333,20 +337,17 @@
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectSupplementOrderList" resultType="com.glxp.api.admin.entity.business.StockOrderEntity">
|
|
|
|
|
SELECT
|
|
|
|
|
billNo, orderIdFk, `status`
|
|
|
|
|
FROM
|
|
|
|
|
stock_order
|
|
|
|
|
WHERE
|
|
|
|
|
( supplementNo IS NULL OR supplementNo = '' )
|
|
|
|
|
SELECT billNo,
|
|
|
|
|
orderIdFk,
|
|
|
|
|
`status`
|
|
|
|
|
FROM stock_order
|
|
|
|
|
WHERE (supplementNo IS NULL OR supplementNo = '')
|
|
|
|
|
AND billType IN (
|
|
|
|
|
SELECT
|
|
|
|
|
localAction
|
|
|
|
|
FROM
|
|
|
|
|
basic_bussiness_type
|
|
|
|
|
WHERE
|
|
|
|
|
supplementOrderType IS NOT NULL
|
|
|
|
|
OR supplementOrderType != '')
|
|
|
|
|
SELECT localAction
|
|
|
|
|
FROM basic_bussiness_type
|
|
|
|
|
WHERE supplementOrderType IS NOT NULL
|
|
|
|
|
OR supplementOrderType
|
|
|
|
|
!= '')
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="findById" resultType="com.glxp.api.admin.entity.business.StockOrderEntity">
|
|
|
|
@ -369,17 +370,17 @@
|
|
|
|
|
select id
|
|
|
|
|
from stock_order
|
|
|
|
|
where billNo in (
|
|
|
|
|
select erpFk
|
|
|
|
|
from io_order
|
|
|
|
|
where erpFk in
|
|
|
|
|
(select billNo
|
|
|
|
|
from stock_order
|
|
|
|
|
where stock_order.billType in (select code from basic_third_sys_bus_api))
|
|
|
|
|
and exportStatus = 0
|
|
|
|
|
)
|
|
|
|
|
select erpFk
|
|
|
|
|
from io_order
|
|
|
|
|
where erpFk in
|
|
|
|
|
(select billNo
|
|
|
|
|
from stock_order
|
|
|
|
|
where stock_order.billType in (select code from basic_third_sys_bus_api))
|
|
|
|
|
and exportStatus = 0
|
|
|
|
|
)
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectIdByOrderIdFk" resultType="java.lang.Integer">
|
|
|
|
|
<select id="selectIdByOrderIdFk" resultType="java.lang.Integer">
|
|
|
|
|
select id
|
|
|
|
|
from stock_order
|
|
|
|
|
where orderIdFk = #{orderIdFk}
|
|
|
|
@ -389,7 +390,8 @@
|
|
|
|
|
select t1.* from stock_order t1 left join io_order t2 on t1.billNo = t2.erpFk
|
|
|
|
|
<where>
|
|
|
|
|
<if test="request.billNo != null and request.billNo != ''">
|
|
|
|
|
AND (t2.erpFk like concat('%', #{request.billNo}, '%') or t2.thirdBillNo like concat('%',#{request.billNo},'%'))
|
|
|
|
|
AND (t2.erpFk like concat('%', #{request.billNo}, '%') or t2.thirdBillNo like
|
|
|
|
|
concat('%',#{request.billNo},'%'))
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.submitStatus != null">
|
|
|
|
|
AND t2.exportStatus = #{request.submitStatus}
|
|
|
|
@ -419,6 +421,8 @@
|
|
|
|
|
order by t1.billdate desc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="findBillTypeById" resultType="java.lang.String">
|
|
|
|
|
select billType from stock_order where id = #{id}
|
|
|
|
|
select billType
|
|
|
|
|
from stock_order
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|