Commit eebd96e6 authored by hezhuozhi's avatar hezhuozhi

修改电站监控优化项

parent 804964ea
...@@ -13,4 +13,5 @@ import java.util.List; ...@@ -13,4 +13,5 @@ import java.util.List;
public class DataDto { public class DataDto {
String time; String time;
List<String> snCodes; List<String> snCodes;
String regionalCompaniesCode;
} }
...@@ -17,12 +17,15 @@ public class DayGenerateEX { ...@@ -17,12 +17,15 @@ public class DayGenerateEX {
@ExcelProperty(value = "电站名称", index = 1) @ExcelProperty(value = "电站名称", index = 1)
@ApiModelProperty(value = "电站名称") @ApiModelProperty(value = "电站名称")
private String name; private String name;
@ExcelProperty(value = "时间", index = 2) @ExcelProperty(value = "项目公司名称", index = 2)
@ApiModelProperty(value = "项目公司名称")
private String regionalCompaniesName;
@ExcelProperty(value = "时间", index = 3)
String timeDate; String timeDate;
@ExcelProperty(value = "业主姓名", index = 3) @ExcelProperty(value = "业主姓名", index = 4)
@ApiModelProperty(value = "业主姓名") @ApiModelProperty(value = "业主姓名")
private String userName; private String userName;
@ExcelProperty(value = "电站联系人", index = 4) @ExcelProperty(value = "电站联系人", index = 5)
@ApiModelProperty(value = "电站联系人") @ApiModelProperty(value = "电站联系人")
private String stationContact; private String stationContact;
...@@ -32,28 +35,28 @@ public class DayGenerateEX { ...@@ -32,28 +35,28 @@ public class DayGenerateEX {
* 满发小时数 * 满发小时数
* *
* */ * */
@ExcelProperty(value = "满发小时数(h)", index = 5) @ExcelProperty(value = "满发小时数(h)", index = 6)
private Double fullhour; private Double fullhour;
@ExcelProperty(value = "日发电量(kWh)", index = 6) @ExcelProperty(value = "日发电量(kWh)", index = 7)
// 日发电量 // 日发电量
private Double dayGenerate; private Double dayGenerate;
@ExcelProperty(value = "日收益(元)", index = 7) @ExcelProperty(value = "日收益(元)", index = 8)
// 日收益 // 日收益
private Double dayIncome; private Double dayIncome;
/** /**
* 累计发电量 * 累计发电量
*/ */
@ExcelProperty(value = "累计发电量(MWh)", index = 8) @ExcelProperty(value = "累计发电量(MWh)", index = 9)
private Double accumulatedPower; private Double accumulatedPower;
/** /**
* 状态 * 状态
*/ */
@ExcelProperty(value = "状态", index = 9) @ExcelProperty(value = "状态", index = 10)
private String state; private String state;
} }
...@@ -167,7 +167,7 @@ public class JpStationDto extends BaseDto { ...@@ -167,7 +167,7 @@ public class JpStationDto extends BaseDto {
private Double ratedPower; private Double ratedPower;
@ExcelIgnore @ExcelIgnore
private String regionalCompaniesCode; private String regionalCompaniesCode;
@ExcelIgnore @ExcelProperty(value = "项目公司名称", index = 7)
private String regionalCompaniesName; private String regionalCompaniesName;
@ExcelIgnore @ExcelIgnore
...@@ -185,7 +185,6 @@ public class JpStationDto extends BaseDto { ...@@ -185,7 +185,6 @@ public class JpStationDto extends BaseDto {
@ExcelProperty(value = "满发小时数(h)", index = 5) @ExcelProperty(value = "满发小时数(h)", index = 5)
private Double fullhour; private Double fullhour;
/** /**
* *
* 实时功率比/ * 实时功率比/
......
...@@ -20,12 +20,15 @@ public class MonthGenerateEX { ...@@ -20,12 +20,15 @@ public class MonthGenerateEX {
@ExcelProperty(value = "电站名称", index = 1) @ExcelProperty(value = "电站名称", index = 1)
@ApiModelProperty(value = "电站名称") @ApiModelProperty(value = "电站名称")
private String name; private String name;
@ExcelProperty(value = "时间", index = 2) @ExcelProperty(value = "项目公司名称", index = 2)
@ApiModelProperty(value = "项目公司名称")
private String regionalCompaniesName;
@ExcelProperty(value = "时间", index = 3)
String timeDate; String timeDate;
@ExcelProperty(value = "业主姓名", index = 3) @ExcelProperty(value = "业主姓名", index = 4)
@ApiModelProperty(value = "业主姓名") @ApiModelProperty(value = "业主姓名")
private String userName; private String userName;
@ExcelProperty(value = "电站联系人", index = 4) @ExcelProperty(value = "电站联系人", index = 5)
@ApiModelProperty(value = "电站联系人") @ApiModelProperty(value = "电站联系人")
private String stationContact; private String stationContact;
...@@ -35,7 +38,7 @@ public class MonthGenerateEX { ...@@ -35,7 +38,7 @@ public class MonthGenerateEX {
* 满发小时数 * 满发小时数
* *
* */ * */
@ExcelProperty(value = "满发小时数(h)", index = 5) @ExcelProperty(value = "满发小时数(h)", index = 6)
private Double fullhour; private Double fullhour;
...@@ -43,15 +46,15 @@ public class MonthGenerateEX { ...@@ -43,15 +46,15 @@ public class MonthGenerateEX {
// 月发电量 // 月发电量
@ExcelProperty(value = "月发电量(kWh)", index = 6) @ExcelProperty(value = "月发电量(kWh)", index = 7)
private Double monthGenerate; private Double monthGenerate;
// 月收益 // 月收益
@ExcelProperty(value = "月收益(元)", index = 7) @ExcelProperty(value = "月收益(元)", index = 8)
private Double monthIncome; private Double monthIncome;
/** /**
* 累计发电量 * 累计发电量
*/ */
@ExcelProperty(value = "累计发电量(MWh)", index = 8) @ExcelProperty(value = "累计发电量(MWh)", index = 9)
private Double accumulatedPower; private Double accumulatedPower;
} }
...@@ -17,12 +17,15 @@ public class YearGenerateEX { ...@@ -17,12 +17,15 @@ public class YearGenerateEX {
@ExcelProperty(value = "电站名称", index = 1) @ExcelProperty(value = "电站名称", index = 1)
@ApiModelProperty(value = "电站名称") @ApiModelProperty(value = "电站名称")
private String name; private String name;
@ExcelProperty(value = "时间", index = 2) @ExcelProperty(value = "项目公司名称", index = 2)
@ApiModelProperty(value = "项目公司名称")
private String regionalCompaniesName;
@ExcelProperty(value = "时间", index = 3)
String timeDate; String timeDate;
@ExcelProperty(value = "业主姓名", index = 3) @ExcelProperty(value = "业主姓名", index = 4)
@ApiModelProperty(value = "业主姓名") @ApiModelProperty(value = "业主姓名")
private String userName; private String userName;
@ExcelProperty(value = "电站联系人", index = 4) @ExcelProperty(value = "电站联系人", index = 5)
@ApiModelProperty(value = "电站联系人") @ApiModelProperty(value = "电站联系人")
private String stationContact; private String stationContact;
...@@ -30,22 +33,22 @@ public class YearGenerateEX { ...@@ -30,22 +33,22 @@ public class YearGenerateEX {
* 满发小时数 * 满发小时数
* *
* */ * */
@ExcelProperty(value = "满发小时数(h)", index = 5) @ExcelProperty(value = "满发小时数(h)", index = 6)
private Double fullhour; private Double fullhour;
// 年发电量 // 年发电量
@ExcelProperty(value = "年发电量(kWh)", index = 6) @ExcelProperty(value = "年发电量(kWh)", index = 7)
private Double yearGenerate; private Double yearGenerate;
// 年收益 // 年收益
@ExcelProperty(value = "年收益(元)", index = 7) @ExcelProperty(value = "年收益(元)", index = 8)
private Double yearIncome; private Double yearIncome;
/** /**
* 累计发电量 * 累计发电量
*/ */
@ExcelProperty(value = "累计发电量(MWh)", index = 8) @ExcelProperty(value = "累计发电量(MWh)", index = 9)
private Double accumulatedPower; private Double accumulatedPower;
} }
...@@ -185,5 +185,10 @@ public class TdHYGFInverterDayGenerate implements Serializable { ...@@ -185,5 +185,10 @@ public class TdHYGFInverterDayGenerate implements Serializable {
private Double fullhour; private Double fullhour;
@ExcelIgnore @ExcelIgnore
private String name; private String name;
@ExcelProperty("项目公司名称")
String regionalCompaniesName;
@ExcelIgnore
String regionalCompaniesCode;
} }
...@@ -53,5 +53,10 @@ public class TdHYGFInverterMonthGenerate implements Serializable { ...@@ -53,5 +53,10 @@ public class TdHYGFInverterMonthGenerate implements Serializable {
private Double fullhour; private Double fullhour;
@ExcelIgnore @ExcelIgnore
private Double income; private Double income;
@ExcelProperty("项目公司名称")
String regionalCompaniesName;
@ExcelIgnore
String regionalCompaniesCode;
} }
...@@ -53,5 +53,9 @@ public class TdHYGFInverterYearGenerate implements Serializable { ...@@ -53,5 +53,9 @@ public class TdHYGFInverterYearGenerate implements Serializable {
private Double fullhour; private Double fullhour;
@ExcelIgnore @ExcelIgnore
private Double income; private Double income;
@ExcelProperty("项目公司名称")
String regionalCompaniesName;
@ExcelIgnore
String regionalCompaniesCode;
} }
...@@ -43,7 +43,8 @@ public interface DayGenerateMapper extends BaseMapper<DayGenerate> { ...@@ -43,7 +43,8 @@ public interface DayGenerateMapper extends BaseMapper<DayGenerate> {
@Param("size") int size,@Param("dto") @Param("size") int size,@Param("dto")
List<String> statioId, List<String> statioId,
@Param("dateTime")String dateTime, @Param("dateTime")String dateTime,
@Param("stationState")String stationState); @Param("stationState")String stationState,
@Param("regionalCompaniesCode")String regionalCompaniesCode);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and") @UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
Integer selectCount(@Param(Constants.WRAPPER) Wrapper<DayGenerate> queryWrapper); Integer selectCount(@Param(Constants.WRAPPER) Wrapper<DayGenerate> queryWrapper);
......
...@@ -15,7 +15,8 @@ public interface MonthGenerateMapper extends BaseMapper<MonthGenerate> { ...@@ -15,7 +15,8 @@ public interface MonthGenerateMapper extends BaseMapper<MonthGenerate> {
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and") @UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<MonthGenerate> selectPagenewMonthGenerate(@Param("current") int current,@Param("size") int size,@Param("dto") List<String> statioId, List<MonthGenerate> selectPagenewMonthGenerate(@Param("current") int current,@Param("size") int size,@Param("dto") List<String> statioId,
@Param("dateTime")String dateTime, @Param("dateTime")String dateTime,
@Param("stationState")String stationState ); @Param("stationState")String stationState,
@Param("regionalCompaniesCode")String regionalCompaniesCode);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and") @UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<MonthGenerate> selectList(@Param(Constants.WRAPPER) Wrapper<MonthGenerate> queryWrapper); List<MonthGenerate> selectList(@Param(Constants.WRAPPER) Wrapper<MonthGenerate> queryWrapper);
......
...@@ -20,5 +20,5 @@ public interface TdHYGFInverterDayGenerateMapper extends BaseMapper<TdHYGFInvert ...@@ -20,5 +20,5 @@ public interface TdHYGFInverterDayGenerateMapper extends BaseMapper<TdHYGFInvert
List<Map<String,Object>> selectSnCodeList(String startTime, String endTime, List<String> sncodes); List<Map<String,Object>> selectSnCodeList(String startTime, String endTime, List<String> sncodes);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and") @UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<TdHYGFInverterDayGenerate> selectListPage(List<String> snCodeList, List<String> maxCreatedTimeList, String startTime, String endTime); List<TdHYGFInverterDayGenerate> selectListPage(List<String> snCodeList, List<String> maxCreatedTimeList, String startTime, String endTime,@Param("regionalCompaniesCode")String regionalCompaniesCode);
} }
...@@ -20,7 +20,8 @@ public interface YearGenerateMapper extends BaseMapper<YearGenerate> { ...@@ -20,7 +20,8 @@ public interface YearGenerateMapper extends BaseMapper<YearGenerate> {
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and") @UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<YearGenerate> selectPagenewYearGenerate(@Param("current") int current,@Param("size") int size,@Param("dto") List<String> statioId, List<YearGenerate> selectPagenewYearGenerate(@Param("current") int current,@Param("size") int size,@Param("dto") List<String> statioId,
@Param("dateTime")String dateTime, @Param("dateTime")String dateTime,
@Param("stationState")String stationState ); @Param("stationState")String stationState,
@Param("regionalCompaniesCode")String regionalCompaniesCode);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and") @UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<YearGenerate> selectList(@Param(Constants.WRAPPER) Wrapper<YearGenerate> queryWrapper); List<YearGenerate> selectList(@Param(Constants.WRAPPER) Wrapper<YearGenerate> queryWrapper);
......
...@@ -67,7 +67,16 @@ ...@@ -67,7 +67,16 @@
<if test="dto.state != null and dto.state !=''"> <if test="dto.state != null and dto.state !=''">
hjc.state = #{dto.state} hjc.state = #{dto.state}
</if> </if>
<if test="dto.stationName != null and dto.stationName !=''">
AND hjc.station_name like concat('%',#{dto.stationName},'%')
</if>
</where> </where>
ORDER BY CASE
WHEN hjc.state = '报警' THEN 1
WHEN hjc.state = '离线' THEN 2
WHEN hjc.state = '在线' THEN 3
ELSE 4
END
limit #{current},#{size} limit #{current},#{size}
</select> </select>
......
...@@ -50,9 +50,9 @@ ...@@ -50,9 +50,9 @@
hjc.collector_sn_code, hjc.collector_sn_code,
hjc.update_time, hjc.update_time,
hjc.current_power, hjc.current_power,
ROUND(hjc.day_power_generation,3) as dayPowerGeneration, CAST(hjc.day_power_generation AS DECIMAL(20, 3)) as dayPowerGeneration,
ROUND(hjc.month_power_generation,3) as monthPowerGeneration, CAST(hjc.month_power_generation AS DECIMAL(20, 3)) as monthPowerGeneration,
ROUND(hjc.year_power_generation,3) as yearPowerGeneration, CAST(hjc.year_power_generation AS DECIMAL(20, 3)) as yearPowerGeneration,
hjc.brand, hjc.brand,
hjc.model, hjc.model,
hjc.national_standard, hjc.national_standard,
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
hjc.AFCI_version, hjc.AFCI_version,
hjc.ID, hjc.ID,
hjc.capacity, hjc.capacity,
ROUND(hjc.total_power_generation/1000,3) as totalPowerGeneration, CAST(hjc.total_power_generation/1000 AS DECIMAL(20, 3)) as totalPowerGeneration,
hjc.third_station_id, hjc.third_station_id,
hjc.is_delete, hjc.is_delete,
hjc.third_code, hjc.third_code,
...@@ -89,7 +89,16 @@ ...@@ -89,7 +89,16 @@
<if test="dto.maxValue != null and dto.maxValue !=''"> <if test="dto.maxValue != null and dto.maxValue !=''">
AND hjc.capacity <![CDATA[<=]]> #{dto.maxValue} AND hjc.capacity <![CDATA[<=]]> #{dto.maxValue}
</if> </if>
<if test="dto.stationName != null and dto.stationName !=''">
AND hjc.station_name like concat('%',#{dto.stationName},'%')
</if>
</where> </where>
ORDER BY CASE
WHEN hjc.state = '报警' THEN 1
WHEN hjc.state = '离线' THEN 2
WHEN hjc.state = '在线' THEN 3
ELSE 4
END
limit #{current},#{size} limit #{current},#{size}
</select> </select>
......
...@@ -33,13 +33,13 @@ ...@@ -33,13 +33,13 @@
`day_power_use` dayPowerUse, `day_power_use` dayPowerUse,
`month_power_use` monthPowerUse, `month_power_use` monthPowerUse,
`year_power_use` yearPowerUse, `year_power_use` yearPowerUse,
ROUND(`real_time_power`,3) realTimePower, CAST(`real_time_power` AS DECIMAL(20, 3)) realTimePower,
ROUND(`accumulated_power`/1000,3) accumulatedPower, CAST(`accumulated_power`/1000 AS DECIMAL(20, 3)) accumulatedPower,
`state` , `state` ,
`type`, `type`,
`organizational_code` organizationalCode, `organizational_code` organizationalCode,
`is_delete` isDelete, `is_delete` isDelete,
ROUND(`day_generate`,3) dayGenerate, CAST(`day_generate` AS DECIMAL(20, 3)) dayGenerate,
`month_generate` monthGenerate, `month_generate` monthGenerate,
`year_generate` yearGenerate, `year_generate` yearGenerate,
`day_income` dayIncome, `day_income` dayIncome,
...@@ -48,7 +48,8 @@ ...@@ -48,7 +48,8 @@
`area` , `area` ,
`cumulative_income` cumulativeIncome, `cumulative_income` cumulativeIncome,
`email`, `email`,
rated_power ratedPower rated_power ratedPower,
regional_companies_code
from hygf_jp_station from hygf_jp_station
...@@ -80,6 +81,9 @@ ...@@ -80,6 +81,9 @@
<if test="dto.thirdStationId!=null"> <if test="dto.thirdStationId!=null">
and hygf_jp_station.third_station_id =#{dto.thirdStationId} and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if> </if>
<if test="dto.regionalCompaniesCode!=null and dto.regionalCompaniesCode != ''">
and hygf_jp_station.regional_companies_code = #{dto.regionalCompaniesCode}
</if>
</where> </where>
</select> </select>
...@@ -89,20 +93,20 @@ ...@@ -89,20 +93,20 @@
select select
ROUND(sum(real_time_power),3) realTimePower, CAST(sum(real_time_power) AS DECIMAL(20, 3)) realTimePower,
ROUND(sum(capacity)/1000,3) capacity, CAST(sum(capacity)/1000 AS DECIMAL(20, 3)) capacity,
ROUND(sum(day_generate)/1000,3) dayGenerate, CAST(sum(day_generate)/1000 AS DECIMAL(20, 3)) dayGenerate,
ROUND(sum(month_generate)/1000,3) monthGenerate, CAST(sum(month_generate)/1000 AS DECIMAL(20, 3)) monthGenerate,
ROUND(sum(year_generate)/1000,3) yearGenerate, CAST(sum(year_generate)/1000 AS DECIMAL(20, 3)) yearGenerate,
ROUND(sum(accumulated_power)/1000,3) accumulatedPower, CAST(sum(accumulated_power)/1000 AS DECIMAL(20, 3)) accumulatedPower,
ROUND( sum(day_income),3) dayIncome, CAST( sum(day_income) AS DECIMAL(20, 3)) dayIncome,
ROUND(sum(month_income)/10000,3) monthIncome, CAST(sum(month_income)/10000 AS DECIMAL(20, 3)) monthIncome,
ROUND(sum(year_income)/10000,3) yearIncome, CAST(sum(year_income)/10000 AS DECIMAL(20, 3)) yearIncome,
ROUND(sum(cumulative_income)/10000,3) cumulativeIncome, CAST(sum(cumulative_income)/10000 AS DECIMAL(20, 3)) cumulativeIncome,
ROUND(sum(day_power_use)/1000,3) dayPowerUse, CAST(sum(day_power_use)/1000 AS DECIMAL(20, 3)) dayPowerUse,
ROUND(sum(month_power_use)/1000,3) monthPowerUse, CAST(sum(month_power_use)/1000 AS DECIMAL(20, 3)) monthPowerUse,
ROUND(sum(year_power_use)/1000,3) yearPowerUse, CAST(sum(year_power_use)/1000 AS DECIMAL(20, 3)) yearPowerUse,
ROUND(sum(rated_power),3) ratedPower, CAST(sum(rated_power) AS DECIMAL(20, 3)) ratedPower,
count(*) countBuiltNum count(*) countBuiltNum
from hygf_jp_station from hygf_jp_station
<where> <where>
...@@ -362,20 +366,20 @@ ...@@ -362,20 +366,20 @@
<select id="getCountJpStationdata" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto"> <select id="getCountJpStationdata" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto">
select select
ROUND(sum(real_time_power),3) realTimePower, CAST(sum(real_time_power) AS DECIMAL(20, 3)) realTimePower,
ROUND(sum(capacity)/1000,3) capacity, CAST(sum(capacity)/1000 AS DECIMAL(20, 3)) capacity,
ROUND(sum(day_generate)/1000,3) dayGenerate, CAST(sum(day_generate)/1000 AS DECIMAL(20, 3)) dayGenerate,
ROUND(sum(month_generate)/1000,3) monthGenerate, CAST(sum(month_generate)/1000 AS DECIMAL(20, 3)) monthGenerate,
ROUND(sum(year_generate)/1000,3) yearGenerate, CAST(sum(year_generate)/1000 AS DECIMAL(20, 3)) yearGenerate,
ROUND(sum(accumulated_power)/1000,3) accumulatedPower, CAST(sum(accumulated_power)/1000 AS DECIMAL(20, 3)) accumulatedPower,
ROUND( sum(day_income),3) dayIncome, CAST( sum(day_income) AS DECIMAL(20, 3)) dayIncome,
ROUND(sum(month_income)/10000,3) monthIncome, CAST(sum(month_income)/10000 AS DECIMAL(20, 3)) monthIncome,
ROUND(sum(year_income)/10000,3) yearIncome, CAST(sum(year_income)/10000 AS DECIMAL(20, 3)) yearIncome,
ROUND(sum(cumulative_income)/10000,3) cumulativeIncome, CAST(sum(cumulative_income)/10000 AS DECIMAL(20, 3)) cumulativeIncome,
ROUND(sum(day_power_use)/1000,3) dayPowerUse, CAST(sum(day_power_use)/1000 AS DECIMAL(20, 3)) dayPowerUse,
ROUND(sum(month_power_use)/1000,3) monthPowerUse, CAST(sum(month_power_use)/1000 AS DECIMAL(20, 3)) monthPowerUse,
ROUND(sum(year_power_use)/1000,3) yearPowerUse, CAST(sum(year_power_use)/1000 AS DECIMAL(20, 3)) yearPowerUse,
ROUND(sum(rated_power),3) ratedPower, CAST(sum(rated_power) AS DECIMAL(20, 3)) ratedPower,
count(*) countBuiltNum count(*) countBuiltNum
from hygf_jp_station from hygf_jp_station
<where> <where>
...@@ -626,7 +630,7 @@ ...@@ -626,7 +630,7 @@
`rec_user_id` recUserId, `rec_user_id` recUserId,
`rec_user_name` recUserName, `rec_user_name` recUserName,
`sn_code` snCode, `sn_code` snCode,
ROUND(`capacity`,3) capacity, CAST(`capacity` AS DECIMAL(20, 3)) capacity,
`name` , `name` ,
`code` , `code` ,
`system_code` systemCode, `system_code` systemCode,
...@@ -648,15 +652,15 @@ ...@@ -648,15 +652,15 @@
`day_power_use` dayPowerUse, `day_power_use` dayPowerUse,
`month_power_use` monthPowerUse, `month_power_use` monthPowerUse,
`year_power_use` yearPowerUse, `year_power_use` yearPowerUse,
ROUND(`real_time_power`,3) realTimePower, CAST(`real_time_power` AS DECIMAL(20, 3)) realTimePower,
ROUND(`accumulated_power`/1000,3) accumulatedPower, CAST(`accumulated_power`/1000 AS DECIMAL(20, 3)) accumulatedPower,
`state` , `state` ,
`type`, `type`,
`organizational_code` organizationalCode, `organizational_code` organizationalCode,
`is_delete` isDelete, `is_delete` isDelete,
ROUND(`day_generate`,3) dayGenerate, CAST(`day_generate` AS DECIMAL(20, 3)) dayGenerate,
ROUND(`month_generate`,3) monthGenerate, CAST(`month_generate` AS DECIMAL(20, 3)) monthGenerate,
ROUND(`year_generate`,3) yearGenerate, CAST(`year_generate` AS DECIMAL(20, 3)) yearGenerate,
`day_income` dayIncome, `day_income` dayIncome,
`month_income` monthIncome, `month_income` monthIncome,
`year_income` yearIncome, `year_income` yearIncome,
...@@ -664,7 +668,7 @@ ...@@ -664,7 +668,7 @@
`cumulative_income` cumulativeIncome, `cumulative_income` cumulativeIncome,
`email`, `email`,
rated_power ratedPower, rated_power ratedPower,
ROUND(`day_generate`/capacity,3) fullhour, CAST(`day_generate`/capacity AS DECIMAL(20, 3)) fullhour,
(select privilege_company.COMPANY_NAME from privilege_company where (select privilege_company.COMPANY_NAME from privilege_company where
privilege_company.ORG_CODE=hygf_jp_station.regional_companies_code) regionalCompaniesName privilege_company.ORG_CODE=hygf_jp_station.regional_companies_code) regionalCompaniesName
from hygf_jp_station from hygf_jp_station
...@@ -703,7 +707,12 @@ ...@@ -703,7 +707,12 @@
and hygf_jp_station.amos_company_code =#{dto.amosCompanyCode} and hygf_jp_station.amos_company_code =#{dto.amosCompanyCode}
</if> </if>
</where> </where>
ORDER BY CASE
WHEN state = '报警' THEN 1
WHEN state = '离线' THEN 2
WHEN state = '在线' THEN 3
ELSE 4
END
</select> </select>
...@@ -724,11 +733,11 @@ ...@@ -724,11 +733,11 @@
<!-- code参数为区域公司orgCode或经销商orgCode--> <!-- code参数为区域公司orgCode或经销商orgCode-->
<!-- <select id="getRegionStatistics" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics">--> <!-- <select id="getRegionStatistics" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics">-->
<!-- SELECT COUNT(*) AS powerStationNumber,--> <!-- SELECT COUNT(*) AS powerStationNumber,-->
<!-- ROUND(SUM(capacity)/1000, 3) AS totalCapacity,--> <!-- CAST(SUM(capacity)/1000, 3) AS totalCapacity,-->
<!-- ROUND(SUM(day_generate)/1000, 3) AS totalDayGenerate,--> <!-- CAST(SUM(day_generate)/1000, 3) AS totalDayGenerate,-->
<!-- ROUND(SUM(rated_power), 3) AS totalRatedPower,--> <!-- CAST(SUM(rated_power), 3) AS totalRatedPower,-->
<!-- ROUND(SUM(real_time_power), 3) AS totalRealTimePower,--> <!-- CAST(SUM(real_time_power), 3) AS totalRealTimePower,-->
<!-- ROUND(SUM(day_income), 3) AS totalDayIncome--> <!-- CAST(SUM(day_income), 3) AS totalDayIncome-->
<!-- FROM hygf_jp_station hjs--> <!-- FROM hygf_jp_station hjs-->
<!-- <where>--> <!-- <where>-->
<!-- <if test="regionCode != null and regionCode !=''">--> <!-- <if test="regionCode != null and regionCode !=''">-->
......
...@@ -148,10 +148,19 @@ ...@@ -148,10 +148,19 @@
<if test="dateTime!=null and dateTime != ''"> <if test="dateTime!=null and dateTime != ''">
and day_time = #{dateTime} and day_time = #{dateTime}
</if> </if>
<if test="regionalCompaniesCode!=null and regionalCompaniesCode != ''">
and regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="stationState!=null and stationState != ''"> <if test="stationState!=null and stationState != ''">
and station_state = #{stationState} and station_state = #{stationState}
</if> </if>
</where> </where>
ORDER BY CASE
WHEN station_state = '报警' THEN 1
WHEN station_state = '离线' THEN 2
WHEN station_state = '在线' THEN 3
ELSE 4
END
LIMIT #{current} ,#{size} LIMIT #{current} ,#{size}
</select> </select>
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
<if test="dateTime!=null and dateTime != ''"> <if test="dateTime!=null and dateTime != ''">
and month_time = #{dateTime} and month_time = #{dateTime}
</if> </if>
<if test="regionalCompaniesCode!=null and regionalCompaniesCode != ''">
and regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="stationState!=null and stationState != ''"> <if test="stationState!=null and stationState != ''">
and station_state = #{stationState} and station_state = #{stationState}
</if> </if>
......
...@@ -80,6 +80,9 @@ ...@@ -80,6 +80,9 @@
<if test="endTime != null"> <if test="endTime != null">
and created_time &lt;= #{endTime} and created_time &lt;= #{endTime}
</if> </if>
<if test="regionalCompaniesCode!=null and regionalCompaniesCode != ''">
and regional_companies_code = #{regionalCompaniesCode}
</if>
</where> </where>
order by created_time desc order by created_time desc
</select> </select>
......
...@@ -132,7 +132,13 @@ ...@@ -132,7 +132,13 @@
AND station_name like #{stationName} AND station_name like #{stationName}
</if> </if>
</where> </where>
ORDER BY start_time desc ORDER BY CASE
WHEN `state` = '未处理' THEN 1
WHEN `state` = '未恢复' THEN 2
WHEN `state` = '已处理' THEN 3
WHEN `state` = '已恢复' THEN 4
ELSE 5
END,start_time desc
limit #{current},#{size} limit #{current},#{size}
</select> </select>
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
<if test="dateTime!=null and dateTime != ''"> <if test="dateTime!=null and dateTime != ''">
and year = #{dateTime} and year = #{dateTime}
</if> </if>
<if test="regionalCompaniesCode!=null and regionalCompaniesCode != ''">
and regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="stationState!=null and stationState != ''"> <if test="stationState!=null and stationState != ''">
and station_state = #{stationState} and station_state = #{stationState}
</if> </if>
......
...@@ -275,7 +275,7 @@ public class JpInverterController extends BaseController { ...@@ -275,7 +275,7 @@ public class JpInverterController extends BaseController {
// List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterDayReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),null)); return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterDayReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),null,dataDto.getRegionalCompaniesCode()));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -288,7 +288,7 @@ public class JpInverterController extends BaseController { ...@@ -288,7 +288,7 @@ public class JpInverterController extends BaseController {
dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM-dd")); dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM-dd"));
} }
//List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; //List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
List<TdHYGFInverterDayGenerate> tdHYGFInverterDayGenerates =jpInverterServiceImpl.jpInverterDayReportExport(dataDto.getTime(),dataDto.getSnCodes(),null); List<TdHYGFInverterDayGenerate> tdHYGFInverterDayGenerates =jpInverterServiceImpl.jpInverterDayReportExport(dataDto.getTime(),dataDto.getSnCodes(),null,dataDto.getRegionalCompaniesCode());
try { try {
setResponseHeadForDowload(response,"逆变器日报表.xls"); setResponseHeadForDowload(response,"逆变器日报表.xls");
EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterDayGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器日报表").doWrite(tdHYGFInverterDayGenerates); EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterDayGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器日报表").doWrite(tdHYGFInverterDayGenerates);
...@@ -309,7 +309,7 @@ public class JpInverterController extends BaseController { ...@@ -309,7 +309,7 @@ public class JpInverterController extends BaseController {
} }
// List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterMonthReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),null)); return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterMonthReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),null,dataDto.getRegionalCompaniesCode()));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -322,7 +322,7 @@ public class JpInverterController extends BaseController { ...@@ -322,7 +322,7 @@ public class JpInverterController extends BaseController {
dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM")); dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM"));
} }
// List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
List<TdHYGFInverterMonthGenerate> tdHYGFInverterMonthGenerates =jpInverterServiceImpl.jpInverterMonthReportExport(dataDto.getTime(),dataDto.getSnCodes(),null); List<TdHYGFInverterMonthGenerate> tdHYGFInverterMonthGenerates =jpInverterServiceImpl.jpInverterMonthReportExport(dataDto.getTime(),dataDto.getSnCodes(),null,dataDto.getRegionalCompaniesCode());
try { try {
setResponseHeadForDowload(response,"逆变器月报表.xls"); setResponseHeadForDowload(response,"逆变器月报表.xls");
EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterMonthGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器月报表").doWrite(tdHYGFInverterMonthGenerates); EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterMonthGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器月报表").doWrite(tdHYGFInverterMonthGenerates);
...@@ -344,7 +344,7 @@ public class JpInverterController extends BaseController { ...@@ -344,7 +344,7 @@ public class JpInverterController extends BaseController {
} }
// List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterYearReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),null)); return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterYearReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),null,dataDto.getRegionalCompaniesCode()));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -357,7 +357,7 @@ public class JpInverterController extends BaseController { ...@@ -357,7 +357,7 @@ public class JpInverterController extends BaseController {
dataDto.setTime(DateUtil.format(new Date(),"yyyy")); dataDto.setTime(DateUtil.format(new Date(),"yyyy"));
} }
// List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
List<TdHYGFInverterYearGenerate> tdHYGFInverterYearGenerates =jpInverterServiceImpl.jpInverterYearReportExport(dataDto.getTime(),dataDto.getSnCodes(),null); List<TdHYGFInverterYearGenerate> tdHYGFInverterYearGenerates =jpInverterServiceImpl.jpInverterYearReportExport(dataDto.getTime(),dataDto.getSnCodes(),null,dataDto.getRegionalCompaniesCode());
try { try {
setResponseHeadForDowload(response,"逆变器年报表.xls"); setResponseHeadForDowload(response,"逆变器年报表.xls");
EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterYearGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器年报表").doWrite(tdHYGFInverterYearGenerates); EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterYearGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器年报表").doWrite(tdHYGFInverterYearGenerates);
......
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