Commit e9abeee2 authored by wujiang's avatar wujiang

添加采集器接口

parent bd1eb970
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpCollectorHistory;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpCollectorHistory;
/**
* 户用光伏监盘采集器历史表 Mapper 接口
......@@ -11,4 +16,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface TdHygfJpCollectorHistoryMapper extends BaseMapper<TdHygfJpCollectorHistory> {
List<TdHygfJpCollectorHistoryDto> dayList(@Param("snCode") String snCode, @Param("thirdStationId") String thirdStationId,
@Param("startTime") long startTime, @Param("endTime") long endTime);
}
<?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.tdenginemapper.TdHygfJpCollectorHistoryMapper">
<select id="dayList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_history
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="startTime!=null and endTime!=null">
AND time BETWEEN #{startTime} AND #{endTime}
</if>
</where>
</select>
</mapper>
<?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.tdenginemapper.TdHygfJpInverterHistoryMapper">
<select id="dayList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_history
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="startTime!=null and endTime!=null">
AND time BETWEEN #{startTime} AND #{endTime}
</if>
</where>
</select>
</mapper>
......@@ -2,8 +2,6 @@
<!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">
<select id="getCountTdHygfJpInverterWarn" resultType="map">
SELECT `state`,count(`state`) num
FROM house_pv_data.td_hygf_jp_inverter_warn
......@@ -23,7 +21,13 @@
<where>
<if test="param.state!=null">
`state` = #{param.state}
</if>
</if>
<if test="param.stationIds!=null">
AND third_station_id IN
<foreach collection="param.stationIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>
<?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.tdenginemapper.TdHygfJpInvertorElecHistoryMapper">
<select id="list" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto">
SELECT * FROM house_pv_data.td_hygf_jp_inverter_warn
<select id="dayList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInvertorElecHistoryDto">
SELECT * FROM house_pv_data.td_hygf_jp_invertor_elec_history
<where>
<if test="param.state!=null">
`state` = #{param.state}
</if>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="startTime!=null and endTime!=null">
AND time BETWEEN #{startTime} AND #{endTime}
</if>
</where>
</select>
</mapper>
......@@ -128,7 +128,7 @@ public class TdHygfJpCollectorHistoryController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/day")
public ResponseModel<List<TdHygfJpCollectorHistory>> dayList(@RequestParam(value = "id") long id,
@RequestParam(value = "day") @DateTimeFormat() Date day) {
@RequestParam(value = "day") @DateTimeFormat(pattern = "yyyy-MM-dd") Date day) {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.dayList(id, day));
}
}
......@@ -128,7 +128,7 @@ public class TdHygfJpInvertorElecHistoryController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器电能历史表列表全部数据查询", notes = "户用光伏监盘逆变器电能历史表列表全部数据查询")
@GetMapping(value = "/list/day")
public ResponseModel<List<TdHygfJpInvertorElecHistory>> dayList(@RequestParam(value = "id") long id,
@RequestParam(value = "day") @DateTimeFormat() Date day) {
@RequestParam(value = "day") @DateTimeFormat(pattern = "yyyy-MM-dd") Date day) {
return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.dayList(id, day));
}
}
......@@ -44,6 +44,7 @@ public class TdHygfJpCollectorHistoryServiceImpl
*/
public List<TdHygfJpCollectorHistory> dayList(long id, Date day) {
JpCollector collector = jpCollectorServiceImpl.getById(id);
if (collector != null) {
LambdaQueryChainWrapper<TdHygfJpCollectorHistory> warpper = this.lambdaQuery()
.between(TdHygfJpCollectorHistory::getTime, TimeUtil.getStartTimeOfDay(day),
......
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