allen 1 year ago
parent
commit
26cd42b9dd

+ 2 - 0
tfis-admin/src/main/java/com/tfis/system/controller/AircraftTypeController.java

@@ -77,6 +77,7 @@ public class AircraftTypeController extends BaseController
     @PostMapping
     @PostMapping
     public AjaxResult add(@RequestBody AircraftType aircraftType)
     public AjaxResult add(@RequestBody AircraftType aircraftType)
     {
     {
+        aircraftType.setCreateBy(getLoginUser().getUser().getUserName());
         return toAjax(aircraftTypeService.insertAircraftType(aircraftType));
         return toAjax(aircraftTypeService.insertAircraftType(aircraftType));
     }
     }
 
 
@@ -88,6 +89,7 @@ public class AircraftTypeController extends BaseController
     @PutMapping
     @PutMapping
     public AjaxResult edit(@RequestBody AircraftType aircraftType)
     public AjaxResult edit(@RequestBody AircraftType aircraftType)
     {
     {
+        aircraftType.setUpdateBy(getLoginUser().getUser().getUserName());
         return toAjax(aircraftTypeService.updateAircraftType(aircraftType));
         return toAjax(aircraftTypeService.updateAircraftType(aircraftType));
     }
     }
 
 

+ 2 - 0
tfis-admin/src/main/java/com/tfis/system/controller/FaultCaseController.java

@@ -77,6 +77,7 @@ public class FaultCaseController extends BaseController
     @PostMapping
     @PostMapping
     public AjaxResult add(@RequestBody FaultCase faultCase)
     public AjaxResult add(@RequestBody FaultCase faultCase)
     {
     {
+        faultCase.setCreateBy(getLoginUser().getUser().getUserName());
         return toAjax(faultCaseService.insertFaultCase(faultCase));
         return toAjax(faultCaseService.insertFaultCase(faultCase));
     }
     }
 
 
@@ -88,6 +89,7 @@ public class FaultCaseController extends BaseController
     @PutMapping
     @PutMapping
     public AjaxResult edit(@RequestBody FaultCase faultCase)
     public AjaxResult edit(@RequestBody FaultCase faultCase)
     {
     {
+        faultCase.setUpdateBy(getLoginUser().getUser().getUserName());
         return toAjax(faultCaseService.updateFaultCase(faultCase));
         return toAjax(faultCaseService.updateFaultCase(faultCase));
     }
     }
 
 

+ 88 - 69
tfis-admin/src/main/java/com/tfis/system/domain/FaultCase.java

@@ -19,17 +19,24 @@ public class FaultCase extends BaseEntity
     private Long id;
     private Long id;
 
 
     /** 机型 */
     /** 机型 */
-    @Excel(name = "机型")
+
     private Long aircraftTypeId;
     private Long aircraftTypeId;
 
 
+    @Excel(name = "机型")
+    private String aircraftTypeName;
+
     /** 系统 */
     /** 系统 */
-    @Excel(name = "系统")
     private Long aircraftSystemId;
     private Long aircraftSystemId;
 
 
+    @Excel(name = "系统")
+    private String aircraftSystemName;
+
     /** 分系统 */
     /** 分系统 */
-    @Excel(name = "分系统")
     private Long aircraftSubsystemId;
     private Long aircraftSubsystemId;
 
 
+    @Excel(name = "分系统")
+    private String aircraftSubsystemName;
+
     /** 故障现象 */
     /** 故障现象 */
     @Excel(name = "故障现象")
     @Excel(name = "故障现象")
     private String faultPhenomenon;
     private String faultPhenomenon;
@@ -54,114 +61,126 @@ public class FaultCase extends BaseEntity
     @Excel(name = "浏览次数")
     @Excel(name = "浏览次数")
     private Long viewCount;
     private Long viewCount;
 
 
-    public void setId(Long id) 
-    {
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
         this.id = id;
         this.id = id;
     }
     }
 
 
-    public Long getId() 
-    {
-        return id;
+    public Long getAircraftTypeId() {
+        return aircraftTypeId;
     }
     }
