Commit ab60131f authored by wujiang's avatar wujiang

修改接口

parent e9abeee2
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.TdHygfJpInvertorElecHistory; import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInvertorElecHistoryDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInvertorElecHistory;
/** /**
* 户用光伏监盘逆变器电能历史表 Mapper 接口 * 户用光伏监盘逆变器电能历史表 Mapper 接口
...@@ -10,5 +15,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -10,5 +15,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @date 2023-09-19 * @date 2023-09-19
*/ */
public interface TdHygfJpInvertorElecHistoryMapper extends BaseMapper<TdHygfJpInvertorElecHistory> { public interface TdHygfJpInvertorElecHistoryMapper extends BaseMapper<TdHygfJpInvertorElecHistory> {
List<TdHygfJpInvertorElecHistoryDto> dayList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("startTime") long startTime,
@Param("endTime") long endTime);
} }
...@@ -127,7 +127,7 @@ public class TdHygfJpCollectorHistoryController extends BaseController { ...@@ -127,7 +127,7 @@ public class TdHygfJpCollectorHistoryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/day") @GetMapping(value = "/list/day")
public ResponseModel<List<TdHygfJpCollectorHistory>> dayList(@RequestParam(value = "id") long id, public ResponseModel<List<TdHygfJpCollectorHistoryDto>> dayList(@RequestParam(value = "id") long id,
@RequestParam(value = "day") @DateTimeFormat(pattern = "yyyy-MM-dd") Date day) { @RequestParam(value = "day") @DateTimeFormat(pattern = "yyyy-MM-dd") Date day) {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.dayList(id, day)); return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.dayList(id, day));
} }
......
...@@ -127,7 +127,7 @@ public class TdHygfJpInvertorElecHistoryController extends BaseController { ...@@ -127,7 +127,7 @@ public class TdHygfJpInvertorElecHistoryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器电能历史表列表全部数据查询", notes = "户用光伏监盘逆变器电能历史表列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器电能历史表列表全部数据查询", notes = "户用光伏监盘逆变器电能历史表列表全部数据查询")
@GetMapping(value = "/list/day") @GetMapping(value = "/list/day")
public ResponseModel<List<TdHygfJpInvertorElecHistory>> dayList(@RequestParam(value = "id") long id, public ResponseModel<List<TdHygfJpInvertorElecHistoryDto>> dayList(@RequestParam(value = "id") long id,
@RequestParam(value = "day") @DateTimeFormat(pattern = "yyyy-MM-dd") Date day) { @RequestParam(value = "day") @DateTimeFormat(pattern = "yyyy-MM-dd") Date day) {
return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.dayList(id, day)); return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.dayList(id, day));
} }
......
...@@ -42,16 +42,12 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -42,16 +42,12 @@ public class TdHygfJpCollectorHistoryServiceImpl
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<TdHygfJpCollectorHistory> dayList(long id, Date day) { public List<TdHygfJpCollectorHistoryDto> dayList(long id, Date day) {
JpCollector collector = jpCollectorServiceImpl.getById(id); JpCollector collector = jpCollectorServiceImpl.getById(id);
if (collector != null) { if (collector != null) {
LambdaQueryChainWrapper<TdHygfJpCollectorHistory> warpper = this.lambdaQuery() return this.baseMapper.dayList(collector.getSnCode(), collector.getThirdStationId(),
.between(TdHygfJpCollectorHistory::getTime, TimeUtil.getStartTimeOfDay(day), TimeUtil.getStartTimeOfDay(day), TimeUtil.getEndTimeOfDay(day));
TimeUtil.getEndTimeOfDay(day))
.eq(TdHygfJpCollectorHistory::getSnCode, collector.getSnCode())
.eq(TdHygfJpCollectorHistory::getThirdStationId, collector.getThirdStationId());
return this.baseMapper.selectList(warpper);
} }
return new ArrayList<>(); return new ArrayList<>();
} }
......
...@@ -43,15 +43,11 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -43,15 +43,11 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<TdHygfJpInvertorElecHistory> dayList(long id, Date day) { public List<TdHygfJpInvertorElecHistoryDto> dayList(long id, Date day) {
JpInverter invertor = jpInvertorServiceImpl.getById(id); JpInverter invertor = jpInvertorServiceImpl.getById(id);
if (invertor != null) { if (invertor != null) {
LambdaQueryChainWrapper<TdHygfJpInvertorElecHistory> warpper = this.lambdaQuery() return this.baseMapper.dayList(invertor.getSnCode(), invertor.getThirdStationId(),
.between(TdHygfJpInvertorElecHistory::getTime, TimeUtil.getStartTimeOfDay(day), TimeUtil.getStartTimeOfDay(day), TimeUtil.getEndTimeOfDay(day));
TimeUtil.getEndTimeOfDay(day))
.eq(TdHygfJpInvertorElecHistory::getSnCode, invertor.getSnCode())
.eq(TdHygfJpInvertorElecHistory::getThirdStationId, invertor.getThirdStationId());
return this.baseMapper.selectList(warpper);
} }
return new ArrayList<>(); return new ArrayList<>();
} }
......
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