Commit 0ab9afee authored by tangwei's avatar tangwei

解决冲突

parents 5a8526e7 ba574c0a
...@@ -81,4 +81,8 @@ public class JpCollectorDto extends BaseDto { ...@@ -81,4 +81,8 @@ public class JpCollectorDto extends BaseDto {
@ApiModelProperty(value = "采集器名称") @ApiModelProperty(value = "采集器名称")
private String name; private String name;
@ApiModelProperty(value = "类型")
private String collectorType;
} }
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
...@@ -35,9 +36,16 @@ public class TdHygfJpInverterWarnDto { ...@@ -35,9 +36,16 @@ public class TdHygfJpInverterWarnDto {
@ApiModelProperty(value = "起始时间") @ApiModelProperty(value = "起始时间")
private Long startTime; private Long startTime;
@ApiModelProperty(value = "报警时间")
private Date startTimeDate;
@ApiModelProperty(value = "恢复时间") @ApiModelProperty(value = "恢复时间")
private Long recoverTime; private Long recoverTime;
@ApiModelProperty(value = "恢复时间")
private Date recoverTimeString;
@ApiModelProperty(value = "处理方法") @ApiModelProperty(value = "处理方法")
private String treatment; private String treatment;
......
...@@ -27,4 +27,6 @@ public interface TdHygfJpInverterWarnMapper extends BaseMapper<TdHygfJpInverterW ...@@ -27,4 +27,6 @@ public interface TdHygfJpInverterWarnMapper extends BaseMapper<TdHygfJpInverterW
TdHygfJpInverterWarnDto getByTime(@Param("createdTime") long createdTime); TdHygfJpInverterWarnDto getByTime(@Param("createdTime") long createdTime);
List<TdHygfJpInverterWarnDto> selectWarnList(String state, String level, String minValue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, Integer current, Integer size); List<TdHygfJpInverterWarnDto> selectWarnList(String state, String level, String minValue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, Integer current, Integer size);
int selectWarnListTotal(String state, String level, String minValue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content);
} }
...@@ -43,12 +43,12 @@ ...@@ -43,12 +43,12 @@
<select id="selectPageData" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorDto"> <select id="selectPageData" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorDto">
select select
hjc.state, hjc.state,
hjc.sn_code, hjc.sn_code as snCode,
sta.station_name, hjc.station_name as stationName,
hjc.update_time, hjc.update_time AS updateTime,
hjc.type as collectorType, hjc.type as collectorType,
sta.name, sta.name as name,
sta.type sta.type as type
from from
hygf_jp_collector hjc hygf_jp_collector hjc
left join hygf_jp_station sta on sta.third_station_id = hjc.third_station_id left join hygf_jp_station sta on sta.third_station_id = hjc.third_station_id
......
...@@ -55,7 +55,12 @@ ...@@ -55,7 +55,12 @@
sn_code, sn_code,
content, content,
start_time, start_time,
ts as `time` start_time as startTimeDate,
`time`,
recover_time,
treatment,
time_long,
recover_time as recoverTimeString
FROM house_pv_data.td_hygf_jp_inverter_warn FROM house_pv_data.td_hygf_jp_inverter_warn
<where> <where>
<if test="state != null and state != ''"> <if test="state != null and state != ''">
...@@ -91,4 +96,43 @@ ...@@ -91,4 +96,43 @@
</where> </where>
limit #{current},#{size} limit #{current},#{size}
</select> </select>
<select id="selectWarnListTotal" resultType="int">
SELECT
count (1)
FROM house_pv_data.td_hygf_jp_inverter_warn
<where>
<if test="state != null and state != ''">
AND state = #{state}
</if>
<if test="level != null and level != ''">
AND level = #{level}
</if>
<if test="minValue != null and minValue != ''">
time_long >= #{minvalue}
</if>
<if test="maxValue != null and maxValue != ''">
AND time_long [<![CDATA[<=]]>]#{maxValue}
</if>
<if test="snCode != null and snCode != ''">
AND sn_code = #{snCode}
</if>
<if test="stationId.size >0 ">
AND third_station_id in
<foreach collection="stationId" item="item" open='(' close=')' separator=",">
#{item}
</foreach>
</if>
<if test="startTime != null and startTime != ''">
AND start_time >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND start_time [<![CDATA[<=]]>] #{endTime}
</if>
<if test="content != null and content != ''">
AND content like #{content}
</if>
</where>
</select>
</mapper> </mapper>
...@@ -236,7 +236,7 @@ public class TdHygfJpInverterWarnController extends BaseController { ...@@ -236,7 +236,7 @@ public class TdHygfJpInverterWarnController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器报警表列表全部数据查询", notes = "户用光伏监盘逆变器报警表列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器报警表列表全部数据查询", notes = "户用光伏监盘逆变器报警表列表全部数据查询")
@GetMapping(value = "/selectWarnList") @GetMapping(value = "/selectWarnList")
@UserLimits @UserLimits
public ResponseModel<List<TdHygfJpInverterWarnDto>> selectWarnList(@RequestParam(required = false) String state, public ResponseModel<Page<TdHygfJpInverterWarnDto>> selectWarnList(@RequestParam(required = false) String state,
@RequestParam(required = false) String level, @RequestParam(required = false) String level,
@RequestParam(required = false) String stationName, @RequestParam(required = false) String stationName,
@RequestParam(required = false) String minvalue, @RequestParam(required = false) String minvalue,
...@@ -249,7 +249,8 @@ public class TdHygfJpInverterWarnController extends BaseController { ...@@ -249,7 +249,8 @@ public class TdHygfJpInverterWarnController extends BaseController {
@RequestParam(required = false) Integer size, @RequestParam(required = false) Integer size,
@RequestParam(required = false) String content) { @RequestParam(required = false) String content) {
JpStationDto reviewDto = new JpStationDto(); Page<TdHygfJpInverterWarnDto> result = new Page<>();
JpStationDto reviewDto = new JpStationDto();
Map<String, String> nameMaps = new HashMap<>(); Map<String, String> nameMaps = new HashMap<>();
if (null != stationName){ if (null != stationName){
reviewDto.setName(stationName); reviewDto.setName(stationName);
...@@ -267,7 +268,11 @@ public class TdHygfJpInverterWarnController extends BaseController { ...@@ -267,7 +268,11 @@ public class TdHygfJpInverterWarnController extends BaseController {
map.setStationName(nameMaps.get(map.getThirdStationId())); map.setStationName(nameMaps.get(map.getThirdStationId()));
} }
} }
return ResponseHelper.buildResponse(maps); result.setCurrent(current);
result.setSize(size);
result.setTotal(tdHygfJpInverterWarnServiceImpl.selectWarnListTotal(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content));
result.setRecords(maps);
return ResponseHelper.buildResponse(result);
} }
} }
...@@ -133,4 +133,7 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -133,4 +133,7 @@ public class TdHygfJpInverterWarnServiceImpl
public List<TdHygfJpInverterWarnDto> selectWarnList(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, Integer current, Integer size){ public List<TdHygfJpInverterWarnDto> selectWarnList(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, Integer current, Integer size){
return this.getBaseMapper().selectWarnList(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content,(current-1)*size,size); return this.getBaseMapper().selectWarnList(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content,(current-1)*size,size);
} }
public int selectWarnListTotal(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content){
return this.getBaseMapper().selectWarnListTotal(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content);
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment