Commit 5ef01947 authored by tangwei's avatar tangwei

修改配置

parent e5e69bcc
...@@ -18,6 +18,6 @@ import java.util.Map; ...@@ -18,6 +18,6 @@ import java.util.Map;
public interface JpStationMapper extends BaseMapper<JpStation> { public interface JpStationMapper extends BaseMapper<JpStation> {
List<JpStationDto> queryForDealerReviewPage(@Param("dto") JpStationDto reviewDto); List<JpStationDto> queryForDealerReviewPage(@Param("dto") JpStationDto reviewDto);
JpStationDto queryCount(@Param("dto") JpStationDto reviewDto); JpStationDto queryCount(@Param("dto") JpStationDto reviewDto);
Map<String,Object> countState(@Param("dto") JpStationDto reviewDto); List<Map<String,Object>> countState(@Param("dto") JpStationDto reviewDto);
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn; import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/** /**
* 户用光伏监盘逆变器报警表 Mapper 接口 * 户用光伏监盘逆变器报警表 Mapper 接口
...@@ -11,4 +16,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +16,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface TdHygfJpInverterWarnMapper extends BaseMapper<TdHygfJpInverterWarn> { public interface TdHygfJpInverterWarnMapper extends BaseMapper<TdHygfJpInverterWarn> {
List<Map<String,Object>> getCountTdHygfJpInverterWarn(@Param("dto") List<JpStation> dto);
} }
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<if test="dto.name!=null"> <if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%") and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
</if> </if>
<if test="dto.nauserNameme!=null"> <if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.nauserNameme}),"%") and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
</if> </if>
<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}),"%")
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
count(*) countBuiltNum count(*) countBuiltNum
from hygf_jp_station from hygf_jp_station
<where> <where>
<if test="dto.nauserNameme!=null"> <if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%") and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
</if> </if>
<if test="dto.area!=null"> <if test="dto.area!=null">
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<if test="dto.name!=null"> <if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%") and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
</if> </if>
<if test="dto.nauserNameme!=null"> <if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%") and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
</if> </if>
<if test="dto.statioId!=null"> <if test="dto.statioId!=null">
......
...@@ -2,4 +2,22 @@ ...@@ -2,4 +2,22 @@
<!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.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper">
<select id="getCountTdHygfJpInverterWarn" resultType="map">
SELECT `state`,count(`state`) num
FROM house_pv_data.td_hygf_jp_inverter_warn
<where>
<if test="dto!=null">
third_station_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item.stationId}
</foreach>
</if>
</where>
GROUP BY `state`
</select>
</mapper> </mapper>
...@@ -47,7 +47,7 @@ import java.net.InetAddress; ...@@ -47,7 +47,7 @@ import java.net.InetAddress;
@EnableScheduling @EnableScheduling
@MapperScan({ "org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*", @MapperScan({ "org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*", "org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*",
"com.yeejoin.amos.boot.module.**.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper","com.yeejoin.amos.boot.module.common.biz.*" }) "com.yeejoin.amos.boot.module.**.api.tdenginemapper","com.yeejoin.amos.boot.module.**.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper","com.yeejoin.amos.boot.module.common.biz.*" })
@ComponentScan(basePackages = { "org.typroject", "com.yeejoin.amos" }) @ComponentScan(basePackages = { "org.typroject", "com.yeejoin.amos" })
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, MybatisAutoConfiguration.class}) @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, MybatisAutoConfiguration.class})
public class AmosHygfApplication { public class AmosHygfApplication {
......
...@@ -74,7 +74,6 @@ public class TDengineServerConfig { ...@@ -74,7 +74,6 @@ public class TDengineServerConfig {
@Bean @Bean
public PaginationInterceptor paginationInterceptor() { public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
paginationInterceptor.setDialectType("mysql");
return paginationInterceptor; return paginationInterceptor;
} }
......
...@@ -130,7 +130,7 @@ public class JpStationController extends BaseController { ...@@ -130,7 +130,7 @@ public class JpStationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/countState") @GetMapping(value = "/countState")
@ApiOperation(httpMethod = "GET",value = "场站列表", notes = "场站列表") @ApiOperation(httpMethod = "GET",value = "场站列表", notes = "场站列表")
public ResponseModel<Map<String,Object>> countState(JpStationDto reviewDto) { public ResponseModel< List<Map<String,Object>>> countState(JpStationDto reviewDto) {
//获取当前人管理场站 //获取当前人管理场站
LambdaQueryWrapper<JpPersonStation> qug=new LambdaQueryWrapper<>(); LambdaQueryWrapper<JpPersonStation> qug=new LambdaQueryWrapper<>();
......
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.JpStationDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpPersonStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper;
import org.apache.commons.lang.StringUtils;
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;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.TdHygfJpInverterWarnServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.TdHygfJpInverterWarnServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -30,7 +43,12 @@ public class TdHygfJpInverterWarnController extends BaseController { ...@@ -30,7 +43,12 @@ public class TdHygfJpInverterWarnController extends BaseController {
@Autowired @Autowired
TdHygfJpInverterWarnServiceImpl tdHygfJpInverterWarnServiceImpl; TdHygfJpInverterWarnServiceImpl tdHygfJpInverterWarnServiceImpl;
@Autowired
JpPersonStationMapper pPersonStationMapper;
@Autowired
TdHygfJpInverterWarnMapper tdHygfJpInverterWarnMapper;
@Autowired
JpStationMapper jpStationMapper;
/** /**
* 新增户用光伏监盘逆变器报警表 * 新增户用光伏监盘逆变器报警表
* *
...@@ -117,4 +135,39 @@ public class TdHygfJpInverterWarnController extends BaseController { ...@@ -117,4 +135,39 @@ public class TdHygfJpInverterWarnController extends BaseController {
public ResponseModel<List<TdHygfJpInverterWarnDto>> selectForList() { public ResponseModel<List<TdHygfJpInverterWarnDto>> selectForList() {
return ResponseHelper.buildResponse(tdHygfJpInverterWarnServiceImpl.queryForTdHygfJpInverterWarnList()); return ResponseHelper.buildResponse(tdHygfJpInverterWarnServiceImpl.queryForTdHygfJpInverterWarnList());
} }
/**
* 获取告警统计
* **/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器报警表列表全部数据查询", notes = "户用光伏监盘逆变器报警表列表全部数据查询")
@GetMapping(value = "/selectcount")
public ResponseModel< List<Map<String,Object>>> selectcount(JpStationDto reviewDto) {
LambdaQueryWrapper<JpStation> qugda=new LambdaQueryWrapper<>();
//获取当前人管理场站
if(reviewDto.getThirdStationId()==null){
//获取当前人管理场站
LambdaQueryWrapper<JpPersonStation> qug=new LambdaQueryWrapper<>();
qug.eq(JpPersonStation::getPersonId,getUserInfo().getUserId());
List<JpPersonStation> pPersonStation=pPersonStationMapper.selectList(qug);
List ids=null;
if(pPersonStation!=null&&!pPersonStation.isEmpty()){
ids=new ArrayList();
for (JpPersonStation jpPersonStation : pPersonStation) {
ids.add(jpPersonStation.getStationId());
}
qugda.in(ids!=null,JpStation::getThirdStationId,ids);
}
}else{
qugda.eq(JpStation::getThirdStationId,reviewDto.getThirdStationId());
}
qugda.like(reviewDto.getUserName()!=null,JpStation::getUserName,reviewDto.getUserName());
qugda.like(reviewDto.getArea()!=null,JpStation::getArea,reviewDto.getArea());
List<JpStation> pPersonStation=jpStationMapper.selectList(qugda);
List<Map<String,Object>> datalist= tdHygfJpInverterWarnMapper.getCountTdHygfJpInverterWarn(pPersonStation);
return ResponseHelper.buildResponse(datalist);
}
} }
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