Переглянути джерело

增加爆管分析模块,增加接口:设备状态列表、预警信息列表、预警信息清除

欧阳劲驰 3 місяців тому
батько
коміт
16f27535ae
21 змінених файлів з 1028 додано та 4 видалено
  1. 2 2
      pom.xml
  2. 56 0
      src/main/java/com/shkpr/service/alambizplugin/apiparam/PipeBustWarningInfoListParams.java
  3. 8 0
      src/main/java/com/shkpr/service/alambizplugin/constants/ApiURI.java
  4. 1 0
      src/main/java/com/shkpr/service/alambizplugin/constants/LogFlagBusiType.java
  5. 261 0
      src/main/java/com/shkpr/service/alambizplugin/controller/ApiPipeBurstController.java
  6. 7 0
      src/main/java/com/shkpr/service/alambizplugin/controllerfilter/third/ApiJWTBizFilterMgr.java
  7. 45 0
      src/main/java/com/shkpr/service/alambizplugin/controllerfilter/third/ApiJWTPipeBurstBizFilter.java
  8. 31 0
      src/main/java/com/shkpr/service/alambizplugin/dbdao/mapper/PipeBurstDeviceStatusMapper.java
  9. 60 0
      src/main/java/com/shkpr/service/alambizplugin/dbdao/mapper/PipeBurstWaringInfoMapper.java
  10. 1 1
      src/main/java/com/shkpr/service/alambizplugin/dbdao/services/GisSurveyLayerApplyThirdCopyServiceImpl.java
  11. 39 0
      src/main/java/com/shkpr/service/alambizplugin/dbdao/services/PipeBurstDeviceStatusServiceImpl.java
  12. 78 0
      src/main/java/com/shkpr/service/alambizplugin/dbdao/services/PipeBurstWaringInfoServiceImpl.java
  13. 20 0
      src/main/java/com/shkpr/service/alambizplugin/dbdao/services/intef/PipeBurstDeviceStatusService.java
  14. 29 0
      src/main/java/com/shkpr/service/alambizplugin/dbdao/services/intef/PipeBurstWaringInfoService.java
  15. 105 0
      src/main/java/com/shkpr/service/alambizplugin/dto/PageRequest.java
  16. 18 1
      src/main/java/com/shkpr/service/alambizplugin/dto/PageResponse.java
  17. 33 0
      src/main/java/com/shkpr/service/alambizplugin/dto/PipeBurstDeviceStatus.java
  18. 86 0
      src/main/java/com/shkpr/service/alambizplugin/dto/PipeBurstWaringInfo.java
  19. 37 0
      src/main/java/com/shkpr/service/alambizplugin/dto/PipeBurstWarningData.java
  20. 23 0
      src/main/resources/mapper/PipeBurstDeviceStatusMapper.xml
  21. 88 0
      src/main/resources/mapper/PipeBurstWaringInfoMapper.xml

+ 2 - 2
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>com.shkpr.service</groupId>
     <artifactId>v1-alam-biz-plugin</artifactId>
-    <version>1.1.0</version>
+    <version>1.2.0</version>
     <name>v1-alam-biz-plugin</name>
     <description>Demo project for Spring Boot</description>
 
@@ -385,7 +385,7 @@
 
     <build>
         <!-- 打成jar包的名称 -->
-        <finalName>v1-alam-biz-plugin-1.1.0</finalName>
+        <finalName>v1-alam-biz-plugin-1.2.0</finalName>
         <plugins>
             <!--运用SpringBoot 插件  使用spring-boot-devtools模块的应用,当classpath中的文件有改变时,会自动重启! -->
             <plugin>

+ 56 - 0
src/main/java/com/shkpr/service/alambizplugin/apiparam/PipeBustWarningInfoListParams.java

@@ -0,0 +1,56 @@
+package com.shkpr.service.alambizplugin.apiparam;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+/**
+ * 预警信息列表参数
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+@Getter
+@Setter
+public class PipeBustWarningInfoListParams {
+    /**
+     * 分页偏移量
+     */
+    private Integer offset = 0;
+    /**
+     * 分页条数
+     */
+    private Integer limit = 20;
+    /**
+     * 预警类型
+     */
+    private Short warnType;
+    /**
+     * 预警级别
+     */
+    private Short warnLevel;
+    /**
+     * 开始时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN", timezone = "Asia/Shanghai")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime startTime;
+    /**
+     * 结束时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN", timezone = "Asia/Shanghai")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime endTime;
+
+    /**
+     * 入参校验
+     *
+     * @return 校验状态
+     */
+    public boolean checkValid() {
+        return offset >= 0 && limit >= 0 && limit <= 200;
+    }
+}

+ 8 - 0
src/main/java/com/shkpr/service/alambizplugin/constants/ApiURI.java

