|
|
|
@ -14,7 +14,7 @@
|
|
|
|
|
(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
|
|
|
|
|
from io_order as io
|
|
|
|
|
<if test="uploadKey != null and uploadKey != ''">
|
|
|
|
|
INNER JOIN io_unit_maintain_platform a2 on io.action = a2.sourceAction AND io.fromCorp = a2.unitId
|
|
|
|
|
</if>
|
|
|
|
@ -77,7 +77,10 @@
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="unionRemark != null and unionRemark != ''">
|
|
|
|
|
AND (io.remark like concat('%', #{unionRemark}, '%')
|
|
|
|
|
or io.outSickInfo like concat('%', #{unionRemark}, '%'))
|
|
|
|
|
</if>
|
|
|
|
|
<if test="statuses != null and statuses.size() != 0">
|
|
|
|
|
AND status in
|
|
|
|
|
<foreach collection="statuses" index="index" item="item" open="(" close=")" separator=",">
|
|
|
|
@ -139,8 +142,8 @@
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="(orderBy!=null ) and (sort=='desc' or sort=='asc')">
|
|
|
|
|
order by ${orderBy} ${sort}
|
|
|
|
|
<when test="(orderBy != null) and (sort == 'desc' or sort == 'asc')">
|
|
|
|
|
order by ${orderBy} ${sort}
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
order by updateTime desc
|
|
|
|
@ -294,8 +297,8 @@
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="(orderBy!=null ) and (sort=='desc' or sort=='asc')">
|
|
|
|
|
order by ${orderBy} ${sort}
|
|
|
|
|
<when test="(orderBy != null) and (sort == 'desc' or sort == 'asc')">
|
|
|
|
|
order by ${orderBy} ${sort}
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
order by updateTime desc
|
|
|
|
@ -340,6 +343,10 @@
|
|
|
|
|
<if test="syncStatus != null">
|
|
|
|
|
AND syncStatus = #{syncStatus}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="unionRemark != null and unionRemark != ''">
|
|
|
|
|
AND (io.remark like concat('%', #{unionRemark}, '%')
|
|
|
|
|
or io.outSickInfo like concat('%', #{unionRemark}, '%'))
|
|
|
|
|
</if>
|
|
|
|
|
<if test="busType != null">
|
|
|
|
|
AND busType = #{busType}
|
|
|
|
|
</if>
|
|
|
|
@ -441,7 +448,7 @@
|
|
|
|
|
<if test="thirdSys != null and thirdSys != ''">
|
|
|
|
|
AND t1.thirdSys = #{thirdSys}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderStartTime != null ">
|
|
|
|
|
<if test="orderStartTime != null">
|
|
|
|
|
<![CDATA[
|
|
|
|
|
and updateTime >= DATE_FORMAT(#{orderStartTime}, '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
]]>
|
|
|
|
@ -462,43 +469,43 @@
|
|
|
|
|
|
|
|
|
|
<select id="selectOrderIdList" resultType="java.lang.String">
|
|
|
|
|
SELECT billNo
|
|
|
|
|
FROM io_order
|
|
|
|
|
LEFT JOIN basic_bussiness_type ON io_order.action = basic_bussiness_type.action
|
|
|
|
|
FROM io_order
|
|
|
|
|
LEFT JOIN basic_bussiness_type ON io_order.action = basic_bussiness_type.action
|
|
|
|
|
WHERE basic_bussiness_type.inStock = 1
|
|
|
|
|
and io_order.`status` = 7
|
|
|
|
|
AND date_format(io_order.updateTime, '%Y-%m-%d') = date_format(#{data},'%Y-%m-%d')
|
|
|
|
|
AND date_format(io_order.updateTime, '%Y-%m-%d') = date_format(#{data}, '%Y-%m-%d')
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectOrderfirstAndLastIdList" resultType="java.lang.String">
|
|
|
|
|
SELECT billNo
|
|
|
|
|
FROM io_order
|
|
|
|
|
LEFT JOIN basic_bussiness_type ON io_order.action = basic_bussiness_type.action
|
|
|
|
|
LEFT JOIN basic_bussiness_type ON io_order.action = basic_bussiness_type.action
|
|
|
|
|
WHERE basic_bussiness_type.inStock = 1
|
|
|
|
|
and io_order.`status` = 7
|
|
|
|
|
AND date_format(io_order.updateTime, '%Y-%m-%d') between date_format(#{lastData}, '%Y-%m-%d') and
|
|
|
|
|
date_format(#{firstData}, '%Y-%m-%d')
|
|
|
|
|
and io_order.`status` = 7
|
|
|
|
|
AND date_format(io_order.updateTime, '%Y-%m-%d') between date_format(#{lastData}, '%Y-%m-%d') and
|
|
|
|
|
date_format(#{firstData}, '%Y-%m-%d')
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getfilterOrderList" resultType="com.glxp.api.res.inout.IoOrderResponse">
|
|
|
|
|
SELECT io.*,
|
|
|
|
|
bus.NAME AS billTypeName,
|
|
|
|
|
ad.NAME AS deptName,
|
|
|
|
|
aw.NAME AS invName,
|
|
|
|
|
bc.NAME AS fromCorpName
|
|
|
|
|
bus.NAME AS billTypeName,
|
|
|
|
|
ad.NAME AS deptName,
|
|
|
|
|
aw.NAME AS invName,
|
|
|
|
|
bc.NAME AS fromCorpName
|
|
|
|
|
FROM io_order io
|
|
|
|
|
LEFT JOIN basic_bussiness_type bus ON io.action = bus.action
|
|
|
|
|
LEFT JOIN auth_dept ad ON io.deptCode = ad.CODE
|
|
|
|
|
LEFT JOIN auth_warehouse aw ON io.invCode = aw.CODE
|
|
|
|
|
LEFT JOIN basic_corp bc ON io.fromCorp = bc.erpId
|
|
|
|
|
LEFT JOIN io_order_detail_code dc ON io.billNo = dc.orderIdFk
|
|
|
|
|
LEFT JOIN basic_bussiness_type bus ON io.action = bus.action
|
|
|
|
|
LEFT JOIN auth_dept ad ON io.deptCode = ad.CODE
|
|
|
|
|
LEFT JOIN auth_warehouse aw ON io.invCode = aw.CODE
|
|
|
|
|
LEFT JOIN basic_corp bc ON io.fromCorp = bc.erpId
|
|
|
|
|
LEFT JOIN io_order_detail_code dc ON io.billNo = dc.orderIdFk
|
|
|
|
|
<where>
|
|
|
|
|
<if test="id != null and id != ''">
|
|
|
|
|
AND io.id = #{id}
|
|
|
|
|
</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 io.action = #{action}
|
|
|
|
@ -506,6 +513,10 @@
|
|
|
|
|
<if test="mainAction != null and mainAction != ''">
|
|
|
|
|
AND io.mainAction = #{mainAction}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="unionRemark != null and unionRemark != ''">
|
|
|
|
|
AND (io.remark like concat('%', #{unionRemark}, '%')
|
|
|
|
|
or io.outSickInfo like concat('%', #{unionRemark}, '%'))
|
|
|
|
|
</if>
|
|
|
|
|
<if test="billNo != null and billNo != ''">
|
|
|
|
|
AND io.billNo like concat('%', #{billNo}, '%')
|
|
|
|
|
</if>
|
|
|
|
@ -586,12 +597,12 @@
|
|
|
|
|
|
|
|
|
|
<if test="invoiceActions1 == null and invoiceActions2 != null">
|
|
|
|
|
and (
|
|
|
|
|
io.`action` in
|
|
|
|
|
io.`action` in
|
|
|
|
|
<foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
and io.status = 7
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="invoiceActions1 != null and invoiceActions2 != null">
|
|
|
|
@ -600,13 +611,13 @@
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
and io.status = 10)
|
|
|
|
|
or (
|
|
|
|
|
io.`action` in
|
|
|
|
|
or (
|
|
|
|
|
io.`action` in
|
|
|
|
|
<foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
and io.status = 7)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|