|
|
|
@ -3,17 +3,17 @@
|
|
|
|
|
<mapper namespace="com.glxp.api.dao.inout.IoOrderDao">
|
|
|
|
|
<select id="filterList" 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 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
|
|
|
|
|
<where>
|
|
|
|
|
<if test="id != null and id != ''">
|
|
|
|
@ -21,7 +21,7 @@
|
|
|
|
|
</if>
|
|
|
|
|
<if test="corpName != null and corpName != ''">
|
|
|
|
|
AND (SELECT NAME FROM auth_warehouse aw2 WHERE aw2.CODE = io.fromInvCode) like
|
|
|
|
|
concat('%', #{corpName}, '%')
|
|
|
|
|
concat('%', #{corpName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="action != null and action != ''">
|
|
|
|
|
AND action = #{action}
|
|
|
|
@ -109,12 +109,12 @@
|
|
|
|
|
|
|
|
|
|
<if test="invoiceActions1 == null and invoiceActions2 != null">
|
|
|
|
|
and (
|
|
|
|
|
`action` in
|
|
|
|
|
`action` in
|
|
|
|
|
<foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
and status = 7
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="invoiceActions1 != null and invoiceActions2 != null">
|
|
|
|
@ -123,13 +123,13 @@
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
and status = 10)
|
|
|
|
|
or (
|
|
|
|
|
`action` in
|
|
|
|
|
or (
|
|
|
|
|
`action` in
|
|
|
|
|
<foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
and status = 7)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
@ -140,20 +140,24 @@
|
|
|
|
|
<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
|
|
|
|
|
(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
|
|
|
|
|
(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
|
|
|
|
@ -196,10 +200,12 @@
|
|
|
|
|
AND relKey = #{relKey}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
|
|
|
|
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d')
|
|
|
|
|
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and
|
|
|
|
|
date_format(#{endTime}, '%Y-%m-%d')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startAduditTime != null and startAduditTime != '' and endAduditTime != null and endAduditTime != ''">
|
|
|
|
|
AND date_format(auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and date_format(#{endAduditTime}, '%Y-%m-%d')
|
|
|
|
|
AND date_format(auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and
|
|
|
|
|
date_format(#{endAduditTime}, '%Y-%m-%d')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="actions != null and actions.size() != 0">
|
|
|
|
|
AND `action` in
|
|
|
|
@ -320,7 +326,7 @@
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
|
|
|
|
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and
|
|
|
|
|
date_format(#{endTime}, '%Y-%m-%d')
|
|
|
|
|
date_format(#{endTime}, '%Y-%m-%d')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="lastUpdateTime != null and lastUpdateTime != ''">
|
|
|
|
|
<![CDATA[
|
|
|
|
@ -340,7 +346,7 @@
|
|
|
|
|
FROM basic_bussiness_type
|
|
|
|
|
WHERE supplementOrderType IS NOT NULL
|
|
|
|
|
OR supplementOrderType
|
|
|
|
|
!= '')
|
|
|
|
|
!= '')
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectBillNos" resultType="com.glxp.api.res.inout.OrderNoResult">
|
|
|
|
@ -351,17 +357,17 @@
|
|
|
|
|
|
|
|
|
|
<select id="selectUploadOrder" 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 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
|
|
|
|
|
<where>
|
|
|
|
|
io.dealStatus = 3
|
|
|
|
@ -382,7 +388,7 @@
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
|
|
|
|
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and
|
|
|
|
|
date_format(#{endTime}, '%Y-%m-%d')
|
|
|
|
|
date_format(#{endTime}, '%Y-%m-%d')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startTime != null and startTime != '' and (endTime == null or endTime == '')">
|
|
|
|
|
AND date_format(createTime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d')
|
|
|
|
@ -409,13 +415,24 @@
|
|
|
|
|
<select id="selectWaitSubmitOrder" resultType="java.lang.String">
|
|
|
|
|
select t.billNo
|
|
|
|
|
from io_order t
|
|
|
|
|
left join thr_system_bus_api t1 on t.action = t1.code
|
|
|
|
|
left join thr_system_bus_api t1 on t.action = t1.code
|
|
|
|
|
<where>
|
|
|
|
|
t.status = 7
|
|
|
|
|
and exportStatus = 0
|
|
|
|
|
and exportStatus = 0
|
|
|
|
|
<if test="thirdSys != null and thirdSys != ''">
|
|
|
|
|
AND t1.thirdSys = #{thirdSys}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<update id="updateOrder" parameterType="com.glxp.api.entity.inout.IoOrderEntity">
|
|
|
|
|
UPDATE io_order
|
|
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
|
|
<if test="checkStatus != null">
|
|
|
|
|
checkStatus=#{checkStatus},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
WHERE billNo = #{billNo}
|
|
|
|
|
</update>
|
|
|
|
|
</mapper>
|
|
|
|
|