@@ -41,6 +41,11 @@ public class ApiURI {
     public static final String URI_XXX_CRS_GET_LIST = "crs-get-list";
     public static final String URI_XXX_CRS_GET_INFO = "crs-get-info";
     public static final String URI_XXX_CRS_TRANSFORM = "crs-transform";
+
+    public static final String URI_XXX_DEVICE_STATUS_LIST = "device-status-list";
+    public static final String URI_XXX_WARING_INFO_LIST = "waring-info-list";
+    public static final String URI_XXX_WARING_INFO_REMOVE = "waring-info-remove";
+
     public static final String URI_XXX_TEMP_FILES = "temp-files";
     public static final String URI_XXX_ASYNC_RESULTS = "async-results";
 
@@ -53,6 +58,9 @@ public class ApiURI {
     public static final String URI_GIS_SURVEY_H = "/kpr-plugin/gis-survey";
     public static final String URI_GIS_SURVEY_XXX = URI_GIS_SURVEY_H + "/**";
 
+    public static final String URI_PIPE_BURST_H = "/kpr-plugin/pipe_burst";
+    public static final String URI_PIPE_BURST_XXX = URI_PIPE_BURST_H + "/**";
+
     public static final String URI_USERS_H = "/kpr-plugin/users";
     public static final String URI_USERS_XXX = URI_USERS_H + "/**";
 

+ 1 - 0
src/main/java/com/shkpr/service/alambizplugin/constants/LogFlagBusiType.java

@@ -39,6 +39,7 @@ public enum  LogFlagBusiType {
     BUSI_GIS_ANALY_STATS_REPORT(35, "Gis Analy Stats Report Biz"),
     BUSI_GIS_SURVEY_PROJECT_BIZ(36,"Gis Survey Project Biz"),
     BUSI_GIS_SURVEY(37,"Gis Survey Biz"),
+    BUSI_PIPE_BURST(38,"Pipe Burst Biz"),
 
     BUSI_INTERNAL(99,"Internal Busi"),
 

+ 261 - 0
src/main/java/com/shkpr/service/alambizplugin/controller/ApiPipeBurstController.java

@@ -0,0 +1,261 @@
+package com.shkpr.service.alambizplugin.controller;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.global.base.log.LogLevelFlag;
+import com.global.base.log.LogPrintMgr;
+import com.shkpr.service.alambizplugin.apiparam.PipeBustWarningInfoListParams;
+import com.shkpr.service.alambizplugin.commtools.CommTool;
+import com.shkpr.service.alambizplugin.constants.ApiURI;
+import com.shkpr.service.alambizplugin.constants.LogFlagBusiType;
+import com.shkpr.service.alambizplugin.constants.ResponseCode;
+import com.shkpr.service.alambizplugin.controllerfilter.TokenAuthenticationService;
+import com.shkpr.service.alambizplugin.controllervalid.CommonParamValidSK;
+import com.shkpr.service.alambizplugin.dbdao.services.intef.PipeBurstDeviceStatusService;
+import com.shkpr.service.alambizplugin.dbdao.services.intef.PipeBurstWaringInfoService;
+import com.shkpr.service.alambizplugin.dto.*;
+import com.shkpr.service.alambizplugin.exception.SelfException;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * 爆管分析controller
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+@RequestMapping(ApiURI.URI_PIPE_BURST_H)
+@RestController
+public class ApiPipeBurstController {
+
+    /**
+     * log
+     */
+    private final String mStrClassName;
+    private final String mBizType;
+    /**
+     * 计数器
+     */
+    private final AtomicInteger mSeqDeviceStatusListReq;
+
+    private final ObjectMapper objectMapper;
+    private final PipeBurstDeviceStatusService deviceStatusService;
+    private final PipeBurstWaringInfoService waringInfoService;
+
+    public ApiPipeBurstController(ObjectMapper objectMapper, PipeBurstDeviceStatusService deviceStatusService, PipeBurstWaringInfoService waringInfoService) {
+        mStrClassName = "ApiPipeBurstController";
+        mBizType = LogFlagBusiType.BUSI_PIPE_BURST.toStrValue();
+        this.mSeqDeviceStatusListReq = new AtomicInteger(0);
+        this.objectMapper = objectMapper;
+        this.deviceStatusService = deviceStatusService;
+        this.waringInfoService = waringInfoService;
+    }
+
+
+    /**
+     * 设备状态列表
+     *
+     * @param request       request
+     * @param strClientType 客户端类型
+     * @param strUserAgent  用户信息
+     * @param offset        偏移数据
+     * @param limit         分页大小
+     * @return 清除状态
+     */
+    @GetMapping(value = ApiURI.URI_XXX_DEVICE_STATUS_LIST)
+    public ResponseRes<String> deviceStatusList(HttpServletRequest request
+            , @RequestHeader(value = ApiURI.HEADER_CLIENT_TYPE, required = false) String strClientType
+            , @RequestHeader(value = ApiURI.HEADER_USER_AGENT, required = false) String strUserAgent
+            , @RequestParam(value = "offset", required = false, defaultValue = "0") Integer offset
+            , @RequestParam(value = "limit", required = false, defaultValue = "20") Integer limit) {
+        //入参校验
+        final String URI_PATH = request.getRequestURI();
+        final String strPlatform = CommTool.getPlatformByAgent(strClientType, strUserAgent);
+        final String strUserId = (String) request.getAttribute(TokenAuthenticationService.HEADER_USERID);
+
+        //begin
+        long llReqBefore = System.currentTimeMillis();
+        String strRunSeq = String.format("%d-%d", llReqBefore, mSeqDeviceStatusListReq.incrementAndGet());
+        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName, strUserId
+                , String.format("%s:%s seq:{%s} begin====>"
+                        , strPlatform
+                        , URI_PATH
+                        , strRunSeq));
+
+
+        //构建result
+        ResponseRes<String> resResult = new ResponseRes<>();
+        resResult.setRescode(ResponseCode.RESULT_BAD.toStrCode());
+        resResult.setResmsg(ResponseCode.RESULT_BAD.toStrMsg());
+
+        //查询
+        PageResponse<PipeBurstDeviceStatus> pageResponse = deviceStatusService.findAll(PageRequest.of(offset, limit));
+        resResult.setRescode(ResponseCode.RESULT_NORMAL.toStrCode());
+        resResult.setResmsg(ResponseCode.RESULT_NORMAL.toStrMsg());
+        String pageStr = null;
+        try {
+            if (pageResponse != null) pageStr = objectMapper.writeValueAsString(pageResponse);
+        } catch (JsonProcessingException e) {
+            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
+                    , String.format("Json序列化异常: error:%s", e));
+        }
+        resResult.setResdata(pageStr);
+
+        //end
+        resResult.setTimestamp(System.currentTimeMillis());
+        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName, strUserId
+                , String.format("%s:%s seq:{%s} rescode:{%s} resmsg:{%s} time:{%d ms} end<===="
+                        , strPlatform
+                        , URI_PATH
+                        , strRunSeq
+                        , resResult.getRescode()
+                        , resResult.getResmsg()
+                        , resResult.getTimestamp() - llReqBefore));
+        return resResult;
+    }
+
+    /**
+     * 预警信息列表
+     *
+     * @param request       request
+     * @param strClientType 客户端类型
+     * @param strUserAgent  用户信息
+     * @return 预警信息列表
+     * @throws SelfException selfException
+     */
+    @PostMapping(value = ApiURI.URI_XXX_WARING_INFO_LIST)
+    public ResponseRes<String> waringInfoList(HttpServletRequest request
+            , @RequestHeader(value = ApiURI.HEADER_CLIENT_TYPE, required = false) String strClientType
+            , @RequestHeader(value = ApiURI.HEADER_USER_AGENT, required = false) String strUserAgent
+            , @RequestBody(required = false) @Validated(value = {CommonParamValidSK.class}) PipeBustWarningInfoListParams oJsonParam
+            , BindingResult bindRes) throws Exception {
+        //入参校验
+        final String URI_PATH = request.getRequestURI();
+        final String strPlatform = CommTool.getPlatformByAgent(strClientType, strUserAgent);
+        final String strUserId = (String) request.getAttribute(TokenAuthenticationService.HEADER_USERID);
+        if (oJsonParam == null | bindRes.hasErrors() || !oJsonParam.checkValid()) {
+            throw new SelfException(ResponseCode.STATUS_ERROR_JSON_FORMAT.toStrCode()
+                    , String.format(ApiURI.EXCEPTION_FORMAT
+                    , strPlatform
+                    , URI_PATH
+                    , ResponseCode.STATUS_ERROR_JSON_FORMAT.toStrMsg()));
+        }
+
+        //begin
+        long llReqBefore = System.currentTimeMillis();
+        String strRunSeq = String.format("%d-%d", llReqBefore, mSeqDeviceStatusListReq.incrementAndGet());
+        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName, strUserId
+                , String.format("%s:%s seq:{%s} begin====>"
+                        , strPlatform
+                        , URI_PATH
+                        , strRunSeq));
+
+
+        //构建result
+        ResponseRes<String> resResult = new ResponseRes<>();
+        resResult.setRescode(ResponseCode.RESULT_BAD.toStrCode());
+        resResult.setResmsg(ResponseCode.RESULT_BAD.toStrMsg());
+
+        //查询
+        PageResponse<PipeBurstWaringInfo> pageResponse = waringInfoService.findAll(oJsonParam);
+        resResult.setRescode(ResponseCode.RESULT_NORMAL.toStrCode());
+        resResult.setResmsg(ResponseCode.RESULT_NORMAL.toStrMsg());
+        String pageStr = null;
+        try {
+            if (pageResponse != null) pageStr = objectMapper.writeValueAsString(pageResponse);
+        } catch (JsonProcessingException e) {
+            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
+                    , String.format("Json序列化异常: error:%s", e));
+        }
+        resResult.setResdata(pageStr);
+
+        //end
+        resResult.setTimestamp(System.currentTimeMillis());
+        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName, strUserId
+                , String.format("%s:%s seq:{%s} rescode:{%s} resmsg:{%s} time:{%d ms} end<===="
+                        , strPlatform
+                        , URI_PATH
+                        , strRunSeq
+                        , resResult.getRescode()
+                        , resResult.getResmsg()
+                        , resResult.getTimestamp() - llReqBefore));
+        return resResult;
+    }
+
+    /**
+     * 预警信息清除
+     *
+     * @param request       request
+     * @param strClientType 客户端类型
+     * @param strUserAgent  用户信息
+     * @param warnId        预警id
+     * @return 清除状态
+     * @throws SelfException selfException
+     */
+    @GetMapping(value = ApiURI.URI_XXX_WARING_INFO_REMOVE)
+    public ResponseRes<String> waringInfoRemove(HttpServletRequest request
+            , @RequestHeader(value = ApiURI.HEADER_CLIENT_TYPE, required = false) String strClientType
+            , @RequestHeader(value = ApiURI.HEADER_USER_AGENT, required = false) String strUserAgent
+            , @RequestParam(value = "warnId", required = false) String warnId) throws Exception {
+        //入参校验
+        final String URI_PATH = request.getRequestURI();
+        final String strPlatform = CommTool.getPlatformByAgent(strClientType, strUserAgent);
+        final String strUserId = (String) request.getAttribute(TokenAuthenticationService.HEADER_USERID);
+        if (StringUtils.isAnyBlank(warnId) || StringUtils.length(warnId) > 64) {
+            throw new SelfException(ResponseCode.STATUS_ERROR_PARAM_FORMAT.toStrCode()
+                    , String.format(ApiURI.EXCEPTION_FORMAT
+                    , strPlatform
+                    , URI_PATH
+                    , ResponseCode.STATUS_ERROR_PARAM_FORMAT.toStrMsg()));
+        }
+
+        //begin
+        long llReqBefore = System.currentTimeMillis();
+        String strRunSeq = String.format("%d-%d", llReqBefore, mSeqDeviceStatusListReq.incrementAndGet());
+        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName, strUserId
+                , String.format("%s:%s seq:{%s} param:%s begin====>"
+                        , strPlatform
+                        , URI_PATH
+                        , strRunSeq
+                        , warnId));
+
+
+        //构建result
+        ResponseRes<String> resResult = new ResponseRes<>();
+        resResult.setRescode(ResponseCode.RESULT_BAD.toStrCode());
+        resResult.setResmsg(ResponseCode.RESULT_BAD.toStrMsg());
+
+        //查询
+        Boolean removed = waringInfoService.remove(warnId);
+        if (removed != null && removed) {
+            resResult.setRescode(ResponseCode.RESULT_NORMAL.toStrCode());
+            resResult.setResmsg(ResponseCode.RESULT_NORMAL.toStrMsg());
+            String pageStr = null;
+            try {
+                pageStr = objectMapper.writeValueAsString(true);
+            } catch (JsonProcessingException e) {
+                LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
+                        , String.format("Json序列化异常: error:%s", e));
+            }
+            resResult.setResdata(pageStr);
+        }
+
+
+        //end
+        resResult.setTimestamp(System.currentTimeMillis());
+        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName, strUserId
+                , String.format("%s:%s seq:{%s} rescode:{%s} resmsg:{%s} time:{%d ms} end<===="
+                        , strPlatform
+                        , URI_PATH
+                        , strRunSeq
+                        , resResult.getRescode()
+                        , resResult.getResmsg()
+                        , resResult.getTimestamp() - llReqBefore));
+        return resResult;
+    }
+}