-    public void setAircraftTypeId(Long aircraftTypeId) 
-    {
+
+    public void setAircraftTypeId(Long aircraftTypeId) {
         this.aircraftTypeId = aircraftTypeId;
         this.aircraftTypeId = aircraftTypeId;
     }
     }
 
 
-    public Long getAircraftTypeId() 
-    {
-        return aircraftTypeId;
+    public String getAircraftTypeName() {
+        return aircraftTypeName;
     }
     }
-    public void setAircraftSystemId(Long aircraftSystemId) 
-    {
-        this.aircraftSystemId = aircraftSystemId;
+
+    public void setAircraftTypeName(String aircraftTypeName) {
+        this.aircraftTypeName = aircraftTypeName;
     }
     }
 
 
-    public Long getAircraftSystemId() 
-    {
+    public Long getAircraftSystemId() {
         return aircraftSystemId;
         return aircraftSystemId;
     }
     }
-    public void setAircraftSubsystemId(Long aircraftSubsystemId) 
-    {
-        this.aircraftSubsystemId = aircraftSubsystemId;
+
+    public void setAircraftSystemId(Long aircraftSystemId) {
+        this.aircraftSystemId = aircraftSystemId;
+    }
+
+    public String getAircraftSystemName() {
+        return aircraftSystemName;
+    }
+
+    public void setAircraftSystemName(String aircraftSystemName) {
+        this.aircraftSystemName = aircraftSystemName;
     }
     }
 
 
-    public Long getAircraftSubsystemId() 
-    {
+    public Long getAircraftSubsystemId() {
         return aircraftSubsystemId;
         return aircraftSubsystemId;
     }
     }
-    public void setFaultPhenomenon(String faultPhenomenon) 
-    {
-        this.faultPhenomenon = faultPhenomenon;
+
+    public void setAircraftSubsystemId(Long aircraftSubsystemId) {
+        this.aircraftSubsystemId = aircraftSubsystemId;
+    }
+
+    public String getAircraftSubsystemName() {
+        return aircraftSubsystemName;
+    }
+
+    public void setAircraftSubsystemName(String aircraftSubsystemName) {
+        this.aircraftSubsystemName = aircraftSubsystemName;
     }
     }
 
 
-    public String getFaultPhenomenon() 
-    {
+    public String getFaultPhenomenon() {
         return faultPhenomenon;
         return faultPhenomenon;
     }
     }
-    public void setFaultCause(String faultCause) 
-    {
-        this.faultCause = faultCause;
+
+    public void setFaultPhenomenon(String faultPhenomenon) {
+        this.faultPhenomenon = faultPhenomenon;
     }
     }
 
 
-    public String getFaultCause() 
-    {
+    public String getFaultCause() {
         return faultCause;
         return faultCause;
     }
     }
-    public void setFaultTreePath(String faultTreePath) 
-    {
-        this.faultTreePath = faultTreePath;
+
+    public void setFaultCause(String faultCause) {
+        this.faultCause = faultCause;
     }
     }
 
 
-    public String getFaultTreePath() 
-    {
+    public String getFaultTreePath() {
         return faultTreePath;
         return faultTreePath;
     }
     }
-    public void setFaultPicturePath(String faultPicturePath) 
-    {
-        this.faultPicturePath = faultPicturePath;
+
+    public void setFaultTreePath(String faultTreePath) {
+        this.faultTreePath = faultTreePath;
     }
     }
 
 
-    public String getFaultPicturePath() 
-    {
+    public String getFaultPicturePath() {
         return faultPicturePath;
         return faultPicturePath;
     }
     }
-    public void setTroubleshootingMethodPath(String troubleshootingMethodPath) 
-    {
-        this.troubleshootingMethodPath = troubleshootingMethodPath;
+
+    public void setFaultPicturePath(String faultPicturePath) {
+        this.faultPicturePath = faultPicturePath;
     }
     }
 
 
-    public String getTroubleshootingMethodPath() 
-    {
+    public String getTroubleshootingMethodPath() {
         return troubleshootingMethodPath;
         return troubleshootingMethodPath;
     }
     }
