Commit c321f8cd authored by co_dengxiongwen's avatar co_dengxiongwen

用电数据接口

parent 29152c5f
......@@ -396,6 +396,11 @@ public class Constants {
*/
public static final int INT_1900 = 1900;
/**
* 整数int=1900
*/
public static final int INT_99999 = 99999;
/**
* Firefox
*/
......
package com.devplatform.admin.modules.eq.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@ApiModel(value="能耗-月对象",description="能耗-月对象")
@TableName("total_month")
public class TotalMonth implements Serializable {
private static final long serialVersionUID = 1L;
/** 主键id */
@ApiModelProperty(value="主键ID",name="id")
@TableId
private java.lang.String id;
/** 电能 */
@ApiModelProperty(value="电能",name="electricEnergy")
private java.lang.String electricEnergy;
/** 站点表id */
@ApiModelProperty(value="站点表id",name="stationId")
private java.lang.String stationId;
/** 创建时间 */
@ApiModelProperty(value="创建时间",name="createTime")
private java.util.Date createTime;
}
package com.devplatform.admin.modules.eq.controller;
import com.devplatform.admin.common.utils.AbstractController;
import com.devplatform.admin.common.utils.DateUtils;
import com.devplatform.admin.modules.eq.bean.SwqxzInfoHour;
import com.devplatform.admin.modules.eq.service.AnalysisService;
import com.devplatform.admin.modules.eq.service.SnqxzInfoHourService;
import com.devplatform.admin.modules.eq.service.SwqxzInfoHourService;
import com.devplatform.admin.modules.sys.service.SysFaulalarmService;
import com.devplatform.common.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -28,6 +35,10 @@ public class AnalysisController extends AbstractController {
private SysFaulalarmService sysFaulalarmService;
@Autowired
private AnalysisService analysisService;
@Autowired
private SwqxzInfoHourService swqxzInfoHourService;
@Autowired
private SnqxzInfoHourService snqxzInfoHourService;
/**
* 首页
......@@ -39,6 +50,127 @@ public class AnalysisController extends AbstractController {
return R.ok().put("bean", analysisService.getSyParam());
}
/**
* 获取室外气象站数据
* @return
*/
@ApiOperation(value="获取室外气象站数据", notes="获取室外气象站数据")
@GetMapping("/getSwqxzInfoTj")
public R getSwqxzInfoTj(@RequestParam Integer type) {
List<SwqxzInfoHour> list = swqxzInfoHourService.getList(type);
List<List<String>> temperatureList = new ArrayList<List<String>>();
List<List<String>> humidityList = new ArrayList<List<String>>();
List<List<String>> windSpeedList = new ArrayList<List<String>>();
List<List<String>> illuminanceList = new ArrayList<List<String>>();
List<List<String>> carbonDioxideList = new ArrayList<List<String>>();
List<List<String>> fineParticlesList = new ArrayList<List<String>>();
List<List<String>> radiationList = new ArrayList<List<String>>();
for (int i = 0; i < list.size(); i++) {
List<String> temperatureListDetail = new ArrayList<String>();
List<String> humidityListDetail = new ArrayList<String>();
List<String> windSpeedListDetail = new ArrayList<String>();
List<String> illuminanceListDetail = new ArrayList<String>();
List<String> carbonDioxideListDetail = new ArrayList<String>();
List<String> fineParticlesListDetail = new ArrayList<String>();
List<String> radiationListDetail = new ArrayList<String>();
String time = DateUtils.format(list.get(i).getCreateTime(),"yyyy-MM-dd HH:mm:ss");
temperatureListDetail.add(time);
temperatureListDetail.add(list.get(i).getTemperature());
humidityListDetail.add(time);
humidityListDetail.add(list.get(i).getHumidity());
windSpeedListDetail.add(time);
windSpeedListDetail.add(list.get(i).getWindSpeed());
illuminanceListDetail.add(time);
illuminanceListDetail.add(list.get(i).getIlluminance());
carbonDioxideListDetail.add(time);
carbonDioxideListDetail.add(list.get(i).getCarbonDioxide());
fineParticlesListDetail.add(time);
fineParticlesListDetail.add(list.get(i).getFineParticles());
radiationListDetail.add(time);
radiationListDetail.add(list.get(i).getRadiation());
temperatureList.add(temperatureListDetail);
humidityList.add(humidityListDetail);
windSpeedList.add(windSpeedListDetail);
illuminanceList.add(illuminanceListDetail);
carbonDioxideList.add(carbonDioxideListDetail);
fineParticlesList.add(fineParticlesListDetail);
radiationList.add(radiationListDetail);
}
return R.ok().put("temperatureList", temperatureList)
.put("humidityList", humidityList)
.put("windSpeedList", windSpeedList)
.put("illuminanceList", illuminanceList)
.put("carbonDioxideList", carbonDioxideList)
.put("fineParticlesList", fineParticlesList)
.put("radiationList", radiationList);
}
/**
* 获取室内气象数据
* @return
*/
@ApiOperation(value="获取室内气象数据", notes="获取室内气象数据")
@GetMapping("/getSnqxzInfoTj")
public R getSnqxzInfoTj(@RequestParam("resourceId") String resourceId,@RequestParam("type") Integer type,@RequestParam("region") Integer region) {
List<Map<String,Object>> list = new ArrayList<>();
if(StringUtils.isNotBlank(resourceId)){
list = snqxzInfoHourService.getList(resourceId,type);
}else{
}
List<List<String>> temperatureList = new ArrayList<List<String>>();
List<List<String>> humidityList = new ArrayList<List<String>>();
List<List<String>> carbonDioxideList = new ArrayList<List<String>>();
for (int i = 0; i < list.size(); i++) {
List<String> temperatureListDetail = new ArrayList<String>();
List<String> humidityListDetail = new ArrayList<String>();
List<String> carbonDioxideListDetail = new ArrayList<String>();
String time = DateUtils.format((Date) list.get(i).get("create_time"),"yyyy-MM-dd HH:mm:ss");
temperatureListDetail.add(time);
temperatureListDetail.add((String) list.get(i).get("temperature"));
humidityListDetail.add(time);
humidityListDetail.add((String) list.get(i).get("humidity"));
carbonDioxideListDetail.add(time);
carbonDioxideListDetail.add((String) list.get(i).get("carbon_dioxide"));
temperatureList.add(temperatureListDetail);
humidityList.add(humidityListDetail);
carbonDioxideList.add(carbonDioxideListDetail);
}
return R.ok().put("temperatureList", temperatureList)
.put("humidityList", humidityList)
.put("carbonDioxideList", carbonDioxideList);
}
/**
* 获取用电数据
* @return
*/
@ApiOperation(value="获取用电数据", notes="获取用电数据")
@GetMapping("/getEnergyTj")
public R getEnergyTj(@RequestParam("resourceId") String resourceId,@RequestParam("type") Integer type,@RequestParam("resourceType") String resourceType) {
List<List<String>> list = analysisService.getEnergyList(resourceId,type,resourceType);
return R.ok().put("list", list);
}
/**
* 设备故障分析
* @param params
......
......@@ -2,7 +2,6 @@ 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.DateUtils;
import com.devplatform.admin.modules.eq.bean.SwqxzInfoHour;
import com.devplatform.admin.modules.eq.model.SwqxzInfoHourModel;
import com.devplatform.admin.modules.eq.service.KanBanService;
......@@ -18,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -51,73 +49,7 @@ public class KanBanController extends AbstractController {
return R.ok().put("list", getMyPage(list,model));
}
/**
* 获取室外气象站数据
* @return
*/
@ApiOperation(value="获取室外气象站数据", notes="获取室外气象站数据")
@GetMapping("/getSwqxzInfoTj")
public R getSwqxzInfoTj(@RequestParam Integer type) {
System.out.println("type:"+ type);
List<SwqxzInfoHour> list = swqxzInfoHourService.getList(type);
List<List<String>> temperatureList = new ArrayList<List<String>>();
List<List<String>> humidityList = new ArrayList<List<String>>();
List<List<String>> windSpeedList = new ArrayList<List<String>>();
List<List<String>> illuminanceList = new ArrayList<List<String>>();
List<List<String>> carbonDioxideList = new ArrayList<List<String>>();
List<List<String>> fineParticlesList = new ArrayList<List<String>>();
List<List<String>> radiationList = new ArrayList<List<String>>();
for (int i = 0; i < list.size(); i++) {
List<String> temperatureListDetail = new ArrayList<String>();
List<String> humidityListDetail = new ArrayList<String>();
List<String> windSpeedListDetail = new ArrayList<String>();
List<String> illuminanceListDetail = new ArrayList<String>();
List<String> carbonDioxideListDetail = new ArrayList<String>();
List<String> fineParticlesListDetail = new ArrayList<String>();
List<String> radiationListDetail = new ArrayList<String>();
String time = DateUtils.format(list.get(i).getCreateTime(),"yyyy-MM-dd HH:mm:ss");
temperatureListDetail.add(time);
temperatureListDetail.add(list.get(i).getTemperature());
humidityListDetail.add(time);
humidityListDetail.add(list.get(i).getHumidity());
windSpeedListDetail.add(time);
windSpeedListDetail.add(list.get(i).getWindSpeed());
illuminanceListDetail.add(time);
illuminanceListDetail.add(list.get(i).getIlluminance());
carbonDioxideListDetail.add(time);
carbonDioxideListDetail.add(list.get(i).getCarbonDioxide());
fineParticlesListDetail.add(time);
fineParticlesListDetail.add(list.get(i).getFineParticles());
radiationListDetail.add(time);
radiationListDetail.add(list.get(i).getRadiation());
temperatureList.add(temperatureListDetail);
humidityList.add(humidityListDetail);
windSpeedList.add(windSpeedListDetail);
illuminanceList.add(illuminanceListDetail);
carbonDioxideList.add(carbonDioxideListDetail);
fineParticlesList.add(fineParticlesListDetail);
radiationList.add(radiationListDetail);
}
return R.ok().put("temperatureList", temperatureList)
.put("humidityList", humidityList)
.put("windSpeedList", windSpeedList)
.put("illuminanceList", illuminanceList)
.put("carbonDioxideList", carbonDioxideList)
.put("fineParticlesList", fineParticlesList)
.put("radiationList", radiationList);
}
/**
* 查询历史数据
......
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.DlswjInfoDayModel;
import com.devplatform.admin.modules.eq.bean.DlswjInfoDay;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* DlswjInfoDay Mapper
......@@ -29,4 +32,7 @@ public interface DlswjInfoDayDao extends MyBaseMapper<DlswjInfoDay> {
* @return
*/
List<DlswjInfoDay> queryPageList(DlswjInfoDayModel model);
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.DlswjInfoHourModel;
import com.devplatform.admin.modules.eq.bean.DlswjInfoHour;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
......@@ -32,4 +34,7 @@ public interface DlswjInfoHourDao extends MyBaseMapper<DlswjInfoHour> {
List<DlswjInfoHour> queryPageList(DlswjInfoHourModel model);
List<Map<String, Object>> querySum();
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.DlswjInfoMonthModel;
import com.devplatform.admin.modules.eq.bean.DlswjInfoMonth;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* DlswjInfoMonth Mapper
......@@ -29,4 +32,7 @@ public interface DlswjInfoMonthDao extends MyBaseMapper<DlswjInfoMonth> {
* @return
*/
List<DlswjInfoMonth> queryPageList(DlswjInfoMonthModel model);
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.FlrbInfoHourModel;
import com.devplatform.admin.modules.eq.bean.FlrbInfoHour;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* FlrbInfoHour Mapper
......@@ -29,4 +32,7 @@ public interface FlrbInfoHourDao extends MyBaseMapper<FlrbInfoHour> {
* @return
*/
List<FlrbInfoHour> queryPageList(FlrbInfoHourModel model);
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.FlrbInfoMonthModel;
import com.devplatform.admin.modules.eq.bean.FlrbInfoMonth;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* FlrbInfoMonth Mapper
......@@ -29,4 +32,7 @@ public interface FlrbInfoMonthDao extends MyBaseMapper<FlrbInfoMonth> {
* @return
*/
List<FlrbInfoMonth> queryPageList(FlrbInfoMonthModel model);
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.JfktgInfoHourModel;
import com.devplatform.admin.modules.eq.bean.JfktgInfoHour;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* JfktgInfoHour Mapper
......@@ -29,4 +32,7 @@ public interface JfktgInfoHourDao extends MyBaseMapper<JfktgInfoHour> {
* @return
*/
List<JfktgInfoHour> queryPageList(JfktgInfoHourModel model);
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.JfktgInfoMonthModel;
import com.devplatform.admin.modules.eq.bean.JfktgInfoMonth;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* JfktgInfoMonth Mapper
......@@ -29,4 +32,7 @@ public interface JfktgInfoMonthDao extends MyBaseMapper<JfktgInfoMonth> {
* @return
*/
List<JfktgInfoMonth> queryPageList(JfktgInfoMonthModel model);
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.JfktpInfoHourModel;
import com.devplatform.admin.modules.eq.bean.JfktpInfoHour;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* JfktpInfoHour Mapper
......@@ -29,4 +32,7 @@ public interface JfktpInfoHourDao extends MyBaseMapper<JfktpInfoHour> {
* @return
*/
List<JfktpInfoHour> queryPageList(JfktpInfoHourModel model);
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.JfktpInfoMonthModel;
import com.devplatform.admin.modules.eq.bean.JfktpInfoMonth;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* JfktpInfoMonth Mapper
......@@ -29,4 +32,7 @@ public interface JfktpInfoMonthDao extends MyBaseMapper<JfktpInfoMonth> {
* @return
*/
List<JfktpInfoMonth> queryPageList(JfktpInfoMonthModel model);
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.PfjInfoHourModel;
import com.devplatform.admin.modules.eq.bean.PfjInfoHour;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* PfjInfoHour Mapper
......@@ -29,4 +32,7 @@ public interface PfjInfoHourDao extends MyBaseMapper<PfjInfoHour> {
* @return
*/
List<PfjInfoHour> queryPageList(PfjInfoHourModel model);
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.PfjInfoMonthModel;
import com.devplatform.admin.modules.eq.bean.PfjInfoMonth;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* PfjInfoMonth Mapper
......@@ -29,4 +32,7 @@ public interface PfjInfoMonthDao extends MyBaseMapper<PfjInfoMonth> {
* @return
*/
List<PfjInfoMonth> queryPageList(PfjInfoMonthModel model);
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
}
......@@ -41,4 +41,6 @@ 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);
}
package com.devplatform.admin.modules.eq.dao;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.TotalMonthModel;
import com.devplatform.admin.modules.eq.bean.TotalMonth;
import com.devplatform.common.dao.MyBaseMapper;
import java.util.List;
/**
* TotalMonth Mapper
* 用于能耗-月的数据库操作
* @author Administrator
*
*/
@Mapper
public interface TotalMonthDao extends MyBaseMapper<TotalMonth> {
/**
* 查询分页数量
* @param model
* @return
*/
Integer queryPageByCount(TotalMonthModel model);
/**
* 查询能耗-月分页数据
* @param model
* @return
*/
List<TotalMonth> queryPageList(TotalMonthModel model);
}
package com.devplatform.admin.modules.eq.model;
import com.devplatform.admin.common.model.BaseModel;
import lombok.Data;
/**
* 能耗-月的Model
* <br>
* @author 代码生成器产生
*/
@Data
public class TotalMonthModel extends BaseModel {
/** 主键id */
private java.lang.String id;
/** 电能 */
private java.lang.String electricEnergy;
/** 站点表id */
private java.lang.String stationId;
/** 创建时间 */
private java.util.Date createTime;
}
package com.devplatform.admin.modules.eq.service;
import java.util.List;
import java.util.Map;
/**
......@@ -9,4 +10,6 @@ import java.util.Map;
public interface AnalysisService {
Map<String,Object> getSyParam();
List<List<String>> getEnergyList(String resourceId, Integer type, String resourceType);
}
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.DlswjInfoDay;
import com.devplatform.admin.modules.eq.model.DlswjInfoDayModel;
import java.util.List;
import java.util.Map;
/**
* 多联室外机信息-天的service接口
......@@ -23,4 +25,5 @@ public interface DlswjInfoDayService extends MyBaseService<DlswjInfoDay> {
List<DlswjInfoDay> queryPageList(DlswjInfoDayModel model);
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.DlswjInfoHour;
import com.devplatform.admin.modules.eq.model.DlswjInfoHourModel;
import com.devplatform.common.service.MyBaseService;
......@@ -24,4 +25,5 @@ public interface DlswjInfoHourService extends MyBaseService<DlswjInfoHour> {
List<Map<String,Object>> querySum();
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
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.DlswjInfoMonth;
import com.devplatform.admin.modules.eq.model.DlswjInfoMonthModel;
import java.util.List;
import java.util.Map;
/**
* 多联室外机信息-月的service接口
......@@ -23,4 +25,5 @@ public interface DlswjInfoMonthService extends MyBaseService<DlswjInfoMonth> {
List<DlswjInfoMonth> queryPageList(DlswjInfoMonthModel model);
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
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.DlswjInfo;
......@@ -25,4 +26,5 @@ public interface DlswjInfoService extends MyBaseService<DlswjInfo> {
List<Map<String, Object>> getList();
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
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.FlrbInfoHour;
import com.devplatform.admin.modules.eq.model.FlrbInfoHourModel;
import java.util.List;
import java.util.Map;
/**
* 风冷热泵机组信息-时的service接口
......@@ -22,4 +24,5 @@ public interface FlrbInfoHourService extends MyBaseService<FlrbInfoHour> {
*/
List<FlrbInfoHour> queryPageList(FlrbInfoHourModel model);
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
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.FlrbInfoMonth;
import com.devplatform.admin.modules.eq.model.FlrbInfoMonthModel;
import java.util.List;
import java.util.Map;
/**
* 风冷热泵机组信息-月的service接口
......@@ -22,4 +24,5 @@ public interface FlrbInfoMonthService extends MyBaseService<FlrbInfoMonth> {
*/
List<FlrbInfoMonth> queryPageList(FlrbInfoMonthModel model);
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.FlrbInfo;
import com.devplatform.admin.modules.eq.model.FlrbInfoModel;
import com.devplatform.common.service.MyBaseService;
......@@ -23,4 +24,6 @@ public interface FlrbInfoService extends MyBaseService<FlrbInfo> {
List<FlrbInfo> queryPageList(FlrbInfoModel model);
List<Map<String, Object>> getList();
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
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.JfktgInfoHour;
import com.devplatform.admin.modules.eq.model.JfktgInfoHourModel;
import java.util.List;
import java.util.Map;
/**
* 机房空调(380V)信息-时的service接口
......@@ -22,4 +24,5 @@ public interface JfktgInfoHourService extends MyBaseService<JfktgInfoHour> {
*/
List<JfktgInfoHour> queryPageList(JfktgInfoHourModel model);
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
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.JfktgInfoMonth;
import com.devplatform.admin.modules.eq.model.JfktgInfoMonthModel;
import java.util.List;
import java.util.Map;
/**
* 机房空调(380V)信息-月的service接口
......@@ -22,4 +24,5 @@ public interface JfktgInfoMonthService extends MyBaseService<JfktgInfoMonth> {
*/
List<JfktgInfoMonth> queryPageList(JfktgInfoMonthModel model);
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.JfktgInfo;
import com.devplatform.admin.modules.eq.model.JfktgInfoModel;
import com.devplatform.common.service.MyBaseService;
......@@ -23,4 +24,6 @@ public interface JfktgInfoService extends MyBaseService<JfktgInfo> {
List<JfktgInfo> queryPageList(JfktgInfoModel model);
List<Map<String, Object>> getList();
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
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.JfktpInfoHour;
import com.devplatform.admin.modules.eq.model.JfktpInfoHourModel;
import java.util.List;
import java.util.Map;
/**
* 机房空调(220V)信息-时的service接口
......@@ -23,4 +25,5 @@ public interface JfktpInfoHourService extends MyBaseService<JfktpInfoHour> {
List<JfktpInfoHour> queryPageList(JfktpInfoHourModel model);
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
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.JfktpInfoMonth;
import com.devplatform.admin.modules.eq.model.JfktpInfoMonthModel;
import java.util.List;
import java.util.Map;
/**
* 机房空调(220V)信息-月的service接口
......@@ -23,4 +25,5 @@ public interface JfktpInfoMonthService extends MyBaseService<JfktpInfoMonth> {
List<JfktpInfoMonth> queryPageList(JfktpInfoMonthModel model);
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.JfktpInfo;
import com.devplatform.admin.modules.eq.model.JfktpInfoModel;
import com.devplatform.common.service.MyBaseService;
......@@ -23,4 +24,6 @@ public interface JfktpInfoService extends MyBaseService<JfktpInfo> {
List<JfktpInfo> queryPageList(JfktpInfoModel model);
List<Map<String, Object>> getList();
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
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.PfjInfoHour;
import com.devplatform.admin.modules.eq.model.PfjInfoHourModel;
import java.util.List;
import java.util.Map;
/**
* 排风机信息-时的service接口
......@@ -23,4 +25,5 @@ public interface PfjInfoHourService extends MyBaseService<PfjInfoHour> {
List<PfjInfoHour> queryPageList(PfjInfoHourModel model);
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
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.PfjInfoMonth;
import com.devplatform.admin.modules.eq.model.PfjInfoMonthModel;
import java.util.List;
import java.util.Map;
/**
* 排风机信息-月的service接口
......@@ -22,4 +24,5 @@ public interface PfjInfoMonthService extends MyBaseService<PfjInfoMonth> {
*/
List<PfjInfoMonth> queryPageList(PfjInfoMonthModel model);
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.PfjInfo;
import com.devplatform.admin.modules.eq.model.PfjInfoModel;
import com.devplatform.common.service.MyBaseService;
......@@ -23,4 +24,6 @@ public interface PfjInfoService extends MyBaseService<PfjInfo> {
List<PfjInfo> queryPageList(PfjInfoModel model);
List<Map<String, Object>> getList();
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
}
......@@ -30,4 +30,6 @@ public interface SnqxzInfoHourService extends MyBaseService<SnqxzInfoHour> {
* @return
*/
Page<Map<String,Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params);
List<Map<String,Object>> getList(String resourceId, Integer type);
}
package com.devplatform.admin.modules.eq.service;
import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.TotalMonth;
import com.devplatform.admin.modules.eq.model.TotalMonthModel;
import java.util.List;
/**
* 能耗-月的service接口
* <br>
* <b>功能:</b>TotalMonthService<br>
* @author 代码生成器产生
*/
public interface TotalMonthService extends MyBaseService<TotalMonth> {
/**
* 查询能耗-月分页数据
* @param model
* @return
*/
List<TotalMonth> queryPageList(TotalMonthModel model);
}
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.DateUtils;
import com.devplatform.admin.modules.eq.bean.TotalDay;
import com.devplatform.admin.modules.eq.bean.TotalHour;
import com.devplatform.admin.modules.eq.service.AnalysisService;
import com.devplatform.admin.modules.eq.service.TotalDayService;
import com.devplatform.admin.modules.eq.service.TotalHourService;
import com.devplatform.admin.modules.eq.service.*;
import com.devplatform.admin.modules.sys.bean.SysSystemParams;
import com.devplatform.admin.modules.sys.service.SysSystemParamsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 设备的service接口实现类
......@@ -29,6 +25,19 @@ public class AnalysisServiceImpl implements AnalysisService {
private TotalDayService totalDayService;
@Autowired
private TotalHourService totalHourService;
@Autowired
private TotalMonthService totalMonthService;
@Autowired
private FlrbInfoService flrbInfoService;
@Autowired
private JfktgInfoService jfktgInfoService;
@Autowired
private JfktpInfoService jfktpInfoService;
@Autowired
private PfjInfoService pfjInfoService;
@Autowired
private DlswjInfoService dlswjInfoService;
@Override
public Map<String,Object> getSyParam(){
......@@ -99,4 +108,37 @@ public class AnalysisServiceImpl implements AnalysisService {
}
return map;
}
@Override
public List<List<String>> getEnergyList(String resourceId, Integer type, String resourceType) {
Page<Map<String, Object>> page = new Page<>();
Map<String,Object> params = new HashMap<>(16);
params.put("resourceId",resourceId);
params.put("type",type);
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);
}else if(Constants.ID_JFKTP.equals(resourceType)){
page = jfktpInfoService.queryPageListByParam(pageTask,params);
}else if(Constants.ID_JFKTG.equals(resourceType)){
page = jfktgInfoService.queryPageListByParam(pageTask,params);
}else if(Constants.ID_FHJLM.equals(resourceType)){
}else if(Constants.ID_FLRBJZ.equals(resourceType)){
page = flrbInfoService.queryPageListByParam(pageTask,params);
}else if(Constants.ID_SLJFG.equals(resourceType)){
}else if(Constants.ID_SLSWJ.equals(resourceType)){
page = dlswjInfoService.queryPageListByParam(pageTask,params);
}
List<List<String>> listTj = new ArrayList<List<String>>();
for (int i = 0; i < page.getRecords().size(); i++) {
List<String> listDetail = new ArrayList<String>();
listDetail.add(DateUtils.format((Date) page.getRecords().get(i).get("create_time"),"yyyy-MM-dd HH:mm:ss"));
listDetail.add((String) page.getRecords().get(i).get("electric_energy"));
listTj.add(listDetail);
}
return listTj;
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.DlswjInfoDay;
import com.devplatform.admin.modules.eq.dao.DlswjInfoDayDao;
import com.devplatform.admin.modules.eq.model.DlswjInfoDayModel;
......@@ -8,6 +9,7 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* 多联室外机信息-天的service接口实现类
......@@ -25,4 +27,9 @@ public class DlswjInfoDayServiceImpl extends MyBaseServiceImpl<DlswjInfoDayDao,
return baseMapper.queryPageList(model);
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
return baseMapper.queryPageListByParam(pageTask,params);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.DlswjInfoHour;
import com.devplatform.admin.modules.eq.dao.DlswjInfoHourDao;
import com.devplatform.admin.modules.eq.model.DlswjInfoHourModel;
......@@ -31,4 +32,9 @@ public class DlswjInfoHourServiceImpl extends MyBaseServiceImpl<DlswjInfoHourDao
return baseMapper.querySum();
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
return baseMapper.queryPageListByParam(pageTask,params);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import org.springframework.stereotype.Service;
import com.devplatform.admin.modules.eq.model.DlswjInfoMonthModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.DlswjInfoMonth;
import com.devplatform.admin.modules.eq.dao.DlswjInfoMonthDao;
import com.devplatform.admin.modules.eq.model.DlswjInfoMonthModel;
import com.devplatform.admin.modules.eq.service.DlswjInfoMonthService;
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;
/**
* 多联室外机信息-月的service接口实现类
......@@ -28,5 +27,10 @@ public class DlswjInfoMonthServiceImpl extends MyBaseServiceImpl<DlswjInfoMonthD
return baseMapper.queryPageList(model);
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
return baseMapper.queryPageListByParam(pageTask,params);
}
}
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.modules.eq.bean.DlswjInfo;
import com.devplatform.admin.modules.eq.dao.DlswjInfoDao;
import com.devplatform.admin.modules.eq.model.DlswjInfoModel;
import com.devplatform.admin.modules.eq.service.DlswjInfoDayService;
import com.devplatform.admin.modules.eq.service.DlswjInfoHourService;
import com.devplatform.admin.modules.eq.service.DlswjInfoMonthService;
import com.devplatform.admin.modules.eq.service.DlswjInfoService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
......@@ -18,6 +24,12 @@ import java.util.Map;
*/
@Service("dlswjInfoService")
public class DlswjInfoServiceImpl extends MyBaseServiceImpl<DlswjInfoDao, DlswjInfo> implements DlswjInfoService {
@Autowired
private DlswjInfoHourService dlswjInfoHourService;
@Autowired
private DlswjInfoDayService dlswjInfoDayService;
@Autowired
private DlswjInfoMonthService dlswjInfoMonthService;
@Override
public List<DlswjInfo> queryPageList(DlswjInfoModel model) {
......@@ -30,4 +42,18 @@ public class DlswjInfoServiceImpl extends MyBaseServiceImpl<DlswjInfoDao, DlswjI
public List<Map<String, Object>> getList() {
return baseMapper.getList();
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
String type = (String) params.get("type");
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
if(Constants.STRING_1.equals(type)){
page = dlswjInfoHourService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){
page = dlswjInfoDayService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_4.equals(type)){
page = dlswjInfoMonthService.queryPageListByParam(pageTask,params);
}
return page;
}
}
package com.devplatform.admin.modules.eq.service.impl;
import org.springframework.stereotype.Service;
import com.devplatform.admin.modules.eq.model.FlrbInfoHourModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.FlrbInfoHour;
import com.devplatform.admin.modules.eq.dao.FlrbInfoHourDao;
import com.devplatform.admin.modules.eq.model.FlrbInfoHourModel;
import com.devplatform.admin.modules.eq.service.FlrbInfoHourService;
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;
/**
* 风冷热泵机组信息-时的service接口实现类
......@@ -28,4 +27,9 @@ public class FlrbInfoHourServiceImpl extends MyBaseServiceImpl<FlrbInfoHourDao,
return baseMapper.queryPageList(model);
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
return baseMapper.queryPageListByParam(pageTask,params);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import org.springframework.stereotype.Service;
import com.devplatform.admin.modules.eq.model.FlrbInfoMonthModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.FlrbInfoMonth;
import com.devplatform.admin.modules.eq.dao.FlrbInfoMonthDao;
import com.devplatform.admin.modules.eq.model.FlrbInfoMonthModel;
import com.devplatform.admin.modules.eq.service.FlrbInfoMonthService;
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;
/**
* 风冷热泵机组信息-月的service接口实现类
......@@ -27,4 +26,9 @@ public class FlrbInfoMonthServiceImpl extends MyBaseServiceImpl<FlrbInfoMonthDao
model.getPager().setRowCount(rowCount);
return baseMapper.queryPageList(model);
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
return baseMapper.queryPageListByParam(pageTask,params);
}
}
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.modules.eq.bean.FlrbInfo;
import com.devplatform.admin.modules.eq.dao.FlrbInfoDao;
import com.devplatform.admin.modules.eq.model.FlrbInfoModel;
import com.devplatform.admin.modules.eq.service.FlrbInfoDayService;
import com.devplatform.admin.modules.eq.service.FlrbInfoHourService;
import com.devplatform.admin.modules.eq.service.FlrbInfoMonthService;
import com.devplatform.admin.modules.eq.service.FlrbInfoService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
......@@ -18,6 +24,12 @@ import java.util.Map;
*/
@Service("flrbInfoService")
public class FlrbInfoServiceImpl extends MyBaseServiceImpl<FlrbInfoDao, FlrbInfo> implements FlrbInfoService {
@Autowired
private FlrbInfoHourService flrbInfoHourService;
@Autowired
private FlrbInfoDayService flrbInfoDayService;
@Autowired
private FlrbInfoMonthService flrbInfoMonthService;
@Override
public List<FlrbInfo> queryPageList(FlrbInfoModel model) {
......@@ -31,4 +43,18 @@ public class FlrbInfoServiceImpl extends MyBaseServiceImpl<FlrbInfoDao, FlrbInfo
return baseMapper.getList();
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
String type = (String) params.get("type");
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
if(Constants.STRING_1.equals(type)){
page = flrbInfoHourService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){
page = flrbInfoDayService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_4.equals(type)){
page = flrbInfoMonthService.queryPageListByParam(pageTask,params);
}
return page;
}
}
package com.devplatform.admin.modules.eq.service.impl;
import org.springframework.stereotype.Service;
import com.devplatform.admin.modules.eq.model.JfktgInfoHourModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.JfktgInfoHour;
import com.devplatform.admin.modules.eq.dao.JfktgInfoHourDao;
import com.devplatform.admin.modules.eq.model.JfktgInfoHourModel;
import com.devplatform.admin.modules.eq.service.JfktgInfoHourService;
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;
/**
* 机房空调(380V)信息-时的service接口实现类
......@@ -28,4 +27,9 @@ public class JfktgInfoHourServiceImpl extends MyBaseServiceImpl<JfktgInfoHourDao
return baseMapper.queryPageList(model);
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
return baseMapper.queryPageListByParam(pageTask,params);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import org.springframework.stereotype.Service;
import com.devplatform.admin.modules.eq.model.JfktgInfoMonthModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.JfktgInfoMonth;
import com.devplatform.admin.modules.eq.dao.JfktgInfoMonthDao;
import com.devplatform.admin.modules.eq.model.JfktgInfoMonthModel;
import com.devplatform.admin.modules.eq.service.JfktgInfoMonthService;
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;
/**
* 机房空调(380V)信息-月的service接口实现类
......@@ -28,4 +27,9 @@ public class JfktgInfoMonthServiceImpl extends MyBaseServiceImpl<JfktgInfoMonthD
return baseMapper.queryPageList(model);
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
return baseMapper.queryPageListByParam(pageTask,params);
}
}
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.modules.eq.bean.JfktgInfo;
import com.devplatform.admin.modules.eq.dao.JfktgInfoDao;
import com.devplatform.admin.modules.eq.model.JfktgInfoModel;
import com.devplatform.admin.modules.eq.service.JfktgInfoDayService;
import com.devplatform.admin.modules.eq.service.JfktgInfoHourService;
import com.devplatform.admin.modules.eq.service.JfktgInfoMonthService;
import com.devplatform.admin.modules.eq.service.JfktgInfoService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
......@@ -18,6 +24,12 @@ import java.util.Map;
*/
@Service("jfktgInfoService")
public class JfktgInfoServiceImpl extends MyBaseServiceImpl<JfktgInfoDao, JfktgInfo> implements JfktgInfoService {
@Autowired
private JfktgInfoHourService jfktgInfoHourService;
@Autowired
private JfktgInfoDayService jfktgInfoDayService;
@Autowired
private JfktgInfoMonthService jfktgInfoMonthService;
@Override
public List<JfktgInfo> queryPageList(JfktgInfoModel model) {
......@@ -31,4 +43,18 @@ public class JfktgInfoServiceImpl extends MyBaseServiceImpl<JfktgInfoDao, JfktgI
return baseMapper.getList();
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
String type = (String) params.get("type");
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
if(Constants.STRING_1.equals(type)){
page = jfktgInfoHourService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){
page = jfktgInfoDayService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_4.equals(type)){
page = jfktgInfoMonthService.queryPageListByParam(pageTask,params);
}
return page;
}
}
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.JfktpInfoHourModel;
......@@ -11,6 +12,7 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 机房空调(220V)信息-时的service接口实现类
......@@ -27,5 +29,8 @@ public class JfktpInfoHourServiceImpl extends MyBaseServiceImpl<JfktpInfoHourDao
model.getPager().setRowCount(rowCount);
return baseMapper.queryPageList(model);
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
return baseMapper.queryPageListByParam(pageTask,params);
}
}
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.JfktpInfoMonthModel;
......@@ -11,6 +12,7 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 机房空调(220V)信息-月的service接口实现类
......@@ -27,5 +29,8 @@ public class JfktpInfoMonthServiceImpl extends MyBaseServiceImpl<JfktpInfoMonthD
model.getPager().setRowCount(rowCount);
return baseMapper.queryPageList(model);
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
return baseMapper.queryPageListByParam(pageTask,params);
}
}
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.modules.eq.bean.JfktpInfo;
import com.devplatform.admin.modules.eq.dao.JfktpInfoDao;
import com.devplatform.admin.modules.eq.model.JfktpInfoModel;
import com.devplatform.admin.modules.eq.service.JfktpInfoDayService;
import com.devplatform.admin.modules.eq.service.JfktpInfoHourService;
import com.devplatform.admin.modules.eq.service.JfktpInfoMonthService;
import com.devplatform.admin.modules.eq.service.JfktpInfoService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
......@@ -18,6 +24,13 @@ import java.util.Map;
*/
@Service("jfktpInfoService")
public class JfktpInfoServiceImpl extends MyBaseServiceImpl<JfktpInfoDao, JfktpInfo> implements JfktpInfoService {
@Autowired
private JfktpInfoHourService jfktpInfoHourService;
@Autowired
private JfktpInfoDayService jfktpInfoDayService;
@Autowired
private JfktpInfoMonthService jfktpInfoMonthService;
@Override
public List<JfktpInfo> queryPageList(JfktpInfoModel model) {
......@@ -31,4 +44,18 @@ public class JfktpInfoServiceImpl extends MyBaseServiceImpl<JfktpInfoDao, JfktpI
return baseMapper.getList();
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
String type = (String) params.get("type");
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
if(Constants.STRING_1.equals(type)){
page = jfktpInfoHourService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){
page = jfktpInfoDayService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_4.equals(type)){
page = jfktpInfoMonthService.queryPageListByParam(pageTask,params);
}
return page;
}
}
......@@ -15,17 +15,19 @@ import java.util.Map;
@Service("kanBanService")
public class KanBanServiceImpl implements KanBanService {
@Autowired
private FlrbInfoDayService flrbInfoDayService;
private FlrbInfoService flrbInfoService;
@Autowired
private JfktgInfoDayService jfktgInfoDayService;
private JfktgInfoService jfktgInfoService;
@Autowired
private JfktpInfoDayService jfktpInfoDayService;
private JfktpInfoService jfktpInfoService;
@Autowired
private PfjInfoDayService pfjInfoDayService;
private PfjInfoService pfjInfoService;
@Autowired
private SnqxzInfoHourService snqxzInfoHourService;
@Autowired
private SwqxzInfoHourService swqxzInfoHourService;
@Autowired
private DlswjInfoService dlswjInfoService;
@Override
public Page<Map<String,Object>> getListByTypeAndId(Map<String, Object> params) {
......@@ -36,15 +38,15 @@ public class KanBanServiceImpl implements KanBanService {
Page<Map<String,Object>> pageTask = new Page<Map<String, Object>>(Integer.valueOf(page), Integer.valueOf(rows));
if(Constants.ID_PFJ.equals(resourceType)){
list = pfjInfoDayService.queryPageListByParam(pageTask,params);
list = pfjInfoService.queryPageListByParam(pageTask,params);
}else if(Constants.ID_JFKTP.equals(resourceType)){
list = jfktpInfoDayService.queryPageListByParam(pageTask,params);
list = jfktpInfoService.queryPageListByParam(pageTask,params);
}else if(Constants.ID_JFKTG.equals(resourceType)){
list = jfktgInfoDayService.queryPageListByParam(pageTask,params);
list = jfktgInfoService.queryPageListByParam(pageTask,params);
}else if(Constants.ID_FHJLM.equals(resourceType)){
}else if(Constants.ID_FLRBJZ.equals(resourceType)){
list = flrbInfoDayService.queryPageListByParam(pageTask,params);
list = flrbInfoService.queryPageListByParam(pageTask,params);
}else if(Constants.ID_SLJFG.equals(resourceType)){
}else if(Constants.ID_SB.equals(resourceType)){
......@@ -54,7 +56,7 @@ public class KanBanServiceImpl implements KanBanService {
}else if(Constants.ID_DLSNJ.equals(resourceType)){
}else if(Constants.ID_SLSWJ.equals(resourceType)){
list = dlswjInfoService.queryPageListByParam(pageTask,params);
}else if(Constants.ID_SNQXZ.equals(resourceType)){
list = snqxzInfoHourService.queryPageListByParam(pageTask,params);
}else if(Constants.ID_HQS.equals(resourceType)){
......
package com.devplatform.admin.modules.eq.service.impl;
import org.springframework.stereotype.Service;
import com.devplatform.admin.modules.eq.model.PfjInfoHourModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.PfjInfoHour;
import com.devplatform.admin.modules.eq.dao.PfjInfoHourDao;
import com.devplatform.admin.modules.eq.model.PfjInfoHourModel;
import com.devplatform.admin.modules.eq.service.PfjInfoHourService;
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;
/**
* 排风机信息-时的service接口实现类
......@@ -28,4 +27,8 @@ public class PfjInfoHourServiceImpl extends MyBaseServiceImpl<PfjInfoHourDao, Pf
return baseMapper.queryPageList(model);
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params) {
return baseMapper.queryPageListByParam(page,params);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import org.springframework.stereotype.Service;
import com.devplatform.admin.modules.eq.model.PfjInfoMonthModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.PfjInfoMonth;
import com.devplatform.admin.modules.eq.dao.PfjInfoMonthDao;
import com.devplatform.admin.modules.eq.model.PfjInfoMonthModel;
import com.devplatform.admin.modules.eq.service.PfjInfoMonthService;
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;
/**
* 排风机信息-月的service接口实现类
......@@ -28,4 +27,9 @@ public class PfjInfoMonthServiceImpl extends MyBaseServiceImpl<PfjInfoMonthDao,
return baseMapper.queryPageList(model);
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
return baseMapper.queryPageListByParam(pageTask,params);
}
}
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.modules.eq.bean.PfjInfo;
import com.devplatform.admin.modules.eq.dao.PfjInfoDao;
import com.devplatform.admin.modules.eq.model.PfjInfoModel;
import com.devplatform.admin.modules.eq.service.PfjInfoDayService;
import com.devplatform.admin.modules.eq.service.PfjInfoHourService;
import com.devplatform.admin.modules.eq.service.PfjInfoMonthService;
import com.devplatform.admin.modules.eq.service.PfjInfoService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
......@@ -18,6 +24,12 @@ import java.util.Map;
*/
@Service("pfjInfoService")
public class PfjInfoServiceImpl extends MyBaseServiceImpl<PfjInfoDao, PfjInfo> implements PfjInfoService {
@Autowired
private PfjInfoHourService pfjInfoHourService;
@Autowired
private PfjInfoDayService pfjInfoDayService;
@Autowired
private PfjInfoMonthService pfjInfoMonthService;
@Override
public List<PfjInfo> queryPageList(PfjInfoModel model) {
......@@ -31,4 +43,17 @@ public class PfjInfoServiceImpl extends MyBaseServiceImpl<PfjInfoDao, PfjInfo> i
return baseMapper.getList();
}
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params) {
String type = (String) params.get("type");
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
if(Constants.STRING_1.equals(type)){
page = pfjInfoHourService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){
page = pfjInfoDayService.queryPageListByParam(pageTask,params);
}else if(Constants.STRING_4.equals(type)){
page = pfjInfoMonthService.queryPageListByParam(pageTask,params);
}
return page;
}
}
......@@ -30,4 +30,9 @@ public class SnqxzInfoHourServiceImpl extends MyBaseServiceImpl<SnqxzInfoHourDao
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params) {
return baseMapper.queryPageListByParam(page,params);
}
@Override
public List<Map<String,Object>> getList(String resourceId, Integer type) {
return baseMapper.getList(resourceId,type);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.devplatform.admin.modules.eq.bean.TotalMonth;
import com.devplatform.admin.modules.eq.dao.TotalMonthDao;
import com.devplatform.admin.modules.eq.model.TotalMonthModel;
import com.devplatform.admin.modules.eq.service.TotalMonthService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 能耗-月的service接口实现类
* <br>
* <b>功能:</b>TotalMonthServiceImpl<br>
* @author 代码生成器产生
*/
@Service("totalMonthService")
public class TotalMonthServiceImpl extends MyBaseServiceImpl<TotalMonthDao, TotalMonth> implements TotalMonthService {
@Override
public List<TotalMonth> queryPageList(TotalMonthModel model) {
Integer rowCount = baseMapper.queryPageByCount(model);
model.getPager().setRowCount(rowCount);
return baseMapper.queryPageList(model);
}
}
......@@ -43,6 +43,25 @@
</if>
</select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from pfj_info_day t
where 1=1
<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>
<if test="params.type == 3">
and DATE_FORMAT(t.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time
</if>
</select>
</mapper>
......@@ -47,6 +47,23 @@
group by create_time order by create_time
</select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from dlswj_info_hour t
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 1">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time
</if>
</select>
</mapper>
......@@ -43,6 +43,23 @@
</if>
</select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from pfj_info_month t
where 1=1
<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>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time
</if>
</select>
</mapper>
......@@ -49,17 +49,17 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
<if test="params.type == 2">
and YEARWEEK(date_format(t.create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1);
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
<if test="params.type == 3">
and DATE_FORMAT(t.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time DESC
ORDER BY t.create_time
</if>
</select>
......
......@@ -43,6 +43,23 @@
</if>
</select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from flrb_info_hour t
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 1">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time
</if>
</select>
</mapper>
......@@ -43,6 +43,22 @@
</if>
</select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from flrb_info_month t
where 1=1
<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>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time
</if>
</select>
</mapper>
......@@ -49,17 +49,17 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
<if test="params.type == 2">
and YEARWEEK(date_format(t.create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1);
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
<if test="params.type == 3">
and DATE_FORMAT(t.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time DESC
ORDER BY t.create_time
</if>
</select>
</mapper>
......
......@@ -43,6 +43,23 @@
</if>
</select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from jfktg_info_hour t
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 1">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time
</if>
</select>
</mapper>
......@@ -43,6 +43,22 @@
</if>
</select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from jfktg_info_month t
where 1=1
<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>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time
</if>
</select>
</mapper>
......@@ -49,17 +49,17 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
<if test="params.type == 2">
and YEARWEEK(date_format(t.create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1);
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
<if test="params.type == 3">
and DATE_FORMAT(t.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time DESC
ORDER BY t.create_time
</if>
</select>
......
......@@ -43,6 +43,22 @@
</if>
</select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from jfktp_info_hour t
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 1">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time
</if>
</select>
</mapper>
......@@ -43,6 +43,22 @@
</if>
</select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from jfktp_info_month t
where 1=1
<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>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time
</if>
</select>
</mapper>
......@@ -49,17 +49,17 @@
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
<if test="params.type == 2">
and YEARWEEK(date_format(t.create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1);
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
<if test="params.type == 3">
and DATE_FORMAT(t.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time DESC
ORDER BY t.create_time
</if>
</select>
......
......@@ -42,6 +42,22 @@
${pager.mysqlQueryCondition}
</if>
</select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from pfj_info_hour t
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 1">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time
</if>
</select>
</mapper>
......
......@@ -43,6 +43,22 @@
</if>
</select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from pfj_info_month t
where 1=1
<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>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time
</if>
</select>
</mapper>
......@@ -72,6 +72,27 @@
ORDER BY t.create_time DESC
</if>
</select>
<select id="getList" resultType="java.util.Map">
select * from snqxz_info_hour
where 1=1
<if test="resourceId!=null and resourceId!=''">
and resource_id = #{resourceId}
</if>
<if test="type == 1">
and TO_DAYS(create_time) = TO_DAYS(NOW())
</if>
<if test="type == 2">
and YEARWEEK(date_format(create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
</if>
<if test="type == 3">
and DATE_FORMAT(create_time,'%Y%m')=DATE_FORMAT(CURDATE(), '%Y%m' )
</if>
<if test="type == 4">
and DATE_FORMAT( create_time, '%Y' ) = DATE_FORMAT( CURDATE() , '%Y' )
</if>
order by create_time
</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.devplatform.admin.modules.eq.dao.TotalMonthDao">
<!-- Result Map -->
<resultMap id="BaseResultMap" type="com.devplatform.admin.modules.eq.bean.TotalMonth">
<result column="id" property="id"/>
<result column="electric_energy" property="electricEnergy"/>
<result column="station_id" property="stationId"/>
<result column="create_time" property="createTime"/>
</resultMap>
<!-- total_month table all fields -->
<sql id="Base_Column_List">
id,electric_energy,station_id,create_time
</sql>
<!-- 公共查询条件 -->
<sql id="Example_Where_Clause">
where t.deleted=0
<if test="id!=null and id!=''">and t.id = #{id}</if>
<if test="electricEnergy!=null and electricEnergy!=''">and t.electric_energy = #{electricEnergy}</if>
<if test="stationId!=null and stationId!=''">and t.station_id = #{stationId}</if>
<if test="createTime!=null ">and t.create_time = #{createTime}</if>
</sql>
<select id="queryPageByCount" parameterType="Object" resultType="java.lang.Integer">
select count(1) from total_month t
<include refid="Example_Where_Clause"/>
</select>
<select id="queryPageList" parameterType="Object" resultMap="BaseResultMap">
select t.* from total_month t
<include refid="Example_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''">
${pager.orderCondition}
</if>
<if test="pager.mysqlQueryCondition != null and pager.mysqlQueryCondition != ''">
${pager.mysqlQueryCondition}
</if>
</select>
</mapper>
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