Browse Source

1.添加 风险预警模型 等相关持久层功能
2.RiskModel,RiskModeRule,RiskSnap,RiskHistory
3.新版诊断报告列表查询 增加时间区间,关键字 等参数

wanghs 2 years ago
parent
commit
de89aedb80
25 changed files with 363 additions and 1 deletions
  1. 6 1
      warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/controller/EarlyReportController.java
  2. 34 0
      warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/entity/RiskHistory.java
  3. 56 0
      warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/entity/RiskModel.java
  4. 43 0
      warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/entity/RiskModelRule.java
  5. 60 0
      warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/entity/RiskSnap.java
  6. 14 0
      warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/RiskHistoryMapper.java
  7. 14 0
      warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/RiskModelMapper.java
  8. 14 0
      warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/RiskModelRuleMapper.java
  9. 14 0
      warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/RiskSnapMapper.java
  10. 15 0
      warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/service/RiskHistoryService.java
  11. 15 0
      warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/service/RiskModelRuleService.java
  12. 15 0
      warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/service/RiskModelService.java
  13. 15 0
      warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/service/RiskSnapService.java
  14. 4 0
      warning-web/src/main/resources/mappers-oracle/RiskHistoryMapper.xml
  15. 4 0
      warning-web/src/main/resources/mappers-oracle/RiskModelMapper.xml
  16. 4 0
      warning-web/src/main/resources/mappers-oracle/RiskModelRuleMapper.xml
  17. 4 0
      warning-web/src/main/resources/mappers-oracle/RiskSnapMapper.xml
  18. 4 0
      warning-web/src/main/resources/mappers-postgresql/RiskHistoryMapper.xml
  19. 4 0
      warning-web/src/main/resources/mappers-postgresql/RiskModelMapper.xml
  20. 4 0
      warning-web/src/main/resources/mappers-postgresql/RiskModelRuleMapper.xml
  21. 4 0
      warning-web/src/main/resources/mappers-postgresql/RiskSnapMapper.xml
  22. 4 0
      warning-web/src/main/resources/mappers/RiskHistoryMapper.xml
  23. 4 0
      warning-web/src/main/resources/mappers/RiskModelMapper.xml
  24. 4 0
      warning-web/src/main/resources/mappers/RiskModelRuleMapper.xml
  25. 4 0
      warning-web/src/main/resources/mappers/RiskSnapMapper.xml

+ 6 - 1
warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/controller/EarlyReportController.java