-    public void setViewCount(Long viewCount) 
-    {
-        this.viewCount = viewCount;
+
+    public void setTroubleshootingMethodPath(String troubleshootingMethodPath) {
+        this.troubleshootingMethodPath = troubleshootingMethodPath;
     }
     }
 
 
-    public Long getViewCount() 
-    {
+    public Long getViewCount() {
         return viewCount;
         return viewCount;
     }
     }
 
 
+    public void setViewCount(Long viewCount) {
+        this.viewCount = viewCount;
+    }
+
     @Override
     @Override
     public String toString() {
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("aircraftTypeId", getAircraftTypeId())
-            .append("aircraftSystemId", getAircraftSystemId())
-            .append("aircraftSubsystemId", getAircraftSubsystemId())
-            .append("faultPhenomenon", getFaultPhenomenon())
-            .append("faultCause", getFaultCause())
-            .append("faultTreePath", getFaultTreePath())
-            .append("faultPicturePath", getFaultPicturePath())
-            .append("troubleshootingMethodPath", getTroubleshootingMethodPath())
-            .append("viewCount", getViewCount())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .toString();
+        return "FaultCase{" +
+                "id=" + id +
+                ", aircraftTypeId=" + aircraftTypeId +
+                ", aircraftTypeName=" + aircraftTypeName +
+                ", aircraftSystemId=" + aircraftSystemId +
+                ", aircraftSystemName=" + aircraftSystemName +
+                ", aircraftSubsystemId=" + aircraftSubsystemId +
+                ", aircraftSubsystemName=" + aircraftSubsystemName +
+                ", faultPhenomenon='" + faultPhenomenon + '\'' +
+                ", faultCause='" + faultCause + '\'' +
+                ", faultTreePath='" + faultTreePath + '\'' +
+                ", faultPicturePath='" + faultPicturePath + '\'' +
+                ", troubleshootingMethodPath='" + troubleshootingMethodPath + '\'' +
+                ", viewCount=" + viewCount +
+                '}';
     }
     }
 }
 }

+ 37 - 11
tfis-admin/src/main/resources/mapper/system/FaultCaseMapper.xml

@@ -7,8 +7,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="FaultCase" id="FaultCaseResult">
     <resultMap type="FaultCase" id="FaultCaseResult">
         <result property="id"    column="id"    />
         <result property="id"    column="id"    />
         <result property="aircraftTypeId"    column="aircraft_type_id"    />
         <result property="aircraftTypeId"    column="aircraft_type_id"    />
+        <result property="aircraftTypeName"    column="aircraft_type_name"    />
         <result property="aircraftSystemId"    column="aircraft_system_id"    />
         <result property="aircraftSystemId"    column="aircraft_system_id"    />
+        <result property="aircraftSystemName"    column="aircraft_system_name"    />
         <result property="aircraftSubsystemId"    column="aircraft_subsystem_id"    />
         <result property="aircraftSubsystemId"    column="aircraft_subsystem_id"    />
+        <result property="aircraftSubsystemName"    column="aircraft_subsystem_name"    />
         <result property="faultPhenomenon"    column="fault_phenomenon"    />
         <result property="faultPhenomenon"    column="fault_phenomenon"    />
         <result property="faultCause"    column="fault_cause"    />
         <result property="faultCause"    column="fault_cause"    />
         <result property="faultTreePath"    column="fault_tree_path"    />
         <result property="faultTreePath"    column="fault_tree_path"    />
@@ -22,27 +25,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
     </resultMap>
 
 
     <sql id="selectFaultCaseVo">
     <sql id="selectFaultCaseVo">
