feat: xml优化

dev_2.5_ocean
chenhc 4 months ago
parent 161be86db0
commit d4d53e7a5f

@ -7,33 +7,41 @@
</select> </select>
<select id="filterList" resultType="com.glxp.api.res.dev.DeptDeviceDetailResponse"> <select id="filterList" resultType="com.glxp.api.res.dev.DeptDeviceDetailResponse">
select t.id, SELECT t.id,
t.deptCode, t.deptCode,
t.invCode, t.invCode,
t.originCode, t.originCode,
t.code, t.code,
t.relId, t.relId,
t.deviceName, t.deviceName,
t.ggxh, t.ggxh,
t.batchNo, t.batchNo,
t.nameCode, t.nameCode,
t.serialNo, t.serialNo,
t.productionDate, t.productionDate,
t.expireDate, t.expireDate,
t.manufactory, t.manufactory,
t.measname, t.measname,
t.zczbhhzbapzbh, t.zczbhhzbapzbh,
t.supId, t.supId,
t.supName, t.supName,
t.status, t.status,
t.addType, t.addType,
t.maTime, t.maTime,
t.remark, t.remark,
(select employeeName from auth_user where id = t.createUser) creatUserName, au_create.employeeName AS creatUserName,
(select employeeName from auth_user where id = t.manager) managerName, au_manager.employeeName AS managerName,
(select `name` from auth_dept where code = t.deptCode) deptName, ad.name AS deptName,
(select `name` from auth_warehouse where code = t.invCode) invName aw.name AS invName
from dept_device_detail t FROM dept_device_detail AS t
LEFT JOIN
auth_user AS au_create ON au_create.id = t.createUser
LEFT JOIN
auth_user AS au_manager ON au_manager.id = t.manager
LEFT JOIN
auth_dept AS ad ON ad.code = t.deptCode
LEFT JOIN
auth_warehouse AS aw ON aw.code = t.invCode
<where> <where>
<if test="deptCode != null and deptCode != ''"> <if test="deptCode != null and deptCode != ''">
AND t.deptCode = #{deptCode} AND t.deptCode = #{deptCode}
@ -92,11 +100,15 @@
</select> </select>
<select id="selectInspectSet" resultType="com.glxp.api.res.dev.DeviceInspectSetResponse"> <select id="selectInspectSet" resultType="com.glxp.api.res.dev.DeviceInspectSetResponse">
select (select `name` from auth_dept where code = t.deptCode) deptName, SELECT ad.name AS deptName,
(select `name` from auth_warehouse where code = t.invCode) invName, aw.name AS invName,
t.deviceName, t.deviceName,
t.code t.code
from dept_device_detail t FROM dept_device_detail AS t
LEFT JOIN
auth_dept AS ad ON ad.code = t.deptCode
LEFT JOIN
auth_warehouse AS aw ON aw.code = t.invCode
where t.code = #{code} where t.code = #{code}
</select> </select>
</mapper> </mapper>

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

