Commit dc2dd219 authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 9e4cf658 cb5f03fa
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 户用光伏监盘人员场站关系表
*
* @author system_generator
* @date 2023-09-19
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="JpPersonStationDto", description="户用光伏监盘人员场站关系表")
public class JpPersonStationDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "人员id")
private String personId;
@ApiModelProperty(value = "场站id")
private Long stationId;
@ApiModelProperty(value = "场站名称")
private String stationName;
}
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation;
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;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 第三方场站 * 第三方场站
...@@ -101,4 +103,21 @@ public class JpStationDto extends BaseDto { ...@@ -101,4 +103,21 @@ public class JpStationDto extends BaseDto {
* 组织编码 * 组织编码
*/ */
private String organizationalCode ; private String organizationalCode ;
//日发电量
private Double dayGenerate;
//月发电量
private Double monthGenerate;
//年发电量
private Double yearGenerate;
//日收益
private Double dayIncome;
//月收益
private Double monthIncome;
// 年收益
private Double yearIncome;
//地区
private String area;
List<JpPersonStation> statioId;
} }
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 户用光伏监盘人员场站关系表
*
* @author system_generator
* @date 2023-09-19
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("hygf_jp_person_station")
public class JpPersonStation extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 人员id
*/
@TableField("person_id")
private String personId;
/**
* 场站id
*/
@TableField("station_id")
private Long stationId;
/**
* 场站名称
*/
@TableField("station_name")
private String stationName;
}
...@@ -166,8 +166,27 @@ public class JpStation extends BaseEntity { ...@@ -166,8 +166,27 @@ public class JpStation extends BaseEntity {
* 组织编码 * 组织编码
*/ */
@TableField("organizational_code") @TableField("organizational_code")
private String organizationalCode ; private String organizationalCode;
//日发电量
@TableField("day_generate")
private Double dayGenerate;
//月发电量
@TableField("month_generate")
private Double monthGenerate;
//年发电量
@TableField("year_generate")
private Double yearGenerate;
//日收益
@TableField("day_income")
private Double dayIncome;
//月收益
@TableField("month_income")
private Double monthIncome;
// 年收益
@TableField("year_income")
private Double yearIncome;
//地区
@TableField("area")
private String area;
} }
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 户用光伏监盘人员场站关系表 Mapper 接口
*
* @author system_generator
* @date 2023-09-19
*/
public interface JpPersonStationMapper extends BaseMapper<JpPersonStation> {
}
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 户用光伏监盘人员场站关系表接口类
*
* @author system_generator
* @date 2023-09-19
*/
public interface IJpPersonStationService {
}
<?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.yeejoin.amos.boot.module.hygf.api.mapper.JpPersonStationMapper">
</mapper>
...@@ -14,7 +14,18 @@ ...@@ -14,7 +14,18 @@
<if test="dto.address!=null"> <if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%") and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
</if> </if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
<foreach collection="dto.statioId" item="item" index="index" open="(" separator="," close=")">
#{item.stationId}
</foreach>
</if>
<if test="dto.thirdStationId!=null">
and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if>
</select> </select>
......
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpPersonStationServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpPersonStationDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 户用光伏监盘人员场站关系表
*
* @author system_generator
* @date 2023-09-19
*/
@RestController
@Api(tags = "户用光伏监盘人员场站关系表Api")
@RequestMapping(value = "/jp-person-station")
public class JpPersonStationController extends BaseController {
@Autowired
JpPersonStationServiceImpl jpPersonStationServiceImpl;
/**
* 新增户用光伏监盘人员场站关系表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增户用光伏监盘人员场站关系表", notes = "新增户用光伏监盘人员场站关系表")
public ResponseModel<JpPersonStationDto> save(@RequestBody JpPersonStationDto model) {
model = jpPersonStationServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘人员场站关系表", notes = "根据sequenceNbr更新户用光伏监盘人员场站关系表")
public ResponseModel<JpPersonStationDto> updateBySequenceNbrJpPersonStation(@RequestBody JpPersonStationDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(jpPersonStationServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除户用光伏监盘人员场站关系表", notes = "根据sequenceNbr删除户用光伏监盘人员场站关系表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(jpPersonStationServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个户用光伏监盘人员场站关系表", notes = "根据sequenceNbr查询单个户用光伏监盘人员场站关系表")
public ResponseModel<JpPersonStationDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jpPersonStationServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘人员场站关系表分页查询", notes = "户用光伏监盘人员场站关系表分页查询")
public ResponseModel<Page<JpPersonStationDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<JpPersonStationDto> page = new Page<JpPersonStationDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jpPersonStationServiceImpl.queryForJpPersonStationPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘人员场站关系表列表全部数据查询", notes = "户用光伏监盘人员场站关系表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<JpPersonStationDto>> selectForList() {
return ResponseHelper.buildResponse(jpPersonStationServiceImpl.queryForJpPersonStationList());
}
}
package com.yeejoin.amos.boot.module.hygf.biz.controller; package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.hygf.api.dto.ReviewDto; import com.yeejoin.amos.boot.module.hygf.api.dto.ReviewDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation;
import com.yeejoin.amos.boot.module.hygf.api.entity.PersonnelBusiness;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpPersonStationMapper;
import com.yeejoin.amos.boot.module.standard.api.entity.PublicAgencyUser;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -31,7 +36,8 @@ public class JpStationController extends BaseController { ...@@ -31,7 +36,8 @@ public class JpStationController extends BaseController {
@Autowired @Autowired
JpStationServiceImpl jpStationServiceImpl; JpStationServiceImpl jpStationServiceImpl;
@Autowired
JpPersonStationMapper pPersonStationMapper;
/** /**
* 新增第三方场站 * 新增第三方场站
* *
...@@ -98,6 +104,17 @@ public class JpStationController extends BaseController { ...@@ -98,6 +104,17 @@ public class JpStationController extends BaseController {
@ApiOperation(httpMethod = "GET",value = "场站列表", notes = "场站列表") @ApiOperation(httpMethod = "GET",value = "场站列表", notes = "场站列表")
public ResponseModel<Page<JpStationDto>> queryForDealerReviewPage(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<JpStationDto>> queryForDealerReviewPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, JpStationDto reviewDto) { (value = "size") int size, JpStationDto reviewDto) {
if(reviewDto.getThirdStationId()==null){
//获取当前人管理场站
LambdaQueryWrapper<JpPersonStation> qug=new LambdaQueryWrapper<>();
qug.eq(JpPersonStation::getPersonId,getUserInfo().getUserId());
List<JpPersonStation> pPersonStation=pPersonStationMapper.selectList(qug);
}
Page<JpStationDto> page=jpStationServiceImpl.queryForJpStationPage(current,size,reviewDto); Page<JpStationDto> page=jpStationServiceImpl.queryForJpStationPage(current,size,reviewDto);
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
......
...@@ -54,7 +54,6 @@ public class TdHygfJpCollectorHistoryController extends BaseController { ...@@ -54,7 +54,6 @@ public class TdHygfJpCollectorHistoryController extends BaseController {
@PutMapping(value = "/{sequenceNbr}") @PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘采集器历史表", notes = "根据sequenceNbr更新户用光伏监盘采集器历史表") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘采集器历史表", notes = "根据sequenceNbr更新户用光伏监盘采集器历史表")
public ResponseModel<TdHygfJpCollectorHistoryDto> updateBySequenceNbrTdHygfJpCollectorHistory(@RequestBody TdHygfJpCollectorHistoryDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<TdHygfJpCollectorHistoryDto> updateBySequenceNbrTdHygfJpCollectorHistory(@RequestBody TdHygfJpCollectorHistoryDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.updateWithModel(model)); return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.updateWithModel(model));
} }
......
...@@ -54,7 +54,6 @@ public class TdHygfJpInverterHistoryController extends BaseController { ...@@ -54,7 +54,6 @@ public class TdHygfJpInverterHistoryController extends BaseController {
@PutMapping(value = "/{sequenceNbr}") @PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘逆变器历史表", notes = "根据sequenceNbr更新户用光伏监盘逆变器历史表") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘逆变器历史表", notes = "根据sequenceNbr更新户用光伏监盘逆变器历史表")
public ResponseModel<TdHygfJpInverterHistoryDto> updateBySequenceNbrTdHygfJpInverterHistory(@RequestBody TdHygfJpInverterHistoryDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<TdHygfJpInverterHistoryDto> updateBySequenceNbrTdHygfJpInverterHistory(@RequestBody TdHygfJpInverterHistoryDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(tdHygfJpInverterHistoryServiceImpl.updateWithModel(model)); return ResponseHelper.buildResponse(tdHygfJpInverterHistoryServiceImpl.updateWithModel(model));
} }
......
...@@ -54,7 +54,6 @@ public class TdHygfJpInverterWarnController extends BaseController { ...@@ -54,7 +54,6 @@ public class TdHygfJpInverterWarnController extends BaseController {
@PutMapping(value = "/{sequenceNbr}") @PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘逆变器报警表", notes = "根据sequenceNbr更新户用光伏监盘逆变器报警表") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘逆变器报警表", notes = "根据sequenceNbr更新户用光伏监盘逆变器报警表")
public ResponseModel<TdHygfJpInverterWarnDto> updateBySequenceNbrTdHygfJpInverterWarn(@RequestBody TdHygfJpInverterWarnDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<TdHygfJpInverterWarnDto> updateBySequenceNbrTdHygfJpInverterWarn(@RequestBody TdHygfJpInverterWarnDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(tdHygfJpInverterWarnServiceImpl.updateWithModel(model)); return ResponseHelper.buildResponse(tdHygfJpInverterWarnServiceImpl.updateWithModel(model));
} }
......
...@@ -54,7 +54,6 @@ public class TdHygfJpInvertorElecHistoryController extends BaseController { ...@@ -54,7 +54,6 @@ public class TdHygfJpInvertorElecHistoryController extends BaseController {
@PutMapping(value = "/{sequenceNbr}") @PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘逆变器电能历史表", notes = "根据sequenceNbr更新户用光伏监盘逆变器电能历史表") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘逆变器电能历史表", notes = "根据sequenceNbr更新户用光伏监盘逆变器电能历史表")
public ResponseModel<TdHygfJpInvertorElecHistoryDto> updateBySequenceNbrTdHygfJpInvertorElecHistory(@RequestBody TdHygfJpInvertorElecHistoryDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<TdHygfJpInvertorElecHistoryDto> updateBySequenceNbrTdHygfJpInvertorElecHistory(@RequestBody TdHygfJpInvertorElecHistoryDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.updateWithModel(model)); return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.updateWithModel(model));
} }
......
...@@ -54,7 +54,6 @@ public class TdHygfJpStationPowerHistoryController extends BaseController { ...@@ -54,7 +54,6 @@ public class TdHygfJpStationPowerHistoryController extends BaseController {
@PutMapping(value = "/{sequenceNbr}") @PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘电站功率表", notes = "根据sequenceNbr更新户用光伏监盘电站功率表") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘电站功率表", notes = "根据sequenceNbr更新户用光伏监盘电站功率表")
public ResponseModel<TdHygfJpStationPowerHistoryDto> updateBySequenceNbrTdHygfJpStationPowerHistory(@RequestBody TdHygfJpStationPowerHistoryDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<TdHygfJpStationPowerHistoryDto> updateBySequenceNbrTdHygfJpStationPowerHistory(@RequestBody TdHygfJpStationPowerHistoryDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(tdHygfJpStationPowerHistoryServiceImpl.updateWithModel(model)); return ResponseHelper.buildResponse(tdHygfJpStationPowerHistoryServiceImpl.updateWithModel(model));
} }
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpPersonStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IJpPersonStationService;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpPersonStationDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 户用光伏监盘人员场站关系表服务实现类
*
* @author system_generator
* @date 2023-09-19
*/
@Service
public class JpPersonStationServiceImpl extends BaseService<JpPersonStationDto,JpPersonStation,JpPersonStationMapper> implements IJpPersonStationService {
/**
* 分页查询
*/
public Page<JpPersonStationDto> queryForJpPersonStationPage(Page<JpPersonStationDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<JpPersonStationDto> queryForJpPersonStationList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
...@@ -31,6 +31,12 @@ ...@@ -31,6 +31,12 @@
<version>5.7.22</version> <version>5.7.22</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-jxiop-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId> <groupId>com.yeejoin</groupId>
<artifactId>amos-component-influxdb</artifactId> <artifactId>amos-component-influxdb</artifactId>
<version>1.8.5-SNAPSHOT</version> <version>1.8.5-SNAPSHOT</version>
......
...@@ -2,12 +2,15 @@ package com.yeejoin.amos.boot.module.jxiop.biz.entity; ...@@ -2,12 +2,15 @@ package com.yeejoin.amos.boot.module.jxiop.biz.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
/** /**
* *
...@@ -39,7 +42,7 @@ public class IdxBizFanWarningRecord{ ...@@ -39,7 +42,7 @@ public class IdxBizFanWarningRecord{
* *
*/ */
@TableField("REC_DATE") @TableField("REC_DATE")
private LocalDateTime recDate; private Date recDate;
/** /**
* *
......
...@@ -2,6 +2,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2; ...@@ -2,6 +2,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthIndex; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthIndex;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/** /**
* Mapper 接口 * Mapper 接口
...@@ -11,4 +16,16 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthIndex; ...@@ -11,4 +16,16 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthIndex;
*/ */
public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIndex> { public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIndex> {
BigDecimal getHealthScoreInfo(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode);
List<Map<String, Object>> getHealthListInfo(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode);
List<Map<String, Object>> getAllEquipAlarmInfo(@Param("tableName") String tableName);
List<Map<String, Object>> getHealthInfoByArea();
List<Map<String, Object>> getAllEquipAlarmInfoByStation();
List<Map<String, Object>> getHealthInfoByStation(@Param("areaCode") String areaCode);
} }
...@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2; ...@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* Mapper 接口 * Mapper 接口
...@@ -11,4 +14,14 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord; ...@@ -11,4 +14,14 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord;
*/ */
public interface IdxBizFanWarningRecordMapper extends BaseMapper<IdxBizFanWarningRecord> { public interface IdxBizFanWarningRecordMapper extends BaseMapper<IdxBizFanWarningRecord> {
List<IdxBizFanWarningRecord> getEquipWarningInfoByPage(@Param("arae") String arae,
@Param("station") String station,
@Param("stationType") String stationType,
@Param("current") Integer current,
@Param("size") Integer size,
@Param("warningName") String warningName);
Integer getEquipWarningInfoByPageCount(@Param("arae") String arae,
@Param("station") String station,
@Param("stationType") String stationType);
} }
...@@ -2,4 +2,220 @@ ...@@ -2,4 +2,220 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper">
<select id="getHealthScoreInfo" resultType="java.math.BigDecimal">
SELECT
avg( a.avgHealthIndex ) AS healthIndex
FROM
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex
FROM
idx_biz_fan_health_index
<where>ANALYSIS_TYPE = '按天'
AND
DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = DATE_FORMAT( NOW(), "%Y-%m-%d" )
<if test="areaCode != null and areaCode != ''">
AND ARAE = #{areaCode}
</if>
<if test="stationCode != null and stationCode != ''">
AND STATION = #{stationCode}
</if>
<if test="stationCode == null or stationCode == ''">
AND ( STATION IS NULL OR STATION = '' )
</if>
</where>
UNION ALL
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex
FROM
idx_biz_pv_health_index
<where>
ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = DATE_FORMAT( NOW(), "%Y-%m-%d" )
<if test="areaCode != null and areaCode != ''">
AND ARAE = #{areaCode}
</if>
<if test="stationCode != null and stationCode != ''">
AND STATION = #{stationCode}
</if>
<if test="stationCode == null or stationCode == ''">
AND ( STATION IS NULL OR STATION = '' )
</if>
</where>
)
) a
</select>
<select id="getHealthListInfo" resultType="java.util.Map">
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
a.date
FROM
(
SELECT
DATE_FORMAT( DATE_ADD(( DATE( DATE_ADD( now(), INTERVAL - 15 DAY ))), INTERVAL @s DAY ), '%Y-%m-%d' ) AS date,
@s := @s + 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 1 ) temp
WHERE
DATEDIFF( now(), DATE( DATE_ADD( now(), INTERVAL - 15 DAY )) ) >= @s
) a
LEFT JOIN (
SELECT
HEALTH_INDEX,
DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) AS recDate
FROM
idx_biz_pv_health_index
<where>
ANALYSIS_TYPE = '按天'
<if test="areaCode != null and areaCode != ''">
AND ARAE = #{areaCode}
</if>
<if test="stationCode != null and stationCode != ''">
AND STATION = #{stationCode}
</if>
<if test="stationCode == null or stationCode == ''">
AND ( STATION IS NULL OR STATION = '' )
</if>
</where>
UNION ALL
(
SELECT
HEALTH_INDEX,
DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) AS recDate
FROM
idx_biz_fan_health_index
<where>
ANALYSIS_TYPE = '按天'
<if test="areaCode != null and areaCode != ''">
AND ARAE = #{areaCode}
</if>
<if test="stationCode != null and stationCode != ''">
AND STATION = #{stationCode}
</if>
<if test="stationCode == null or stationCode == ''">
AND ( STATION IS NULL OR STATION = '' )
</if>
</where>
)
) b ON DATE_FORMAT( b.recDate, "%Y-%m-%d" ) = a.date
GROUP BY
a.date
</select>
<select id="getAllEquipAlarmInfo" resultType="java.util.Map">
SELECT
ARAE as area,
WARNING_NAME as warningName,
count(1) as num
FROM
${tableName} a
group by ARAE,
WARNING_NAME
</select>
<select id="getHealthInfoByArea" resultType="java.util.Map">
SELECT
ARAE as area,
avg( a.avgHealthIndex ) AS healthIndex
FROM
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
ARAE
FROM
idx_biz_fan_health_index
WHERE
( STATION IS NULL OR STATION = '' )
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = DATE_FORMAT( NOW(), "%Y-%m-%d" )
GROUP BY
ARAE UNION ALL
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
ARAE
FROM
idx_biz_pv_health_index
WHERE
( STATION IS NULL OR STATION = '' )
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = DATE_FORMAT( NOW(), "%Y-%m-%d" )
GROUP BY
ARAE
)
) a
GROUP BY
a.ARAE
</select>
<select id="getAllEquipAlarmInfoByStation" resultType="java.util.Map">
SELECT
STATION as station,
WARNING_NAME as warningName,
count(1) as num
FROM
idx_biz_fan_warning_record
group by STATION,
WARNING_NAME
union all
SELECT
STATION as station,
WARNING_NAME as warningName,
count(1) as num
FROM
idx_biz_pv_warning_record
group by STATION,
WARNING_NAME
</select>
<select id="getHealthInfoByStation" resultType="java.util.Map">
SELECT
a.STATION as station,
avg( a.avgHealthIndex ) AS healthIndex
FROM
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
STATION
FROM
idx_biz_fan_health_index
<where>
( STATION IS NOT NULL OR STATION != '' )
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = DATE_FORMAT( NOW(), "%Y-%m-%d" )
<if test="areaCode != null and areaCode != ''">
AND ARAE = #{areaCode}
</if>
</where>
GROUP BY
STATION UNION ALL
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
ARAE
FROM
idx_biz_pv_health_index
<where>
( STATION IS NOT NULL OR STATION != '' )
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = DATE_FORMAT( NOW(), "%Y-%m-%d" )
<if test="areaCode != null and areaCode != ''">
AND ARAE = #{areaCode}
</if>
</where>
GROUP BY
STATION
)
) a
GROUP BY
a.STATION
</select>
</mapper> </mapper>
...@@ -2,4 +2,93 @@ ...@@ -2,4 +2,93 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWarningRecordMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWarningRecordMapper">
<select id="getEquipWarningInfoByPage"
resultType="com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord">
SELECT
a.*
FROM
(
SELECT
REC_DATE AS recDate,
STATION AS station,
EQUIPMENT_NAME AS equipmentName,
CONTENT AS content,
WARNING_NAME AS warningName,
DISPOSOTION_STATE AS disposotionState,
ARAE AS arae,
'pv' AS stationType
FROM
idx_biz_pv_warning_record UNION ALL
SELECT
REC_DATE AS recDate,
STATION AS station,
EQUIPMENT_NAME AS equipmentName,
CONTENT AS content,
WARNING_NAME AS warningName,
DISPOSOTION_STATE AS disposotionState,
ARAE AS arae,
'fan' AS stationType
FROM
idx_biz_fan_warning_record
) a
<where>
<if test="arae != '' and arae != null">
AND a.arae = #{arae}
</if>
<if test="station != '' and station != null">
AND a.station = #{station}
</if>
<if test="stationType != '' and stationType != null">
AND a.stationType = #{stationType}
</if>
<if test="warningName != '' and warningName != null">
AND a.WARNING_NAME = #{warningName}
</if>
</where>
limit #{current}, #{size}
</select>
<select id="getEquipWarningInfoByPageCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM
(
SELECT
REC_DATE AS recDate,
STATION AS station,
EQUIPMENT_NAME AS equipmentName,
CONTENT AS content,
WARNING_NAME AS warningName,
DISPOSOTION_STATE AS disposotionState,
ARAE AS arae,
'pv' AS stationType
FROM
idx_biz_pv_warning_record UNION ALL
SELECT
REC_DATE AS recDate,
STATION AS station,
EQUIPMENT_NAME AS equipmentName,
CONTENT AS content,
WARNING_NAME AS warningName,
DISPOSOTION_STATE AS disposotionState,
ARAE AS arae,
'fan' AS stationType
FROM
idx_biz_fan_warning_record
) a
<where>
<if test="arae != '' and arae != null">
AND a.arae = #{arae}
</if>
<if test="station != '' and station != null">
AND a.station = #{station}
</if>
<if test="stationType != '' and stationType != null">
AND a.stationType = #{stationType}
</if>
<if test="warningName != '' and warningName != null">
AND a.WARNING_NAME = #{warningName}
</if>
</where>
</select>
</mapper> </mapper>
...@@ -986,7 +986,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -986,7 +986,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
//构建平台数据 //构建平台数据
DataGridMock DataGridMock = new DataGridMock(current, resultList.size(), false, current, resultList); DataGridMock DataGridMock = new DataGridMock(current, resultList.size(), false, current, resultList);
ColModel colModelEquipmentNumber = new ColModel("equipmentNumber", "equipmentNumber", "风机编码", "风机编码", "dataGrid", "equipmentNumber"); ColModel colModelEquipmentNumber = new ColModel("equipmentNumber", "equipmentNumber", "风机编码", "风机编码", "dataGrid", "equipmentNumber");
ColModel colModelPower = new ColModel("power", "power", "有功功率(MV)", "有功功率(MV)", "dataGrid", "power"); ColModel colModelPower = new ColModel("power", "power", "有功功率(kW)", "有功功率(kW)", "dataGrid", "power");
ColModel colModelWindSpeed = new ColModel("windSpeed", "windSpeed", "风速(m/s)", "风速(m/s)", "dataGrid", "windSpeed"); ColModel colModelWindSpeed = new ColModel("windSpeed", "windSpeed", "风速(m/s)", "风速(m/s)", "dataGrid", "windSpeed");
ColModel colModelWind = new ColModel("wind", "wind", "风向(°)", "风向(°)", "dataGrid", "wind"); ColModel colModelWind = new ColModel("wind", "wind", "风向(°)", "风向(°)", "dataGrid", "wind");
ColModel colModelElectricity = new ColModel("electricity", "electricity", "日发电量(万KWh)", "日发电量(万KWh)", "dataGrid", "electricity"); ColModel colModelElectricity = new ColModel("electricity", "electricity", "日发电量(万KWh)", "日发电量(万KWh)", "dataGrid", "electricity");
......
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