|
|
|
@ -254,29 +254,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getfilterList" resultType="com.glxp.api.res.inout.IoOrderResponse">
|
|
|
|
|
select io.*,
|
|
|
|
|
(select name from basic_bussiness_type bus where bus.action = io.action) billTypeName,
|
|
|
|
|
(select name from auth_dept ad where ad.code = io.deptCode) deptName,
|
|
|
|
|
(select name from auth_warehouse aw where aw.code = io.invCode) invName,
|
|
|
|
|
(select employeeName from auth_user au where au.id = io.createUser) createUserName,
|
|
|
|
|
(select employeeName from auth_user au2 where au2.id = io.updateUser) updateUserName,
|
|
|
|
|
(select employeeName from auth_user au3 where au3.id = io.reviewUser) reviewUserName,
|
|
|
|
|
(select employeeName from auth_user au4 where au4.id = io.checkUser) checkUserName,
|
|
|
|
|
(select name from auth_dept ad2 where ad2.code = io.fromDeptCode) fromDeptName,
|
|
|
|
|
(select name from auth_warehouse aw2 where aw2.code = io.fromInvCode) fromInvName,
|
|
|
|
|
(select name from basic_corp bc where bc.erpId = io.fromCorp) fromCorpName,
|
|
|
|
|
(select name from basic_corp bc where bc.erpId = io.customerId) customerName,
|
|
|
|
|
(SELECT count(*)
|
|
|
|
|
FROM io_order_detail_code
|
|
|
|
|
WHERE io_order_detail_code.orderIdFk = io.billNo
|
|
|
|
|
and io_order_detail_code.regStatus = 1
|
|
|
|
|
) AS allCout,
|
|
|
|
|
(SELECT count(*)
|
|
|
|
|
FROM io_order_detail_code
|
|
|
|
|
WHERE io_order_detail_code.orderIdFk = io.billNo
|
|
|
|
|
and io_order_detail_code.regStatus = 0
|
|
|
|
|
) As partCount
|
|
|
|
|
from io_order as io
|
|
|
|
|
SELECT
|
|
|
|
|
io.*,
|
|
|
|
|
bbt.name AS billTypeName,
|
|
|
|
|
ad.name AS deptName,
|
|
|
|
|
aw.name AS invName,
|
|
|
|
|
au_create.employeeName AS createUserName,
|
|
|
|
|
au_update.employeeName AS updateUserName,
|
|
|
|
|
au_review.employeeName AS reviewUserName,
|
|
|
|
|
au_check.employeeName AS checkUserName,
|
|
|
|
|
ad_from.name AS fromDeptName,
|
|
|
|
|
aw_from.name AS fromInvName,
|
|
|
|
|
bc_from.name AS fromCorpName,
|
|
|
|
|
bc_customer.name AS customerName,
|
|
|
|
|
SUM(CASE WHEN iodc.regStatus = 1 THEN 1 ELSE 0 END) AS allCount,
|
|
|
|
|
SUM(CASE WHEN iodc.regStatus = 0 THEN 1 ELSE 0 END) AS partCount
|
|
|
|
|
FROM
|
|
|
|
|
io_order io
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
basic_bussiness_type bbt ON bbt.action = io.action
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_dept ad ON ad.code = io.deptCode
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_warehouse aw ON aw.code = io.invCode
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_user au_create ON au_create.id = io.createUser
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_user au_update ON au_update.id = io.updateUser
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_user au_review ON au_review.id = io.reviewUser
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_user au_check ON au_check.id = io.checkUser
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_dept ad_from ON ad_from.code = io.fromDeptCode
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_warehouse aw_from ON aw_from.code = io.fromInvCode
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
basic_corp bc_from ON bc_from.erpId = io.fromCorp
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
basic_corp bc_customer ON bc_customer.erpId = io.customerId
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
io_order_detail_code iodc ON iodc.orderIdFk = io.billNo
|
|
|
|
|
<where>
|
|
|
|
|
<if test="billNo != null and billNo != ''">
|
|
|
|
|
AND billNo like concat(#{billNo}, '%')
|
|
|
|
@ -397,6 +415,10 @@
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
GROUP BY io.billNo,
|
|
|
|
|
bbt.name, ad.name, aw.name, au_create.employeeName, au_update.employeeName,
|
|
|
|
|
au_review.employeeName, au_check.employeeName, ad_from.name, aw_from.name,
|
|
|
|
|
bc_from.name, bc_customer.name
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="(orderBy != null) and (sort == 'desc' or sort == 'asc')">
|
|
|
|
|
order by ${orderBy} ${sort}
|
|
|
|
@ -467,14 +489,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectSupplementOrderList" resultType="com.glxp.api.entity.inout.IoOrderEntity">
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM io_order
|
|
|
|
|
WHERE (supplementNo IS NULL OR supplementNo = '')
|
|
|
|
|
AND `action` IN (SELECT `action`
|
|
|
|
|
FROM basic_bussiness_type
|
|
|
|
|
WHERE supplementOrderType IS NOT NULL
|
|
|
|
|
and supplementOrderType
|
|
|
|
|
!= '')
|
|
|
|
|
SELECT io.*
|
|
|
|
|
FROM io_order io
|
|
|
|
|
WHERE (io.supplementNo IS NULL OR io.supplementNo = '')
|
|
|
|
|
AND EXISTS(
|
|
|
|
|
SELECT 1
|
|
|
|
|
FROM basic_bussiness_type bbt
|
|
|
|
|
WHERE bbt.action = io.action
|
|
|
|
|
AND bbt.supplementOrderType IS NOT NULL
|
|
|
|
|
AND bbt.supplementOrderType != ''
|
|
|
|
|
)
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectBillNos" resultType="com.glxp.api.res.inout.OrderNoResult">
|
|
|
|
@ -484,21 +508,46 @@
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectUploadOrder" resultType="com.glxp.api.res.inout.IoOrderResponse">
|
|
|
|
|
select io.*,
|
|
|
|
|
ioul.result,
|
|
|
|
|
(select name from basic_bussiness_type bus where bus.action = io.action) billTypeName,
|
|
|
|
|
(select name from auth_dept ad where ad.code = io.deptCode) deptName,
|
|
|
|
|
(select name from auth_warehouse aw where aw.code = io.invCode) invName,
|
|
|
|
|
(select employeeName from auth_user au where au.id = io.createUser) createUserName,
|
|
|
|
|
(select employeeName from auth_user au2 where au2.id = io.updateUser) updateUserName,
|
|
|
|
|
(select employeeName from auth_user au3 where au3.id = io.reviewUser) reviewUserName,
|
|
|
|
|
(select employeeName from auth_user au4 where au4.id = io.checkUser) checkUserName,
|
|
|
|
|
(select name from auth_dept ad2 where ad2.code = io.fromDeptCode) fromDeptName,
|
|
|
|
|
(select name from auth_warehouse aw2 where aw2.code = io.fromInvCode) fromInvName,
|
|
|
|
|
(select name from basic_corp bc where bc.erpId = io.fromCorp) fromCorpName,
|
|
|
|
|
(select name from basic_corp bc where bc.erpId = io.customerId) customerName
|
|
|
|
|
from io_order as io
|
|
|
|
|
left join io_order_upload_log ioul on io.billNo = ioul.billNo
|
|
|
|
|
SELECT
|
|
|
|
|
io.*,
|
|
|
|
|
ioul.result,
|
|
|
|
|
bbt.name AS billTypeName,
|
|
|
|
|
ad.name AS deptName,
|
|
|
|
|
aw.name AS invName,
|
|
|
|
|
au_create.employeeName AS createUserName,
|
|
|
|
|
au_update.employeeName AS updateUserName,
|
|
|
|
|
au_review.employeeName AS reviewUserName,
|
|
|
|
|
au_check.employeeName AS checkUserName,
|
|
|
|
|
ad_from.name AS fromDeptName,
|
|
|
|
|
aw_from.name AS fromInvName,
|
|
|
|
|
bc_from.name AS fromCorpName,
|
|
|
|
|
bc_customer.name AS customerName
|
|
|
|
|
FROM
|
|
|
|
|
io_order io
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
io_order_upload_log ioul ON io.billNo = ioul.billNo
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
basic_bussiness_type bbt ON bbt.action = io.action
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_dept ad ON ad.code = io.deptCode
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_warehouse aw ON aw.code = io.invCode
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_user au_create ON au_create.id = io.createUser
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_user au_update ON au_update.id = io.updateUser
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_user au_review ON au_review.id = io.reviewUser
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_user au_check ON au_check.id = io.checkUser
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_dept ad_from ON ad_from.code = io.fromDeptCode
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_warehouse aw_from ON aw_from.code = io.fromInvCode
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
basic_corp bc_from ON bc_from.erpId = io.fromCorp
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
basic_corp bc_customer ON bc_customer.erpId = io.customerId
|
|
|
|
|
<where>
|
|
|
|
|
io.dealStatus = 3
|
|
|
|
|
<if test="billNo != null and billNo != ''">
|
|
|
|
|