|
|
|
@ -2,22 +2,47 @@
|
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
<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
|
|
|
|
|
from io_order as io
|
|
|
|
|
left join auth_warehouse aw on aw.code = io.fromInvCode
|
|
|
|
|
left join basic_corp bc on bc.erpId = io.fromCorp
|
|
|
|
|
left join io_order_invoice ioi on ioi.orderIdFk = io.billNo
|
|
|
|
|
SELECT io.*,
|
|
|
|
|
bus.name AS billTypeName,
|
|
|
|
|
ad.name AS deptName,
|
|
|
|
|
aw.name AS invName,
|
|
|
|
|
au.employeeName AS createUserName,
|
|
|
|
|
au2.employeeName AS updateUserName,
|
|
|
|
|
au3.employeeName AS reviewUserName,
|
|
|
|
|
au4.employeeName AS checkUserName,
|
|
|
|
|
ad2.name AS fromDeptName,
|
|
|
|
|
aw2.name AS fromInvName,
|
|
|
|
|
bc1.name AS fromCorpName,
|
|
|
|
|
bc2.name AS customerName,
|
|
|
|
|
sw.workplaceName AS workPlaceName
|
|
|
|
|
FROM
|
|
|
|
|
io_order io
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
basic_bussiness_type bus ON bus.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 ON au.id = io.createUser
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_user au2 ON au2.id = io.updateUser
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_user au3 ON au3.id = io.reviewUser
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_user au4 ON au4.id = io.checkUser
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_dept ad2 ON ad2.code = io.fromDeptCode
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
auth_warehouse aw2 ON aw2.code = io.fromInvCode
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
basic_corp bc1 ON bc1.erpId = io.fromCorp
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
basic_corp bc2 ON bc2.erpId = io.customerId
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
io_order_invoice ioi ON ioi.orderIdFk = io.billNo
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
sys_workplace sw ON sw.workplaceId = io.workPlaceCode
|
|
|
|
|
|
|
|
|
|
<if test="uploadKey != null and uploadKey != ''">
|
|
|
|
|
INNER JOIN io_unit_maintain_platform a2 on io.action = a2.sourceAction AND io.fromCorp = a2.unitId
|
|
|
|
|