-        select id, aircraft_type_id, aircraft_system_id, aircraft_subsystem_id, fault_phenomenon, fault_cause, fault_tree_path, fault_picture_path, troubleshooting_method_path, view_count, create_by, create_time, update_by, update_time from biz_fault_case
+        SELECT
+            bfc.id,
+            bfc.aircraft_type_id,
+            bat.aircraft_type_name,
+            bfc.aircraft_system_id,
+            bas.aircraft_type_name aircraft_system_name,
+            bfc.aircraft_subsystem_id,
+            bass.aircraft_type_name aircraft_subsystem_name,
+            bfc.fault_phenomenon,
+            bfc.fault_cause,
+            bfc.fault_tree_path,
+            bfc.fault_picture_path,
+            bfc.troubleshooting_method_path,
+            bfc.view_count,
+            bfc.create_by,
+            bfc.create_time,
+            bfc.update_by,
+            bfc.update_time
+        FROM
+            biz_fault_case bfc
+            LEFT JOIN biz_aircraft_type bat ON bfc.aircraft_type_id = bat.id
+            LEFT JOIN biz_aircraft_system bas ON bfc.aircraft_system_id = bas.id
+            LEFT JOIN biz_aircraft_subsystem bass ON bfc.aircraft_subsystem_id = bass.id
     </sql>
     </sql>
 
 
     <select id="selectFaultCaseList" parameterType="FaultCase" resultMap="FaultCaseResult">
     <select id="selectFaultCaseList" parameterType="FaultCase" resultMap="FaultCaseResult">
         <include refid="selectFaultCaseVo"/>
         <include refid="selectFaultCaseVo"/>
         <where>  
         <where>  
-            <if test="aircraftTypeId != null "> and aircraft_type_id = #{aircraftTypeId}</if>
-            <if test="aircraftSystemId != null "> and aircraft_system_id = #{aircraftSystemId}</if>
-            <if test="aircraftSubsystemId != null "> and aircraft_subsystem_id = #{aircraftSubsystemId}</if>
-            <if test="faultPhenomenon != null  and faultPhenomenon != ''"> and fault_phenomenon = #{faultPhenomenon}</if>
-            <if test="faultCause != null  and faultCause != ''"> and fault_cause = #{faultCause}</if>
-            <if test="faultTreePath != null  and faultTreePath != ''"> and fault_tree_path = #{faultTreePath}</if>
-            <if test="faultPicturePath != null  and faultPicturePath != ''"> and fault_picture_path = #{faultPicturePath}</if>
-            <if test="troubleshootingMethodPath != null  and troubleshootingMethodPath != ''"> and troubleshooting_method_path = #{troubleshootingMethodPath}</if>
-            <if test="viewCount != null "> and view_count = #{viewCount}</if>
+            <if test="aircraftTypeId != null "> and bfc.aircraft_type_id = #{aircraftTypeId}</if>
+            <if test="aircraftSystemId != null "> and bfc.aircraft_system_id = #{aircraftSystemId}</if>
+            <if test="aircraftSubsystemId != null "> and bfc.aircraft_subsystem_id = #{aircraftSubsystemId}</if>
+            <if test="faultPhenomenon != null  and faultPhenomenon != ''"> and bfc.fault_phenomenon like concat('%', #{faultPhenomenon}, '%')</if>
+            <if test="faultCause != null  and faultCause != ''"> and bfc.fault_cause like concat('%', #{faultCause}, '%')</if>
+            <if test="faultTreePath != null  and faultTreePath != ''"> and bfc.fault_tree_path = #{faultTreePath}</if>
+            <if test="faultPicturePath != null  and faultPicturePath != ''"> and bfc.fault_picture_path = #{faultPicturePath}</if>
+            <if test="troubleshootingMethodPath != null  and troubleshootingMethodPath != ''"> and bfc.troubleshooting_method_path = #{troubleshootingMethodPath}</if>
+            <if test="viewCount != null "> and bfc.view_count = #{viewCount}</if>
         </where>
         </where>
+        order by id desc
     </select>
     </select>
     
     
     <select id="selectFaultCaseById" parameterType="Long" resultMap="FaultCaseResult">
     <select id="selectFaultCaseById" parameterType="Long" resultMap="FaultCaseResult">
         <include refid="selectFaultCaseVo"/>
         <include refid="selectFaultCaseVo"/>
-        where id = #{id}
+        where bfc.id = #{id}
     </select>
     </select>
         
         
     <insert id="insertFaultCase" parameterType="FaultCase" useGeneratedKeys="true" keyProperty="id">
     <insert id="insertFaultCase" parameterType="FaultCase" useGeneratedKeys="true" keyProperty="id">