Commit bf1a96c7 authored by tangwei's avatar tangwei

解决冲突

parents 84b0794c f86040ee
......@@ -16,6 +16,16 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpCollectorHistory;
*/
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);
List<TdHygfJpCollectorHistoryDto> dayList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("startTime") long startTime,
@Param("endTime") long endTime);
List<TdHygfJpCollectorHistoryDto> monthList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("month") String month);
List<TdHygfJpCollectorHistoryDto> yearList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("year") String year);
List<TdHygfJpCollectorHistoryDto> allList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId);
}
......@@ -7,7 +7,7 @@
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="startTime!=null and endTime!=null">
......@@ -15,4 +15,43 @@
</if>
</where>
</select>
<select id="monthList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryMonthDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_history_month
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="month!=null">
AND year_month = #{month}
</if>
</where>
</select>
<select id="yearList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryYearDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_history_month
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="year!=null">
AND year = #{year}
</if>
</where>
</select>
<select id="yearList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryAllDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_history_month
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
</where>
</select>
</mapper>
......@@ -131,4 +131,42 @@ public class TdHygfJpCollectorHistoryController extends BaseController {
@RequestParam(value = "day") @DateTimeFormat(pattern = "yyyy-MM-dd") Date day) {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.dayList(id, day));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/month")
public ResponseModel<List<TdHygfJpCollectorHistoryDto>> monthList(@RequestParam(value = "id") long id,
@RequestParam(value = "month") @DateTimeFormat(pattern = "yyyy-MM") Date month) {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.monthList(id, month));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/year")
public ResponseModel<List<TdHygfJpCollectorHistoryDto>> yearList(@RequestParam(value = "id") long id,
@RequestParam(value = "year") @DateTimeFormat(pattern = "yyyy") Date year) {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.yearList(id, year));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/all")
public ResponseModel<List<TdHygfJpCollectorHistoryDto>> allList(@RequestParam(value = "id") long id) {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.allList(id));
}
}
......@@ -9,11 +9,13 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpCollector;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpCollectorHistory;
import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpCollectorHistoryService;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryAllMapper;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryMonthMapper;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryYearMapper;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpCollectorHistoryMapper;
import com.yeejoin.amos.boot.module.hygf.api.util.TimeUtil;
......@@ -51,4 +53,42 @@ public class TdHygfJpCollectorHistoryServiceImpl
}
return new ArrayList<>();
}
/**
* 列表查询 示例
*/
public List<TdHygfJpCollectorHistoryDto> monthList(long id, Date month) {
JpCollector collector = jpCollectorServiceImpl.getById(id);
if (collector != null) {
return this.baseMapper.monthList(collector.getSnCode(), collector.getThirdStationId(),
month.toString());
}
return new ArrayList<>();
}
/**
* 列表查询 示例
*/
public List<TdHygfJpCollectorHistoryDto> yearList(long id, Date year) {
JpCollector collector = jpCollectorServiceImpl.getById(id);
if (collector != null) {
return this.baseMapper.yearList(collector.getSnCode(), collector.getThirdStationId(),
year.toString());
}
return new ArrayList<>();
}
/**
* 列表查询 示例
*/
public List<TdHygfJpCollectorHistoryDto> allList(long id) {
JpCollector collector = jpCollectorServiceImpl.getById(id);
if (collector != null) {
return this.baseMapper.allList(collector.getSnCode(), collector.getThirdStationId());
}
return new ArrayList<>();
}
}
\ No newline at end of file
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