更新工单分页接口显示场站和设备信息

This commit is contained in:
panshuling321 2022-09-21 15:02:28 +08:00
parent 45befa30c4
commit 8ce57ae370
3 changed files with 31 additions and 5 deletions

View File

@ -1122,3 +1122,7 @@ ALTER TABLE `xhpc_work_user`
ALTER TABLE `xhpc_work_dept` ALTER TABLE `xhpc_work_dept`
ADD COLUMN `type` int(4) NULL DEFAULT null COMMENT '人员类型1-管理员2-运维人员)' AFTER `status`; ADD COLUMN `type` int(4) NULL DEFAULT null COMMENT '人员类型1-管理员2-运维人员)' AFTER `status`;
ALTER TABLE `xhpc_work_order`
ADD COLUMN `fault_end_time` datetime NULL DEFAULT null COMMENT '故障结束时间' AFTER `fault_time`;

View File

@ -37,10 +37,15 @@ public class XhpcWorkOrderDomain implements Serializable {
private String content; private String content;
/** /**
* 故障时间 * 故障开始时间
*/ */
private Date faultTime; private Date faultTime;
/**
* 故障结束时间
*/
private Date faultEndTime;
/** /**
* 设备类型 * 设备类型
*/ */

View File

@ -7,6 +7,7 @@
<result column="title" jdbcType="VARCHAR" property="title" /> <result column="title" jdbcType="VARCHAR" property="title" />
<result column="content" jdbcType="VARCHAR" property="content" /> <result column="content" jdbcType="VARCHAR" property="content" />
<result column="fault_time" jdbcType="TIMESTAMP" property="faultTime" /> <result column="fault_time" jdbcType="TIMESTAMP" property="faultTime" />
<result column="fault_end_time" property="faultEndTime" />
<result column="device_type" jdbcType="VARCHAR" property="deviceType" /> <result column="device_type" jdbcType="VARCHAR" property="deviceType" />
<result column="serial_number" jdbcType="VARCHAR" property="serialNumber" /> <result column="serial_number" jdbcType="VARCHAR" property="serialNumber" />
<result column="station_id" jdbcType="BIGINT" property="stationId" /> <result column="station_id" jdbcType="BIGINT" property="stationId" />
@ -23,7 +24,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
o.work_order_id, o.`type`, o.title, o.content, o.fault_time, o.device_type, o.serial_number, o.station_id, o.work_order_id, o.`type`, o.title, o.content, o.fault_time, o.fault_end_time, o.device_type, o.serial_number, o.station_id,
o.reason, o.disposal_method, o.`status`, o.del_flag, o.tenant_id, o.create_time, o.create_by, o.update_time, o.reason, o.disposal_method, o.`status`, o.del_flag, o.tenant_id, o.create_time, o.create_by, o.update_time,
o.update_by, o.remark o.update_by, o.remark
</sql> </sql>
@ -61,12 +62,18 @@
GROUP_CONCAT(u.work_user_id) as 'userId', GROUP_CONCAT(u.work_user_id) as 'userId',
GROUP_CONCAT(u.user_name, '(', d.dept_name, ')') as 'userName', GROUP_CONCAT(u.user_name, '(', d.dept_name, ')') as 'userName',
o.`status` as 'status', o.`status` as 'status',
s.name as 'stationName',
sd.device_name as 'deviceName',
o.fault_time as 'faultTime',
o.fault_end_time as 'faultEndTime',
o.create_time as createTime o.create_time as createTime
from xhpc_work_order o from xhpc_work_order o
left join xhpc_work_type_dict td on td.work_type_id=o.type left join xhpc_work_type_dict td on td.work_type_id=o.type
LEFT JOIN xhpc_work_order_user ou on o.work_order_id=ou.order_id LEFT JOIN xhpc_work_order_user ou on o.work_order_id=ou.order_id
LEFT JOIN xhpc_work_user u on ou.user_id=u.work_user_id LEFT JOIN xhpc_work_user u on ou.user_id=u.work_user_id
LEFT JOIN xhpc_work_dept d on d.work_dept_id=u.dept_id LEFT JOIN xhpc_work_dept d on d.work_dept_id=u.dept_id
left join xhpc_work_station s on o.station_id=s.work_station_id
left join xhpc_station_device sd on sd.serial_number=o.serial_number
where o.del_flag=0 where o.del_flag=0
<if test="params.orderType != null and params.orderType != ''"> <if test="params.orderType != null and params.orderType != ''">
and o.type=#{params.orderType} and o.type=#{params.orderType}
@ -98,12 +105,12 @@
where work_order_id = #{workOrderId,jdbcType=BIGINT} where work_order_id = #{workOrderId,jdbcType=BIGINT}
</update> </update>
<insert id="insert" keyColumn="work_order_id" keyProperty="workOrderId" parameterType="com.xhpc.activity.domain.XhpcWorkOrderDomain" useGeneratedKeys="true"> <insert id="insert" keyColumn="work_order_id" keyProperty="workOrderId" parameterType="com.xhpc.activity.domain.XhpcWorkOrderDomain" useGeneratedKeys="true">
insert into xhpc_work_order (`type`, title, content, fault_time insert into xhpc_work_order (`type`, title, content, fault_time, fault_end_time,
device_type, serial_number, reason, disposal_method, device_type, serial_number, reason, disposal_method,
`status`, del_flag, tenant_id, `status`, del_flag, tenant_id,
create_time, create_by, update_time, create_time, create_by, update_time,
update_by, remark) update_by, remark)
values (#{type,jdbcType=SMALLINT}, #{title,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{faultTime, jdbcType=TIMESTAMP} values (#{type,jdbcType=SMALLINT}, #{title,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{faultTime, jdbcType=TIMESTAMP}, #{faultEndTime},
#{deviceType,jdbcType=VARCHAR}, #{serialNumber,jdbcType=VARCHAR}, #{deviceType,jdbcType=VARCHAR}, #{serialNumber,jdbcType=VARCHAR},
#{reason,jdbcType=VARCHAR}, #{disposalMethod,jdbcType=VARCHAR}, #{reason,jdbcType=VARCHAR}, #{disposalMethod,jdbcType=VARCHAR},
1, 0, #{tenantId,jdbcType=VARCHAR}, 1, 0, #{tenantId,jdbcType=VARCHAR},
@ -125,6 +132,9 @@
<if test="faultTime != null"> <if test="faultTime != null">
fault_time, fault_time,
</if> </if>
<if test="faultEndTime != null">
fault_end_time,
</if>
<if test="deviceType != null"> <if test="deviceType != null">
device_type, device_type,
</if> </if>
@ -170,6 +180,9 @@
<if test="faultTime!=null"> <if test="faultTime!=null">
#{faultTime, jdbcType=TIMESTAMP}, #{faultTime, jdbcType=TIMESTAMP},
</if> </if>
<if test="faultEndTime!=null">
#{faultEndTime},
</if>
<if test="deviceType != null"> <if test="deviceType != null">
#{deviceType,jdbcType=VARCHAR}, #{deviceType,jdbcType=VARCHAR},
</if> </if>
@ -225,6 +238,9 @@
<if test="faultTime!=null"> <if test="faultTime!=null">
fault_time = #{faultTime, jdbcType=TIMESTAMP}, fault_time = #{faultTime, jdbcType=TIMESTAMP},
</if> </if>
<if test="faultEndTime!=null">
fault_end_time = #{faultEndTime},
</if>
<if test="deviceType != null"> <if test="deviceType != null">
device_type = #{deviceType,jdbcType=VARCHAR}, device_type = #{deviceType,jdbcType=VARCHAR},
</if> </if>
@ -262,6 +278,7 @@
title = #{title,jdbcType=VARCHAR}, title = #{title,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR}, content = #{content,jdbcType=VARCHAR},
fault_time = #{faultTime, jdbcType=TIMESTAMP}, fault_time = #{faultTime, jdbcType=TIMESTAMP},
fault_end_time = #{faultEndTime},
device_type = #{deviceType,jdbcType=VARCHAR}, device_type = #{deviceType,jdbcType=VARCHAR},
serial_number = #{serialNumber,jdbcType=VARCHAR}, serial_number = #{serialNumber,jdbcType=VARCHAR},
station_id=#{stationId}, station_id=#{stationId},