Commit 51740993 authored by caotao's avatar caotao

Merge branch 'developer' of http://36.40.66.175:5000/moa/amos-boot-biz into developer

parents 1406f253 455dbd54
......@@ -81,4 +81,16 @@ public class JpCollectorDto extends BaseDto {
@ApiModelProperty(value = "采集器名称")
private String name;
@ApiModelProperty(value = "类型")
private String collectorType;
@ApiModelProperty(value = "信号强度")
private String signalStrength;
@ApiModelProperty(value = "所属项目公司")
private String companyName;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
......@@ -35,9 +36,16 @@ public class TdHygfJpInverterWarnDto {
@ApiModelProperty(value = "起始时间")
private Long startTime;
@ApiModelProperty(value = "报警时间")
private Date startTimeDate;
@ApiModelProperty(value = "恢复时间")
private Long recoverTime;
@ApiModelProperty(value = "恢复时间")
private Date recoverTimeString;
@ApiModelProperty(value = "处理方法")
private String treatment;
......
......@@ -123,4 +123,11 @@ public class JpCollector extends BaseEntity {
@TableField("name")
private String name;
/**
* 信号强度
*/
@TableField("signal_strength")
private String signalStrength;
}
......@@ -27,4 +27,6 @@ public interface TdHygfJpInverterWarnMapper extends BaseMapper<TdHygfJpInverterW
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);
int selectWarnListTotal(String state, String level, String minValue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content);
}
......@@ -43,15 +43,18 @@
<select id="selectPageData" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorDto">
select
hjc.state,
hjc.sn_code,
sta.station_name,
hjc.update_time,
hjc.sn_code as snCode,
hjc.station_name as stationName,
hjc.update_time AS updateTime,
hjc.type as collectorType,
sta.name,
sta.type
sta.name as name,
sta.type as type,
hjc.signalStrength,
pc.COMPANY_NAME as companyName
from
hygf_jp_collector hjc
left join hygf_jp_station sta on sta.third_station_id = hjc.third_station_id
left join privilege_company pc on sta.regional_companies_code = pc.ORG_CODE
<where>
<if test="dto.snCode != null and dto.snCode != ''">
hjc.sn_code = #{dto.snCode}
......@@ -72,6 +75,7 @@
from
hygf_jp_collector hjc
left join hygf_jp_station sta on sta.third_station_id = hjc.third_station_id
left join privilege_company pc on sta.regional_companies_code = pc.ORG_CODE
<where>
<if test="dto.snCode != null and dto.snCode != ''">
hjc.sn_code = #{dto.snCode}
......
......@@ -187,10 +187,10 @@
<if test="dto.thirdStationId!=null">
and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if>
<if test="dto.regionalCompaniesCode!=null">
<if test="dto.regionalCompaniesCode!=null and dto.regionalCompaniesCode!=''">
and hygf_jp_station.regional_companies_code =#{dto.regionalCompaniesCode}
</if>
<if test="dto.amosCompanyCode!=null">
<if test="dto.amosCompanyCode!=null and dto.amosCompanyCode!=''">
and hygf_jp_station.amos_company_code =#{dto.amosCompanyCode}
</if>
<if test="dto.state!=null">
......
......@@ -55,7 +55,12 @@
sn_code,
content,
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
<where>
<if test="state != null and state != ''">
......@@ -91,4 +96,43 @@
</where>
limit #{current},#{size}
</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>
......@@ -236,7 +236,7 @@ public class TdHygfJpInverterWarnController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器报警表列表全部数据查询", notes = "户用光伏监盘逆变器报警表列表全部数据查询")
@GetMapping(value = "/selectWarnList")
@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 stationName,
@RequestParam(required = false) String minvalue,
......@@ -249,7 +249,8 @@ public class TdHygfJpInverterWarnController extends BaseController {
@RequestParam(required = false) Integer size,
@RequestParam(required = false) String content) {
JpStationDto reviewDto = new JpStationDto();
Page<TdHygfJpInverterWarnDto> result = new Page<>();
JpStationDto reviewDto = new JpStationDto();
Map<String, String> nameMaps = new HashMap<>();
if (null != stationName){
reviewDto.setName(stationName);
......@@ -267,7 +268,11 @@ public class TdHygfJpInverterWarnController extends BaseController {
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);
}
}
......@@ -487,7 +487,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
hd.setState(jpStation.getState());
hd.setAccumulatedPower(jpStation.getAccumulatedPower());
hd.setFullhour(dayGenerate.getFullhour());
hd.setFullhour(dayGenerate.getFullhour()!=null?Double.valueOf(String.format("%.2f",dayGenerate.getFullhour())):null);
hd.setDayGenerate(dayGenerate.getGenerate());
hd.setTimeDate(dayGenerate.getDayTime());
hd.setDayIncome(dayGenerate.getDayIncome());
......@@ -514,7 +514,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
hd.setMonthGenerate(dayGenerate.getGenerate());
hd.setMonthIncome(dayGenerate.getMonthIncome());
hd.setTimeDate(dayGenerate.getMonthTime());
hd.setFullhour(dayGenerate.getFullhour());
hd.setFullhour(dayGenerate.getFullhour()!=null?Double.valueOf(String.format("%.2f",dayGenerate.getFullhour())):null);
break;
}
}
......@@ -536,7 +536,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
hd.setState(jpStation.getState());
hd.setAccumulatedPower(jpStation.getAccumulatedPower());
hd.setFullhour(dayGenerate.getFullhour());
hd.setFullhour(dayGenerate.getFullhour()!=null?Double.valueOf(String.format("%.2f",dayGenerate.getFullhour())):null);
hd.setYearGenerate(dayGenerate.getGenerate());
hd.setYearIncome(dayGenerate.getYearIncome());
hd.setTimeDate(dayGenerate.getYearTime());
......@@ -627,7 +627,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
hd.setState(jpStation.getState());
hd.setAccumulatedPower(jpStation.getAccumulatedPower());
hd.setFullhour(dayGenerate.getFullhour());
hd.setFullhour(dayGenerate.getFullhour()!=null?Double.valueOf(String.format("%.2f",dayGenerate.getFullhour())):null);
hd.setDayGenerate(dayGenerate.getGenerate());
hd.setTimeDate(dayGenerate.getDayTime());
hd.setDayIncome(dayGenerate.getDayIncome());
......@@ -653,7 +653,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
hd.setMonthGenerate(dayGenerate.getGenerate());
hd.setMonthIncome(dayGenerate.getMonthIncome());
hd.setTimeDate(dayGenerate.getMonthTime());
hd.setFullhour(dayGenerate.getFullhour());
hd.setFullhour(dayGenerate.getFullhour()!=null?Double.valueOf(String.format("%.2f",dayGenerate.getFullhour())):null);
break;
}
}
......@@ -674,7 +674,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
hd.setStationContact(jpStation.getStationContact());
hd.setAccumulatedPower(jpStation.getAccumulatedPower());
hd.setFullhour(dayGenerate.getFullhour());
hd.setFullhour(dayGenerate.getFullhour()!=null?Double.valueOf(String.format("%.2f",dayGenerate.getFullhour())):null);
hd.setYearGenerate(dayGenerate.getGenerate());
hd.setYearIncome(dayGenerate.getYearIncome());
hd.setTimeDate(dayGenerate.getYearTime());
......
......@@ -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){
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