@@ -32,7 +32,12 @@ public class EarlyReportController {
     public ResponseWrapper getReportList(
             @Parameter(name = "pagenum", description = "当前页") @RequestParam(value = "pagenum") Integer pageNum,
             @Parameter(name = "pagesize", description = "分页大小") @RequestParam(value = "pagesize") Integer pageSize,
-            @Parameter(name = "pagesize", description = "场站id") @RequestParam(value = "stationid", required = false) String stationid) {
+            @Parameter(name = "pagesize", description = "场站id") @RequestParam(value = "stationid", required = false) String stationid,
+            @Parameter(name = "keyword", description = "关键字")   @RequestParam(value = "keyword",required = false) String keyWord,
+            @Parameter(name = "starttime", description = "起始时间")  @RequestParam(value = "starttime", required = false) String startTime,
+            @Parameter(name = "endtime", description = "结束时间")   @RequestParam(value = "endtime", required = false) String endTime
+
+    ) {
 
         Page<EarlyReport> page = new Page<EarlyReport>(pageNum,pageSize);
 

+ 34 - 0
warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/entity/RiskHistory.java

@@ -0,0 +1,34 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @description:
+ * @auther: Wanghs
+ * @date: 2022-09-06
+ */
+
+@Data
+@TableName("RISKHISTORY")
+public class RiskHistory implements Serializable {
+
+    @TableId
+    private String id;
+
+    //riskSnap 表id
+    @TableField("SNAPID")
+    private String snapId;
+
+    //风险触发时间
+    @TableField("RISKTIME")
+    private Date riskTime;
+    //触发信息  冗余字段
+    @TableField("DATAINFO")
+    private String dataInfo;
+}

+ 56 - 0
warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/entity/RiskModel.java

@@ -0,0 +1,56 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @description:
+ * @auther: Wanghs
+ * @date: 2022-09-06
+ */
+@Data
+@Accessors(chain = true)
+@TableName("RISKMODEL")
+public class RiskModel  implements Serializable {
+
+    @TableId
+    private String id;
+
+    //模型名称
+    @TableField("NAME")
+    private String name;
+
+    //模型描述
+    @TableField("DESCRIPTION")
+    private  String description;
+
+    //计算时间窗口
+    @TableField("ROLLINGPERIOD")
+    private int rollingPeriod;
+
+    //风机型号
+    @TableField("MODEL")
+    private String model;
+
+    //风场id
+    @TableField("WINDPOWERSTATIONID")
+    private String windpowerstationId;
+
+    //模型所属部件
+    @TableField("PARTS")
+    private String parts;
+
+    //模型风险等级
+    @TableField("RANK")
+    private int rank;
+
+    @TableField(exist = false)
+    private List<RiskModelRule> ruleList;
+
+}

+ 43 - 0
warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/entity/RiskModelRule.java

@@ -0,0 +1,43 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @auther: Wanghs
+ * @date: 2022-09-06
+ */
+@Data
+@Accessors(chain = true)
+@TableName("RISKMODELRULE")
+public class RiskModelRule implements Serializable {
+
+    @TableId
+    private String id;
+
+    //规则类型  custom 自定义  windturbine 风机原始报警
+    @TableField("RULETYPE")
+    private String ruleType;
+
+    //规则id
+    @TableField("RULEID")
+    private String ruleId;
+
+    //次数阈值
+    @TableField("COUNT")
+    private int count;
+
+    //保持时间
+    @TableField("KEEPTIME")
+    private int keepTime;
+
+    //模型主表id
+    @TableField("RISKMODELID")
+    private String riskModelId;
+}

+ 60 - 0
warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/entity/RiskSnap.java

@@ -0,0 +1,60 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @description:
+ * @auther: Wanghs
+ * @date: 2022-09-06
+ */
+@Data
+@Accessors(chain = true)
+@TableName("RISKSNAP")
+public class RiskSnap  implements Serializable {
+
+    @TableId
+    private String id;
+
+    //名称
+    @TableField("NAME")
+    private String name;
+
+    //描述
+    @TableField("DESCRIPTION")
+    private String description;
+
+    //级别
+    @TableField("RANK")
+    private int rank;
+
+    //风机id
+    @TableField("WINDTURBINEID")
+    private String windturbineId;
+
+    //风场id
+    @TableField("WINDPOWERSTATIONID")
+    private String windpowerstationId;
+
+    //风场名称
+    @TableField("WINDPOWERSTATIONNAME")
+    private String windpowerstationName;
+
+    //是否开启
+    @TableField("OPENED")
+    private boolean opened;
+
+    //所属部件
+    @TableField("PARTS")
+    private String parts;
+
+    //最后更新时间
+    @TableField("LASTUPDATETIME")
+    private Date lastUpdateTime;
+}

+ 14 - 0
warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/RiskHistoryMapper.java

@@ -0,0 +1,14 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.RiskHistory;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @description:
+ * @auther: Wanghs
+ * @date: 2022-09-06
+ */
+@Mapper
+public interface RiskHistoryMapper extends BaseMapper<RiskHistory> {
+}

+ 14 - 0
warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/RiskModelMapper.java

@@ -0,0 +1,14 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.RiskModel;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @description:
+ * @auther: Wanghs
+ * @date: 2022-09-06
+ */
+@Mapper
+public interface RiskModelMapper extends BaseMapper<RiskModel> {
+}

+ 14 - 0
warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/RiskModelRuleMapper.java

@@ -0,0 +1,14 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.RiskModelRule;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @description:
+ * @auther: Wanghs
+ * @date: 2022-09-06
+ */
+@Mapper
+public interface RiskModelRuleMapper extends BaseMapper<RiskModelRule> {
+}

+ 14 - 0
warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/RiskSnapMapper.java

@@ -0,0 +1,14 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.RiskSnap;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @description:
+ * @auther: Wanghs
+ * @date: 2022-09-06
+ */
+@Mapper
+public interface RiskSnapMapper extends BaseMapper<RiskSnap> {
+}

+ 15 - 0
warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/service/RiskHistoryService.java

@@ -0,0 +1,15 @@
+package com.gyee.wisdom.alarm.sharding.service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.wisdom.alarm.sharding.entity.RiskHistory;
+import com.gyee.wisdom.alarm.sharding.mapper.RiskHistoryMapper;
+import org.springframework.stereotype.Service;
+
+/**
+ * @description:
+ * @auther: Wanghs
+ * @date: 2022-09-06
+ */
+@Service
+public class RiskHistoryService  extends ServiceImpl<RiskHistoryMapper, RiskHistory> {
+}

+ 15 - 0
warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/service/RiskModelRuleService.java

@@ -0,0 +1,15 @@
+package com.gyee.wisdom.alarm.sharding.service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.wisdom.alarm.sharding.entity.RiskModelRule;
+import com.gyee.wisdom.alarm.sharding.mapper.RiskModelRuleMapper;
+import org.springframework.stereotype.Service;
+
+/**
+ * @description:
+ * @auther: Wanghs
+ * @date: 2022-09-06
+ */
+@Service
+public class RiskModelRuleService extends ServiceImpl<RiskModelRuleMapper, RiskModelRule> {
+}

+ 15 - 0
warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/service/RiskModelService.java

@@ -0,0 +1,15 @@
+package com.gyee.wisdom.alarm.sharding.service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.wisdom.alarm.sharding.entity.RiskModel;
+import com.gyee.wisdom.alarm.sharding.mapper.RiskModelMapper;
+import org.springframework.stereotype.Service;
+
+/**
+ * @description:
+ * @auther: Wanghs
+ * @date: 2022-09-06
+ */
+@Service
+public class RiskModelService extends ServiceImpl<RiskModelMapper, RiskModel> {
+}

+ 15 - 0
warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/service/RiskSnapService.java

@@ -0,0 +1,15 @@
+package com.gyee.wisdom.alarm.sharding.service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.wisdom.alarm.sharding.entity.RiskSnap;
+import com.gyee.wisdom.alarm.sharding.mapper.RiskSnapMapper;
+import org.springframework.stereotype.Service;
+
+/**
+ * @description:
+ * @auther: Wanghs
+ * @date: 2022-09-06
+ */
+@Service
+public class RiskSnapService extends ServiceImpl<RiskSnapMapper, RiskSnap> {
+}

+ 4 - 0
warning-web/src/main/resources/mappers-oracle/RiskHistoryMapper.xml

@@ -0,0 +1,4 @@
+<?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.wisdom.alarm.sharding.mapper.RiskHistoryMapper">
+</mapper>

+ 4 - 0
warning-web/src/main/resources/mappers-oracle/RiskModelMapper.xml

@@ -0,0 +1,4 @@
+<?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.wisdom.alarm.sharding.mapper.RiskModelMapper">
+</mapper>

+ 4 - 0
warning-web/src/main/resources/mappers-oracle/RiskModelRuleMapper.xml

@@ -0,0 +1,4 @@
+<?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.wisdom.alarm.sharding.mapper.RiskModelRuleMapper">
+</mapper>

+ 4 - 0
warning-web/src/main/resources/mappers-oracle/RiskSnapMapper.xml

@@ -0,0 +1,4 @@
+<?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.wisdom.alarm.sharding.mapper.RiskSnapMapper">
+</mapper>

+ 4 - 0
warning-web/src/main/resources/mappers-postgresql/RiskHistoryMapper.xml

@@ -0,0 +1,4 @@
+<?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.wisdom.alarm.sharding.mapper.RiskHistoryMapper">
+</mapper>

+ 4 - 0
warning-web/src/main/resources/mappers-postgresql/RiskModelMapper.xml

@@ -0,0 +1,4 @@
+<?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.wisdom.alarm.sharding.mapper.RiskModelMapper">
+</mapper>

+ 4 - 0
warning-web/src/main/resources/mappers-postgresql/RiskModelRuleMapper.xml

@@ -0,0 +1,4 @@
+<?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.wisdom.alarm.sharding.mapper.RiskModelRuleMapper">
+</mapper>

+ 4 - 0
warning-web/src/main/resources/mappers-postgresql/RiskSnapMapper.xml

@@ -0,0 +1,4 @@
+<?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.wisdom.alarm.sharding.mapper.RiskSnapMapper">
+</mapper>

+ 4 - 0
warning-web/src/main/resources/mappers/RiskHistoryMapper.xml

@@ -0,0 +1,4 @@
+<?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.wisdom.alarm.sharding.mapper.RiskHistoryMapper">
+</mapper>

+ 4 - 0
warning-web/src/main/resources/mappers/RiskModelMapper.xml

@@ -0,0 +1,4 @@
+<?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.wisdom.alarm.sharding.mapper.RiskModelMapper">
+</mapper>

+ 4 - 0
warning-web/src/main/resources/mappers/RiskModelRuleMapper.xml

@@ -0,0 +1,4 @@
+<?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.wisdom.alarm.sharding.mapper.RiskModelRuleMapper">
+</mapper>

+ 4 - 0
warning-web/src/main/resources/mappers/RiskSnapMapper.xml

@@ -0,0 +1,4 @@
+<?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.wisdom.alarm.sharding.mapper.RiskSnapMapper">
+</mapper>