移动代码

This commit is contained in:
huangzj
2023-05-25 11:06:33 +08:00
parent 2fcbd9bc37
commit e169fe55a6
178 changed files with 9625 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
package com.njcn.warn;
package com.njcn.cswarn;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;

View File

@@ -0,0 +1,62 @@
package com.njcn.cswarn.controller.alarm;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.cswarn.service.CsEquipmentAlarmPOService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmAddParm;
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmPageParm;
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
/**
* Description:
* Date: 2023/5/16 16:33【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Slf4j
@RestController
@RequestMapping("/EquipmentAlarm")
@Api(tags = "设备警告")
@AllArgsConstructor
public class CsEquipmentAlarmController extends BaseController {
private final CsEquipmentAlarmPOService csEquipmentAlarmPOService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/add")
@ApiOperation("新增设备警告")
@ApiImplicitParam(name = "csEquipmentAlarmAddParm", value = "新增设备警告参数", required = true)
public HttpResult<CsEquipmentAlarmVO> add(@RequestBody @Validated CsEquipmentAlarmAddParm csEquipmentAlarmAddParm){
String methodDescribe = getMethodDescribe("add");
CsEquipmentAlarmVO csEquipmentAlarmVO = csEquipmentAlarmPOService.add (csEquipmentAlarmAddParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csEquipmentAlarmVO, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPage")
@ApiOperation("设备警告分页查询")
@ApiImplicitParam(name = "csEquipmentAlarmPageParm", value = "设备警告查询参数", required = true)
public HttpResult<IPage<CsEquipmentAlarmVO>> queryPage(@RequestBody @Validated CsEquipmentAlarmPageParm csEquipmentAlarmPageParm ){
String methodDescribe = getMethodDescribe("queryPage");
IPage<CsEquipmentAlarmVO> page = csEquipmentAlarmPOService.queryPage (csEquipmentAlarmPageParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
}

View File

@@ -0,0 +1,48 @@
package com.njcn.cswarn.controller.alarm;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.cswarn.service.CsEventDetailPOService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.njcn.cswarn.pojo.parm.CsEventDetailPageParm;
import com.njcn.cswarn.pojo.vo.CsEventDetailVO;
/**
* (cs_event_detail)表控制层
*
* @author xxxxx
*/
@Slf4j
@RestController
@RequestMapping("/EventAlarm")
@Api(tags = "暂态警告")
@AllArgsConstructor
public class CsEventDetailPOController extends BaseController {
private final CsEventDetailPOService csEventDetailPOService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPage")
@ApiOperation("暂态警告分页查询")
@ApiImplicitParam(name = "csEventDetailPageParm", value = "暂态警告查询参数", required = true)
public HttpResult<IPage<CsEventDetailVO>> queryPage(@RequestBody @Validated CsEventDetailPageParm csEventDetailPageParm ){
String methodDescribe = getMethodDescribe("queryPage");
IPage<CsEventDetailVO> page = csEventDetailPOService.queryPage (csEventDetailPageParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
}

View File

@@ -0,0 +1,49 @@
package com.njcn.cswarn.controller.alarm;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.cswarn.service.CsStatLimitRateDPOService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.njcn.cswarn.pojo.parm.CsStatLimitRatePageParm;
import com.njcn.cswarn.pojo.vo.CsStatLimitRateDVO;
/**
* (cs_stat_limit_rate_d)表控制层
*
* @author xxxxx
*/
@Slf4j
@RestController
@RequestMapping("/LimitRateAlarm")
@Api(tags = "稳态警告")
@AllArgsConstructor
public class CsStatLimitRateDPOController extends BaseController {
private final CsStatLimitRateDPOService csStatLimitRateDPOService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPage")
@ApiOperation("设备模板分页查询")
@ApiImplicitParam(name = "csStatLimitRatePageParm", value = "设备警告查询参数", required = true)
public HttpResult<IPage<CsStatLimitRateDVO>> queryPage(@RequestBody @Validated CsStatLimitRatePageParm csStatLimitRatePageParm ){
String methodDescribe = getMethodDescribe("queryPage");
IPage<CsStatLimitRateDVO> page = csStatLimitRateDPOService.queryPage (csStatLimitRatePageParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
}

View File

@@ -0,0 +1,14 @@
package com.njcn.cswarn.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.cswarn.pojo.po.CsEquipmentAlarmPO;
/**
* Description:
* Date: 2023/5/16 16:25【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEquipmentAlarmPOMapper extends BaseMapper<CsEquipmentAlarmPO> {
}

View File

@@ -0,0 +1,19 @@
package com.njcn.cswarn.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import com.njcn.cswarn.pojo.parm.CsEventDetailPageParm;
import com.njcn.cswarn.pojo.po.CsEventDetailPO;
import com.njcn.cswarn.pojo.vo.CsEventDetailVO;
/**
* Description:
* Date: 2023/5/17 10:51【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEventDetailPOMapper extends BaseMapper<CsEventDetailPO> {
Page<CsEventDetailVO> queryPage(Page<CsEventDetailVO> returnpage, @Param("csEventDetailPageParm") CsEventDetailPageParm csEventDetailPageParm);
}

View File

@@ -0,0 +1,20 @@
package com.njcn.cswarn.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import com.njcn.cswarn.pojo.parm.CsStatLimitRatePageParm;
import com.njcn.cswarn.pojo.po.CsStatLimitRateDPO;
import com.njcn.cswarn.pojo.vo.CsStatLimitRateDVO;
/**
*
* Description:
* Date: 2023/5/17 13:45【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsStatLimitRateDPOMapper extends BaseMapper<CsStatLimitRateDPO> {
Page<CsStatLimitRateDVO> queryPage(Page<CsStatLimitRateDVO> returnpage, @Param("csStatLimitRatePageParm") CsStatLimitRatePageParm csStatLimitRatePageParm);
}

View File

@@ -0,0 +1,25 @@
<?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.njcn.cswarn.mapper.CsEquipmentAlarmPOMapper">
<resultMap id="BaseResultMap" type="com.njcn.cswarn.pojo.po.CsEquipmentAlarmPO">
<!--@mbg.generated-->
<!--@Table cs_equipment_alarm-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="equipment_id" jdbcType="VARCHAR" property="equipmentId" />
<result column="alarm_msg" jdbcType="VARCHAR" property="alarmMsg" />
<result column="alarm_level" jdbcType="VARCHAR" property="alarmLevel" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="status" jdbcType="BIT" property="status" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, project_id, equipment_id, alarm_msg, alarm_level, start_time, end_time, `status`,
create_by, create_time, update_by, update_time
</sql>
</mapper>

View File

@@ -0,0 +1,72 @@
<?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.njcn.cswarn.mapper.CsEventDetailPOMapper">
<resultMap id="BaseResultMap" type="com.njcn.cswarn.pojo.po.CsEventDetailPO">
<!--@mbg.generated-->
<!--@Table cs_event_detail-->
<id column="event_id" jdbcType="CHAR" property="eventId" />
<result column="measurement_point_id" jdbcType="VARCHAR" property="measurementPointId" />
<result column="event_type" jdbcType="CHAR" property="eventType" />
<result column="advance_reason" jdbcType="CHAR" property="advanceReason" />
<result column="advance_type" jdbcType="CHAR" property="advanceType" />
<result column="eventass_index" jdbcType="VARCHAR" property="eventassIndex" />
<result column="dq_time" jdbcType="DOUBLE" property="dqTime" />
<result column="deal_time" jdbcType="TIMESTAMP" property="dealTime" />
<result column="num" jdbcType="INTEGER" property="num" />
<result column="file_flag" jdbcType="BIT" property="fileFlag" />
<result column="deal_flag" jdbcType="BIT" property="dealFlag" />
<result column="first_time" jdbcType="TIMESTAMP" property="firstTime" />
<result column="first_type" jdbcType="VARCHAR" property="firstType" />
<result column="first_ms" jdbcType="DECIMAL" property="firstMs" />
<result column="energy" jdbcType="DOUBLE" property="energy" />
<result column="severity" jdbcType="DOUBLE" property="severity" />
<result column="sagsource" jdbcType="VARCHAR" property="sagsource" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="duration" jdbcType="DECIMAL" property="duration" />
<result column="feature_amplitude" jdbcType="DECIMAL" property="featureAmplitude" />
<result column="phase" jdbcType="VARCHAR" property="phase" />
<result column="event_describe" jdbcType="VARCHAR" property="eventDescribe" />
<result column="wave_path" jdbcType="VARCHAR" property="wavePath" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="transient_value" jdbcType="DOUBLE" property="transientValue" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
event_id, measurement_point_id, event_type, advance_reason, advance_type, eventass_index,
dq_time, deal_time, num, file_flag, deal_flag, first_time, first_type, first_ms,
energy, severity, sagsource, start_time, duration, feature_amplitude, phase, event_describe,
wave_path, create_time, transient_value
</sql>
<select id="queryPage" resultType="com.njcn.cswarn.pojo.vo.CsEventDetailVO">
SELECT
temp.*, cs.*
FROM
cs_event_detail cs
INNER JOIN (
SELECT
a.line_id,
a. NAME line_name,
c.id project_id,
c. NAME project_name
FROM
cs_line a,
cs_project_equipment b,
cs_project c
WHERE
1 = 1
AND c.id = b.project_id
AND b.equipment_id = a.dev_id
<if test="csEventDetailPageParm.projectId != null and csEventDetailPageParm.projectId != ''">
AND c.id = #{csEventDetailPageParm.projectId }
</if>
) temp ON cs.measurement_point_id = temp.line_id
where 1=1
<if test="csEventDetailPageParm.startTime != null and csEventDetailPageParm.startTime != ''">
AND cs.start_time &gt;= #{csEventDetailPageParm.startTime }
</if>
<if test="csEventDetailPageParm.endTime != null and csEventDetailPageParm.endTime != ''">
AND cs.start_time &lt;= #{csEventDetailPageParm.endTime }
</if>
</select>
</mapper>

View File

@@ -0,0 +1,133 @@
<?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.njcn.cswarn.mapper.CsStatLimitRateDPOMapper">
<resultMap id="BaseResultMap" type="com.njcn.cswarn.pojo.po.CsStatLimitRateDPO">
<!--@mbg.generated-->
<!--@Table cs_stat_limit_rate_d-->
<id column="time_id" jdbcType="TIMESTAMP" property="timeId" />
<id column="my_index" jdbcType="VARCHAR" property="myIndex" />
<id column="phasic_type" jdbcType="VARCHAR" property="phasicType" />
<result column="all_time" jdbcType="INTEGER" property="allTime" />
<result column="flicker_all_time" jdbcType="INTEGER" property="flickerAllTime" />
<result column="freq_dev_overtime" jdbcType="INTEGER" property="freqDevOvertime" />
<result column="voltage_dev_overtime" jdbcType="INTEGER" property="voltageDevOvertime" />
<result column="ubalance_overtime" jdbcType="INTEGER" property="ubalanceOvertime" />
<result column="flicker_overtime" jdbcType="INTEGER" property="flickerOvertime" />
<result column="uaberrance_overtime" jdbcType="INTEGER" property="uaberranceOvertime" />
<result column="uharm_2_overtime" jdbcType="INTEGER" property="uharm2Overtime" />
<result column="uharm_3_overtime" jdbcType="INTEGER" property="uharm3Overtime" />
<result column="uharm_4_overtime" jdbcType="INTEGER" property="uharm4Overtime" />
<result column="uharm_5_overtime" jdbcType="INTEGER" property="uharm5Overtime" />
<result column="uharm_6_overtime" jdbcType="INTEGER" property="uharm6Overtime" />
<result column="uharm_7_overtime" jdbcType="INTEGER" property="uharm7Overtime" />
<result column="uharm_8_overtime" jdbcType="INTEGER" property="uharm8Overtime" />
<result column="uharm_9_overtime" jdbcType="INTEGER" property="uharm9Overtime" />
<result column="uharm_10_overtime" jdbcType="INTEGER" property="uharm10Overtime" />
<result column="uharm_11_overtime" jdbcType="INTEGER" property="uharm11Overtime" />
<result column="uharm_12_overtime" jdbcType="INTEGER" property="uharm12Overtime" />
<result column="uharm_13_overtime" jdbcType="INTEGER" property="uharm13Overtime" />
<result column="uharm_14_overtime" jdbcType="INTEGER" property="uharm14Overtime" />
<result column="uharm_15_overtime" jdbcType="INTEGER" property="uharm15Overtime" />
<result column="uharm_16_overtime" jdbcType="INTEGER" property="uharm16Overtime" />
<result column="uharm_17_overtime" jdbcType="INTEGER" property="uharm17Overtime" />
<result column="uharm_18_overtime" jdbcType="INTEGER" property="uharm18Overtime" />
<result column="uharm_19_overtime" jdbcType="INTEGER" property="uharm19Overtime" />
<result column="uharm_20_overtime" jdbcType="INTEGER" property="uharm20Overtime" />
<result column="uharm_21_overtime" jdbcType="INTEGER" property="uharm21Overtime" />
<result column="uharm_22_overtime" jdbcType="INTEGER" property="uharm22Overtime" />
<result column="uharm_23_overtime" jdbcType="INTEGER" property="uharm23Overtime" />
<result column="uharm_24_overtime" jdbcType="INTEGER" property="uharm24Overtime" />
<result column="uharm_25_overtime" jdbcType="INTEGER" property="uharm25Overtime" />
<result column="iharm_2_overtime" jdbcType="INTEGER" property="iharm2Overtime" />
<result column="iharm_3_overtime" jdbcType="INTEGER" property="iharm3Overtime" />
<result column="iharm_4_overtime" jdbcType="INTEGER" property="iharm4Overtime" />
<result column="iharm_5_overtime" jdbcType="INTEGER" property="iharm5Overtime" />
<result column="iharm_6_overtime" jdbcType="INTEGER" property="iharm6Overtime" />
<result column="iharm_7_overtime" jdbcType="INTEGER" property="iharm7Overtime" />
<result column="iharm_8_overtime" jdbcType="INTEGER" property="iharm8Overtime" />
<result column="iharm_9_overtime" jdbcType="INTEGER" property="iharm9Overtime" />
<result column="iharm_10_overtime" jdbcType="INTEGER" property="iharm10Overtime" />
<result column="iharm_11_overtime" jdbcType="INTEGER" property="iharm11Overtime" />
<result column="iharm_12_overtime" jdbcType="INTEGER" property="iharm12Overtime" />
<result column="iharm_13_overtime" jdbcType="INTEGER" property="iharm13Overtime" />
<result column="iharm_14_overtime" jdbcType="INTEGER" property="iharm14Overtime" />
<result column="iharm_15_overtime" jdbcType="INTEGER" property="iharm15Overtime" />
<result column="iharm_16_overtime" jdbcType="INTEGER" property="iharm16Overtime" />
<result column="iharm_17_overtime" jdbcType="INTEGER" property="iharm17Overtime" />
<result column="iharm_18_overtime" jdbcType="INTEGER" property="iharm18Overtime" />
<result column="iharm_19_overtime" jdbcType="INTEGER" property="iharm19Overtime" />
<result column="iharm_20_overtime" jdbcType="INTEGER" property="iharm20Overtime" />
<result column="iharm_21_overtime" jdbcType="INTEGER" property="iharm21Overtime" />
<result column="iharm_22_overtime" jdbcType="INTEGER" property="iharm22Overtime" />
<result column="iharm_23_overtime" jdbcType="INTEGER" property="iharm23Overtime" />
<result column="iharm_24_overtime" jdbcType="INTEGER" property="iharm24Overtime" />
<result column="iharm_25_overtime" jdbcType="INTEGER" property="iharm25Overtime" />
<result column="inuharm_1_overtime" jdbcType="INTEGER" property="inuharm1Overtime" />
<result column="inuharm_2_overtime" jdbcType="INTEGER" property="inuharm2Overtime" />
<result column="inuharm_3_overtime" jdbcType="INTEGER" property="inuharm3Overtime" />
<result column="inuharm_4_overtime" jdbcType="INTEGER" property="inuharm4Overtime" />
<result column="inuharm_5_overtime" jdbcType="INTEGER" property="inuharm5Overtime" />
<result column="inuharm_6_overtime" jdbcType="INTEGER" property="inuharm6Overtime" />
<result column="inuharm_7_overtime" jdbcType="INTEGER" property="inuharm7Overtime" />
<result column="inuharm_8_overtime" jdbcType="INTEGER" property="inuharm8Overtime" />
<result column="inuharm_9_overtime" jdbcType="INTEGER" property="inuharm9Overtime" />
<result column="inuharm_10_overtime" jdbcType="INTEGER" property="inuharm10Overtime" />
<result column="inuharm_11_overtime" jdbcType="INTEGER" property="inuharm11Overtime" />
<result column="inuharm_12_overtime" jdbcType="INTEGER" property="inuharm12Overtime" />
<result column="inuharm_13_overtime" jdbcType="INTEGER" property="inuharm13Overtime" />
<result column="inuharm_14_overtime" jdbcType="INTEGER" property="inuharm14Overtime" />
<result column="inuharm_15_overtime" jdbcType="INTEGER" property="inuharm15Overtime" />
<result column="inuharm_16_overtime" jdbcType="INTEGER" property="inuharm16Overtime" />
<result column="i_neg_overtime" jdbcType="INTEGER" property="iNegOvertime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
time_id, my_index, phasic_type, all_time, flicker_all_time, freq_dev_overtime, voltage_dev_overtime,
ubalance_overtime, flicker_overtime, uaberrance_overtime, uharm_2_overtime, uharm_3_overtime,
uharm_4_overtime, uharm_5_overtime, uharm_6_overtime, uharm_7_overtime, uharm_8_overtime,
uharm_9_overtime, uharm_10_overtime, uharm_11_overtime, uharm_12_overtime, uharm_13_overtime,
uharm_14_overtime, uharm_15_overtime, uharm_16_overtime, uharm_17_overtime, uharm_18_overtime,
uharm_19_overtime, uharm_20_overtime, uharm_21_overtime, uharm_22_overtime, uharm_23_overtime,
uharm_24_overtime, uharm_25_overtime, iharm_2_overtime, iharm_3_overtime, iharm_4_overtime,
iharm_5_overtime, iharm_6_overtime, iharm_7_overtime, iharm_8_overtime, iharm_9_overtime,
iharm_10_overtime, iharm_11_overtime, iharm_12_overtime, iharm_13_overtime, iharm_14_overtime,
iharm_15_overtime, iharm_16_overtime, iharm_17_overtime, iharm_18_overtime, iharm_19_overtime,
iharm_20_overtime, iharm_21_overtime, iharm_22_overtime, iharm_23_overtime, iharm_24_overtime,
iharm_25_overtime, inuharm_1_overtime, inuharm_2_overtime, inuharm_3_overtime, inuharm_4_overtime,
inuharm_5_overtime, inuharm_6_overtime, inuharm_7_overtime, inuharm_8_overtime, inuharm_9_overtime,
inuharm_10_overtime, inuharm_11_overtime, inuharm_12_overtime, inuharm_13_overtime,
inuharm_14_overtime, inuharm_15_overtime, inuharm_16_overtime, i_neg_overtime
</sql>
<select id="queryPage" resultType="com.njcn.cswarn.pojo.vo.CsStatLimitRateDVO">
SELECT
temp.*, cs.*
FROM
cs_stat_limit_rate_d cs
INNER JOIN (
SELECT
a.line_id,
a. NAME line_name,
c.id project_id,
c. NAME project_name
FROM
cs_line a,
cs_project_equipment b,
cs_project c
WHERE
1 = 1
AND c.id = b.project_id
AND b.equipment_id = a.dev_id
<if test="csStatLimitRatePageParm.projectId != null and csStatLimitRatePageParm.projectId != ''">
AND c.id = #{csStatLimitRatePageParm.projectId }
</if>
) temp ON cs.my_index = temp.line_id
where 1=1
<if test="csStatLimitRatePageParm.startTime != null and csStatLimitRatePageParm.startTime != ''">
AND cs.time_id &gt;= #{csStatLimitRatePageParm.startTime }
</if>
<if test="csStatLimitRatePageParm.endTime != null and csStatLimitRatePageParm.endTime != ''">
AND cs.time_id &lt;= #{csStatLimitRatePageParm.endTime }
</if>
</select>
</mapper>

View File

@@ -0,0 +1,31 @@
package com.njcn.cswarn.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmAddParm;
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmPageParm;
import com.njcn.cswarn.pojo.po.CsEquipmentAlarmPO;
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
/**
*
* Description:
* Date: 2023/5/16 16:24【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEquipmentAlarmPOService extends IService<CsEquipmentAlarmPO>{
/**
* @Description: 新增设备警告
* @Param:
* @return: com.njcn.algorithm.pojo.vo.CsEquipmentAlarmVO
* @Author: clam
* @Date: 2023/5/17
*/
CsEquipmentAlarmVO add(CsEquipmentAlarmAddParm csEquipmentAlarmAddParm);
IPage<CsEquipmentAlarmVO> queryPage(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm);
}

View File

@@ -0,0 +1,22 @@
package com.njcn.cswarn.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.cswarn.pojo.parm.CsEventDetailPageParm;
import com.njcn.cswarn.pojo.po.CsEventDetailPO;
import com.njcn.cswarn.pojo.vo.CsEventDetailVO;
/**
*
* Description:
* Date: 2023/5/17 10:49【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEventDetailPOService extends IService<CsEventDetailPO>{
IPage<CsEventDetailVO> queryPage(CsEventDetailPageParm csEventDetailPageParm);
}

View File

@@ -0,0 +1,22 @@
package com.njcn.cswarn.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.cswarn.pojo.parm.CsStatLimitRatePageParm;
import com.njcn.cswarn.pojo.po.CsStatLimitRateDPO;
import com.njcn.cswarn.pojo.vo.CsStatLimitRateDVO;
/**
*
* Description:
* Date: 2023/5/17 13:45【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsStatLimitRateDPOService extends IService<CsStatLimitRateDPO>{
IPage<CsStatLimitRateDVO> queryPage(CsStatLimitRatePageParm csStatLimitRatePageParm);
}

View File

@@ -0,0 +1,115 @@
package com.njcn.cswarn.service.impl;
import com.alibaba.cloud.commons.lang.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.csdevice.api.AppProjectFeignClient;
import com.njcn.csdevice.api.EquipmentFeignClient;
import com.njcn.csdevice.pojo.po.AppProjectPO;
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
import com.njcn.cswarn.mapper.CsEquipmentAlarmPOMapper;
import com.njcn.cswarn.service.CsEquipmentAlarmPOService;
import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.enums.DicDataTypeEnum;
import com.njcn.system.pojo.po.DictData;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmAddParm;
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmPageParm;
import com.njcn.cswarn.pojo.po.CsEquipmentAlarmPO;
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static java.util.stream.Collectors.toList;
/**
*
* Description:
* Date: 2023/5/16 16:24【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class CsEquipmentAlarmPOServiceImpl extends ServiceImpl<CsEquipmentAlarmPOMapper, CsEquipmentAlarmPO> implements CsEquipmentAlarmPOService {
private final EquipmentFeignClient equipmentFeignClient;
private final AppProjectFeignClient appProjectFeignClient;
private final DicDataFeignClient dicDataFeignClient;
@Override
@Transactional(rollbackFor = {Exception.class})
public CsEquipmentAlarmVO add(CsEquipmentAlarmAddParm csEquipmentAlarmAddParm) {
CsEquipmentAlarmPO csEquipmentAlarmPO = new CsEquipmentAlarmPO();
BeanUtils.copyProperties(csEquipmentAlarmAddParm,csEquipmentAlarmPO);
csEquipmentAlarmPO.setStatus("1");
this.save(csEquipmentAlarmPO);
CsEquipmentAlarmVO csEquipmentAlarmVO = new CsEquipmentAlarmVO();
List<CsEquipmentDeliveryPO> data = equipmentFeignClient.queryDeviceById(Stream.of(csEquipmentAlarmAddParm.getEquipmentId()).collect(toList())).getData();
List<AppProjectPO> data1 = appProjectFeignClient.queryProjectById(Stream.of(csEquipmentAlarmAddParm.getProjectId()).collect(toList())).getData();
List<DictData> data3 = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.ALARM_TYPE.getCode()).getData();
Map<String, String> collect3 = data.stream().collect(Collectors.toMap(CsEquipmentDeliveryPO::getId, CsEquipmentDeliveryPO::getName));
Map<String, String> collect4 = data1.stream().collect(Collectors.toMap(AppProjectPO::getId, AppProjectPO::getName));
Map<String, String> collect5 = data3.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
csEquipmentAlarmVO.setEquipmentName(collect3.get(csEquipmentAlarmAddParm.getEquipmentId()));
csEquipmentAlarmVO.setAlarmLevelName(collect4.get(csEquipmentAlarmAddParm.getAlarmLevel()));
csEquipmentAlarmVO.setProjectName(collect5.get(csEquipmentAlarmAddParm.getProjectId()));
log.info("新增设备警告:{}", csEquipmentAlarmVO.toString());
return csEquipmentAlarmVO;
}
@Override
public IPage<CsEquipmentAlarmVO> queryPage(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm) {
Page<CsEquipmentAlarmVO> returnpage = new Page<> (csEquipmentAlarmPageParm.getCurrentPage ( ), csEquipmentAlarmPageParm.getPageSize ( ));
Page<CsEquipmentAlarmPO> queryPage = new Page<> (csEquipmentAlarmPageParm.getCurrentPage ( ), csEquipmentAlarmPageParm.getPageSize ( ));
QueryWrapper<CsEquipmentAlarmPO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status", "1");
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmPageParm.getProjectId()),CsEquipmentAlarmPO.COL_PROJECT_ID,csEquipmentAlarmPageParm.getProjectId());
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmPageParm.getEquipmentId()),CsEquipmentAlarmPO.COL_EQUIPMENT_ID,csEquipmentAlarmPageParm.getEquipmentId());
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmPageParm.getAlarmLevel()),CsEquipmentAlarmPO.COL_ALARM_LEVEL,csEquipmentAlarmPageParm.getAlarmLevel());
queryWrapper.ge(Objects.nonNull(csEquipmentAlarmPageParm.getStartTime()),CsEquipmentAlarmPO.COL_START_TIME,csEquipmentAlarmPageParm.getStartTime());
queryWrapper.le(Objects.nonNull(csEquipmentAlarmPageParm.getStartTime()),CsEquipmentAlarmPO.COL_START_TIME,csEquipmentAlarmPageParm.getEndTime());
queryWrapper.orderByDesc("create_time");
Page<CsEquipmentAlarmPO> csEquipmentAlarmPOPage = this.getBaseMapper().selectPage(queryPage, queryWrapper);
List<String> collect1 = csEquipmentAlarmPOPage.getRecords().stream().map(CsEquipmentAlarmPO::getProjectId).distinct().collect(toList());
List<String> collect2 = csEquipmentAlarmPOPage.getRecords().stream().map(CsEquipmentAlarmPO::getEquipmentId).distinct().collect(toList());
List<CsEquipmentDeliveryPO> data = equipmentFeignClient.queryDeviceById(collect2).getData();
List<AppProjectPO> data1 = appProjectFeignClient.queryProjectById(collect1).getData();
List<DictData> data3 = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.ALARM_TYPE.getCode()).getData();
Map<String, String> collect3 = data.stream().collect(Collectors.toMap(CsEquipmentDeliveryPO::getId, CsEquipmentDeliveryPO::getName));
Map<String, String> collect4 = data1.stream().collect(Collectors.toMap(AppProjectPO::getId, AppProjectPO::getName));
Map<String, String> collect5 = data3.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
List<CsEquipmentAlarmVO> collect = csEquipmentAlarmPOPage.getRecords().stream().map(temp -> {
CsEquipmentAlarmVO csEquipmentAlarmVO = new CsEquipmentAlarmVO();
csEquipmentAlarmVO.setEquipmentName(collect3.get(temp.getEquipmentId()));
csEquipmentAlarmVO.setAlarmLevelName(collect4.get(temp.getAlarmLevel()));
csEquipmentAlarmVO.setProjectName(collect5.get(temp.getProjectId()));
return csEquipmentAlarmVO;
}).collect(toList());
returnpage.setRecords(collect);
return returnpage;
}
}

View File

@@ -0,0 +1,34 @@
package com.njcn.cswarn.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.cswarn.mapper.CsEventDetailPOMapper;
import com.njcn.cswarn.service.CsEventDetailPOService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.njcn.cswarn.pojo.parm.CsEventDetailPageParm;
import com.njcn.cswarn.pojo.po.CsEventDetailPO;
import com.njcn.cswarn.pojo.vo.CsEventDetailVO;
/**
*
* Description:
* Date: 2023/5/17 10:49【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class CsEventDetailPOServiceImpl extends ServiceImpl<CsEventDetailPOMapper, CsEventDetailPO> implements CsEventDetailPOService {
@Override
public IPage<CsEventDetailVO> queryPage(CsEventDetailPageParm csEventDetailPageParm) {
Page<CsEventDetailVO> returnpage = new Page<> (csEventDetailPageParm.getCurrentPage ( ), csEventDetailPageParm.getPageSize ( ));
returnpage = this.getBaseMapper().queryPage(returnpage,csEventDetailPageParm);
return returnpage;
}
}

View File

@@ -0,0 +1,30 @@
package com.njcn.cswarn.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.cswarn.mapper.CsStatLimitRateDPOMapper;
import com.njcn.cswarn.service.CsStatLimitRateDPOService;
import org.springframework.stereotype.Service;
import com.njcn.cswarn.pojo.parm.CsStatLimitRatePageParm;
import com.njcn.cswarn.pojo.po.CsStatLimitRateDPO;
import com.njcn.cswarn.pojo.vo.CsStatLimitRateDVO;
/**
*
* Description:
* Date: 2023/5/17 13:45【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
public class CsStatLimitRateDPOServiceImpl extends ServiceImpl<CsStatLimitRateDPOMapper, CsStatLimitRateDPO> implements CsStatLimitRateDPOService {
@Override
public IPage<CsStatLimitRateDVO> queryPage(CsStatLimitRatePageParm csStatLimitRatePageParm) {
Page<CsStatLimitRateDVO> returnpage = new Page<> (csStatLimitRatePageParm.getCurrentPage ( ), csStatLimitRatePageParm.getPageSize ( ));
returnpage = this.getBaseMapper().queryPage(returnpage,csStatLimitRatePageParm);
return returnpage;
}
}