+ 7 - 0
src/main/java/com/shkpr/service/alambizplugin/controllerfilter/third/ApiJWTBizFilterMgr.java

@@ -17,10 +17,12 @@ public class ApiJWTBizFilterMgr extends JWTAuthenticationFilter {
     private RequestMatcher mRequestMatcherForUser = null;
     private RequestMatcher mRequestMatcherForCommon = null;
     private RequestMatcher mRequestMatcherForGisSurvey = null;
+    private RequestMatcher mRequestMatcherForPipeBurst = null;
 
     private ApiJWTUserBizFilter mFilterForUser = null;
     private ApiJWTCommonBizFilter mFilterForCommon = null;
     private ApiJWTGisSurveyBizFilter mFilterForGisSurvey = null;
+    private ApiJWTPipeBurstBizFilter mFilterForPipeBurst = null;
 
     public ApiJWTBizFilterMgr(AuthenticationManager authenticationManager) {
         this(null, authenticationManager);
@@ -33,10 +35,12 @@ public class ApiJWTBizFilterMgr extends JWTAuthenticationFilter {
         mRequestMatcherForUser = new AntPathRequestMatcher(ApiURI.URI_USERS_XXX);
         mRequestMatcherForCommon = new AntPathRequestMatcher(ApiURI.URI_COMMON_XXX);
         mRequestMatcherForGisSurvey = new AntPathRequestMatcher(ApiURI.URI_GIS_SURVEY_XXX);
+        mRequestMatcherForPipeBurst = new AntPathRequestMatcher(ApiURI.URI_PIPE_BURST_XXX);
 
         mFilterForUser = new ApiJWTUserBizFilter(ApiURI.URI_USERS_XXX, authenticationManager);
         mFilterForCommon = new ApiJWTCommonBizFilter(ApiURI.URI_COMMON_XXX, authenticationManager);
         mFilterForGisSurvey = new ApiJWTGisSurveyBizFilter(ApiURI.URI_GIS_SURVEY_XXX, authenticationManager);
+        mFilterForPipeBurst = new ApiJWTPipeBurstBizFilter(ApiURI.URI_PIPE_BURST_XXX, authenticationManager);
         //setControllerCheck(null);
     }
 
@@ -53,6 +57,9 @@ public class ApiJWTBizFilterMgr extends JWTAuthenticationFilter {
             }else if (mRequestMatcherForGisSurvey != null && mRequestMatcherForGisSurvey.matches(request)){
                 TraceLogMgr.setTraceIdByBusinessType("GIS.SURVEY");
                 mFilterForGisSurvey.doFilterInternal(request, response, chain);
+            } else if (mRequestMatcherForPipeBurst!= null && mRequestMatcherForPipeBurst.matches(request)){
+                TraceLogMgr.setTraceIdByBusinessType("PIPE.BURST");
+                mFilterForPipeBurst.doFilterInternal(request, response, chain);
             }
             else {
                 TraceLogMgr.setTraceIdByBusinessType("OTH");

+ 45 - 0
src/main/java/com/shkpr/service/alambizplugin/controllerfilter/third/ApiJWTPipeBurstBizFilter.java

@@ -0,0 +1,45 @@
+package com.shkpr.service.alambizplugin.controllerfilter.third;
+
+import com.shkpr.service.alambizplugin.constants.ApiURI;
+import com.shkpr.service.alambizplugin.controllercheck.ApiUserControllerCheck;
+import com.shkpr.service.alambizplugin.controllercheck.JWTControllerCheck;
+import com.shkpr.service.alambizplugin.controllerfilter.JWTAuthenticationFilter;
+import org.springframework.security.authentication.AuthenticationManager;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ApiJWTPipeBurstBizFilter extends JWTAuthenticationFilter {
+    private JWTControllerCheck mControllerCheck = null;
+    private static final Map<String, String> msMapURI2Method;
+    static {
+        msMapURI2Method = new HashMap<String, String>();
+        msMapURI2Method.put(String.format("%s/%s", ApiURI.URI_PIPE_BURST_H, ApiURI.URI_XXX_DEVICE_STATUS_LIST), "GET");
+        msMapURI2Method.put(String.format("%s/%s", ApiURI.URI_PIPE_BURST_H, ApiURI.URI_XXX_WARING_INFO_LIST), "POST");
+        msMapURI2Method.put(String.format("%s/%s", ApiURI.URI_PIPE_BURST_H, ApiURI.URI_XXX_WARING_INFO_REMOVE), "GET");
+    }
+
+    public ApiJWTPipeBurstBizFilter(String url, AuthenticationManager authenticationManager){
+        super(url, authenticationManager);
+        this.mStrThisSampleName = this.getClass().getSimpleName();
+        this.mControllerCheck = new ApiUserControllerCheck(msMapURI2Method);
+        setControllerCheck(this.mControllerCheck);
+    }
+
+    public ApiJWTPipeBurstBizFilter(AuthenticationManager authenticationManager){
+        super(authenticationManager);
+        this.mStrThisSampleName = this.getClass().getSimpleName();
+        this.mControllerCheck = new ApiUserControllerCheck(msMapURI2Method);
+        setControllerCheck(this.mControllerCheck);
+    }
+
+    @Override
+    public void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {
+        super.doFilterInternal(request, response, chain);
+    }
+}

+ 31 - 0
src/main/java/com/shkpr/service/alambizplugin/dbdao/mapper/PipeBurstDeviceStatusMapper.java

@@ -0,0 +1,31 @@
+package com.shkpr.service.alambizplugin.dbdao.mapper;
+
+import com.shkpr.service.alambizplugin.dto.PipeBurstDeviceStatus;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
+
+import java.util.List;
+
+/**
+ * 爆管设备状态mapper
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+@Mapper
+public interface PipeBurstDeviceStatusMapper {
+    /**
+     * 查询全部
+     *
+     * @return 预警信息集合
+     */
+    List<PipeBurstDeviceStatus> findAll(@Param("pageable") Pageable pageable);
+
+    /**
+     * 获取总数
+     *
+     * @return 总数
+     */
+    Long count();
+}

+ 60 - 0
src/main/java/com/shkpr/service/alambizplugin/dbdao/mapper/PipeBurstWaringInfoMapper.java

@@ -0,0 +1,60 @@
+package com.shkpr.service.alambizplugin.dbdao.mapper;
+
+import com.shkpr.service.alambizplugin.dto.PipeBurstWaringInfo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * 爆管预警信息mapper
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+@Mapper
+public interface PipeBurstWaringInfoMapper {
+    /**
+     * 查询全部
+     *
+     * @param pageable  分页
+     * @param warnType  预警类型
+     * @param warnLevel 预警级别
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @return 预警信息集合
+     */
+    List<PipeBurstWaringInfo> findByWarnTypeAndWarnLevelAndWarnTime(
+            @Param("pageable") Pageable pageable,
+            @Param("warnType") Short warnType,
+            @Param("warnLevel") Short warnLevel,
+            @Param("startTime") LocalDateTime startTime,
+            @Param("endTime") LocalDateTime endTime
+    );
+
+    /**
+     * 获取总数
+     *
+     * @param warnType  预警类型
+     * @param warnLevel 预警级别
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @return 总数
+     */
+    Long countByWarnTypeAndWarnLevelAndWarnTime(
+            @Param("warnType") Short warnType,
+            @Param("warnLevel") Short warnLevel,
+            @Param("startTime") LocalDateTime startTime,
+            @Param("endTime") LocalDateTime endTime
+    );
+
+    /**
+     * 根据预警id逻辑删除
+     *
+     * @param warnId 预警id
+     * @return 删除状态
+     */
+    int removeById(@Param("warnId") String warnId);
+}

+ 1 - 1
src/main/java/com/shkpr/service/alambizplugin/dbdao/services/GisSurveyLayerApplyThirdCopyServiceImpl.java

@@ -139,6 +139,6 @@ public class GisSurveyLayerApplyThirdCopyServiceImpl implements GisSurveyLayerAp
     public PageResponse<GisSurveyLayerApplyThirdCopy> findByJobId(String jobId, Pageable pageable) {
         List<GisSurveyLayerApplyThirdCopy> content = layerApplyThirdCopyMapper.findByJobId(jobId, pageable);
         long total = layerApplyThirdCopyMapper.countByJobId(jobId);
-        return new PageResponse<>(content, total);
+        return PageResponse.of(content, total);
     }
 }

+ 39 - 0
src/main/java/com/shkpr/service/alambizplugin/dbdao/services/PipeBurstDeviceStatusServiceImpl.java

@@ -0,0 +1,39 @@
+package com.shkpr.service.alambizplugin.dbdao.services;
+
+import com.shkpr.service.alambizplugin.dbdao.mapper.PipeBurstDeviceStatusMapper;
+import com.shkpr.service.alambizplugin.dbdao.services.intef.PipeBurstDeviceStatusService;
+import com.shkpr.service.alambizplugin.dto.PageResponse;
+import com.shkpr.service.alambizplugin.dto.PipeBurstDeviceStatus;
+import org.springframework.data.domain.Pageable;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 爆管设备service实现
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+@Service
+public class PipeBurstDeviceStatusServiceImpl implements PipeBurstDeviceStatusService {
+    final
+    PipeBurstDeviceStatusMapper deviceStatusMapper;
+
+    public PipeBurstDeviceStatusServiceImpl(PipeBurstDeviceStatusMapper deviceStatusMapper) {
+        this.deviceStatusMapper = deviceStatusMapper;
+    }
+
+    /**
+     * 查询全部
+     *
+     * @return 预警信息集合
+     */
+    @Override
+    public PageResponse<PipeBurstDeviceStatus> findAll(Pageable pageable) {
+        //查询数据和条数
+        List<PipeBurstDeviceStatus> data = deviceStatusMapper.findAll(pageable);
+        Long total = deviceStatusMapper.count();
+        return PageResponse.of(data, total, pageable);
+    }
+}

+ 78 - 0
src/main/java/com/shkpr/service/alambizplugin/dbdao/services/PipeBurstWaringInfoServiceImpl.java

@@ -0,0 +1,78 @@
+package com.shkpr.service.alambizplugin.dbdao.services;
+
+import com.shkpr.service.alambizplugin.apiparam.PipeBustWarningInfoListParams;
+import com.shkpr.service.alambizplugin.commtools.GeomUtil;
+import com.shkpr.service.alambizplugin.dbdao.mapper.PipeBurstWaringInfoMapper;
+import com.shkpr.service.alambizplugin.dbdao.services.intef.PipeBurstWaringInfoService;
+import com.shkpr.service.alambizplugin.dto.PageRequest;
+import com.shkpr.service.alambizplugin.dto.PageResponse;
+import com.shkpr.service.alambizplugin.dto.PipeBurstWaringInfo;
+import org.locationtech.jts.geom.Point;
+import org.locationtech.jts.geom.Polygon;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 爆管预警信息service实现
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+@Service
+public class PipeBurstWaringInfoServiceImpl implements PipeBurstWaringInfoService {
+    final
+    PipeBurstWaringInfoMapper waringInfoMapper;
+
+    public PipeBurstWaringInfoServiceImpl(PipeBurstWaringInfoMapper waringInfoMapper) {
+        this.waringInfoMapper = waringInfoMapper;
+    }
+
+    /**
+     * 查询全部
+     *
+     * @param params 预警信息列表参数
+     * @return 预警信息集合
+     */
+    @Override
+    public PageResponse<PipeBurstWaringInfo> findAll(PipeBustWarningInfoListParams params) {
+        //查询数据
+        List<PipeBurstWaringInfo> data = waringInfoMapper.findByWarnTypeAndWarnLevelAndWarnTime(
+                        PageRequest.of(params.getOffset(), params.getLimit()),
+                        params.getWarnType(),
+                        params.getWarnLevel(),
+                        params.getStartTime(),
+                        params.getEndTime()
+                ).stream()
+                //设置范围gis
+                .peek(waringInfo -> {
+                    //获取中心点gis
+                    Point centerGis = waringInfo.getCenterGis();
+                    //创建圆
+                    Polygon circle = GeomUtil.createCircle(
+                            centerGis.getCoordinate(),
+                            waringInfo.getWarnRange(),
+                            "4490"
+                    );
+                    //设置预警范围gis
+                    waringInfo.setWarnRangeGis(circle);
+                }).collect(Collectors.toList());
+        //查询条数
+        Long total = waringInfoMapper.countByWarnTypeAndWarnLevelAndWarnTime(params.getWarnType(), params.getWarnLevel(),
+                params.getStartTime(), params.getEndTime());
+
+        return PageResponse.of(data, total, PageRequest.of(params.getOffset(), params.getLimit()));
+    }
+
+    /**
+     * 根据预警id逻辑删除
+     *
+     * @param warnId 预警id
+     * @return 删除状态
+     */
+    @Override
+    public Boolean remove(String warnId) {
+        return waringInfoMapper.removeById(warnId) > 0;
+    }
+}

+ 20 - 0
src/main/java/com/shkpr/service/alambizplugin/dbdao/services/intef/PipeBurstDeviceStatusService.java

@@ -0,0 +1,20 @@
+package com.shkpr.service.alambizplugin.dbdao.services.intef;
+
+import com.shkpr.service.alambizplugin.dto.PageResponse;
+import com.shkpr.service.alambizplugin.dto.PipeBurstDeviceStatus;
+import org.springframework.data.domain.Pageable;
+
+/**
+ * 爆管设备service
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+public interface PipeBurstDeviceStatusService {
+    /**
+     * 查询全部
+     *
+     * @return 预警信息集合
+     */
+    PageResponse<PipeBurstDeviceStatus> findAll(Pageable pageable);
+}