@ -139,20 +139,45 @@
<select id="filterByInvoiceCode" parameterType="com.glxp.api.req.inout.IoOrderInvoiceRequest" <select id="filterByInvoiceCode" parameterType="com.glxp.api.req.inout.IoOrderInvoiceRequest"
resultType="com.glxp.api.res.inout.IoOrderResponse"> resultType="com.glxp.api.res.inout.IoOrderResponse">
select io.*, SELECT
(select name from basic_bussiness_type bus where bus.action = io.action) billTypeName, io.*,
(select name from auth_dept ad where ad.code = io.deptCode) deptName, bus.name AS billTypeName,
(select name from auth_warehouse aw where aw.code = io.invCode) invName, ad.name AS deptName,
(select employeeName from auth_user au where au.id = io.createUser) createUserName, aw.name AS invName,
(select employeeName from auth_user au2 where au2.id = io.updateUser) updateUserName, au_create.employeeName AS createUserName,
(select employeeName from auth_user au3 where au3.id = io.reviewUser) reviewUserName, au_update.employeeName AS updateUserName,
(select employeeName from auth_user au4 where au4.id = io.checkUser) checkUserName, au_review.employeeName AS reviewUserName,
(select name from auth_dept ad2 where ad2.code = io.fromDeptCode) fromDeptName, au_check.employeeName AS checkUserName,
(select name from auth_warehouse aw2 where aw2.code = io.fromInvCode) fromInvName, ad_from.name AS fromDeptName,
(select name from basic_corp bc where bc.erpId = io.fromCorp) fromCorpName, aw_from.name AS fromInvName,
(select name from basic_corp bc where bc.erpId = io.customerId) customerName bc_from.name AS fromCorpName,
from io_order as io bc_customer.name AS customerName
inner join io_order_invoice ioi on io.billNo = ioi.orderIdFk FROM
io_order AS io
INNER JOIN
io_order_invoice AS ioi ON io.billNo = ioi.orderIdFk
LEFT JOIN
basic_bussiness_type AS bus ON bus.action = io.action
LEFT JOIN
auth_dept AS ad ON ad.code = io.deptCode
LEFT JOIN
auth_warehouse AS aw ON aw.code = io.invCode
LEFT JOIN
auth_user AS au_create ON au_create.id = io.createUser
LEFT JOIN
auth_user AS au_update ON au_update.id = io.updateUser
LEFT JOIN
auth_user AS au_review ON au_review.id = io.reviewUser
LEFT JOIN
auth_user AS au_check ON au_check.id = io.checkUser
LEFT JOIN
auth_dept AS ad_from ON ad_from.code = io.fromDeptCode
LEFT JOIN
auth_warehouse AS aw_from ON aw_from.code = io.fromInvCode
LEFT JOIN
basic_corp AS bc_from ON bc_from.erpId = io.fromCorp
LEFT JOIN
basic_corp AS bc_customer ON bc_customer.erpId = io.customerId
<where> <where>
<if test="invoiceEncode != null"> <if test="invoiceEncode != null">
AND ioi.invoiceEncode = #{invoiceEncode} AND ioi.invoiceEncode = #{invoiceEncode}

@ -5,14 +5,19 @@
<select id="filterList" parameterType="com.glxp.api.req.inout.IoOrderMutiRequest" <select id="filterList" parameterType="com.glxp.api.req.inout.IoOrderMutiRequest"
resultType="com.glxp.api.res.inout.IoOrderMutiResponse"> resultType="com.glxp.api.res.inout.IoOrderMutiResponse">
SELECT SELECT
io.*, io.*,
b1.ggxh, b1.ggxh,
b1.cpmctymc, b1.cpmctymc,
(SELECT userName FROM auth_user WHERE auth_user.id=io.createUser) as createUserName, au_create.userName AS createUserName,
(SELECT userName FROM auth_user WHERE auth_user.id=io.auditUser) as auditUserName au_audit.userName AS auditUserName
FROM FROM
io_order_muti io io_order_muti io
LEFT JOIN basic_products b1 on b1.nameCode=io.nameCode LEFT JOIN
basic_products b1 ON b1.nameCode = io.nameCode
LEFT JOIN
auth_user au_create ON au_create.id = io.createUser
LEFT JOIN
auth_user au_audit ON au_audit.id = io.auditUser
<where> <where>
<if test=" udiCode!= '' and udiCode != null"> <if test=" udiCode!= '' and udiCode != null">
and io.udiCode = #{udiCode} and io.udiCode = #{udiCode}

