Commit f9b5df50 authored by co_dengxiongwen's avatar co_dengxiongwen

接口调整

parent 3e552d54
......@@ -1165,6 +1165,26 @@ public class DateUtil {
return length;
}
/**
* 判断两个日期按哪种类型统计
* 1:小时
* 2:天
* 3:月
* 4:年
*/
public static int checkTimeToType(String startTime,String endTime) {
int type = 1;
if(StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)){
Date time1 = parseFormatIso8601Date(startTime);
Date time2 = parseFormatIso8601Date(endTime);
if(daysBetweenDates(time2,time1) > 2){
type = 2;
}
}
return type;
}
/**
* 得到两个日期之间相差的天数
*
......@@ -2492,12 +2512,12 @@ public class DateUtil {
return DateUtil.format(date, DateUtil.friendlyDateFormat(true));
}
public static Date parseFormatIso8601Date(String date) throws Exception {
public static Date parseFormatIso8601Date(String date){
Date returnDate = null;
try {
returnDate = M_FORMAT_ISO_8601_DAY.parse(date);
} catch (Exception e) {
throw e;
e.printStackTrace();
}
return returnDate;
}
......@@ -2916,4 +2936,45 @@ public class DateUtil {
return str + rannum;
}
/**
* 获取本月最后一天
* @return
*/
public static String getStringOfLastDayInMonth() {
// 获取当前月最后一天
Calendar ca = Calendar.getInstance();
ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH));
return DateUtil.formatIso8601Day(ca.getTime());
}
/**
* 获取距离本月几个月的1号
* @return
*/
public static String getStringOfFirstDayInMonth(Date date,Integer addMonth) {
return DateUtil.formatIso8601Day(getFirstDayOfMonth(date,addMonth));
}
/**
* 给日期加上00:00:00
* @return
*/
public static String getStringOfFirstDay(String time) {
if(StringUtils.isNotBlank(time)){
return time + " 00:00:00";
}
return time;
}
/**
* 给日期加上23:59:59
* @return
*/
public static String getStringOfLastDay(String time) {
if(StringUtils.isNotBlank(time)){
return time + " 23:59:59";
}
return time ;
}
}
package com.devplatform.admin.modules.eq.controller;
import com.devplatform.admin.common.utils.AbstractController;
import com.devplatform.admin.common.utils.DateUtil;
import com.devplatform.admin.common.utils.DateUtils;
import com.devplatform.admin.modules.eq.bean.SwqxzInfoHour;
import com.devplatform.admin.modules.eq.service.AnalysisService;
......@@ -56,8 +57,10 @@ public class AnalysisController extends AbstractController {
*/
@ApiOperation(value="获取室外气象站数据", notes="获取室外气象站数据")
@GetMapping("/getSwqxzInfoTj")
public R getSwqxzInfoTj(@RequestParam Integer type) {
List<SwqxzInfoHour> list = swqxzInfoHourService.getList(type);
public R getSwqxzInfoTj(String startTime, String endTime) {
startTime = DateUtil.getStringOfFirstDay(startTime);
endTime = DateUtil.getStringOfLastDay(endTime);
List<SwqxzInfoHour> list = swqxzInfoHourService.getList(startTime,endTime);
List<List<String>> temperatureList = new ArrayList<List<String>>();
List<List<String>> humidityList = new ArrayList<List<String>>();
......@@ -123,12 +126,14 @@ public class AnalysisController extends AbstractController {
*/
@ApiOperation(value="获取室内气象数据", notes="获取室内气象数据")
@GetMapping("/getSnqxzInfoTj")
public R getSnqxzInfoTj(@RequestParam("resourceId") String resourceId,@RequestParam("type") Integer type,@RequestParam("region") Integer region) {
public R getSnqxzInfoTj(@RequestParam("resourceId") String resourceId,@RequestParam("startTime") String startTime,@RequestParam("endTime") String endTime,@RequestParam("region") Integer region) {
List<Map<String,Object>> list = new ArrayList<>();
startTime = DateUtil.getStringOfFirstDay(startTime);
endTime = DateUtil.getStringOfLastDay(endTime);
if(StringUtils.isNotBlank(resourceId)){
list = snqxzInfoHourService.getList(resourceId,type);
list = snqxzInfoHourService.getList(resourceId,startTime,endTime);
}else{
list = snqxzInfoHourService.getListFx(region,type);
list = snqxzInfoHourService.getListFx(region,startTime,endTime);
}
List<List<String>> temperatureList = new ArrayList<List<String>>();
List<List<String>> humidityList = new ArrayList<List<String>>();
......@@ -166,8 +171,10 @@ public class AnalysisController extends AbstractController {
*/
@ApiOperation(value="获取用电数据-统计图表", notes="获取用电数据-统计图表")
@GetMapping("/getEnergyTb")
public R getEnergyTb(@RequestParam("resourceId") String resourceId,@RequestParam("type") Integer type,@RequestParam("resourceType") String resourceType) {
List<List<String>> list = analysisService.getEnergyListTb(resourceId,type,resourceType);
public R getEnergyTb(@RequestParam("resourceId") String resourceId,@RequestParam("startTime") String startTime,@RequestParam("endTime") String endTime,@RequestParam("resourceType") String resourceType) {
startTime = DateUtil.getStringOfFirstDay(startTime);
endTime = DateUtil.getStringOfLastDay(endTime);
List<List<String>> list = analysisService.getEnergyListTb(resourceId,startTime,endTime,resourceType);
return R.ok().put("list", list);
}
......@@ -177,8 +184,10 @@ public class AnalysisController extends AbstractController {
*/
@ApiOperation(value="获取能耗数据分析", notes="获取能耗数据分析")
@GetMapping("/getEnergyFx")
public R getEnergyFx(@RequestParam("type") Integer type,@RequestParam("resourceType") String resourceType) {
List<List<String>> list = analysisService.getEnergyListFx(type,resourceType);
public R getEnergyFx(@RequestParam("startTime") String startTime,@RequestParam("endTime") String endTime,@RequestParam("resourceType") String resourceType) {
startTime = DateUtil.getStringOfFirstDay(startTime);
endTime = DateUtil.getStringOfLastDay(endTime);
List<List<String>> list = analysisService.getEnergyListFx(startTime,endTime,resourceType);
return R.ok().put("list", list);
}
......@@ -196,6 +205,8 @@ public class AnalysisController extends AbstractController {
dataType = "Map<String, Object>")
@GetMapping("/getFaultAlarmList")
public R getFaultAlarmList(@RequestParam Map<String, Object> params) {
params.put("startTime",DateUtil.getStringOfFirstDay((String) params.get("startTime")));
params.put("endTime",DateUtil.getStringOfLastDay((String) params.get("endTime")));
List<Map<String, Object>> typeList = sysFaulalarmService.getListGroupByResourceType(params);
List<Map<String, Object>> idList = sysFaulalarmService.getListGroupByResourceId(params);
return R.ok().put("typeList", typeList).put("idList",idList);
......
......@@ -289,4 +289,14 @@ public class EquipmentController extends AbstractController {
.eq(SysSystemParams::getId,sysSystemParams.getId()));
return R.ok();
}
@ApiOperation(value = "温度设定", notes = "温度设定")
@PostMapping("/changeTemperature")
public R changeTemperature(String temperature) {
SysSystemParams sysSystemParams = sysSystemParamsService.getById(Constants.STRING_1);
sysSystemParams.setTemperature(temperature);
sysSystemParamsService.update(sysSystemParams,new LambdaQueryWrapper<SysSystemParams>()
.eq(SysSystemParams::getId,sysSystemParams.getId()));
return R.ok();
}
}
......@@ -2,6 +2,7 @@ package com.devplatform.admin.modules.eq.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.AbstractController;
import com.devplatform.admin.common.utils.DateUtil;
import com.devplatform.admin.modules.eq.bean.SwqxzInfoHour;
import com.devplatform.admin.modules.eq.model.SwqxzInfoHourModel;
import com.devplatform.admin.modules.eq.service.KanBanService;
......@@ -65,6 +66,8 @@ public class KanBanController extends AbstractController {
dataType = "Map<String, Object>")
@GetMapping("/getListByTypeAndId")
public R getListByTypeAndId(@RequestParam Map<String, Object> params) {
params.put("startTime", DateUtil.getStringOfFirstDay((String) params.get("startTime")));
params.put("endTime",DateUtil.getStringOfLastDay((String) params.get("endTime")));
Page<Map<String,Object>> page = kanBanService.getListByTypeAndId(params);
return R.ok().put("page",page);
}
......
......@@ -36,5 +36,5 @@ public interface DlswjInfoDayDao extends MyBaseMapper<DlswjInfoDay> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -36,5 +36,5 @@ public interface DlswjInfoHourDao extends MyBaseMapper<DlswjInfoHour> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -36,5 +36,5 @@ public interface DlswjInfoMonthDao extends MyBaseMapper<DlswjInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -41,5 +41,5 @@ public interface FlrbInfoDayDao extends MyBaseMapper<FlrbInfoDay> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -36,5 +36,5 @@ public interface FlrbInfoHourDao extends MyBaseMapper<FlrbInfoHour> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -36,5 +36,5 @@ public interface FlrbInfoMonthDao extends MyBaseMapper<FlrbInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -41,5 +41,5 @@ public interface JfktgInfoDayDao extends MyBaseMapper<JfktgInfoDay> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -36,5 +36,5 @@ public interface JfktgInfoHourDao extends MyBaseMapper<JfktgInfoHour> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -36,5 +36,5 @@ public interface JfktgInfoMonthDao extends MyBaseMapper<JfktgInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -41,5 +41,5 @@ public interface JfktpInfoDayDao extends MyBaseMapper<JfktpInfoDay> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -36,5 +36,5 @@ public interface JfktpInfoHourDao extends MyBaseMapper<JfktpInfoHour> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -36,5 +36,5 @@ public interface JfktpInfoMonthDao extends MyBaseMapper<JfktpInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -41,5 +41,5 @@ public interface PfjInfoDayDao extends MyBaseMapper<PfjInfoDay> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -36,5 +36,5 @@ public interface PfjInfoHourDao extends MyBaseMapper<PfjInfoHour> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -36,5 +36,5 @@ public interface PfjInfoMonthDao extends MyBaseMapper<PfjInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -36,5 +36,5 @@ public interface SljfgInfoDayDao extends MyBaseMapper<SljfgInfoDay> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -36,5 +36,5 @@ public interface SljfgInfoHourDao extends MyBaseMapper<SljfgInfoHour> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -36,5 +36,5 @@ public interface SljfgInfoMonthDao extends MyBaseMapper<SljfgInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("type")Integer type);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -42,9 +42,9 @@ public interface SnqxzInfoHourDao extends MyBaseMapper<SnqxzInfoHour> {
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<Map<String,Object>> getList(@Param("resourceId")String resourceId, @Param("type") Integer type);
List<Map<String,Object>> getList(@Param("resourceId")String resourceId, @Param("startTime")String startTime,@Param("endTime")String endTime);
List<Map<String, Object>> getListFx(@Param("region")Integer region,@Param("type") Integer type);
List<Map<String, Object>> getListFx(@Param("region")Integer region,@Param("startTime")String startTime,@Param("endTime")String endTime);
List<Map<String, Object>> getParamGroupByRegion();
}
......@@ -33,7 +33,7 @@ public interface SwqxzInfoHourDao extends MyBaseMapper<SwqxzInfoHour> {
*/
List<SwqxzInfoHour> queryPageList(SwqxzInfoHourModel model);
List<SwqxzInfoHour> getList(@Param("type")Integer type);
List<SwqxzInfoHour> getList(@Param("startTime")String startTime,@Param("endTime")String endTime);
/**
......
......@@ -32,5 +32,5 @@ public interface TotalDayDao extends MyBaseMapper<TotalDay> {
*/
List<TotalDay> queryPageList(TotalDayModel model);
List<Map<String,Object>> queryList(@Param("type") Integer type);
List<Map<String,Object>> queryList(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -31,5 +31,5 @@ public interface TotalHourDao extends MyBaseMapper<TotalHour> {
*/
List<TotalHour> queryPageList(TotalHourModel model);
List<Map<String,Object>> queryList(@Param("type")Integer type);
List<Map<String,Object>> queryList(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -32,5 +32,5 @@ public interface TotalMonthDao extends MyBaseMapper<TotalMonth> {
*/
List<TotalMonth> queryPageList(TotalMonthModel model);
List<Map<String, Object>> queryList(@Param("type") Integer type);
List<Map<String, Object>> queryList(@Param("startTime")String startTime,@Param("endTime")String endTime);
}
......@@ -11,7 +11,7 @@ public interface AnalysisService {
Map<String,Object> getSyParam();
List<List<String>> getEnergyListTb(String resourceId, Integer type, String resourceType);
List<List<String>> getEnergyListTb(String resourceId, String startTime,String endTime, String resourceType);
List<List<String>> getEnergyListFx(Integer type, String resourceType);
List<List<String>> getEnergyListFx(String startTime,String endTime, String resourceType);
}
......@@ -27,5 +27,5 @@ public interface DlswjInfoDayService extends MyBaseService<DlswjInfoDay> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -25,5 +25,5 @@ public interface DlswjInfoHourService extends MyBaseService<DlswjInfoHour> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -27,5 +27,5 @@ public interface DlswjInfoMonthService extends MyBaseService<DlswjInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -28,5 +28,5 @@ public interface DlswjInfoService extends MyBaseService<DlswjInfo> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -31,5 +31,5 @@ public interface FlrbInfoDayService extends MyBaseService<FlrbInfoDay> {
*/
Page<Map<String,Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -26,5 +26,5 @@ public interface FlrbInfoHourService extends MyBaseService<FlrbInfoHour> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -26,5 +26,5 @@ public interface FlrbInfoMonthService extends MyBaseService<FlrbInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -27,5 +27,5 @@ public interface FlrbInfoService extends MyBaseService<FlrbInfo> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -31,5 +31,5 @@ public interface JfktgInfoDayService extends MyBaseService<JfktgInfoDay> {
*/
Page<Map<String,Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -26,5 +26,5 @@ public interface JfktgInfoHourService extends MyBaseService<JfktgInfoHour> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -26,5 +26,5 @@ public interface JfktgInfoMonthService extends MyBaseService<JfktgInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -27,5 +27,5 @@ public interface JfktgInfoService extends MyBaseService<JfktgInfo> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -31,5 +31,5 @@ public interface JfktpInfoDayService extends MyBaseService<JfktpInfoDay> {
*/
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -27,5 +27,5 @@ public interface JfktpInfoHourService extends MyBaseService<JfktpInfoHour> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -27,5 +27,5 @@ public interface JfktpInfoMonthService extends MyBaseService<JfktpInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -27,5 +27,5 @@ public interface JfktpInfoService extends MyBaseService<JfktpInfo> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -30,5 +30,5 @@ public interface PfjInfoDayService extends MyBaseService<PfjInfoDay> {
*/
Page<Map<String,Object>> queryPageListByParam(Page<Map<String, Object>> page,Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -27,5 +27,5 @@ public interface PfjInfoHourService extends MyBaseService<PfjInfoHour> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -26,5 +26,5 @@ public interface PfjInfoMonthService extends MyBaseService<PfjInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -27,5 +27,5 @@ public interface PfjInfoService extends MyBaseService<PfjInfo> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -26,6 +26,6 @@ public interface SljfgInfoDayService extends MyBaseService<SljfgInfoDay> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -27,5 +27,5 @@ public interface SljfgInfoHourService extends MyBaseService<SljfgInfoHour> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -26,6 +26,6 @@ public interface SljfgInfoMonthService extends MyBaseService<SljfgInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -27,5 +27,5 @@ public interface SljfgInfoService extends MyBaseService<SljfgInfo> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(Integer type);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.SnqxzInfoHour;
import com.devplatform.admin.modules.eq.model.SnqxzInfoHourModel;
import com.devplatform.common.service.MyBaseService;
import java.util.List;
import java.util.Map;
......@@ -31,9 +30,9 @@ public interface SnqxzInfoHourService extends MyBaseService<SnqxzInfoHour> {
*/
Page<Map<String,Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params);
List<Map<String,Object>> getList(String resourceId, Integer type);
List<Map<String,Object>> getList(String resourceId, String startTime,String endTime);
List<Map<String, Object>> getListFx(Integer region, Integer type);
List<Map<String, Object>> getListFx(Integer region, String startTime,String endTime);
List<Map<String, Object>> getParamGroupByRegion();
}
......@@ -25,7 +25,7 @@ public interface SwqxzInfoHourService extends MyBaseService<SwqxzInfoHour> {
List<SwqxzInfoHour> queryPageList(SwqxzInfoHourModel model);
List<SwqxzInfoHour> getList(Integer type);
List<SwqxzInfoHour> getList(String startTime,String endTime);
/**
* 查询室外气象站信息-时分页数据
......
......@@ -23,5 +23,5 @@ public interface TotalDayService extends MyBaseService<TotalDay> {
*/
List<TotalDay> queryPageList(TotalDayModel model);
List<Map<String,Object>> queryList(Integer type);
List<Map<String,Object>> queryList(String startTime,String endTime);
}
......@@ -22,5 +22,5 @@ public interface TotalHourService extends MyBaseService<TotalHour> {
*/
List<TotalHour> queryPageList(TotalHourModel model);
List<Map<String,Object>> queryList(Integer type);
List<Map<String,Object>> queryList(String startTime,String endTime);
}
......@@ -23,5 +23,5 @@ public interface TotalMonthService extends MyBaseService<TotalMonth> {
*/
List<TotalMonth> queryPageList(TotalMonthModel model);
List<Map<String, Object>> queryList(Integer type);
List<Map<String, Object>> queryList(String startTime,String endTime);
}
......@@ -2,6 +2,7 @@ package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.common.utils.DateUtil;
import com.devplatform.admin.common.utils.DateUtils;
import com.devplatform.admin.modules.eq.service.*;
import com.devplatform.admin.modules.sys.bean.SysSystemParams;
......@@ -86,7 +87,8 @@ public class AnalysisServiceImpl implements AnalysisService {
//能耗统计
List<List<String>> list = new ArrayList<List<String>>();
//当天
List<Map<String,Object>> listHour = totalHourService.queryList(Constants.INT_1);
List<Map<String,Object>> listHour = totalHourService.queryList(DateUtil.getStringOfFirstDay(DateUtil.getNowFormateDate()),
DateUtil.getStringOfLastDay(DateUtil.getNowFormateDate()));
for (int i = 0; i < listHour.size(); i++) {
List<String> listDetail = new ArrayList<String>();
listDetail.add(DateUtils.format((Date) listHour.get(i).get("create_time"),"yyyy-MM-dd HH:mm:ss"));
......@@ -96,7 +98,8 @@ public class AnalysisServiceImpl implements AnalysisService {
List<List<String>> listMonth = new ArrayList<List<String>>();
//当月
List<Map<String,Object>> listDay = totalDayService.queryList(Constants.INT_3);
List<Map<String,Object>> listDay = totalDayService.queryList(DateUtil.getStringOfFirstDay(DateUtil.getStringOfFirstDayInMonth()),
DateUtil.getStringOfLastDay(DateUtil.getStringOfLastDayInMonth()));
for (int i = 0; i < listDay.size(); i++) {
List<String> listDetail = new ArrayList<String>();
listDetail.add(DateUtils.format((Date) listDay.get(i).get("create_time"),"yyyy-MM-dd HH:mm:ss"));
......@@ -113,11 +116,12 @@ public class AnalysisServiceImpl implements AnalysisService {
}
@Override
public List<List<String>> getEnergyListTb(String resourceId, Integer type, String resourceType) {
public List<List<String>> getEnergyListTb(String resourceId, String startTime,String endTime, String resourceType) {
Page<Map<String, Object>> page = new Page<>();
Map<String,Object> params = new HashMap<>(16);
params.put("resourceId",resourceId);
params.put("type",type);
params.put("startTime",DateUtil.getStringOfFirstDay(startTime));
params.put("endTime",DateUtil.getStringOfLastDay(endTime));
Page<Map<String,Object>> pageTask = new Page<Map<String, Object>>(Constants.INT_1, Constants.INT_99);
if(Constants.ID_PFJ.equals(resourceType)){
page = pfjInfoService.queryPageListByParam(pageTask,params);
......@@ -148,30 +152,31 @@ public class AnalysisServiceImpl implements AnalysisService {
}
@Override
public List<List<String>> getEnergyListFx(Integer type, String resourceType) {
public List<List<String>> getEnergyListFx(String startTime,String endTime, String resourceType) {
List<Map<String,Object>> list = new ArrayList<>();
if(Constants.STRING_1.equals(resourceType)){
int type = DateUtil.checkTimeToType(startTime,endTime);
if(type == Constants.INT_1){
list = totalHourService.queryList(type);
list = totalHourService.queryList(startTime,endTime);
}else if(type == Constants.INT_2 || type == Constants.INT_3){
list = totalDayService.queryList(type);
list = totalDayService.queryList(startTime,endTime);
}else if(type == Constants.INT_4){
list = totalMonthService.queryList(type);
list = totalMonthService.queryList(startTime,endTime);
}
}else if(Constants.ID_PFJ.equals(resourceType)){
list = pfjInfoService.queryListByParam(type);
list = pfjInfoService.queryListByParam(startTime,endTime);
}else if(Constants.ID_JFKTP.equals(resourceType)){
list = jfktpInfoService.queryListByParam(type);
list = jfktpInfoService.queryListByParam(startTime,endTime);
}else if(Constants.ID_JFKTG.equals(resourceType)){
list = jfktgInfoService.queryListByParam(type);
list = jfktgInfoService.queryListByParam(startTime,endTime);
}else if(Constants.ID_JLM.equals(resourceType)){
}else if(Constants.ID_FLRBJZ.equals(resourceType)){
list = flrbInfoService.queryListByParam(type);
list = flrbInfoService.queryListByParam(startTime,endTime);
}else if(Constants.ID_SLJFG.equals(resourceType)){
list = sljfgInfoService.queryListByParam(type);
list = sljfgInfoService.queryListByParam(startTime,endTime);
}else if(Constants.ID_SLSWJ.equals(resourceType)){
list = dlswjInfoService.queryListByParam(type);
list = dlswjInfoService.queryListByParam(startTime,endTime);
}
List<List<String>> listTj = new ArrayList<List<String>>();
......
......@@ -33,7 +33,7 @@ public class DlswjInfoDayServiceImpl extends MyBaseServiceImpl<DlswjInfoDayDao,
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -33,8 +33,8 @@ public class DlswjInfoHourServiceImpl extends MyBaseServiceImpl<DlswjInfoHourDao
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -33,7 +33,7 @@ public class DlswjInfoMonthServiceImpl extends MyBaseServiceImpl<DlswjInfoMonthD
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -2,6 +2,7 @@ package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.common.utils.DateUtil;
import com.devplatform.admin.modules.eq.bean.DlswjInfo;
import com.devplatform.admin.modules.eq.dao.DlswjInfoDao;
import com.devplatform.admin.modules.eq.model.DlswjInfoModel;
......@@ -46,27 +47,30 @@ public class DlswjInfoServiceImpl extends MyBaseServiceImpl<DlswjInfoDao, DlswjI
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
String type = params.get("type").toString();
String startTime = (String) params.get("startTime");
String endTime = (String) params.get("endTime");
int type = DateUtil.checkTimeToType(startTime,endTime);
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
if(Constants.STRING_1.equals(type)){
if(type == Constants.INT_1){
page = dlswjInfoHourService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){
}else if(type == Constants.INT_2 || type == Constants.INT_3){
page = dlswjInfoDayService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_4.equals(type)){
}else if(type == Constants.INT_4){
page = dlswjInfoMonthService.queryPageListByParam(pageTask,params);
}
return page;
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
List<Map<String,Object>> list = new ArrayList<>();
int type = DateUtil.checkTimeToType(startTime,endTime);
if(type == Constants.INT_1){
list = dlswjInfoHourService.queryListByParam(type);
list = dlswjInfoHourService.queryListByParam(startTime,endTime);
}else if(type == Constants.INT_2 || type == Constants.INT_3){
list = dlswjInfoDayService.queryListByParam(type);
list = dlswjInfoDayService.queryListByParam(startTime,endTime);
}else if(type == Constants.INT_4){
list = dlswjInfoMonthService.queryListByParam(type);
list = dlswjInfoMonthService.queryListByParam(startTime,endTime);
}
return list;
}
......
......@@ -32,7 +32,7 @@ public class FlrbInfoDayServiceImpl extends MyBaseServiceImpl<FlrbInfoDayDao, Fl
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -32,7 +32,7 @@ public class FlrbInfoHourServiceImpl extends MyBaseServiceImpl<FlrbInfoHourDao,
return baseMapper.queryPageListByParam(pageTask,params);
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -33,7 +33,7 @@ public class FlrbInfoMonthServiceImpl extends MyBaseServiceImpl<FlrbInfoMonthDao
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -2,6 +2,7 @@ package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.common.utils.DateUtil;
import com.devplatform.admin.modules.eq.bean.FlrbInfo;
import com.devplatform.admin.modules.eq.dao.FlrbInfoDao;
import com.devplatform.admin.modules.eq.model.FlrbInfoModel;
......@@ -46,27 +47,30 @@ public class FlrbInfoServiceImpl extends MyBaseServiceImpl<FlrbInfoDao, FlrbInfo
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
String type = params.get("type").toString();
String startTime = (String) params.get("startTime");
String endTime = (String) params.get("endTime");
int type = DateUtil.checkTimeToType(startTime,endTime);
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
if(Constants.STRING_1.equals(type)){
if(type == Constants.INT_1){
page = flrbInfoHourService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){
}else if(type == Constants.INT_2 || type == Constants.INT_3){
page = flrbInfoDayService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_4.equals(type)){
}else if(type == Constants.INT_4){
page = flrbInfoMonthService.queryPageListByParam(pageTask,params);
}
return page;
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
List<Map<String,Object>> list = new ArrayList<>();
int type = DateUtil.checkTimeToType(startTime,endTime);
if(type == Constants.INT_1){
list = flrbInfoHourService.queryListByParam(type);
list = flrbInfoHourService.queryListByParam(startTime,endTime);
}else if(type == Constants.INT_2 || type == Constants.INT_3){
list = flrbInfoDayService.queryListByParam(type);
list = flrbInfoDayService.queryListByParam(startTime,endTime);
}else if(type == Constants.INT_4){
list = flrbInfoMonthService.queryListByParam(type);
list = flrbInfoMonthService.queryListByParam(startTime,endTime);
}
return list;
}
......
......@@ -33,7 +33,7 @@ public class JfktgInfoDayServiceImpl extends MyBaseServiceImpl<JfktgInfoDayDao,
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -33,7 +33,7 @@ public class JfktgInfoHourServiceImpl extends MyBaseServiceImpl<JfktgInfoHourDao
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -33,7 +33,7 @@ public class JfktgInfoMonthServiceImpl extends MyBaseServiceImpl<JfktgInfoMonthD
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -2,6 +2,7 @@ package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.common.utils.DateUtil;
import com.devplatform.admin.modules.eq.bean.JfktgInfo;
import com.devplatform.admin.modules.eq.dao.JfktgInfoDao;
import com.devplatform.admin.modules.eq.model.JfktgInfoModel;
......@@ -46,27 +47,30 @@ public class JfktgInfoServiceImpl extends MyBaseServiceImpl<JfktgInfoDao, JfktgI
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
String type = params.get("type").toString();
String startTime = (String) params.get("startTime");
String endTime = (String) params.get("endTime");
int type = DateUtil.checkTimeToType(startTime,endTime);
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
if(Constants.STRING_1.equals(type)){
if(type == Constants.INT_1){
page = jfktgInfoHourService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){
}else if(type == Constants.INT_2 || type == Constants.INT_3){
page = jfktgInfoDayService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_4.equals(type)){
}else if(type == Constants.INT_4){
page = jfktgInfoMonthService.queryPageListByParam(pageTask,params);
}
return page;
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
List<Map<String,Object>> list = new ArrayList<>();
int type = DateUtil.checkTimeToType(startTime,endTime);
if(type == Constants.INT_1){
list = jfktgInfoHourService.queryListByParam(type);
list = jfktgInfoHourService.queryListByParam(startTime,endTime);
}else if(type == Constants.INT_2 || type == Constants.INT_3){
list = jfktgInfoDayService.queryListByParam(type);
list = jfktgInfoDayService.queryListByParam(startTime,endTime);
}else if(type == Constants.INT_4){
list = jfktgInfoMonthService.queryListByParam(type);
list = jfktgInfoMonthService.queryListByParam(startTime,endTime);
}
return list;
}
......
......@@ -33,7 +33,7 @@ public class JfktpInfoDayServiceImpl extends MyBaseServiceImpl<JfktpInfoDayDao,
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -32,7 +32,7 @@ public class JfktpInfoHourServiceImpl extends MyBaseServiceImpl<JfktpInfoHourDao
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -32,7 +32,7 @@ public class JfktpInfoMonthServiceImpl extends MyBaseServiceImpl<JfktpInfoMonthD
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -2,6 +2,7 @@ package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.common.utils.DateUtil;
import com.devplatform.admin.modules.eq.bean.JfktpInfo;
import com.devplatform.admin.modules.eq.dao.JfktpInfoDao;
import com.devplatform.admin.modules.eq.model.JfktpInfoModel;
......@@ -47,27 +48,30 @@ public class JfktpInfoServiceImpl extends MyBaseServiceImpl<JfktpInfoDao, JfktpI
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
String type = params.get("type").toString();
String startTime = (String) params.get("startTime");
String endTime = (String) params.get("endTime");
int type = DateUtil.checkTimeToType(startTime,endTime);
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
if(Constants.STRING_1.equals(type)){
if(type == Constants.INT_1){
page = jfktpInfoHourService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){
}else if(type == Constants.INT_2|| type == Constants.INT_3){
page = jfktpInfoDayService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_4.equals(type)){
}else if(type == Constants.INT_4){
page = jfktpInfoMonthService.queryPageListByParam(pageTask,params);
}
return page;
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
List<Map<String,Object>> list = new ArrayList<>();
int type = DateUtil.checkTimeToType(startTime,endTime);
if(type == Constants.INT_1){
list = jfktpInfoHourService.queryListByParam(type);
list = jfktpInfoHourService.queryListByParam(startTime,endTime);
}else if(type == Constants.INT_2|| type == Constants.INT_3){
list = jfktpInfoDayService.queryListByParam(type);
list = jfktpInfoDayService.queryListByParam(startTime,endTime);
}else if(type == Constants.INT_4){
list = jfktpInfoMonthService.queryListByParam(type);
list = jfktpInfoMonthService.queryListByParam(startTime,endTime);
}
return list;
}
......
......@@ -33,8 +33,8 @@ public class PfjInfoDayServiceImpl extends MyBaseServiceImpl<PfjInfoDayDao, PfjI
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -33,7 +33,7 @@ public class PfjInfoHourServiceImpl extends MyBaseServiceImpl<PfjInfoHourDao, Pf
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -33,8 +33,8 @@ public class PfjInfoMonthServiceImpl extends MyBaseServiceImpl<PfjInfoMonthDao,
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -2,6 +2,7 @@ package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.common.utils.DateUtil;
import com.devplatform.admin.modules.eq.bean.PfjInfo;
import com.devplatform.admin.modules.eq.dao.PfjInfoDao;
import com.devplatform.admin.modules.eq.model.PfjInfoModel;
......@@ -46,27 +47,30 @@ public class PfjInfoServiceImpl extends MyBaseServiceImpl<PfjInfoDao, PfjInfo> i
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
String type = params.get("type").toString();
String startTime = (String) params.get("startTime");
String endTime = (String) params.get("endTime");
int type = DateUtil.checkTimeToType(startTime,endTime);
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
if(Constants.STRING_1.equals(type)){
if(type == Constants.INT_1){
page = pfjInfoHourService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){
}else if(type == Constants.INT_2 || type == Constants.INT_3){
page = pfjInfoDayService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_4.equals(type)){
}else if(type == Constants.INT_4){
page = pfjInfoMonthService.queryPageListByParam(pageTask,params);
}
return page;
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
List<Map<String,Object>> list = new ArrayList<>();
int type = DateUtil.checkTimeToType(startTime,endTime);
if(type == Constants.INT_1){
list = pfjInfoHourService.queryListByParam(type);
list = pfjInfoHourService.queryListByParam(startTime,endTime);
}else if(type == Constants.INT_2 || type == Constants.INT_3){
list = pfjInfoDayService.queryListByParam(type);
list = pfjInfoDayService.queryListByParam(startTime,endTime);
}else if(type == Constants.INT_4){
list = pfjInfoMonthService.queryListByParam(type);
list = pfjInfoMonthService.queryListByParam(startTime,endTime);
}
return list;
}
......
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;
import com.devplatform.admin.modules.eq.model.SljfgInfoDayModel;
import com.devplatform.admin.modules.eq.bean.SljfgInfoDay;
import com.devplatform.admin.modules.eq.dao.SljfgInfoDayDao;
import com.devplatform.admin.modules.eq.model.SljfgInfoDayModel;
import com.devplatform.admin.modules.eq.service.SljfgInfoDayService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -36,7 +33,7 @@ public class SljfgInfoDayServiceImpl extends MyBaseServiceImpl<SljfgInfoDayDao,
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -33,8 +33,8 @@ public class SljfgInfoHourServiceImpl extends MyBaseServiceImpl<SljfgInfoHourDao
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
......
......@@ -33,7 +33,7 @@ public class SljfgInfoMonthServiceImpl extends MyBaseServiceImpl<SljfgInfoMonthD
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
return baseMapper.queryListByParam(type);
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
......@@ -2,6 +2,7 @@ package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.common.utils.DateUtil;
import com.devplatform.admin.modules.eq.bean.SljfgInfo;
import com.devplatform.admin.modules.eq.dao.SljfgInfoDao;
import com.devplatform.admin.modules.eq.model.SljfgInfoModel;
......@@ -46,27 +47,30 @@ public class SljfgInfoServiceImpl extends MyBaseServiceImpl<SljfgInfoDao, SljfgI
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
String type = params.get("type").toString();
String startTime = (String) params.get("startTime");
String endTime = (String) params.get("endTime");
int type = DateUtil.checkTimeToType(startTime,endTime);
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
if(Constants.STRING_1.equals(type)){
if(type == Constants.INT_1){
page = sljfgInfoHourService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){
}else if(type == Constants.INT_2 || type == Constants.INT_3){
page = sljfgInfoDayService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_4.equals(type)){
}else if(type == Constants.INT_4){
page = sljfgInfoMonthService.queryPageListByParam(pageTask,params);
}
return page;
}
@Override
public List<Map<String, Object>> queryListByParam(Integer type) {
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
List<Map<String,Object>> list = new ArrayList<>();
int type = DateUtil.checkTimeToType(startTime,endTime);
if(type == Constants.INT_1){
list = sljfgInfoHourService.queryListByParam(type);
list = sljfgInfoHourService.queryListByParam(startTime,endTime);
}else if(type == Constants.INT_2 || type == Constants.INT_3){
list = sljfgInfoDayService.queryListByParam(type);
list = sljfgInfoDayService.queryListByParam(startTime,endTime);
}else if(type == Constants.INT_4){
list = sljfgInfoMonthService.queryListByParam(type);
list = sljfgInfoMonthService.queryListByParam(startTime,endTime);
}
return list;
}
......
......@@ -32,13 +32,13 @@ public class SnqxzInfoHourServiceImpl extends MyBaseServiceImpl<SnqxzInfoHourDao
}
@Override
public List<Map<String,Object>> getList(String resourceId, Integer type) {
return baseMapper.getList(resourceId,type);
public List<Map<String,Object>> getList(String resourceId, String startTime,String endTime) {
return baseMapper.getList(resourceId,startTime,endTime);
}
@Override
public List<Map<String, Object>> getListFx(Integer region, Integer type) {
return baseMapper.getListFx(region,type);
public List<Map<String, Object>> getListFx(Integer region, String startTime,String endTime) {
return baseMapper.getListFx(region,startTime,endTime);
}
@Override
......
......@@ -28,8 +28,8 @@ public class SwqxzInfoHourServiceImpl extends MyBaseServiceImpl<SwqxzInfoHourDao
}
@Override
public List<SwqxzInfoHour> getList(Integer type) {
return baseMapper.getList(type);
public List<SwqxzInfoHour> getList(String startTime,String endTime) {
return baseMapper.getList(startTime,endTime);
}
@Override
......
......@@ -27,8 +27,8 @@ public class TotalDayServiceImpl extends MyBaseServiceImpl<TotalDayDao, TotalDay
}
@Override
public List<Map<String,Object>> queryList(Integer type) {
return baseMapper.queryList(type);
public List<Map<String,Object>> queryList(String startTime,String endTime) {
return baseMapper.queryList(startTime,endTime);
}
......
......@@ -27,8 +27,8 @@ public class TotalHourServiceImpl extends MyBaseServiceImpl<TotalHourDao, TotalH
}
@Override
public List<Map<String,Object>> queryList(Integer type) {
return baseMapper.queryList(type);
public List<Map<String,Object>> queryList(String startTime,String endTime) {
return baseMapper.queryList(startTime,endTime);
}
}
......@@ -27,8 +27,8 @@ public class TotalMonthServiceImpl extends MyBaseServiceImpl<TotalMonthDao, Tota
}
@Override
public List<Map<String, Object>> queryList(Integer type) {
return baseMapper.queryList(type);
public List<Map<String, Object>> queryList(String startTime,String endTime) {
return baseMapper.queryList(startTime,endTime);
}
}
......@@ -57,4 +57,7 @@ public class SysSystemParams implements Serializable {
private Integer fan;
@ApiModelProperty(value="自然通风模式(1:开启 2:关闭)",name="nan")
private Integer nan;
/** 温度 */
@ApiModelProperty(value="温度",name="temperature")
private java.lang.String temperature;
}
......@@ -41,4 +41,6 @@ public class SysSystemParamsModel extends BaseModel {
private Integer fan;
/** 自然通风模式(1:开启 2:关闭) */
private Integer nan;
/** 温度 */
private java.lang.String temperature;
}
......@@ -49,11 +49,14 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 2">
and YEARWEEK(date_format(t.create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.type == 3">
and DATE_FORMAT(t.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
......@@ -67,11 +70,14 @@
select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from dlswj_info_day
where 1=1
<if test="type == 2">
and YEARWEEK(date_format(create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
<if test="(startTime == null or startTime == '') and (endTime == null or endTime == '')">
and TO_DAYS(create_time) = TO_DAYS(NOW())
</if>
<if test="startTime != null and startTime != ''">
and create_time &gt;= #{startTime}
</if>
<if test="type == 3">
and DATE_FORMAT(create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
<if test="endTime != null and endTime != ''">
and create_time &lt;= #{endTime}
</if>
group by create_time
order by create_time
......
......@@ -49,9 +49,15 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 1">
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
......@@ -64,9 +70,15 @@
select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from dlswj_info_hour
where 1=1
<if test="type == 1">
<if test="(startTime == null or startTime == '') and (endTime == null or endTime == '')">
and TO_DAYS(create_time) = TO_DAYS(NOW())
</if>
<if test="startTime != null and startTime != ''">
and create_time &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and create_time &lt;= #{endTime}
</if>
group by create_time
order by create_time
</select>
......
......@@ -49,8 +49,14 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 4">
and DATE_FORMAT(t.create_time, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' )
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
......@@ -64,8 +70,14 @@
select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from dlswj_info_month
where 1=1
<if test="type == 4">
and DATE_FORMAT(create_time, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' )
<if test="(startTime == null or startTime == '') and (endTime == null or endTime == '')">
and TO_DAYS(create_time) = TO_DAYS(NOW())
</if>
<if test="startTime != null and startTime != ''">
and create_time &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and create_time &lt;= #{endTime}
</if>
group by create_time
order by create_time
......
......@@ -49,11 +49,14 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 2">
and YEARWEEK(date_format(t.create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.type == 3">
and DATE_FORMAT(t.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
......@@ -67,11 +70,14 @@
select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from flrb_info_day
where 1=1
<if test="type == 2">
and YEARWEEK(date_format(create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
<if test="(startTime == null or startTime == '') and (endTime == null or endTime == '')">
and TO_DAYS(create_time) = TO_DAYS(NOW())
</if>
<if test="startTime != null and startTime != ''">
and create_time &gt;= #{startTime}
</if>
<if test="type == 3">
and DATE_FORMAT(create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
<if test="endTime != null and endTime != ''">
and create_time &lt;= #{endTime}
</if>
group by create_time
order by create_time
......
......@@ -49,9 +49,15 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 1">
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
......@@ -64,9 +70,15 @@
select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from flrb_info_hour
where 1=1
<if test="type == 1">
<if test="(startTime == null or startTime == '') and (endTime == null or endTime == '')">
and TO_DAYS(create_time) = TO_DAYS(NOW())
</if>
<if test="startTime != null and startTime != ''">
and create_time &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and create_time &lt;= #{endTime}
</if>
group by create_time
order by create_time
</select>
......
......@@ -49,8 +49,14 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 4">
and DATE_FORMAT(t.create_time, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' )
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
......@@ -64,8 +70,14 @@
select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from flrb_info_month
where 1=1
<if test="type == 4">
and DATE_FORMAT(create_time, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' )
<if test="(startTime == null or startTime == '') and (endTime == null or endTime == '')">
and TO_DAYS(create_time) = TO_DAYS(NOW())
</if>
<if test="startTime != null and startTime != ''">
and create_time &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and create_time &lt;= #{endTime}
</if>
group by create_time
order by create_time
......
......@@ -49,11 +49,14 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 2">
and YEARWEEK(date_format(t.create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.type == 3">
and DATE_FORMAT(t.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
......@@ -67,11 +70,14 @@
select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from jfktg_info_day
where 1=1
<if test="type == 2">
and YEARWEEK(date_format(create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
<if test="(startTime == null or startTime == '') and (endTime == null or endTime == '')">
and TO_DAYS(create_time) = TO_DAYS(NOW())
</if>
<if test="startTime != null and startTime != ''">
and create_time &gt;= #{startTime}
</if>
<if test="type == 3">
and DATE_FORMAT(create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
<if test="endTime != null and endTime != ''">
and create_time &lt;= #{endTime}
</if>
group by create_time
order by create_time
......
......@@ -49,9 +49,15 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 1">
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
......@@ -64,9 +70,15 @@
select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from jfktg_info_hour
where 1=1
<if test="type == 1">
<if test="(startTime == null or startTime == '') and (endTime == null or endTime == '')">
and TO_DAYS(create_time) = TO_DAYS(NOW())
</if>
<if test="startTime != null and startTime != ''">
and create_time &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and create_time &lt;= #{endTime}
</if>
group by create_time
order by create_time
</select>
......
......@@ -49,8 +49,14 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 4">
and DATE_FORMAT(t.create_time, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' )
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
......@@ -64,8 +70,14 @@
select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from jfktg_info_month
where 1=1
<if test="type == 4">
and DATE_FORMAT(create_time, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' )
<if test="(startTime == null or startTime == '') and (endTime == null or endTime == '')">
and TO_DAYS(create_time) = TO_DAYS(NOW())
</if>
<if test="startTime != null and startTime != ''">
and create_time &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and create_time &lt;= #{endTime}
</if>
group by create_time
order by create_time
......
......@@ -49,11 +49,14 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 2">
and YEARWEEK(date_format(t.create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.type == 3">
and DATE_FORMAT(t.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
......@@ -67,11 +70,14 @@
select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from jfktp_info_day
where 1=1
<if test="type == 2">
and YEARWEEK(date_format(create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
<if test="(startTime == null or startTime == '') and (endTime == null or endTime == '')">
and TO_DAYS(create_time) = TO_DAYS(NOW())
</if>
<if test="startTime != null and startTime != ''">
and create_time &gt;= #{startTime}
</if>
<if test="type == 3">
and DATE_FORMAT(create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
<if test="endTime != null and endTime != ''">
and create_time &lt;= #{endTime}
</if>
group by create_time
order by create_time
......
......@@ -49,9 +49,15 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 1">
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
......@@ -64,9 +70,15 @@
select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from jfktp_info_hour
where 1=1
<if test="type == 1">
<if test="(startTime == null or startTime == '') and (endTime == null or endTime == '')">
and TO_DAYS(create_time) = TO_DAYS(NOW())
</if>
<if test="startTime != null and startTime != ''">
and create_time &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and create_time &lt;= #{endTime}
</if>
group by create_time
order by create_time
</select>
......
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