+ 29 - 0
src/main/java/com/shkpr/service/alambizplugin/dbdao/services/intef/PipeBurstWaringInfoService.java

@@ -0,0 +1,29 @@
+package com.shkpr.service.alambizplugin.dbdao.services.intef;
+
+import com.shkpr.service.alambizplugin.apiparam.PipeBustWarningInfoListParams;
+import com.shkpr.service.alambizplugin.dto.PageResponse;
+import com.shkpr.service.alambizplugin.dto.PipeBurstWaringInfo;
+
+/**
+ * 爆管预警信息service
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+public interface PipeBurstWaringInfoService {
+    /**
+     * 查询全部
+     *
+     * @param params 预警信息列表参数
+     * @return 预警信息集合
+     */
+    PageResponse<PipeBurstWaringInfo> findAll(PipeBustWarningInfoListParams params);
+
+    /**
+     * 逻辑删除
+     *
+     * @param warnId 预警id
+     * @return 删除状态
+     */
+    Boolean remove(String warnId);
+}

+ 105 - 0
src/main/java/com/shkpr/service/alambizplugin/dto/PageRequest.java

@@ -0,0 +1,105 @@
+package com.shkpr.service.alambizplugin.dto;
+
+import lombok.NonNull;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
+
+public class PageRequest implements Pageable {
+    /**
+     * 跳过条数
+     */
+    private final int offset;
+    /**
+     * 分页条数
+     */
+    private final int limit;
+
+    public PageRequest(int offset, int limit) {
+        if (offset < 0) throw new IllegalArgumentException("Page offset must not be less than zero!");
+        if (limit < 1) throw new IllegalArgumentException("Page size must not be less than one!");
+        if (limit > 200) throw new IllegalArgumentException("Page size must not be greater than 200!");
+
+        this.offset = offset;
+        this.limit = limit;
+    }
+
+    /**
+     * 创建未排序的请求页
+     *
+     * @param offset 跳过条数
+     * @param limit  页面条数
+     * @since 2.0
+     */
+    public static PageRequest of(int offset, int limit) {
+        return new PageRequest(offset, limit);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int getPageNumber() {
+        return offset / limit;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int getPageSize() {
+        return this.limit;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public long getOffset() {
+        return this.offset;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @NonNull
+    public Sort getSort() {
+        return Sort.unsorted();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @NonNull
+    public Pageable next() {
+        return new PageRequest(offset + limit, limit);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @NonNull
+    public Pageable previousOrFirst() {
+        int prevOffset = Math.max(offset - limit, 0);
+        return new PageRequest(prevOffset, limit);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @NonNull
+    public Pageable first() {
+        return new PageRequest(0, limit);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean hasPrevious() {
+        return offset > 0;
+    }
+}

+ 18 - 1
src/main/java/com/shkpr/service/alambizplugin/dto/PageResponse.java

@@ -2,6 +2,7 @@ package com.shkpr.service.alambizplugin.dto;
 
 import lombok.AllArgsConstructor;
 import lombok.Data;
+import org.springframework.data.domain.Pageable;
 
 import java.util.List;
 
@@ -17,9 +18,25 @@ public class PageResponse<T> {
     /**
      * 内容
      */
-    private List<T> content;
+    private List<T> data;
     /**
      * 数量
      */
     private Long total;
+    /**
+     * 跳过条数
+     */
+    private Integer offset;
+    /**
+     * 分页条数
+     */
+    private Integer limit;
+
+    public static <T> PageResponse<T> of(List<T> data, Long total) {
+        return new PageResponse<>(data, total, null, null);
+    }
+
+    public static <T> PageResponse<T> of(List<T> data, Long total, Pageable pageable) {
+        return new PageResponse<>(data, total, (int) pageable.getOffset(), pageable.getPageSize());
+    }
 }

+ 33 - 0
src/main/java/com/shkpr/service/alambizplugin/dto/PipeBurstDeviceStatus.java

@@ -0,0 +1,33 @@
+package com.shkpr.service.alambizplugin.dto;
+
+import lombok.Data;
+
+/**
+ * 爆管设备状态
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+@Data
+public class PipeBurstDeviceStatus {
+    /**
+     * 设备ID
+     */
+    private String devId;
+    /**
+     * 设备类型
+     */
+    private String devType;
+    /**
+     * 设备状态
+     */
+    private Short devStatus;
+    /**
+     * 设备状态名称
+     */
+    private String devStatusName;
+    /**
+     * 设备名称
+     */
+    private String devName;
+}

+ 86 - 0
src/main/java/com/shkpr/service/alambizplugin/dto/PipeBurstWaringInfo.java

@@ -0,0 +1,86 @@
+package com.shkpr.service.alambizplugin.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.shkpr.service.alambizplugin.controllerserializer.GeometryDeserializer;
+import com.shkpr.service.alambizplugin.controllerserializer.GeometrySerializer;
+import lombok.Data;
+import org.locationtech.jts.geom.Point;
+import org.locationtech.jts.geom.Polygon;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * 爆管预警信息
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+@Data
+public class PipeBurstWaringInfo {
+    /**
+     * 预警ID
+     */
+    private String warnId;
+    /**
+     * 预警类型
+     */
+    private Short warnType;
+    /**
+     * 预警类型
+     */
+    private String warnTypeName;
+    /**
+     * 预警级别(0-无风险,1-低风险,2-中风险,3-高风险)
+     */
+    private Short warnLevel;
+    /**
+     * 中心点经度
+     */
+    private Double centerLng;
+    /**
+     * 中心点纬度
+     */
+    private Double centerLat;
+    /**
+     * 中心gis
+     */
+    @JsonSerialize(using = GeometrySerializer.class)
+    @JsonDeserialize(using = GeometryDeserializer.class)
+    private Point centerGis;
+    /**
+     * 预警位置名称
+     */
+    private String centerAddress;
+    /**
+     * 预警范围(米)
+     */
+    private Double warnRange;
+    /**
+     * 预警范围gis
+     */
+    @JsonSerialize(using = GeometrySerializer.class)
+    @JsonDeserialize(using = GeometryDeserializer.class)
+    private Polygon warnRangeGis;
+    /**
+     * 预警时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN", timezone = "Asia/Shanghai")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime warnTime;
+    /**
+     * 预警分析
+     */
+    private String message;
+    /**
+     * 删除标志(0-未删除,1-已删除)
+     */
+    private Short deleted;
+    /**
+     * 预警数据集合
+     */
+    private List<PipeBurstWarningData> warningDates;
+}

+ 37 - 0
src/main/java/com/shkpr/service/alambizplugin/dto/PipeBurstWarningData.java

@@ -0,0 +1,37 @@
+package com.shkpr.service.alambizplugin.dto;
+
+import lombok.Data;
+
+/**
+ * 爆管预警数据
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+@Data
+public class PipeBurstWarningData {
+    /**
+     * 预警ID
+     */
+    private String warnId;
+    /**
+     * 设备ID
+     */
+    private String devId;
+    /**
+     * 设备类型
+     */
+    private String devType;
+    /**
+     * 设备名称
+     */
+    private String devName;
+    /**
+     * 预警值
+     */
+    private Double value;
+    /**
+     * 预警值单位
+     */
+    private String unit;
+}

+ 23 - 0
src/main/resources/mapper/PipeBurstDeviceStatusMapper.xml

@@ -0,0 +1,23 @@
+<?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.shkpr.service.alambizplugin.dbdao.mapper.PipeBurstDeviceStatusMapper">
+    <resultMap id="BaseResultMap" type="com.shkpr.service.alambizplugin.dto.PipeBurstDeviceStatus">
+        <!--@Table k1_pgn_pb_device_status-->
+        <result column="dev_id" property="devId" jdbcType="VARCHAR"/>
+        <result column="dev_type" property="devType" jdbcType="INTEGER"/>
+        <result column="dev_status" property="devStatus" jdbcType="INTEGER"/>
+        <result column="dev_status_name" property="devStatusName" jdbcType="VARCHAR"/>
+        <result column="dev_name" property="devName" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <select id="findAll" resultMap="BaseResultMap">
+        select dev_id, dev_type, dev_status, des.name as dev_status_name, dev_name
+        from k1_pgn_pb_device_status ds
+                 left join k1_pgn_pb_define_equipment_status des on ds.dev_status = des.code
+    </select>
+
+    <select id="count" resultType="java.lang.Long">
+        select count(1)
+        from k1_pgn_pb_device_status
+    </select>
+</mapper>

+ 88 - 0
src/main/resources/mapper/PipeBurstWaringInfoMapper.xml

@@ -0,0 +1,88 @@
+<?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.shkpr.service.alambizplugin.dbdao.mapper.PipeBurstWaringInfoMapper">
+    <resultMap id="BaseResultMap" type="com.shkpr.service.alambizplugin.dto.PipeBurstWaringInfo">
+        <!--@Table k1_pgn_pb_device_status-->
+        <result property="warnId" column="warn_id"/>
+        <result property="warnType" column="warn_type"/>
+        <result property="warnTypeName" column="warn_type_name"/>
+        <result property="warnLevel" column="warn_level"/>
+        <result property="centerLng" column="center_lng"/>
+        <result property="centerLat" column="center_lat"/>
+        <result property="centerGis" column="center_gis"
+                typeHandler="com.shkpr.service.alambizplugin.dbdao.pgtype.GeomPointTypeHandlePg"/>
+        <result property="centerAddress" column="center_address"/>
+        <result property="warnRange" column="warn_range"/>
+        <result property="warnTime" column="warn_time"/>
+        <result property="message" column="message"/>
+        <collection property="warningDates" ofType="com.shkpr.service.alambizplugin.dto.PipeBurstWarningData">
+            <result property="warnId" column="wd_warn_id" jdbcType="VARCHAR"/>
+            <result property="devId" column="wd_dev_id" jdbcType="VARCHAR"/>
+            <result property="devType" column="wd_dev_type" jdbcType="VARCHAR"/>
+            <result property="devName" column="wd_dev_name" jdbcType="VARCHAR"/>
+            <result property="value" column="wd_value" jdbcType="DECIMAL"/>
+            <result property="unit" column="wd_unit" jdbcType="VARCHAR"/>
+        </collection>
+    </resultMap>
+
+    <select id="findByWarnTypeAndWarnLevelAndWarnTime" resultMap="BaseResultMap">
+        select wi.warn_id,
+        wi.warn_type,
+        wi.warn_level,
+        wi.center_lng,
+        wi.center_lat,
+        concat('[', wi.center_lng, ',', wi.center_lat, ']') as center_gis,
+        wi.center_address,
+        wi.warn_range,
+        wi.warn_time,
+        wi.message,
+        dwt.name as warn_type_name,
+        wd.warn_id as wd_warn_id,
+        wd.dev_id as wd_dev_id,
+        wd.dev_type as wd_dev_type,
+        wd.dev_name as wd_dev_name,
+        wd.value as wd_value,
+        wd.unit as wd_unit
+        from k1_pgn_pb_warning_info wi
+        left join k1_pgn_pb_define_warning_type dwt on wi.warn_type = dwt.code
+        left join k1_pgn_pb_warning_data wd on wi.warn_id = wd.warn_id
+        <where>
+            deleted = 0
+            <if test="startTime != null and endTime != null">
+                and warn_time &gt;= #{startTime,jdbcType=TIMESTAMP}
+                and warn_time &lt;= #{endTime,jdbcType=TIMESTAMP}
+            </if>
+            <if test="warnType !=null">
+                and warn_type = #{warnType,jdbcType=SMALLINT}
+            </if>
+            <if test="warnLevel !=null">
+                and warn_level = #{warnLevel,jdbcType=SMALLINT}
+            </if>
+        </where>
+        limit #{pageable.pageSize} offset #{pageable.offset}
+    </select>
+
+    <select id="countByWarnTypeAndWarnLevelAndWarnTime" resultType="java.lang.Long">
+        select count(1)
+        from k1_pgn_pb_warning_info wi
+        <where>
+            deleted = 0
+            <if test="startTime != null and endTime != null">
+                and warn_time &gt;= #{startTime,jdbcType=TIMESTAMP}
+                and warn_time &lt;= #{endTime,jdbcType=TIMESTAMP}
+            </if>
+            <if test="warnType !=null">
+                and warn_type = #{warnType,jdbcType=SMALLINT}
+            </if>
+            <if test="warnLevel !=null">
+                and warn_level = #{warnLevel,jdbcType=SMALLINT}
+            </if>
+        </where>
+    </select>
+
+    <update id="removeById">
+        update k1_pgn_pb_warning_info
+        set deleted = 1
+        where warn_id = #{warnId,jdbcType=VARCHAR}
+    </update>
+</mapper>