feat: xml优化

dev_2.5_ocean
chenhc 4 months ago
parent 7ca8141624
commit d5af216f75

@ -29,12 +29,19 @@
createUser,createTime createUser,createTime
</sql> </sql>
<select id="listByVo" resultType="com.glxp.api.vo.dev.DeviceChangeOrderVo"> <select id="listByVo" resultType="com.glxp.api.vo.dev.DeviceChangeOrderVo">
select IFNULL(saf.status,1) as flowStatus,saf.updateTime as flowAuditTime,saf.updateUserName as flowAuditByName, SELECT IFNULL(saf.status, 1) AS flowStatus,
o.*, saf.updateTime AS flowAuditTime,
(select name from auth_dept where code = o.deptCode) deptName, saf.updateUserName AS flowAuditByName,
(select name from auth_dept where code = o.toDeptCode) toDeptName o.*,
from device_change_order o ad_dept.name AS deptName,
Left Join sys_approval_flow as saf ON o.approvalFlowId = saf.id ad_toDept.name AS toDeptName
FROM device_change_order AS o
LEFT JOIN
sys_approval_flow AS saf ON o.approvalFlowId = saf.id
LEFT JOIN
auth_dept AS ad_dept ON ad_dept.code = o.deptCode
LEFT JOIN
auth_dept AS ad_toDept ON ad_toDept.code = o.toDeptCode
<where> <where>
and o.status != 'temp' and o.status != 'temp'
and (o.deptCode = #{user.locDeptCode} or o.toDeptCode = #{user.locDeptCode}) and (o.deptCode = #{user.locDeptCode} or o.toDeptCode = #{user.locDeptCode})
@ -58,10 +65,14 @@
</select> </select>
<select id="getVoById" resultType="com.glxp.api.vo.dev.DeviceChangeOrderVo"> <select id="getVoById" resultType="com.glxp.api.vo.dev.DeviceChangeOrderVo">
select o.*, SELECT o.*,
(select name from auth_dept where code = o.deptCode) deptName, ad_dept.name AS deptName,
(select name from auth_dept where code = o.toDeptCode) toDeptName ad_toDept.name AS toDeptName
from device_change_order o FROM device_change_order AS o
LEFT JOIN
auth_dept AS ad_dept ON ad_dept.code = o.deptCode
LEFT JOIN
auth_dept AS ad_toDept ON ad_toDept.code = o.toDeptCode
where o.orderId = #{orderId} where o.orderId = #{orderId}
</select> </select>

@ -2,7 +2,7 @@
<!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.dev.DeviceInspectOrderDao"> <mapper namespace="com.glxp.api.dao.dev.DeviceInspectOrderDao">
<select id="filterList" resultType="com.glxp.api.res.dev.DeviceInspectOrderResponse"> <select id="filterList" resultType="com.glxp.api.res.dev.DeviceInspectOrderResponse">
select t.id, SELECT t.id,
t.orderId, t.orderId,
t.deptCode, t.deptCode,
t.invCode, t.invCode,
@ -12,20 +12,28 @@
t.deviceStatus, t.deviceStatus,
t.lastOrderId, t.lastOrderId,
t.createUser, t.createUser,
au_create.employeeName AS createUserName,
t.auditUser, t.auditUser,
au_audit.employeeName AS auditUserName,
t.createTime, t.createTime,
t.auditUser,
t.auditTime, t.auditTime,
t.remark, t.remark,
(select employeeName from auth_user where id = t.createUser) createUserName, ad_dept.name AS deptName,
(select employeeName from auth_user where id = t.auditUser) auditUserName, aw_inv.name AS invName,
(select `name` from auth_dept where code = t.deptCode) deptName,
(select `name` from auth_warehouse where code = t.invCode) invName,
t1.deviceName, t1.deviceName,
t1.ggxh, t1.ggxh,
t1.batchNo t1.batchNo
from device_inspect_order t FROM device_inspect_order AS t
left join dept_device_detail t1 on t.code = t1.code LEFT JOIN
dept_device_detail AS t1 ON t.code = t1.code
LEFT JOIN
auth_user AS au_create ON t.createUser = au_create.id
LEFT JOIN
auth_user AS au_audit ON t.auditUser = au_audit.id
LEFT JOIN
auth_dept AS ad_dept ON t.deptCode = ad_dept.code
LEFT JOIN
auth_warehouse AS aw_inv ON t.invCode = aw_inv.code
<where> <where>
<if test="orderId != null and orderId != ''"> <if test="orderId != null and orderId != ''">
AND t.orderId like concat('%', #{orderId}, '%') AND t.orderId like concat('%', #{orderId}, '%')

@ -8,7 +8,7 @@
</select> </select>
<select id="filterList" resultType="com.glxp.api.res.dev.DeviceInspectPlanResponse"> <select id="filterList" resultType="com.glxp.api.res.dev.DeviceInspectPlanResponse">
select t.id, SELECT t.id,
t.orderId, t.orderId,
t.deptCode, t.deptCode,
t.invCode, t.invCode,
@ -16,9 +16,10 @@
t.level, t.level,
t.status, t.status,
t.createUser, t.createUser,
au_create.employeeName AS createUserName,
t.auditUser, t.auditUser,
au_audit.employeeName AS auditUserName,
t.createTime, t.createTime,
t.auditUser,
t.auditTime, t.auditTime,
t.remark, t.remark,
t.startTime, t.startTime,
@ -29,15 +30,22 @@
t.inspectUser, t.inspectUser,
t.lastTime, t.lastTime,
t.nextTime, t.nextTime,
(select employeeName from auth_user where id = t.createUser) createUserName, ad_dept.name AS deptName,
(select employeeName from auth_user where id = t.auditUser) auditUserName, aw_inv.name AS invName,
(select `name` from auth_dept where code = t.deptCode) deptName,
(select `name` from auth_warehouse where code = t.invCode) invName,
t1.deviceName, t1.deviceName,
t1.ggxh, t1.ggxh,
t1.batchNo t1.batchNo
from device_inspect_plan t FROM device_inspect_plan AS t
left join dept_device_detail t1 on t.code = t1.code LEFT JOIN
dept_device_detail AS t1 ON t.code = t1.code
LEFT JOIN
auth_user AS au_create ON t.createUser = au_create.id
LEFT JOIN
auth_user AS au_audit ON t.auditUser = au_audit.id
LEFT JOIN
auth_dept AS ad_dept ON t.deptCode = ad_dept.code
LEFT JOIN
auth_warehouse AS aw_inv ON t.invCode = aw_inv.code
<where> <where>
<if test="orderId != null and orderId != ''"> <if test="orderId != null and orderId != ''">
AND t.orderId like concat('%', #{orderId}, '%') AND t.orderId like concat('%', #{orderId}, '%')

@ -2,17 +2,21 @@
<!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.dev.DeviceInspectSetDao"> <mapper namespace="com.glxp.api.dao.dev.DeviceInspectSetDao">
<select id="selectInspectSet" resultType="com.glxp.api.res.dev.DeviceInspectSetResponse"> <select id="selectInspectSet" resultType="com.glxp.api.res.dev.DeviceInspectSetResponse">
select t.id, SELECT t.id,
t.code, t.code,
t.frequency, t.frequency,
t.frequency,
t.frequencyUnit, t.frequencyUnit,
t.remark, t.remark,
d.deviceName, d.deviceName,
(select name from auth_dept where code = d.deptCode) deptName, ad_dept.name AS deptName,
(select name from auth_warehouse where code = d.invCode) invName aw_inv.name AS invName
from device_inspect_set t FROM device_inspect_set AS t
left join dept_device_detail d on t.code = d.code LEFT JOIN
dept_device_detail AS d ON t.code = d.code
LEFT JOIN
auth_dept AS ad_dept ON d.deptCode = ad_dept.code
LEFT JOIN
auth_warehouse AS aw_inv ON d.invCode = aw_inv.code
<where> <where>
<if test="code != null and code != ''"> <if test="code != null and code != ''">
t.code = #{code} t.code = #{code}

@ -28,33 +28,39 @@
<select id="filterList" resultType="com.glxp.api.res.dev.DeviceInspectTakeResponse"> <select id="filterList" resultType="com.glxp.api.res.dev.DeviceInspectTakeResponse">
select SELECT t.id,
t.id, t.orderId,
t.orderId, t.planOrderIdFk,
t.planOrderIdFk, t.deptCode,
t.deptCode, t.invCode,
t.invCode, t.code,
t.code, t.status,
t.status, t.inspectUser,
t.inspectUser, t.updateTime,
t.updateTime, t.createTime,
t.createTime, t.endTime,
t.endTime, t.strartTime,
t.strartTime, t.remark,
t.remark, t.remindTime,
t.remindTime, t.expectedTime,
t.expectedTime, t.repairType,
t.repairType, t.level,
t.level, ad_dept.name AS deptName,
(select `name` from auth_dept where code = t.deptCode) deptName, aw_inv.name AS invName,
(select `name` from auth_warehouse where code = t.invCode) invName, au_inspect.employeeName AS inspectName,
( SELECT `employeeName` FROM auth_user WHERE id = t.inspectUser ) inspectName, t1.deviceName,
t1.deviceName, t1.ggxh,
t1.ggxh, t1.batchNo,
t1.batchNo, t.type
t.type FROM device_inspect_task AS t
from device_inspect_task t LEFT JOIN
left join dept_device_detail t1 on t.code = t1.code dept_device_detail AS t1 ON t.code = t1.code
LEFT JOIN
auth_dept AS ad_dept ON t.deptCode = ad_dept.code
LEFT JOIN
auth_warehouse AS aw_inv ON t.invCode = aw_inv.code
LEFT JOIN
auth_user AS au_inspect ON t.inspectUser = au_inspect.id
<where> <where>
<if test="orderId != null and orderId != ''"> <if test="orderId != null and orderId != ''">
AND t.orderId like concat('%', #{orderId}, '%') AND t.orderId like concat('%', #{orderId}, '%')

@ -20,10 +20,14 @@
</sql> </sql>
<select id="filterList" resultType="com.glxp.api.res.dev.DeviceProjectSetResponse"> <select id="filterList" resultType="com.glxp.api.res.dev.DeviceProjectSetResponse">
select device_project_set.*, SELECT dps.*,
(select employeeName from auth_user where device_project_set.updateUser=auth_user.id) as updateUserName, au_update.employeeName AS updateUserName,
(select employeeName from auth_user where device_project_set.createUser=auth_user.id) as createUserName au_create.employeeName AS createUserName
from device_project_set FROM device_project_set AS dps
LEFT JOIN
auth_user AS au_update ON dps.updateUser = au_update.id
LEFT JOIN
auth_user AS au_create ON dps.createUser = au_create.id
<where> <where>
<if test="type != null"> <if test="type != null">
AND type = #{type} AND type = #{type}

Loading…
Cancel
Save