From 88f536a0e3aba9a3c483a06ec3a16a80ee6380d2 Mon Sep 17 00:00:00 2001 From: 79493 <794930212@qq.com> Date: Mon, 20 Mar 2023 17:33:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=85=E9=81=93BUG=E4=BF=AE=E6=94=B9-?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=8A=9F=E8=83=BD=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/rzyc/model/EntDeviceInsStatistic.java | 10 +++++ .../java/com/rzyc/model/EntInsRecord.java | 13 ++++++ .../java/com/rzyc/model/EntRepairRecord.java | 16 +++++++ .../java/com/rzyc/model/user/Listchange.java | 2 +- .../main/resources/mapper/EntDeviceMapper.xml | 31 ++++++++++++-- .../resources/mapper/EntInsRecordMapper.xml | 34 ++++++++++++++- .../mapper/EntRepairRecordMapper.xml | 42 +++++++++++++++++-- 7 files changed, 138 insertions(+), 10 deletions(-) diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntDeviceInsStatistic.java b/inventory-dao/src/main/java/com/rzyc/model/EntDeviceInsStatistic.java index 2d83a04..ee64bfa 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/EntDeviceInsStatistic.java +++ b/inventory-dao/src/main/java/com/rzyc/model/EntDeviceInsStatistic.java @@ -36,6 +36,16 @@ public class EntDeviceInsStatistic { @ApiModelProperty("巡检次数") private long countRecord; + private ListsysdocumentList; + + public List getSysdocumentList() { + return sysdocumentList; + } + + public void setSysdocumentList(List sysdocumentList) { + this.sysdocumentList = sysdocumentList; + } + public String getDeviceId() { return deviceId; } diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntInsRecord.java b/inventory-dao/src/main/java/com/rzyc/model/EntInsRecord.java index 1253c32..c15f114 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/EntInsRecord.java +++ b/inventory-dao/src/main/java/com/rzyc/model/EntInsRecord.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableName; import java.util.Date; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; +import java.util.List; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; @@ -75,6 +76,18 @@ public class EntInsRecord implements Serializable { @TableField(exist = false) private String inspectionName; + + @TableField(exist = false) + private List sysdocumentList; + + public List getSysdocumentList() { + return sysdocumentList; + } + + public void setSysdocumentList(List sysdocumentList) { + this.sysdocumentList = sysdocumentList; + } + public String getInspectionName() { return inspectionName; } diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntRepairRecord.java b/inventory-dao/src/main/java/com/rzyc/model/EntRepairRecord.java index a8b7934..c449e60 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/EntRepairRecord.java +++ b/inventory-dao/src/main/java/com/rzyc/model/EntRepairRecord.java @@ -6,6 +6,9 @@ import java.util.Date; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -56,9 +59,11 @@ public class EntRepairRecord implements Serializable { @ApiModelProperty(value = "维修开始时间") @TableField("repair_start_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") private Date repairStartTime; @ApiModelProperty(value = "维修结束时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") @TableField("repair_end_time") private Date repairEndTime; @@ -98,6 +103,17 @@ public class EntRepairRecord implements Serializable { @TableField("modify_time") private Date modifyTime; + @TableField(exist = false) + private ListsysdocumentList; + + public List getList() { + return sysdocumentList; + } + + public void setList(List list) { + this.sysdocumentList = list; + } + public String getRepairRecordId() { return repairRecordId; } diff --git a/inventory-dao/src/main/java/com/rzyc/model/user/Listchange.java b/inventory-dao/src/main/java/com/rzyc/model/user/Listchange.java index a40015a..35a2dd0 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/user/Listchange.java +++ b/inventory-dao/src/main/java/com/rzyc/model/user/Listchange.java @@ -19,7 +19,7 @@ import io.swagger.annotations.ApiModelProperty; * @since 2023-02-09 */ @TableName("listchange") -@ApiModel(value="Listchange对象", description="") +@ApiModel(value="Listchange", description="") public class Listchange implements Serializable { private static final long serialVersionUID = 1L; diff --git a/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml b/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml index 495cfcf..07f77cd 100644 --- a/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml @@ -108,11 +108,33 @@ order by ed.model_state desc - + select ed.device_id ,ed.name,ed.number,ed.model_state ,count(eir.ins_record_id)as countRecord,sd.* from ent_device ed - left join (SELECT MAX( inspection_id ) as inspection_id,device_id FROM ent_device_ins_cycle where del_state = 1 GROUP BY device_id) as edic on ed.device_id = edic.device_id - left join ent_ins_record eir on edic.inspection_id = eir.cycle_id + left join ent_ins_record eir on ed.device_id = eir.device_id + left join sysdocument sd on ed.device_id = sd.OTCId where ed.enterprise_id = #{enterpriseId} and ed.del_state = 1 and ed.type_path like concat('%',#{typeId},'%') @@ -122,6 +144,7 @@ or ed.number like concat('%',#{keyWord},'%') or ed.model_num like concat('%',#{keyWord},'%') + GROUP BY ed.device_id diff --git a/inventory-dao/src/main/resources/mapper/EntInsRecordMapper.xml b/inventory-dao/src/main/resources/mapper/EntInsRecordMapper.xml index 303fa66..9809037 100644 --- a/inventory-dao/src/main/resources/mapper/EntInsRecordMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntInsRecordMapper.xml @@ -30,8 +30,38 @@ device_id = #{entInsRecord.deviceId},spare_part_id = #{entInsRecord.spare_part_id} ,cycle_id = #{entInsRecord.cycleId} where ins_record_id = #{insRecordId} - + select eir.*,edic.inspection_name as inspectionName,sd.* from ent_ins_record eir + left join ent_device_ins_cycle edic on eir.cycle_id = edic.inspection_id + left join sysdocument sd on eir.ins_record_id = sd.OTCId where eir.device_id = #{deviceId} and eir.del_state = 1 and eir.ins_record_situation like concat('%',#{inspectionRecordName},'%') diff --git a/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml b/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml index e3b09a8..99f6b72 100644 --- a/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml @@ -26,17 +26,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + repair_record_id, device_id, repair_code, repair_time, cause_of_failure, external_maintenance_unit, external_maintenance_person_name, repair_state, repair_start_time, repair_end_time, repair_level, shutdown, down_time, affected_generation, repair_cost, work_description, create_by, create_time, modify_by, modify_time - + select * from ent_repair_record err + left join sysdocument sd on err.repair_record_id = sd.OTCId + where err.device_id = #{deviceId} and err.del_state = 1 - update ent_report_repair set device_id = #{deviceId},repair_code = #{repairCode}, repair_time = #{repairTime}, cause_of_failure = #{causeOfFailure}, external_maintenance_unit = #{externalMaintenanceUnit}, external_maintenance_person_name = #{externalMaintenancePersonName}, repair_state = #{repairState}, repair_start_time = #{repairStartTime}, repair_end_time = #{repairEndTime}, repair_level = #{repairLevel}, shutdown = #{shutdown}, down_time = #{downTime}, affected_generation = #{affectedGeneration}, repair_cost = #{repairCost}, work_description = #{workDescription},modify_by = #{modifyBy}, modify_time= #{modifyTime} + update ent_repair_record set device_id = #{deviceId},repair_code = #{repairCode}, repair_time = #{repairTime}, cause_of_failure = #{causeOfFailure}, external_maintenance_unit = #{externalMaintenanceUnit}, external_maintenance_person_name = #{externalMaintenancePersonName}, repair_state = #{repairState}, repair_start_time = #{repairStartTime}, repair_end_time = #{repairEndTime}, repair_level = #{repairLevel}, shutdown = #{shutdown}, down_time = #{downTime}, affected_generation = #{affectedGeneration}, repair_cost = #{repairCost}, work_description = #{workDescription},modify_by = #{modifyBy}, modify_time= #{modifyTime} where repair_record_id = #{repairRecordId}