@ -4,11 +4,17 @@
<select id="filterList" parameterType="com.glxp.api.req.inout.IoOrderMutiSetRequest" <select id="filterList" parameterType="com.glxp.api.req.inout.IoOrderMutiSetRequest"
resultType="com.glxp.api.res.inout.IoOrderMutiSetResponse"> resultType="com.glxp.api.res.inout.IoOrderMutiSetResponse">
SELECT io.*, SELECT io.*,
(SELECT NAME FROM auth_warehouse aw WHERE aw.CODE = io.curInv) invName, a1.NAME AS invName,
(SELECT NAME FROM basic_corp bc WHERE bc.erpId = io.fromCorp) fromCorpName, bc.NAME AS fromCorpName,
(SELECT NAME FROM basic_bussiness_type bus WHERE bus.action = io.targetAction) targetActionName bus.NAME AS targetActionName
FROM io_order_muti_set io FROM io_order_muti_set io
left join auth_warehouse a1 on a1.code=io.curInv LEFT JOIN
auth_warehouse a1 ON a1.code = io.curInv
LEFT JOIN
basic_corp bc ON bc.erpId = io.fromCorp
LEFT JOIN
basic_bussiness_type bus ON bus.action = io.targetAction
<where> <where>
<if test=" curInv!= '' and curInv != null"> <if test=" curInv!= '' and curInv != null">
AND a1.name like concat('%', #{curInv}, '%') AND a1.name like concat('%', #{curInv}, '%')

@ -28,8 +28,11 @@
</sql> </sql>
<select id="filterList" resultType="com.glxp.api.res.thrsys.ThrOrderUploadLogResponse"> <select id="filterList" resultType="com.glxp.api.res.thrsys.ThrOrderUploadLogResponse">
select log.*, (select `name` from basic_bussiness_type where action = log.billType) billTypeName SELECT log.*,
from io_order_upload_log log bbt.name AS billTypeName
FROM io_order_upload_log log
LEFT JOIN
basic_bussiness_type bbt ON bbt.action = log.billType
<where> <where>
<if test="billNo != null and billNo != ''"> <if test="billNo != null and billNo != ''">
AND log.billNo like concat('%', #{billNo}, '%') AND log.billNo like concat('%', #{billNo}, '%')

@ -2,8 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.IoStatDayDao"> <mapper namespace="com.glxp.api.dao.inout.IoStatDayDao">
<select id="filterList" resultType="com.glxp.api.entity.inout.IoStatDayEntity"> <select id="filterList" resultType="com.glxp.api.entity.inout.IoStatDayEntity">
select *, ( SELECT NAME FROM auth_dept WHERE io_stat_day.deptCode = auth_dept.CODE ) deptName SELECT io_stat_day.*,
from io_stat_day ad.NAME AS deptName
FROM io_stat_day
LEFT JOIN
auth_dept ad ON io_stat_day.deptCode = ad.CODE
<where> <where>
<if test="recordKey != null and recordKey != ''"> <if test="recordKey != null and recordKey != ''">
AND recordKeyFk = #{recordKey} AND recordKeyFk = #{recordKey}
@ -21,7 +24,11 @@
</select> </select>
<select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatDayEntity"> <select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatDayEntity">
select *, ( SELECT NAME FROM auth_dept WHERE io_stat_day.deptCode = auth_dept.CODE ) deptName SELECT io_stat_day.*,
ad.NAME AS deptName
FROM io_stat_day
LEFT JOIN
auth_dept ad ON io_stat_day.deptCode = ad.CODE
from io_stat_day from io_stat_day
where recordKeyFk = #{recordKey} where recordKeyFk = #{recordKey}
</select> </select>

@ -33,8 +33,11 @@
</sql> </sql>
<select id="filterList" resultType="com.glxp.api.entity.inout.IoStatDetailEntity"> <select id="filterList" resultType="com.glxp.api.entity.inout.IoStatDetailEntity">
select *, (SELECT NAME FROM auth_warehouse WHERE io_stat_detail.invCode = auth_warehouse.code) invName SELECT io_stat_detail.*,
from io_stat_detail aw.NAME AS invName
FROM io_stat_detail
LEFT JOIN
auth_warehouse aw ON io_stat_detail.invCode = aw.code
<where> <where>
<if test="recordKey != null and recordKey != ''"> <if test="recordKey != null and recordKey != ''">
AND recordKeyFk = #{recordKey} AND recordKeyFk = #{recordKey}
@ -52,8 +55,11 @@
</select> </select>
<select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatDetailEntity"> <select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatDetailEntity">
select *, (SELECT NAME FROM auth_warehouse WHERE io_stat_detail.invCode = auth_warehouse.code) invName SELECT io_stat_detail.*,
from io_stat_detail aw.NAME AS invName
FROM io_stat_detail
LEFT JOIN
auth_warehouse aw ON io_stat_detail.invCode = aw.code
where recordKeyFk = #{recordKey} where recordKeyFk = #{recordKey}
</select> </select>
</mapper> </mapper>

@ -2,8 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.IoStatMonthDao"> <mapper namespace="com.glxp.api.dao.inout.IoStatMonthDao">
<select id="filterList" resultType="com.glxp.api.entity.inout.IoStatMonthEntity"> <select id="filterList" resultType="com.glxp.api.entity.inout.IoStatMonthEntity">
select *, ( SELECT NAME FROM auth_dept WHERE io_stat_month.deptCode = auth_dept.CODE ) deptName SELECT io_stat_month.*,
from io_stat_month ad.NAME AS deptName
FROM io_stat_month
LEFT JOIN
auth_dept ad ON io_stat_month.deptCode = ad.CODE
<where> <where>
<if test="recordKey != null and recordKey != ''"> <if test="recordKey != null and recordKey != ''">
AND recordKeyFk = #{recordKey} AND recordKeyFk = #{recordKey}
@ -20,8 +23,11 @@
</where> </where>
</select> </select>
<select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatMonthEntity"> <select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatMonthEntity">
select *, ( SELECT NAME FROM auth_dept WHERE io_stat_month.deptCode = auth_dept.CODE ) deptName SELECT io_stat_month.*,
from io_stat_month ad.NAME AS deptName
FROM io_stat_month
LEFT JOIN
auth_dept ad ON io_stat_month.deptCode = ad.CODE
where recordKeyFk = #{recordKey} where recordKeyFk = #{recordKey}
</select> </select>
</mapper> </mapper>

@ -2,8 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.IoStatQuarterDao"> <mapper namespace="com.glxp.api.dao.inout.IoStatQuarterDao">
<select id="filterList" resultType="com.glxp.api.entity.inout.IoStatQuarterEntity"> <select id="filterList" resultType="com.glxp.api.entity.inout.IoStatQuarterEntity">
select *, (SELECT NAME FROM auth_dept WHERE io_stat_quarter.deptCode = auth_dept.CODE) deptName SELECT io_stat_quarter.*,
from io_stat_quarter ad.NAME AS deptName
FROM io_stat_quarter
LEFT JOIN
auth_dept ad ON io_stat_quarter.deptCode = ad.CODE
<where> <where>
<if test="recordKey != null and recordKey != ''"> <if test="recordKey != null and recordKey != ''">
AND recordKeyFk = #{recordKey} AND recordKeyFk = #{recordKey}
@ -21,8 +24,11 @@
</select> </select>
<select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatQuarterEntity"> <select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatQuarterEntity">
select *, (SELECT NAME FROM auth_dept WHERE io_stat_quarter.deptCode = auth_dept.CODE) deptName SELECT io_stat_quarter.*,
from io_stat_quarter ad.NAME AS deptName
FROM io_stat_quarter
LEFT JOIN
auth_dept ad ON io_stat_quarter.deptCode = ad.CODE
where recordKeyFk = #{recordKey} where recordKeyFk = #{recordKey}
</select> </select>
</mapper> </mapper>

@ -2,8 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.IoStatYearDao"> <mapper namespace="com.glxp.api.dao.inout.IoStatYearDao">
<select id="filterList" resultType="com.glxp.api.entity.inout.IoStatYearEntity"> <select id="filterList" resultType="com.glxp.api.entity.inout.IoStatYearEntity">
select *, ( SELECT NAME FROM auth_dept WHERE io_stat_year.deptCode = auth_dept.CODE ) deptName SELECT io_stat_year.*,
from io_stat_year ad.NAME AS deptName
FROM io_stat_year
LEFT JOIN auth_dept ad ON io_stat_year.deptCode = ad.CODE
<where> <where>
<if test="recordKey != null and recordKey != ''"> <if test="recordKey != null and recordKey != ''">
AND recordKeyFk = #{recordKey} AND recordKeyFk = #{recordKey}
@ -21,8 +23,10 @@
</select> </select>
<select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatYearEntity"> <select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatYearEntity">
select *, ( SELECT NAME FROM auth_dept WHERE io_stat_year.deptCode = auth_dept.CODE ) deptName SELECT io_stat_year.*,
from io_stat_year ad.NAME AS deptName
FROM io_stat_year
LEFT JOIN auth_dept ad ON io_stat_year.deptCode = ad.CODE
where recordKeyFk = #{recordKey} where recordKeyFk = #{recordKey}
</select> </select>
</mapper> </mapper>

@ -2,18 +2,36 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.ReceiveDao"> <mapper namespace="com.glxp.api.dao.inout.ReceiveDao">
<select id="filterList" resultType="com.glxp.api.res.inout.ReceiveResponse"> <select id="filterList" resultType="com.glxp.api.res.inout.ReceiveResponse">
select IFNULL(saf.status,1) as flowStatus,saf.updateTime as flowAuditTime, SELECT IFNULL(saf.status, 1) AS flowStatus,
io.*, saf.updateTime AS flowAuditTime,
( SELECT originName FROM basic_bustype_change bus WHERE bus.originAction = io.billType ) billTypeName, io.*,
(select name from auth_dept ad where ad.code = io.deptCode) deptName, bus.originName AS billTypeName,
(select name from auth_warehouse aw where aw.code = io.invCode) invName, ad.name AS deptName,
(select employeeName from auth_user au where au.id = io.createUser) createUserName, aw.name AS invName,
(select employeeName from auth_user au2 where au2.id = io.updateUser) updateUserName, au_create.employeeName AS createUserName,
(select employeeName from auth_user au3 where au3.id = io.auditUser) auditUserName, au_update.employeeName AS updateUserName,
(select name from auth_dept ad2 where ad2.code = io.targetDeptCode) targetDeptName, au_audit.employeeName AS auditUserName,
(select name from auth_warehouse aw2 where aw2.code = io.targetInvCode) targetInvName ad_target.name AS targetDeptName,
from pur_receive as io aw_target.name AS targetInvName
Left Join sys_approval_flow as saf ON io.approvalFlowId = saf.id FROM pur_receive AS io
LEFT JOIN
sys_approval_flow AS saf ON io.approvalFlowId = saf.id
LEFT JOIN
basic_bustype_change AS bus ON bus.originAction = io.billType
LEFT JOIN
auth_dept AS ad ON ad.code = io.deptCode
LEFT JOIN
auth_warehouse AS aw ON aw.code = io.invCode
LEFT JOIN
auth_user AS au_create ON au_create.id = io.createUser
LEFT JOIN
auth_user AS au_update ON au_update.id = io.updateUser
LEFT JOIN
auth_user AS au_audit ON au_audit.id = io.auditUser
LEFT JOIN
auth_dept AS ad_target ON ad_target.code = io.targetDeptCode
LEFT JOIN
auth_warehouse AS aw_target ON aw_target.code = io.targetInvCode
<where> <where>
<if test="billType != null and billType != ''"> <if test="billType != null and billType != ''">
AND billType = #{billType} AND billType = #{billType}

@ -21,10 +21,8 @@
sys_pdf_template_relevance.remark3, sys_pdf_template_relevance.remark3,
printType printType
from basic_bussiness_type from basic_bussiness_type
LEFT JOIN sys_pdf_template_relevance LEFT JOIN sys_pdf_template_relevance on basic_bussiness_type.action = sys_pdf_template_relevance.localAction
on basic_bussiness_type.action = sys_pdf_template_relevance.localAction LEFT JOIN sys_pdf_template on sys_pdf_template_relevance.templateId = sys_pdf_template.id
LEFT JOIN sys_pdf_template
on sys_pdf_template_relevance.templateId = sys_pdf_template.id
<where> <where>
<if test="moduleId != null"> <if test="moduleId != null">
AND `moduleId` = #{moduleId} AND `moduleId` = #{moduleId}

@ -99,20 +99,6 @@
) )
</insert> </insert>
<!-- <insert id="insertThrDeptList" parameterType="java.util.List">-->
<!-- replace INTO thr_dept-->
<!-- (pid, code, name, advanceType, isDefault,-->
<!-- status, updateTime, remark, thirdSysFk)-->
<!-- VALUES-->
<!-- <foreach collection="thrDeptEntities" item="item" index="index"-->
<!-- separator=",">-->
<!-- (-->
<!-- #{item.pid}, #{item.code},-->
<!-- #{item.name}, #{item.advanceType}, #{item.isDefault},-->
<!-- #{item.status}, #{item.updateTime},-->
<!-- #{item.remark}, #{item.thirdSysFk})-->
<!-- </foreach>-->
<!-- </insert>-->
<delete id="deleteById" parameterType="Map"> <delete id="deleteById" parameterType="Map">
DELETE DELETE

Loading…
Cancel
Save