فهرست منبع

开发知识库相关接口

shilin 3 سال پیش
والد
کامیت
4d313c5da3

+ 10 - 10
pom.xml

@@ -333,16 +333,16 @@
 					<configurationFile>src/main/resources/mybatis-generator.xml</configurationFile>
 				</configuration>
 				<dependencies>
-					<dependency>
-						<groupId>mysql</groupId>
-						<artifactId>mysql-connector-java</artifactId>
-						<version>${mysql.version}</version>
-					</dependency>
-<!--			<dependency>-->
-<!--                <groupId>com.oracle</groupId>-->
-<!--                <artifactId>ojdbc6</artifactId>-->
-<!--                <version>11.2.0.3</version>-->
-<!--            </dependency>-->
+<!--					<dependency>-->
+<!--						<groupId>mysql</groupId>-->
+<!--						<artifactId>mysql-connector-java</artifactId>-->
+<!--						<version>${mysql.version}</version>-->
+<!--					</dependency>-->
+			<dependency>
+                <groupId>com.oracle</groupId>
+                <artifactId>ojdbc6</artifactId>
+                <version>11.2.0.3</version>
+            </dependency>
 
 <!--					<dependency>-->
 <!--					<groupId>com.microsoft.sqlserver</groupId>-->

+ 133 - 0
src/main/java/com/gyee/frame/controller/health/FaultKnowledgeController.java

@@ -0,0 +1,133 @@
+package com.gyee.frame.controller.health;
+
+import com.github.pagehelper.PageInfo;
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.auto.P3DeviceFault;
+import com.gyee.frame.model.custom.Tablepar;
+import com.gyee.frame.service.health.FaultKnowledgeService;
+import com.gyee.frame.util.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+
+@Controller
+@RequestMapping("/faultknowledge")
+@Api(value = "故障知识" ,tags =  "故障知识")
+public class FaultKnowledgeController {
+
+    @Resource
+    private FaultKnowledgeService faultKnowledgeService;
+
+
+
+    @PostMapping("/faultknowledgeList")
+    @ResponseBody
+    @ApiOperation(value = "故障知识列表", notes = "故障知识列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "tablepar", value = "分页排序对象", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "name", value = "故障名称", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "halttype", value = "停机类型", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "faultlevel", value = "故障级别", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult faultknowledgeList(Tablepar tablepar, String name, String halttype, String faultlevel) {
+
+
+        PageInfo<P3DeviceFault> pageInfo = new PageInfo<>();
+
+
+        pageInfo = faultKnowledgeService.findP3DeviceFaultList(tablepar, name, halttype, faultlevel);
+
+        if (null!=pageInfo) {
+            return AjaxResult.successData(AjaxStatus.success.code, pageInfo);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, pageInfo);
+        }
+
+    }
+
+    @PostMapping("/findFaultknowledge")
+    @ResponseBody
+    @ApiOperation(value = "通过主键查询故障知识", notes = "通过主键查询故障知识")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "编号", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult findFaultknowledge(String id) {
+
+
+        P3DeviceFault  po = new P3DeviceFault();
+
+        po = faultKnowledgeService.findP3DeviceFaultById(id);
+
+        if (null!=po) {
+            return AjaxResult.successData(AjaxStatus.success.code, po);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, po);
+        }
+
+    }
+    @PostMapping("/updateFaultknowledge")
+    @ResponseBody
+    @ApiOperation(value = "修改故障知识", notes = "修改故障知识")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "po", value = "故障知识对象", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult updateFaultknowledge(P3DeviceFault po) {
+
+        int result =-1;
+        if(StringUtils.notEmp(po) && StringUtils.notEmp(po.getId()))
+        {
+            result =faultKnowledgeService.updateP3DeviceFault(po);
+        }
+        if (result!=-1) {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, result);
+        }
+    }
+    @PostMapping("/insertFaultknowledge")
+    @ResponseBody
+    @ApiOperation(value = "新增故障知识", notes = "新增故障知识")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "po", value = "故障知识对象", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult insertFaultknowledge(P3DeviceFault po) {
+
+        int result =-1;
+        if(StringUtils.notEmp(po) )
+        {
+            result = faultKnowledgeService.insertP3DeviceFault(po);
+        }
+        if (result!=-1) {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, result);
+        }
+
+    }
+    @PostMapping("/deleteFaultknowledge")
+    @ResponseBody
+    @ApiOperation(value = "删除故障知识", notes = "删除故障知识")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "故障知识编号", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult deleteFaultknowledge(String id) {
+
+        int result =-1;
+        if(StringUtils.notEmp(id))
+        {
+            result =faultKnowledgeService.deleteP3DeviceFault(id);
+        }
+        if (result!=-1) {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, result);
+        }
+    }
+
+
+}

+ 1 - 1
src/main/java/com/gyee/frame/controller/health/WindTurbineCurveController.java

@@ -48,7 +48,7 @@ public class WindTurbineCurveController {
     @ResponseBody
     @ApiOperation(value = "单机区间曲线偏差率", notes = "单机区间曲线偏差率")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "tablwtIdepar", value = "分页排序对象", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "tablepar", value = "分页排序对象", required = true, dataType = "string", paramType = "query"),
             @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
             @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})
 

+ 2 - 2
src/main/java/com/gyee/frame/mapper/auto/AlarmsnapMapper.java

@@ -3,9 +3,9 @@ package com.gyee.frame.mapper.auto;
 import com.gyee.frame.model.auto.Alarmsnap;
 import com.gyee.frame.model.auto.AlarmsnapExample;
 import com.gyee.frame.model.custom.TotalNumVo;
