Commit 1aebbe6d authored by wujiang's avatar wujiang

添加曲线接口

parent 23cab297
......@@ -42,9 +42,6 @@ public class TdHygfJpInvertorElecHistoryDto {
@ApiModelProperty(value = "W交流电流")
private Double wAcCurrent;
@ApiModelProperty(value = "品牌")
private String brand;
@ApiModelProperty(value = "时间")
private Long time;
......
......@@ -64,12 +64,6 @@ public class TdHygfJpInvertorElecHistory {
private Double wAcCurrent;
/**
* 品牌
*/
@TableField("brand")
private String brand;
/**
* 时间
*/
@TableField("time")
......
......@@ -5,6 +5,9 @@ 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.JpInvertorElecHistoryAllDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryMonthDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryYearDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInvertorElecHistoryDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInvertorElecHistory;
......@@ -19,4 +22,13 @@ public interface TdHygfJpInvertorElecHistoryMapper extends BaseMapper<TdHygfJpIn
List<TdHygfJpInvertorElecHistoryDto> dayList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("startTime") long startTime,
@Param("endTime") long endTime);
List<JpInvertorElecHistoryMonthDto> monthList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("month") String month);
List<JpInvertorElecHistoryYearDto> yearList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("year") String year);
List<JpInvertorElecHistoryAllDto> allList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId);
}
......@@ -15,4 +15,43 @@
</if>
</where>
</select>
<select id="monthList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryMonthDto">
SELECT * FROM house_pv_data.td_hygf_jp_invertor_elec_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.JpInvertorElecHistoryYearDto">
SELECT * FROM house_pv_data.td_hygf_jp_invertor_elec_history_year
<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="allList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryAllDto">
SELECT * FROM house_pv_data.td_hygf_jp_invertor_elec_history_all
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
</where>
</select>
</mapper>
......@@ -23,8 +23,10 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryAllDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryMonthDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryYearDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInvertorElecHistoryDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInvertorElecHistory;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.TdHygfJpInvertorElecHistoryServiceImpl;
import io.swagger.annotations.Api;
......@@ -131,4 +133,42 @@ public class TdHygfJpInvertorElecHistoryController extends BaseController {
@RequestParam(value = "day") @DateTimeFormat(pattern = "yyyy-MM-dd") Date day) {
return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.dayList(id, day));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/month")
public ResponseModel<List<JpInvertorElecHistoryMonthDto>> monthList(@RequestParam(value = "id") long id,
@RequestParam(value = "month") @DateTimeFormat(pattern = "yyyy-MM") Date month) {
return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.monthList(id, month));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/year")
public ResponseModel<List<JpInvertorElecHistoryYearDto>> yearList(@RequestParam(value = "id") long id,
@RequestParam(value = "year") @DateTimeFormat(pattern = "yyyy") Date year) {
return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.yearList(id, year));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/all")
public ResponseModel<List<JpInvertorElecHistoryAllDto>> allList(@RequestParam(value = "id") long id) {
return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.allList(id));
}
}
......@@ -9,10 +9,12 @@ 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.JpInvertorElecHistoryAllDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryMonthDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryYearDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInvertorElecHistoryDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpCollector;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInverter;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpCollectorHistory;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInvertorElecHistory;
import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpInvertorElecHistoryService;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInvertorElecHistoryMapper;
......@@ -51,4 +53,40 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
}
return new ArrayList<>();
}
/**
* 列表查询 示例
*/
public List<JpInvertorElecHistoryMonthDto> monthList(long id, Date month) {
JpInverter invertor = jpInvertorServiceImpl.getById(id);
if (invertor != null) {
return this.baseMapper.monthList(invertor.getSnCode(), invertor.getThirdStationId(), month.toString());
}
return new ArrayList<>();
}
/**
* 列表查询 示例
*/
public List<JpInvertorElecHistoryYearDto> yearList(long id, Date year) {
JpInverter invertor = jpInvertorServiceImpl.getById(id);
if (invertor != null) {
return this.baseMapper.yearList(invertor.getSnCode(), invertor.getThirdStationId(), year.toString());
}
return new ArrayList<>();
}
/**
* 列表查询 示例
*/
public List<JpInvertorElecHistoryAllDto> allList(long id) {
JpInverter invertor = jpInvertorServiceImpl.getById(id);
if (invertor != null) {
return this.baseMapper.allList(invertor.getSnCode(), invertor.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