+import com.gyee.frame.model.custom.TotalNumsVo;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.Date;
 import java.util.List;
 
 public interface AlarmsnapMapper {
@@ -97,7 +97,7 @@ public interface AlarmsnapMapper {
      */
     int updateByPrimaryKey(Alarmsnap record);
 
-    List<TotalNumVo> getAlarmhistoryList(@Param("tablename") String tablename, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+    List<TotalNumsVo> getAlarmhistoryList(@Param("tname") String tname, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
 
     List<TotalNumVo> findAlertrulefailuresubMap();
 

+ 96 - 0
src/main/java/com/gyee/frame/mapper/auto/P3DeviceFaultMapper.java

@@ -0,0 +1,96 @@
+package com.gyee.frame.mapper.auto;
+
+import com.gyee.frame.model.auto.P3DeviceFault;
+import com.gyee.frame.model.auto.P3DeviceFaultExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface P3DeviceFaultMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table P3_DEVICE_FAULT
+     *
+     * @mbg.generated
+     */
+    long countByExample(P3DeviceFaultExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table P3_DEVICE_FAULT
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(P3DeviceFaultExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table P3_DEVICE_FAULT
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(String id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table P3_DEVICE_FAULT
+     *
+     * @mbg.generated
+     */
+    int insert(P3DeviceFault record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table P3_DEVICE_FAULT
+     *
+     * @mbg.generated
+     */
+    int insertSelective(P3DeviceFault record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table P3_DEVICE_FAULT
+     *
+     * @mbg.generated
+     */
+    List<P3DeviceFault> selectByExample(P3DeviceFaultExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table P3_DEVICE_FAULT
+     *
+     * @mbg.generated
+     */
+    P3DeviceFault selectByPrimaryKey(String id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table P3_DEVICE_FAULT
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") P3DeviceFault record, @Param("example") P3DeviceFaultExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table P3_DEVICE_FAULT
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") P3DeviceFault record, @Param("example") P3DeviceFaultExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table P3_DEVICE_FAULT
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(P3DeviceFault record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table P3_DEVICE_FAULT
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(P3DeviceFault record);
+}

+ 443 - 0
src/main/java/com/gyee/frame/model/auto/P3DeviceFault.java

@@ -0,0 +1,443 @@
+package com.gyee.frame.model.auto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class P3DeviceFault implements Serializable {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column P3_DEVICE_FAULT.ID
+     *
+     * @mbg.generated
+     */
+    private String id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column P3_DEVICE_FAULT.CODE
+     *
+     * @mbg.generated
+     */
+    private String code;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column P3_DEVICE_FAULT.FAULTID
+     *
+     * @mbg.generated
+     */
+    private String faultid;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column P3_DEVICE_FAULT.HALTTYPE
+     *
+     * @mbg.generated
+     */
+    private String halttype;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column P3_DEVICE_FAULT.NAME
+     *
+     * @mbg.generated
+     */
+    private String name;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column P3_DEVICE_FAULT.CATEGORY
+     *
+     * @mbg.generated
+     */
+    private String category;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column P3_DEVICE_FAULT.FAULTLEVEL
+     *
+     * @mbg.generated
+     */
+    private Integer faultlevel;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column P3_DEVICE_FAULT.CAUSE
+     *
+     * @mbg.generated
+     */
+    private String cause;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column P3_DEVICE_FAULT.TREATMENTMEASURE
+     *
+     * @mbg.generated
+     */
+    private String treatmentmeasure;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column P3_DEVICE_FAULT.DEVICEMODEL
+     *
+     * @mbg.generated
+     */
+    private String devicemodel;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column P3_DEVICE_FAULT.DEVICETREEID
+     *
+     * @mbg.generated
+     */
+    private Integer devicetreeid;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column P3_DEVICE_FAULT.CREATETOR
+     *
+     * @mbg.generated
+     */
+    private String createtor;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column P3_DEVICE_FAULT.CREATETIME
+     *
+     * @mbg.generated
+     */
+    private Date createtime;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table P3_DEVICE_FAULT
+     *
+     * @mbg.generated
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column P3_DEVICE_FAULT.ID
+     *
+     * @return the value of P3_DEVICE_FAULT.ID
+     *
+     * @mbg.generated
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column P3_DEVICE_FAULT.ID
+     *
+     * @param id the value for P3_DEVICE_FAULT.ID
+     *
+     * @mbg.generated
+     */
+    public void setId(String id) {
+        this.id = id == null ? null : id.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column P3_DEVICE_FAULT.CODE
+     *
+     * @return the value of P3_DEVICE_FAULT.CODE
+     *
+     * @mbg.generated
+     */
+    public String getCode() {
+        return code;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column P3_DEVICE_FAULT.CODE
+     *
+     * @param code the value for P3_DEVICE_FAULT.CODE
+     *
+     * @mbg.generated
+     */
+    public void setCode(String code) {
+        this.code = code == null ? null : code.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column P3_DEVICE_FAULT.FAULTID
+     *
+     * @return the value of P3_DEVICE_FAULT.FAULTID
+     *
+     * @mbg.generated
+     */
+    public String getFaultid() {
+        return faultid;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column P3_DEVICE_FAULT.FAULTID
+     *
+     * @param faultid the value for P3_DEVICE_FAULT.FAULTID
+     *
+     * @mbg.generated
+     */
+    public void setFaultid(String faultid) {
+        this.faultid = faultid == null ? null : faultid.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column P3_DEVICE_FAULT.HALTTYPE
+     *
+     * @return the value of P3_DEVICE_FAULT.HALTTYPE
+     *
+     * @mbg.generated
+     */
+    public String getHalttype() {
+        return halttype;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column P3_DEVICE_FAULT.HALTTYPE
+     *
+     * @param halttype the value for P3_DEVICE_FAULT.HALTTYPE
+     *
+     * @mbg.generated
+     */
+    public void setHalttype(String halttype) {
+        this.halttype = halttype == null ? null : halttype.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column P3_DEVICE_FAULT.NAME
+     *
+     * @return the value of P3_DEVICE_FAULT.NAME
+     *
+     * @mbg.generated
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column P3_DEVICE_FAULT.NAME
+     *
+     * @param name the value for P3_DEVICE_FAULT.NAME
+     *
+     * @mbg.generated
+     */
+    public void setName(String name) {
+        this.name = name == null ? null : name.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column P3_DEVICE_FAULT.CATEGORY
+     *
+     * @return the value of P3_DEVICE_FAULT.CATEGORY
+     *
+     * @mbg.generated
+     */
+    public String getCategory() {
+        return category;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column P3_DEVICE_FAULT.CATEGORY
+     *
+     * @param category the value for P3_DEVICE_FAULT.CATEGORY
+     *
+     * @mbg.generated
+     */
+    public void setCategory(String category) {
+        this.category = category == null ? null : category.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column P3_DEVICE_FAULT.FAULTLEVEL
+     *
+     * @return the value of P3_DEVICE_FAULT.FAULTLEVEL
+     *
+     * @mbg.generated
+     */
+    public Integer getFaultlevel() {
+        return faultlevel;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column P3_DEVICE_FAULT.FAULTLEVEL
+     *
+     * @param faultlevel the value for P3_DEVICE_FAULT.FAULTLEVEL
+     *
+     * @mbg.generated
+     */
+    public void setFaultlevel(Integer faultlevel) {
+        this.faultlevel = faultlevel;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column P3_DEVICE_FAULT.CAUSE
+     *
+     * @return the value of P3_DEVICE_FAULT.CAUSE
+     *
+     * @mbg.generated
+     */
+    public String getCause() {
+        return cause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column P3_DEVICE_FAULT.CAUSE
+     *
+     * @param cause the value for P3_DEVICE_FAULT.CAUSE
+     *
+     * @mbg.generated
+     */
+    public void setCause(String cause) {
+        this.cause = cause == null ? null : cause.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column P3_DEVICE_FAULT.TREATMENTMEASURE
+     *
+     * @return the value of P3_DEVICE_FAULT.TREATMENTMEASURE
+     *
+     * @mbg.generated
+     */
+    public String getTreatmentmeasure() {
+        return treatmentmeasure;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column P3_DEVICE_FAULT.TREATMENTMEASURE
+     *
+     * @param treatmentmeasure the value for P3_DEVICE_FAULT.TREATMENTMEASURE
+     *
+     * @mbg.generated
+     */
+    public void setTreatmentmeasure(String treatmentmeasure) {
+        this.treatmentmeasure = treatmentmeasure == null ? null : treatmentmeasure.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column P3_DEVICE_FAULT.DEVICEMODEL
+     *
+     * @return the value of P3_DEVICE_FAULT.DEVICEMODEL
+     *
+     * @mbg.generated
+     */
+    public String getDevicemodel() {
+        return devicemodel;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column P3_DEVICE_FAULT.DEVICEMODEL
+     *
+     * @param devicemodel the value for P3_DEVICE_FAULT.DEVICEMODEL
+     *
+     * @mbg.generated
+     */
+    public void setDevicemodel(String devicemodel) {
+        this.devicemodel = devicemodel == null ? null : devicemodel.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column P3_DEVICE_FAULT.DEVICETREEID
+     *
+     * @return the value of P3_DEVICE_FAULT.DEVICETREEID
+     *
+     * @mbg.generated
+     */
+    public Integer getDevicetreeid() {
+        return devicetreeid;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column P3_DEVICE_FAULT.DEVICETREEID
+     *
+     * @param devicetreeid the value for P3_DEVICE_FAULT.DEVICETREEID
+     *
+     * @mbg.generated
+     */
+    public void setDevicetreeid(Integer devicetreeid) {
+        this.devicetreeid = devicetreeid;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column P3_DEVICE_FAULT.CREATETOR
+     *
+     * @return the value of P3_DEVICE_FAULT.CREATETOR
+     *
+     * @mbg.generated
+     */
+    public String getCreatetor() {
+        return createtor;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column P3_DEVICE_FAULT.CREATETOR
+     *
+     * @param createtor the value for P3_DEVICE_FAULT.CREATETOR
+     *
+     * @mbg.generated
+     */
+    public void setCreatetor(String createtor) {
+        this.createtor = createtor == null ? null : createtor.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column P3_DEVICE_FAULT.CREATETIME
+     *
+     * @return the value of P3_DEVICE_FAULT.CREATETIME
+     *
+     * @mbg.generated
+     */
+    public Date getCreatetime() {
+        return createtime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column P3_DEVICE_FAULT.CREATETIME
+     *
+     * @param createtime the value for P3_DEVICE_FAULT.CREATETIME
+     *
+     * @mbg.generated
+     */
+    public void setCreatetime(Date createtime) {
+        this.createtime = createtime;
+    }
+}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1183 - 0
src/main/java/com/gyee/frame/model/auto/P3DeviceFaultExample.java


+ 134 - 0
src/main/java/com/gyee/frame/model/custom/ElementNode.java

@@ -0,0 +1,134 @@
+package com.gyee.frame.model.custom;
+
+import java.util.List;
+
+public class ElementNode {
+	
+	private String id;
+	private Integer state;
+	private String pid;
+	private String icon;
+	private String iconClose;
+	private String iconOpen;
+	private String label;
+	private Boolean open;
+	private Boolean isParent;
+	private Boolean collapse;
+	private String title;
+	private Boolean click;
+	private String url;
+	private List<ElementNode> children;
+
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public Integer getState() {
+		return state;
+	}
+
+	public void setState(Integer state) {
+		this.state = state;
+	}
+
+	public String getPid() {
+		return pid;
+	}
+
+	public void setPid(String pid) {
+		this.pid = pid;
+	}
+
+	public String getIcon() {
+		return icon;
+	}
+
+	public void setIcon(String icon) {
+		this.icon = icon;
+	}
+
+	public String getIconClose() {
+		return iconClose;
+	}
+
+	public void setIconClose(String iconClose) {
+		this.iconClose = iconClose;
+	}
+
+	public String getIconOpen() {
+		return iconOpen;
+	}
+
+	public void setIconOpen(String iconOpen) {
+		this.iconOpen = iconOpen;
+	}
+
+	public String getLabel() {
+		return label;
+	}
+
+	public void setLabel(String label) {
+		this.label = label;
+	}
+
+	public Boolean getOpen() {
+		return open;
+	}
+
+	public void setOpen(Boolean open) {
+		this.open = open;
+	}
+
+	public Boolean getParent() {
+		return isParent;
+	}
+
+	public void setIsParent(Boolean parent) {
+		isParent = parent;
+	}
+
+	public Boolean getCollapse() {
+		return collapse;
+	}
+
+	public void setCollapse(Boolean collapse) {
+		this.collapse = collapse;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public Boolean getClick() {
+		return click;
+	}
+
+	public void setClick(Boolean click) {
+		this.click = click;
+	}
+
+	public String getUrl() {
+		return url;
+	}
+
+	public void setUrl(String url) {
+		this.url = url;
+	}
+
+	public List<ElementNode> getChildren() {
+		return children;
+	}
+
+	public void setChildren(List<ElementNode> children) {
+		this.children = children;
+	}
+}

+ 30 - 0
src/main/java/com/gyee/frame/model/custom/TotalNumsVo.java

@@ -0,0 +1,30 @@
+package com.gyee.frame.model.custom;
+
+public class TotalNumsVo implements java.io.Serializable {
+
+	/**
+	 * @Fields serialVersionUID : TODO
+	 */
+
+
+	private static final long serialVersionUID = 1L;
+	
+	private String windturbineid;
+	private String alertvalue;
+
+	public String getWindturbineid() {
+		return windturbineid;
+	}
+
+	public void setWindturbineid(String windturbineid) {
+		this.windturbineid = windturbineid;
+	}
+
+	public String getAlertvalue() {
+		return alertvalue;
+	}
+
+	public void setAlertvalue(String alertvalue) {
+		this.alertvalue = alertvalue;
+	}
+}

+ 155 - 0
src/main/java/com/gyee/frame/service/P3DeviceFaultService.java

@@ -0,0 +1,155 @@
+package com.gyee.frame.service;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.gyee.frame.common.base.BaseService;
+import com.gyee.frame.common.support.Convert;
+import com.gyee.frame.mapper.auto.P3DeviceFaultMapper;
+import com.gyee.frame.model.auto.P3DeviceFault;
+import com.gyee.frame.model.auto.P3DeviceFaultExample;
+import com.gyee.frame.model.custom.Tablepar;
+import com.gyee.frame.util.SnowflakeIdWorker;
+import com.gyee.frame.util.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 故障知识 P3DeviceFaultService
+ *
+ * @author gyee_自动生成
+ * @Title: P3DeviceFaultService.java 
+ * @Package com.gyee.frame.service 
+ * @email 1@qq.com
+ * @date 2019-12-31 14:58:09  
+ **/
+@Service
+public class P3DeviceFaultService implements BaseService<P3DeviceFault, P3DeviceFaultExample> {
+    @Resource
+    private P3DeviceFaultMapper p3DeviceFaultMapper;
+
+
+    @Override
+    public int deleteByPrimaryKey(String ids) {
+
+        List<String> lista = Convert.toListStrArray(ids);
+        P3DeviceFaultExample example = new P3DeviceFaultExample();
+        example.createCriteria().andIdIn(lista);
+        return p3DeviceFaultMapper.deleteByExample(example);
+
+
+    }
+
+
+    @Override
+    public P3DeviceFault selectByPrimaryKey(String id) {
+
+        return p3DeviceFaultMapper.selectByPrimaryKey(id);
+
+    }
+
+
+    @Override
+    public int updateByPrimaryKeySelective(P3DeviceFault record) {
+        return p3DeviceFaultMapper.updateByPrimaryKeySelective(record);
+    }
+
+
+    /**
+     * 添加
+     */
+    @Override
+    public int insertSelective(P3DeviceFault record) {
+
+        //添加雪花主键id
+        record.setId(SnowflakeIdWorker.getUUID());
+
+
+        return p3DeviceFaultMapper.insertSelective(record);
+    }
+
+
+    @Override
+    public int updateByExampleSelective(P3DeviceFault record, P3DeviceFaultExample example) {
+
+        return p3DeviceFaultMapper.updateByExampleSelective(record, example);
+    }
+
+
+    @Override
+    public int updateByExample(P3DeviceFault record, P3DeviceFaultExample example) {
+
+        return p3DeviceFaultMapper.updateByExample(record, example);
+    }
+
+    @Override
+    public List<P3DeviceFault> selectByExample(P3DeviceFaultExample example) {
+
+        return p3DeviceFaultMapper.selectByExample(example);
+    }
+
+
+    @Override
+    public long countByExample(P3DeviceFaultExample example) {
+
+        return p3DeviceFaultMapper.countByExample(example);
+    }
+
+
+    @Override
+    public int deleteByExample(P3DeviceFaultExample example) {
+
+        return p3DeviceFaultMapper.deleteByExample(example);
+    }
+
+
+
+    public PageInfo<P3DeviceFault> findP3DeviceFaultList(Tablepar tablepar, String name, String halttype, String faultlevel) {
+
+
+        PageInfo<P3DeviceFault> pageInfo = new PageInfo<>();
+
+
+        P3DeviceFaultExample example = new P3DeviceFaultExample();
+
+        if (StringUtils.isNotEmpty(tablepar.getOrderByColumn())) {
+            StringBuilder sb = new StringBuilder();
+            sb.append(" ").append(tablepar.getOrderByColumn());
+            if (StringUtils.isNotEmpty(tablepar.getIsAsc())) {
+                sb.append(" ").append(tablepar.getIsAsc());
+            } else {
+                sb.append(" asc ");
+            }
+            example.setOrderByClause(String.valueOf(sb));
+        } else {
+            example.setOrderByClause("name ASC");
+        }
+
+        P3DeviceFaultExample.Criteria criteria = example.createCriteria();
+
+        if (StringUtils.notEmp(name)) {
+
+            criteria.andNameLike("%" + name + "%");
+        }
+
+        if (StringUtils.notEmp(halttype)) {
+
+            criteria.andHalttypeLike("%" + halttype + "%");
+        }
+
+        if (StringUtils.notEmp(faultlevel)) {
+
+            criteria.andFaultlevelEqualTo(Integer.valueOf(faultlevel) );
+        }
+
+
+        PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
+        List<P3DeviceFault> vos = p3DeviceFaultMapper.selectByExample(example);
+        pageInfo = new PageInfo<P3DeviceFault>(vos);
+
+
+        return pageInfo;
+
+    }
+}

+ 80 - 0
src/main/java/com/gyee/frame/service/health/FaultKnowledgeService.java

@@ -0,0 +1,80 @@
+package com.gyee.frame.service.health;
+
+import com.github.pagehelper.PageInfo;
+import com.gyee.frame.model.auto.P3DeviceFault;
+import com.gyee.frame.model.custom.Tablepar;
+import com.gyee.frame.service.P3DeviceFaultService;
+import com.gyee.frame.util.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+@Service
+public class FaultKnowledgeService {
+
+    @Resource
+    private P3DeviceFaultService p3DeviceFaultService;
+
+
+    private final int digit = 2;
+
+
+    public PageInfo<P3DeviceFault> findP3DeviceFaultList(Tablepar tablepar, String name, String halttype, String faultlevel) {
+
+
+        PageInfo<P3DeviceFault> pageInfo = new PageInfo<>();
+
+
+        pageInfo = p3DeviceFaultService.findP3DeviceFaultList(tablepar, name, halttype, faultlevel);
+
+        return pageInfo;
+
+    }
+
+
+    public P3DeviceFault findP3DeviceFaultById(String id) {
+
+
+       P3DeviceFault  po = new P3DeviceFault();
+
+        po = p3DeviceFaultService.selectByPrimaryKey(id);
+
+        return po;
+
+    }
+
+    public int updateP3DeviceFault(P3DeviceFault po) {
+
+        int result =-1;
+        if(StringUtils.notEmp(po) && StringUtils.notEmp(po.getId()))
+        {
+            result =p3DeviceFaultService.updateByPrimaryKeySelective(po);
+        }
+        return result;
+
+    }
+
+    public int insertP3DeviceFault(P3DeviceFault po) {
+
+        int result =-1;
+        if(StringUtils.notEmp(po) )
+        {
+             result = p3DeviceFaultService.insertSelective(po);
+        }
+
+
+        return result;
+
+    }
+
+    public int deleteP3DeviceFault(String id) {
+
+        int result =-1;
+        if(StringUtils.notEmp(id))
+        {
+            result =p3DeviceFaultService.deleteByPrimaryKey(id);
+        }
+        return result;
+
+    }
+}

+ 9 - 8
src/main/java/com/gyee/frame/service/health/LossPowerRateHealthService.java

@@ -9,6 +9,7 @@ import com.gyee.frame.model.auto.Windturbine;
 import com.gyee.frame.model.custom.DNAVal;
 import com.gyee.frame.model.custom.HealthmodelrecordsVo;
 import com.gyee.frame.model.custom.TotalNumVo;
+import com.gyee.frame.model.custom.TotalNumsVo;
 import com.gyee.frame.service.WindTurbineTestingPointAiService;
 import com.gyee.frame.util.IRealTimeDataBaseUtil;
 import com.gyee.frame.util.StringUtils;
@@ -195,22 +196,22 @@ public class LossPowerRateHealthService {
 
 
 
-                List<TotalNumVo> list = alarmsnapMapper.getAlarmhistoryList(String.valueOf(tablename),beginDate,endDate);
+                List<TotalNumsVo> list = alarmsnapMapper.getAlarmhistoryList(String.valueOf(tablename),sdf.format(beginDate),sdf.format(endDate));
 
                 if (!list.isEmpty()) {
 
-                    for (TotalNumVo vo : list) {
+                    for (TotalNumsVo vo : list) {
 
-                        if(map.containsKey(vo.getWtId()))
+                        if(map.containsKey(vo.getWindturbineid()))
                         {
-                            List<String> ls=map.get(vo.getWtId());
-                            ls.add(String.valueOf(vo.getNumbers()));
-                            map.put(vo.getWtId(), ls);
+                            List<String> ls=map.get(vo.getWindturbineid());
+                            ls.add(String.valueOf(vo.getAlertvalue()));
+                            map.put(vo.getWindturbineid(), ls);
                         }else
                         {
                             List<String> ls=new ArrayList<>();
-                            ls.add(String.valueOf(vo.getNumbers()));
-                            map.put(vo.getWtId(), ls);
+                            ls.add(String.valueOf(vo.getAlertvalue()));
+                            map.put(vo.getWindturbineid(), ls);
                         }
 
                     }

+ 9 - 8
src/main/java/com/gyee/frame/service/health/WindTurbineHealthListService.java

@@ -9,6 +9,7 @@ import com.gyee.frame.model.auto.Windturbine;
 import com.gyee.frame.model.custom.DNAVal;
 import com.gyee.frame.model.custom.HealthmodelrecordsVo;
 import com.gyee.frame.model.custom.TotalNumVo;
+import com.gyee.frame.model.custom.TotalNumsVo;
 import com.gyee.frame.service.WindTurbineTestingPointAiService;
 import com.gyee.frame.util.IRealTimeDataBaseUtil;
 import com.gyee.frame.util.StringUtils;
@@ -195,22 +196,22 @@ public class WindTurbineHealthListService {
 
 
 
-                List<TotalNumVo> list = alarmsnapMapper.getAlarmhistoryList(String.valueOf(tablename),beginDate,endDate);
+                List<TotalNumsVo> list = alarmsnapMapper.getAlarmhistoryList(String.valueOf(tablename),sdf.format(beginDate),sdf.format(endDate));
 
                 if (!list.isEmpty()) {
 
-                    for (TotalNumVo vo : list) {
+                    for (TotalNumsVo vo : list) {
 
-                        if(map.containsKey(vo.getWtId()))
+                        if(map.containsKey(vo.getWindturbineid()))
                         {
-                            List<String> ls=map.get(vo.getWtId());
-                            ls.add(String.valueOf(vo.getNumbers()));
-                            map.put(vo.getWtId(), ls);
+                            List<String> ls=map.get(vo.getWindturbineid());
+                            ls.add(String.valueOf(vo.getAlertvalue()));
+                            map.put(vo.getWindturbineid(), ls);
                         }else
                         {
                             List<String> ls=new ArrayList<>();
-                            ls.add(String.valueOf(vo.getNumbers()));
-                            map.put(vo.getWtId(), ls);
+                            ls.add(String.valueOf(vo.getAlertvalue()));
+                            map.put(vo.getWindturbineid(), ls);
                         }
 
                     }

+ 3 - 3
src/main/java/com/gyee/frame/service/recommen/RecommenService.java

@@ -598,13 +598,13 @@ public class RecommenService {
 				List<EquipmentSql> eqls = equipmentSqlService.getEquipmentListByLocation(wt.getLocation());
 				if(!eqls.isEmpty())
 				{
-					List<ZtreeNode> nodes = new ArrayList<ZtreeNode>();
+					List<ElementNode> nodes = new ArrayList<ElementNode>();
 					for(EquipmentSql eq:eqls)
 					{
-						ZtreeNode node=new ZtreeNode();
+						ElementNode node=new ElementNode();
 						node.setId(eq.getLocation());
 						node.setPid(eq.getParent());
-						node.setName(eq.getDescription());
+						node.setLabel(eq.getDescription());
 						node.setOpen(true);
 						nodes.add(node);
 					}

+ 19 - 19
src/main/java/com/gyee/frame/util/TreeUtil.java

@@ -1,7 +1,7 @@
 package com.gyee.frame.util;
 
 import com.alibaba.fastjson.JSON;
-import com.gyee.frame.model.custom.ZtreeNode;
+import com.gyee.frame.model.custom.ElementNode;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -13,9 +13,9 @@ public class TreeUtil {
 //	private final String ROOT="../pages/warningalert/css/zTreeStyle/img/fj.png";
 //	private final String PARENT="../pages/warningalert/css/zTreeStyle/img/fu.png";
 //	private final String LEAF="../pages/warningalert/css/zTreeStyle/img/zi.png";
-	List<ZtreeNode> nodes = new ArrayList<ZtreeNode>();
+	List<ElementNode> nodes = new ArrayList<ElementNode>();
 
-	public TreeUtil(List<ZtreeNode> nodes) {
+	public TreeUtil(List<ElementNode> nodes) {
 
 		super();
 
@@ -31,7 +31,7 @@ public class TreeUtil {
 
 	public String buildJSONTree() {
 
-		List<ZtreeNode> nodeTree = buildTree();
+		List<ElementNode> nodeTree = buildTree();
 		
 		//nodeTree.get(0).setIcon(ROOT);
 
@@ -47,13 +47,13 @@ public class TreeUtil {
 	 * @return
 	 */
 
-	public List<ZtreeNode> buildTree() {
+	public List<ElementNode> buildTree() {
 
-		List<ZtreeNode> treeNodes = new ArrayList<ZtreeNode>();
+		List<ElementNode> treeNodes = new ArrayList<ElementNode>();
 
-		List<ZtreeNode> rootNodes = getRootNodes();
+		List<ElementNode> rootNodes = getRootNodes();
 
-		for (ZtreeNode rootNode : rootNodes) {
+		for (ElementNode rootNode : rootNodes) {
 
 			buildChildNodes(rootNode);
 
@@ -71,14 +71,14 @@ public class TreeUtil {
 	 * @param node
 	 */
 
-	public void buildChildNodes(ZtreeNode node) {
+	public void buildChildNodes(ElementNode node) {
 
-		List<ZtreeNode> children = getChildNodes(node);
+		List<ElementNode> children = getChildNodes(node);
 
 		if (!children.isEmpty()) {
 			//node.setIcon(PARENT);
 			
-			for (ZtreeNode child : children) {
+			for (ElementNode child : children) {
 
 				buildChildNodes(child);
 
@@ -100,12 +100,12 @@ public class TreeUtil {
 	 * @return
 	 */
 
-	public List<ZtreeNode> getChildNodes(ZtreeNode pnode) {
+	public List<ElementNode> getChildNodes(ElementNode pnode) {
 
 		
-		List<ZtreeNode> childNodes = new ArrayList<ZtreeNode>();
+		List<ElementNode> childNodes = new ArrayList<ElementNode>();
 
-		for (ZtreeNode n : nodes) {
+		for (ElementNode n : nodes) {
 
 			if (pnode.getId().equals(n.getPid())) {
 
@@ -125,11 +125,11 @@ public class TreeUtil {
 	 * @return
 	 */
 
-	public boolean rootNode(ZtreeNode node) {
+	public boolean rootNode(ElementNode node) {
 
 		boolean isRootNode = true;
 
-		for (ZtreeNode n : nodes) {
+		for (ElementNode n : nodes) {
 
 			if (StringUtils.notEmp(node.getPid()) && node.getPid().equals(n.getId())) {
 
@@ -151,11 +151,11 @@ public class TreeUtil {
 	 * @return
 	 */
 
-	public List<ZtreeNode> getRootNodes() {
+	public List<ElementNode> getRootNodes() {
 
-		List<ZtreeNode> rootNodes = new ArrayList<ZtreeNode>();
+		List<ElementNode> rootNodes = new ArrayList<ElementNode>();
 
-		for (ZtreeNode n : nodes) {
+		for (ElementNode n : nodes) {
 
 			if (rootNode(n)) {
 

+ 1 - 1
src/main/resources/mybatis-generator.xml

@@ -105,7 +105,7 @@
 <!--        <table tableName='Windturbine' domainObjectName='WindturbineSql'/>-->
 <!--        <table tableName='Equipment' domainObjectName='EquipmentSql'/>-->
 
-        <table tableName='PartBjCountSub' domainObjectName='PartBjCountSub'/>
+        <table tableName='P3_device_fault' domainObjectName='P3DeviceFault'/>
 
 
     </context>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 477 - 474
src/main/resources/mybatis/auto/AlarmsnapMapper.xml


+ 398 - 0
src/main/resources/mybatis/auto/P3DeviceFaultMapper.xml

@@ -0,0 +1,398 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.gyee.frame.mapper.auto.P3DeviceFaultMapper">
+  <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.P3DeviceFault">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <id column="ID" jdbcType="VARCHAR" property="id" />
+    <result column="CODE" jdbcType="VARCHAR" property="code" />
+    <result column="FAULTID" jdbcType="VARCHAR" property="faultid" />
+    <result column="HALTTYPE" jdbcType="VARCHAR" property="halttype" />
+    <result column="NAME" jdbcType="VARCHAR" property="name" />
+    <result column="CATEGORY" jdbcType="VARCHAR" property="category" />
+    <result column="FAULTLEVEL" jdbcType="DECIMAL" property="faultlevel" />
+    <result column="CAUSE" jdbcType="VARCHAR" property="cause" />
+    <result column="TREATMENTMEASURE" jdbcType="VARCHAR" property="treatmentmeasure" />
+    <result column="DEVICEMODEL" jdbcType="VARCHAR" property="devicemodel" />
+    <result column="DEVICETREEID" jdbcType="DECIMAL" property="devicetreeid" />
+    <result column="CREATETOR" jdbcType="VARCHAR" property="createtor" />
+    <result column="CREATETIME" jdbcType="TIMESTAMP" property="createtime" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    ID, CODE, FAULTID, HALTTYPE, NAME, CATEGORY, FAULTLEVEL, CAUSE, TREATMENTMEASURE, 
+    DEVICEMODEL, DEVICETREEID, CREATETOR, CREATETIME
+  </sql>
+  <select id="selectByExample" parameterType="com.gyee.frame.model.auto.P3DeviceFaultExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from P3_DEVICE_FAULT
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from P3_DEVICE_FAULT
+    where ID = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    delete from P3_DEVICE_FAULT
+    where ID = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.P3DeviceFaultExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    delete from P3_DEVICE_FAULT
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.gyee.frame.model.auto.P3DeviceFault">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    insert into P3_DEVICE_FAULT (ID, CODE, FAULTID, 
+      HALTTYPE, NAME, CATEGORY, 
+      FAULTLEVEL, CAUSE, TREATMENTMEASURE, 
+      DEVICEMODEL, DEVICETREEID, CREATETOR, 
+      CREATETIME)
+    values (#{id,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{faultid,jdbcType=VARCHAR}, 
+      #{halttype,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR}, 
+      #{faultlevel,jdbcType=DECIMAL}, #{cause,jdbcType=VARCHAR}, #{treatmentmeasure,jdbcType=VARCHAR}, 
+      #{devicemodel,jdbcType=VARCHAR}, #{devicetreeid,jdbcType=DECIMAL}, #{createtor,jdbcType=VARCHAR}, 
+      #{createtime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.P3DeviceFault">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    insert into P3_DEVICE_FAULT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        ID,
+      </if>
+      <if test="code != null">
+        CODE,
+      </if>
+      <if test="faultid != null">
+        FAULTID,
+      </if>
+      <if test="halttype != null">
+        HALTTYPE,
+      </if>
+      <if test="name != null">
+        NAME,
+      </if>
+      <if test="category != null">
+        CATEGORY,
+      </if>
+      <if test="faultlevel != null">
+        FAULTLEVEL,
+      </if>
+      <if test="cause != null">
+        CAUSE,
+      </if>
+      <if test="treatmentmeasure != null">
+        TREATMENTMEASURE,
+      </if>
+      <if test="devicemodel != null">
+        DEVICEMODEL,
+      </if>
+      <if test="devicetreeid != null">
+        DEVICETREEID,
+      </if>
+      <if test="createtor != null">
+        CREATETOR,
+      </if>
+      <if test="createtime != null">
+        CREATETIME,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="code != null">
+        #{code,jdbcType=VARCHAR},
+      </if>
+      <if test="faultid != null">
+        #{faultid,jdbcType=VARCHAR},
+      </if>
+      <if test="halttype != null">
+        #{halttype,jdbcType=VARCHAR},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="category != null">
+        #{category,jdbcType=VARCHAR},
+      </if>
+      <if test="faultlevel != null">
+        #{faultlevel,jdbcType=DECIMAL},
+      </if>
+      <if test="cause != null">
+        #{cause,jdbcType=VARCHAR},
+      </if>
+      <if test="treatmentmeasure != null">
+        #{treatmentmeasure,jdbcType=VARCHAR},
+      </if>
+      <if test="devicemodel != null">
+        #{devicemodel,jdbcType=VARCHAR},
+      </if>
+      <if test="devicetreeid != null">
+        #{devicetreeid,jdbcType=DECIMAL},
+      </if>
+      <if test="createtor != null">
+        #{createtor,jdbcType=VARCHAR},
+      </if>
+      <if test="createtime != null">
+        #{createtime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.gyee.frame.model.auto.P3DeviceFaultExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select count(*) from P3_DEVICE_FAULT
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update P3_DEVICE_FAULT
+    <set>
+      <if test="record.id != null">
+        ID = #{record.id,jdbcType=VARCHAR},
+      </if>
+      <if test="record.code != null">
+        CODE = #{record.code,jdbcType=VARCHAR},
+      </if>
+      <if test="record.faultid != null">
+        FAULTID = #{record.faultid,jdbcType=VARCHAR},
+      </if>
+      <if test="record.halttype != null">
+        HALTTYPE = #{record.halttype,jdbcType=VARCHAR},
+      </if>
+      <if test="record.name != null">
+        NAME = #{record.name,jdbcType=VARCHAR},
+      </if>
+      <if test="record.category != null">
+        CATEGORY = #{record.category,jdbcType=VARCHAR},
+      </if>
+      <if test="record.faultlevel != null">
+        FAULTLEVEL = #{record.faultlevel,jdbcType=DECIMAL},
+      </if>
+      <if test="record.cause != null">
+        CAUSE = #{record.cause,jdbcType=VARCHAR},
+      </if>
+      <if test="record.treatmentmeasure != null">
+        TREATMENTMEASURE = #{record.treatmentmeasure,jdbcType=VARCHAR},
+      </if>
+      <if test="record.devicemodel != null">
+        DEVICEMODEL = #{record.devicemodel,jdbcType=VARCHAR},
+      </if>
+      <if test="record.devicetreeid != null">
+        DEVICETREEID = #{record.devicetreeid,jdbcType=DECIMAL},
+      </if>
+      <if test="record.createtor != null">
+        CREATETOR = #{record.createtor,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createtime != null">
+        CREATETIME = #{record.createtime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update P3_DEVICE_FAULT
+    set ID = #{record.id,jdbcType=VARCHAR},
+      CODE = #{record.code,jdbcType=VARCHAR},
+      FAULTID = #{record.faultid,jdbcType=VARCHAR},
+      HALTTYPE = #{record.halttype,jdbcType=VARCHAR},
+      NAME = #{record.name,jdbcType=VARCHAR},
+      CATEGORY = #{record.category,jdbcType=VARCHAR},
+      FAULTLEVEL = #{record.faultlevel,jdbcType=DECIMAL},
+      CAUSE = #{record.cause,jdbcType=VARCHAR},
+      TREATMENTMEASURE = #{record.treatmentmeasure,jdbcType=VARCHAR},
+      DEVICEMODEL = #{record.devicemodel,jdbcType=VARCHAR},
+      DEVICETREEID = #{record.devicetreeid,jdbcType=DECIMAL},
+      CREATETOR = #{record.createtor,jdbcType=VARCHAR},
+      CREATETIME = #{record.createtime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.P3DeviceFault">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update P3_DEVICE_FAULT
+    <set>
+      <if test="code != null">
+        CODE = #{code,jdbcType=VARCHAR},
+      </if>
+      <if test="faultid != null">
+        FAULTID = #{faultid,jdbcType=VARCHAR},
+      </if>
+      <if test="halttype != null">
+        HALTTYPE = #{halttype,jdbcType=VARCHAR},
+      </if>
+      <if test="name != null">
+        NAME = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="category != null">
+        CATEGORY = #{category,jdbcType=VARCHAR},
+      </if>
+      <if test="faultlevel != null">
+        FAULTLEVEL = #{faultlevel,jdbcType=DECIMAL},
+      </if>
+      <if test="cause != null">
+        CAUSE = #{cause,jdbcType=VARCHAR},
+      </if>
+      <if test="treatmentmeasure != null">
+        TREATMENTMEASURE = #{treatmentmeasure,jdbcType=VARCHAR},
+      </if>
+      <if test="devicemodel != null">
+        DEVICEMODEL = #{devicemodel,jdbcType=VARCHAR},
+      </if>
+      <if test="devicetreeid != null">
+        DEVICETREEID = #{devicetreeid,jdbcType=DECIMAL},
+      </if>
+      <if test="createtor != null">
+        CREATETOR = #{createtor,jdbcType=VARCHAR},
+      </if>
+      <if test="createtime != null">
+        CREATETIME = #{createtime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where ID = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.P3DeviceFault">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update P3_DEVICE_FAULT
+    set CODE = #{code,jdbcType=VARCHAR},
+      FAULTID = #{faultid,jdbcType=VARCHAR},
+      HALTTYPE = #{halttype,jdbcType=VARCHAR},
+      NAME = #{name,jdbcType=VARCHAR},
+      CATEGORY = #{category,jdbcType=VARCHAR},
+      FAULTLEVEL = #{faultlevel,jdbcType=DECIMAL},
+      CAUSE = #{cause,jdbcType=VARCHAR},
+      TREATMENTMEASURE = #{treatmentmeasure,jdbcType=VARCHAR},
+      DEVICEMODEL = #{devicemodel,jdbcType=VARCHAR},
+      DEVICETREEID = #{devicetreeid,jdbcType=DECIMAL},
+      CREATETOR = #{createtor,jdbcType=VARCHAR},
+      CREATETIME = #{createtime,jdbcType=TIMESTAMP}
+    where ID = #{id,jdbcType=VARCHAR}
+  </update>
+</mapper>

+ 80 - 0
src/test/java/test/FaultKnowledgeTest.java

@@ -0,0 +1,80 @@
+package test;
+
+import com.github.pagehelper.PageInfo;
+import com.gyee.SpringbootStart;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.common.spring.SpringUtils;
+import com.gyee.frame.controller.health.FaultKnowledgeController;
+import com.gyee.frame.model.auto.P3DeviceFault;
+import com.gyee.frame.model.custom.Tablepar;
+import com.gyee.frame.util.StringUtils;
+import lombok.SneakyThrows;
+import org.springframework.boot.SpringApplication;
+
+public class FaultKnowledgeTest {
+
+    @SneakyThrows
+    public static void main(String[] args) {
+
+        SpringApplication.run(SpringbootStart.class, args);
+
+
+
+        String wtId="MG01_03";
+        String wpId="MHS_FDC";
+        String year="2021";
+        String month="1";
+
+        String name="故障";
+        String halttype="fff";
+        String faultlevel="3";
+
+        FaultKnowledgeController faultKnowledgeController= SpringUtils.getBean("faultKnowledgeController");
+
+        Tablepar tablepar=new Tablepar();
+        tablepar.setPageNum(1);
+        tablepar.setPageSize(10);
+        tablepar.setOrderByColumn("halttype");
+        tablepar.setIsAsc("asc");
+
+
+        P3DeviceFault po=new P3DeviceFault();
+
+        po.setId(StringUtils.getUUID());
+        po.setHalttype("ccc");
+        po.setFaultlevel(3);
+        po.setDevicemodel("aaa");
+        po.setHalttype("bbb");
+
+        faultKnowledgeController.insertFaultknowledge(po);
+
+
+        AjaxResult result=faultKnowledgeController.findFaultknowledge(po.getId());
+
+        P3DeviceFault po2=(P3DeviceFault)result.get("data");
+
+        if(StringUtils.notEmp(po2))
+        {
+            po2.setHalttype("ddd");
+            po2.setFaultlevel(6);
+            po2.setDevicemodel("eee");
+            po2.setHalttype("fff");
+
+            faultKnowledgeController.updateFaultknowledge(po2);
+        }
+        AjaxResult ar = faultKnowledgeController.faultknowledgeList(tablepar,null,halttype,null);
+
+        PageInfo<P3DeviceFault> vos=(PageInfo<P3DeviceFault>)ar.get("data");
+
+
+        for(P3DeviceFault wtd:vos.getList())
+        {
+            System.out.println(wtd.getName()+"----------------"+wtd.getHalttype()
+                   +"----------------"+wtd.getFaultlevel()+"----------------"+wtd.getDevicemodel());
+        }
+
+
+        faultKnowledgeController.deleteFaultknowledge(po2.getId());
+
+    }
+}