Commit b845d14a authored by 史志龙's avatar 史志龙

资阳西站提交初版--shizhilong

parent 66773fa3
......@@ -36,16 +36,17 @@ public class InitRunner implements CommandLineRunner {
List<TimedTask> timedTasks = timedTaskService.list(new LambdaQueryWrapper<TimedTask>().eq(TimedTask::getStatus,Constants.INT_1));
if(timedTasks != null && timedTasks.size() > 0){
for(TimedTask timedTask : timedTasks){
//人工模式
if(sysSystemParams.getType() == 1 && timedTask.getBusinessType() != Constants.INT_3) {
// R r = equipmentController.timedTask(timedTask.getId(), timedTask.getStartTime(), timedTask.getEndTime(), Constants.INT_1,
// timedTask.getBusinessType(), timedTask.getType(), Constants.STRING_1,Constants.INT_3);
// if (!Constants.STRING_0.equals(r.get(Constants.CODE_WORD).toString())) {
// System.err.println("定时任务启动失败!!");
// }
} else if(sysSystemParams.getType() == 2 && timedTask.getBusinessType() == Constants.INT_3) {
//开启节能大小循环
R r = equipmentController.timedTask(timedTask.getId(), timedTask.getStartTime(), timedTask.getEndTime(), Constants.INT_1,
timedTask.getBusinessType(), timedTask.getType(), Constants.STRING_1);
if (!Constants.STRING_0.equals(r.get(Constants.CODE_WORD).toString())) {
System.err.println("定时任务启动失败!!");
}
}
else if(sysSystemParams.getType() == 2 && timedTask.getBusinessType() == Constants.INT_3) {
R r = equipmentController.timedTask(timedTask.getId(), timedTask.getStartTime(), timedTask.getEndTime(), Constants.INT_1,
timedTask.getBusinessType(), timedTask.getType(), Constants.STRING_1);
timedTask.getBusinessType(), timedTask.getType(), Constants.STRING_1,timedTask.getBusinessSonType());
if (!Constants.STRING_0.equals(r.get(Constants.CODE_WORD).toString())) {
System.err.println("定时任务启动失败!!");
}
......
......@@ -26,6 +26,7 @@ public class SimpleJob implements Job {
Integer status = (Integer) jobDataMap.get("status");
Integer type = (Integer) jobDataMap.get("type");
Integer businessType = (Integer) jobDataMap.get("businessType");
Integer businessSonType = (Integer) jobDataMap.get("businessSonType");
Map<String, String> postParam = new HashMap<String, String>(10);
......@@ -49,12 +50,22 @@ public class SimpleJob implements Job {
}
}else if(businessType == Constants.INT_3){
LOG.info("执行节能任务");
String postUrl = "http://localhost:8089/command/energyTask";
Map<String, Object> resultMap = TestClient.uploadText(postUrl, postParam);
Map<String, Object> map = null;
if (Constants.STRING_200.equals(resultMap.get(Constants.STATUS_CODE).toString())) {
map = JSONObject.parseObject(resultMap.get("data").toString(), Map.class);
if(businessSonType==Constants.INT_1){
String postUrl = "http://localhost:8089/command/energyTask";
Map<String, Object> resultMap = TestClient.uploadText(postUrl, postParam);
Map<String, Object> map = null;
if (Constants.STRING_200.equals(resultMap.get(Constants.STATUS_CODE).toString())) {
map = JSONObject.parseObject(resultMap.get("data").toString(), Map.class);
}
}else if(businessSonType == Constants.INT_2){
String postUrl = "http://localhost:8089/command/energyTask2";
Map<String, Object> resultMap = TestClient.uploadText(postUrl, postParam);
Map<String, Object> map = null;
if (Constants.STRING_200.equals(resultMap.get(Constants.STATUS_CODE).toString())) {
map = JSONObject.parseObject(resultMap.get("data").toString(), Map.class);
}
}
}
}
}
......@@ -697,5 +697,38 @@ public class Constants {
* 右热泵主机2
*/
public static final String ID_FLRBJZ_4 = "21b83b939a3848ae8a38368a59ca0004";
/**
* 组合式空调机组A
*/
public static final String KTJZ_A = "组合式空调机组A";
/**
* 组合式空调机组C
*/
public static final String KTJZ_C = "组合式空调机组C";
/**
* 一体化风冷热泵A
*/
public static final String FLRB_A = "一体化风冷热泵A";
/**
* 一体化风冷热泵C
*/
public static final String FLRB_C = "一体化风冷热泵C";
/**设备类型ID*/
/**
* 资阳西站空调机组
*/
public static final String ZY_KTJZ = "2";
/**
* 资阳西站一体化风冷热泵机组
*/
public static final String ZY_FLRB = "3";
/**
* 资阳西站空气处理机
*/
public static final String ZY_KQCLJ = "1";
/**
* 资阳西站全部能耗统计
*/
public static final String ZY_QB = "999";
}
package com.devplatform.admin.modules.eq.bean;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author dxw
*/
@Data
@ApiModel(value="空气处理器信息对象",description="空气处理器信息对象")
@TableName("kqclj_info")
public class KqcljInfo implements Serializable {
private static final long serialVersionUID = 1L;
/** 主键id */
@ApiModelProperty(value="主键ID",name="id")
@TableId
private String id;
/** 资源点id */
@ApiModelProperty(value="资源点id",name="resourceId")
private String resourceId;
/** 空气处理机能耗 */
@ApiModelProperty(value="空气处理机能耗",name="energy")
private String energy;
/** 类型(1手动,2节能) */
@ApiModelProperty(value="类型(1手动,2节能)",name="type")
private Integer type;
/** 站点表id */
@ApiModelProperty(value="站点表id",name="stationId")
private String stationId;
/** 创建时间 */
@ApiModelProperty(value="创建时间",name="createTime")
private java.util.Date createTime;
}
package com.devplatform.admin.modules.eq.bean;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel(value="空气处理机信息-时对象",description="空气处理机信息-时对象")
@TableName("kqclj_info_hour")
public class KqcljInfoHour implements Serializable {
private static final long serialVersionUID = 1L;
/** 主键id */
@ApiModelProperty(value="主键ID",name="id")
@TableId
private String id;
/** 资源点id */
@ApiModelProperty(value="资源点id",name="resourceId")
private String resourceId;
/** 空气处理机能耗 */
@ApiModelProperty(value="空气处理机能耗",name="electricEnergy")
private String electricEnergy;
/** 类型(1手动,2节能) */
@ApiModelProperty(value="类型(1手动,2节能)",name="type")
private Integer type;
/** 站点表id */
@ApiModelProperty(value="站点表id",name="stationId")
private String stationId;
/** 创建时间 */
@ApiModelProperty(value="创建时间",name="createTime")
private java.util.Date createTime;
}
......@@ -36,6 +36,9 @@ public class SwqxzInfo implements Serializable {
/** 风向 */
@ApiModelProperty(value="风向",name="windDirection")
private java.lang.String windDirection;
/** 风向360 */
@ApiModelProperty(value="风向360",name="windDirectionNum")
private String windDirectionNum;
/** 光照度 */
@ApiModelProperty(value="光照度",name="illuminance")
private java.lang.String illuminance;
......@@ -51,6 +54,10 @@ public class SwqxzInfo implements Serializable {
/** 电表通讯故障 */
@ApiModelProperty(value="电表通讯故障",name="communicationFailure")
private java.lang.String communicationFailure;
/** 气压 */
@ApiModelProperty(value="气压",name="pressure")
private java.lang.String pressure;
/** 类型(1手动,2节能) */
@ApiModelProperty(value="类型(1手动,2节能)",name="type")
private Integer type;
......
......@@ -46,6 +46,9 @@ public class SwqxzInfoHour implements Serializable {
/** 辐射 */
@ApiModelProperty(value="辐射",name="radiation")
private java.lang.String radiation;
/** 气压 */
@ApiModelProperty(value="气压",name="pressure")
private java.lang.String pressure;
/** 类型(1手动,2节能) */
@ApiModelProperty(value="类型(1手动,2节能)",name="type")
private Integer type;
......
......@@ -54,7 +54,7 @@ public class TimedTask implements Serializable {
/** 备用项3 */
@ApiModelProperty(value="备用项3",name="byx3")
private java.lang.String byx3;
/** 业务类型(1 候车大厅全局 2 电动门帘) */
/** 业务类型(1 人工 3节能) */
@ApiModelProperty(value="业务类型(1 候车大厅全局 2 电动门帘)",name="businessType")
private Integer businessType;
/** 类型(1 上升 2 下降) */
......@@ -63,4 +63,7 @@ public class TimedTask implements Serializable {
/** 温度 */
@ApiModelProperty(value="温度",name="temperature")
private java.lang.String temperature;
/** 业务子类型:节能(1:大循环,2:小循环)3:人工模式 */
@ApiModelProperty(value="业务子类型:节能(1:大循环,2:小循环)3:人工模式",name="businessSonType")
private Integer businessSonType;
}
package com.devplatform.admin.modules.eq.bean;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @author dxw
*/
@Data
@ApiModel(value="算法模块预警信息表",description="算法模块预警信息表")
@TableName("warn_info")
public class WarnInfo implements Serializable {
private static final long serialVersionUID = 1L;
/** 主键id */
@ApiModelProperty(value="主键ID",name="id")
@TableId
private String id;
/** 预警类型(1:数值范围错误,2:网络问题连接不上,3:空调机组滤网压差故障,4:空调机组故障,5:恢复) */
@ApiModelProperty(value="预警类型",name="infoStatus")
private Integer infoStatus;
/** 资源点id */
@ApiModelProperty(value="资源点id",name="resourceId")
private String resourceId;
/** 资源点名称 */
@ApiModelProperty(value="资源点名称",name="resourceName")
private String resourceName;
/** 点位名称 */
@ApiModelProperty(value="点位名称",name="pointName")
private String pointName;
/** 点位id */
@ApiModelProperty(value="点位id",name="pointId")
private String pointId;
/** 预警信息 */
@ApiModelProperty(value="预警信息",name="info")
private String info;
/** 创建时间 */
@ApiModelProperty(value="创建时间",name="createTime")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
}
package com.devplatform.admin.modules.eq.bean;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author dxw
*/
@Data
@ApiModel(value="资阳西站风冷热泵机组信息对象",description="风冷热泵机组信息对象")
@TableName("zy_flrb_info")
public class ZyFlrbInfo implements Serializable {
private static final long serialVersionUID = 1L;
/** 主键id */
@ApiModelProperty(value="主键ID",name="id")
@TableId
private String id;
/** 资源点id */
@ApiModelProperty(value="资源点id",name="resourceId")
private String resourceId;
/** 供水实时温度 */
@ApiModelProperty(value="供水温度",name="waterSupplyTemperature")
private String waterSupplyTemperature;
/** 回水实时温度 */
@ApiModelProperty(value="回水温度",name="returnWaterTemperature")
private String returnWaterTemperature;
/** 总管水流量 */
@ApiModelProperty(value="总管水流量",name="waterRate")
private String waterRate;
/** 制热温度 */
@ApiModelProperty(value="制热温度",name="heatingTem")
private String heatingTem;
/** 制冷温度 */
@ApiModelProperty(value="制冷温度",name="refrigerationTem")
private String refrigerationTem;
/** 制冷制热模式切换 */
@ApiModelProperty(value="制冷制热模式切换",name="switchMode")
private String switchMode;
/** 主机状态 */
@ApiModelProperty(value="主机状态",name="hostStatus")
private String hostStatus;
/** 冷热源能耗 */
@ApiModelProperty(value="冷热源能耗",name="energy")
private String energy;
/** 类型(1手动,2节能) */
@ApiModelProperty(value="类型(1手动,2节能)",name="type")
private Integer type;
/** 站点表id */
@ApiModelProperty(value="站点表id",name="stationId")
private String stationId;
/** 创建时间 */
@ApiModelProperty(value="创建时间",name="createTime")
private java.util.Date createTime;
}
package com.devplatform.admin.modules.eq.bean;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author dxw
*/
@Data
@ApiModel(value="资阳西站空调机组信息对象",description="机房空调信息对象")
@TableName("zy_jfktp_info")
public class ZyJfktpInfo implements Serializable {
private static final long serialVersionUID = 1L;
/** 主键id */
@ApiModelProperty(value="主键ID",name="id")
@TableId
private String id;
/** 资源点id */
@ApiModelProperty(value="资源点id",name="resourceId")
private String resourceId;
/** 空调回风温度 */
@ApiModelProperty(value="空调回风温度",name="windTem")
private String windTem;
/** 水阀反馈 */
@ApiModelProperty(value="水阀反馈",name="waterFeedback")
private String waterFeedback;
/** 新风温度 */
@ApiModelProperty(value="新风温度",name="newTem")
private String newTem;
/** 季节 */
@ApiModelProperty(value="季节",name="season")
private String season;
/** 滤网压差 */
@ApiModelProperty(value="滤网压差",name="filterPressure")
private String filterPressure;
/** 风机压差 */
@ApiModelProperty(value="风机压差",name="fanPressure")
private String fanPressure;
/** 状态 */
@ApiModelProperty(value="状态",name="status")
private String status;
/** 故障 */
@ApiModelProperty(value="故障",name="failure")
private String failure;
/** 手自动 */
@ApiModelProperty(value="手自动",name="automatic")
private String automatic;
/** 空调能耗 */
@ApiModelProperty(value="空调能耗",name="energy")
private String energy;
/** 类型(1手动,2节能) */
@ApiModelProperty(value="类型(1手动,2节能)",name="type")
private Integer type;
/** 站点表id */
@ApiModelProperty(value="站点表id",name="stationId")
private String stationId;
/** 创建时间 */
@ApiModelProperty(value="创建时间",name="createTime")
private java.util.Date createTime;
}
......@@ -65,23 +65,36 @@ public class AnalysisController extends AbstractController {
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>>();
//风速
List<List<String>> windSpeedList = new ArrayList<List<String>>();
//照度
List<List<String>> illuminanceList = new ArrayList<List<String>>();
//co2
List<List<String>> carbonDioxideList = new ArrayList<List<String>>();
//细粒度
List<List<String>> fineParticlesList = new ArrayList<List<String>>();
//辐射
List<List<String>> radiationList = new ArrayList<List<String>>();
List<List<String>> bjList = 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>();
//co2详情
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");
......@@ -236,6 +249,19 @@ public class AnalysisController extends AbstractController {
List<List<String>> list = analysisService.getEnergyListFx(startTime,endTime,resourceType);
return R.ok().put("list", list);
}
/**
* 资阳西站获取能耗数据分析
*
* @return
*/
@ApiOperation(value="资阳西站获取能耗数据分析", notes="资阳西站获取能耗数据分析")
@GetMapping("/getZyEnergyFx")
public R getZyEnergyFx(String startTime,String endTime, String resourceType) {
startTime = DateUtil.getStringOfFirstDay(startTime);
endTime = DateUtil.getStringOfLastDay(endTime);
List<List<String>> list = analysisService.getZyEnergyFx(startTime,endTime,resourceType);
return R.ok().put("list", list);
}
/**
* 数据分析-能耗数据-导出
......
package com.devplatform.admin.modules.eq.dao;
import com.devplatform.admin.modules.eq.bean.KqcljInfo;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* KqcljInfo Mapper
* 用于空气处理机信息的数据库操作
* @author Administrator
*
*/
@Mapper
public interface KqcljInfoDao extends MyBaseMapper<KqcljInfo> {
List<Map<String, Object>> getList();
BigDecimal getTotalEnergy(String time);
}
package com.devplatform.admin.modules.eq.dao;
import com.devplatform.admin.modules.eq.bean.KqcljInfoHour;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* KqcljInfoHour Mapper
* 用于空气处理机信息-时的数据库操作
* @author Administrator
*
*/
@Mapper
public interface KqcljInfoHourDao extends MyBaseMapper<KqcljInfoHour> {
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime, @Param("endTime")String endTime);
}
......@@ -32,4 +32,6 @@ public interface SnqxzInfoDao extends MyBaseMapper<SnqxzInfo> {
List<SnqxzInfo> queryPageList(SnqxzInfoModel model);
List<Map<String, Object>> getList();
List<Map<String, Object>> getList2(String time);
}
......@@ -32,4 +32,6 @@ public interface SwqxzInfoDao extends MyBaseMapper<SwqxzInfo> {
List<SwqxzInfo> queryPageList(SwqxzInfoModel model);
List<Map<String, Object>> getList();
List<Map<String, Object>> getList2();
}
package com.devplatform.admin.modules.eq.dao;
import com.devplatform.admin.modules.eq.bean.WarnInfo;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* WarnInfo Mapper
* 算法模块预警信息的数据库操作
* @author Administrator
*
*/
@Mapper
public interface WarnInfoDao extends MyBaseMapper<WarnInfo> {
}
package com.devplatform.admin.modules.eq.dao;
import com.devplatform.admin.modules.eq.bean.ZyFlrbInfo;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* ZyFlrbInfo Mapper
* 用于资阳西站风冷热泵机组信息的数据库操作
* @author Administrator
*
*/
@Mapper
public interface ZyFlrbInfoDao extends MyBaseMapper<ZyFlrbInfo> {
List<Map<String, Object>> getList();
ZyFlrbInfo selectZyFlrbInfo(@Param("resourceId") String resourceId, @Param("time") String time);
BigDecimal getTotalEnergy(String time);
}
package com.devplatform.admin.modules.eq.dao;
import com.devplatform.admin.modules.eq.bean.ZyJfktpInfo;
import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* JfktpInfo Mapper
* 用于资阳西站空调机组信息的数据库操作
* @author Administrator
*
*/
@Mapper
public interface ZyJfktpInfoDao extends MyBaseMapper<ZyJfktpInfo> {
List<Map<String, Object>> getList();
ZyJfktpInfo selectZyJfktpInfo(@Param("resourceId") String resourceId, @Param("time") String time);
BigDecimal getTotalEnergy(String time);
}
......@@ -17,4 +17,6 @@ public interface AnalysisService {
List<List<String>> getEnergyListFx(String startTime,String endTime, String resourceType);
void toExcel(HttpServletResponse response, String startTime, String endTime, String resourceType);
List<List<String>> getZyEnergyFx(String startTime,String endTime, String resourceType);
}
......@@ -9,4 +9,6 @@ import java.util.Map;
public interface EquipmentService {
Map<String, Object> getList();
Map<String, Object> getList2(String startTime,String endTime,String resourceType);
}
package com.devplatform.admin.modules.eq.service;
import com.devplatform.admin.modules.eq.bean.KqcljInfoHour;
import com.devplatform.common.service.MyBaseService;
import java.util.List;
import java.util.Map;
/**
* 空气处理机-时的service接口
* <br>
* <b>功能:</b>JfktpInfoHourService<br>
* @author 代码生成器产生
*/
public interface KqcljInfoHourService extends MyBaseService<KqcljInfoHour> {
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
package com.devplatform.admin.modules.eq.service;
import com.devplatform.admin.modules.eq.bean.KqcljInfo;
import com.devplatform.common.service.MyBaseService;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* 空气处理机信息的service接口
* <br>
* <b>功能:</b>KqcljInfoService<br>
* @author 代码生成器产生
*/
public interface KqcljInfoService extends MyBaseService<KqcljInfo> {
List<Map<String, Object>> getList();
BigDecimal getTotalEnergy(String time);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
\ No newline at end of file
......@@ -23,4 +23,6 @@ public interface SnqxzInfoService extends MyBaseService<SnqxzInfo> {
List<SnqxzInfo> queryPageList(SnqxzInfoModel model);
List<Map<String, Object>> getList();
List<Map<String, Object>> getList2(String time);
}
......@@ -23,4 +23,5 @@ public interface SwqxzInfoService extends MyBaseService<SwqxzInfo> {
List<SwqxzInfo> queryPageList(SwqxzInfoModel model);
List<Map<String, Object>> getList();
List<Map<String, Object>> getList2();
}
package com.devplatform.admin.modules.eq.service;
import com.devplatform.admin.modules.eq.bean.WarnInfo;
import com.devplatform.common.service.MyBaseService;
import java.util.List;
/**
* 算法模块预警信息的service接口
* <br>
* <b>功能:</b>TotalMonthService<br>
* @author 代码生成器产生
*/
public interface WarnInfoService extends MyBaseService<WarnInfo> {
}
package com.devplatform.admin.modules.eq.service;
import com.devplatform.admin.modules.eq.bean.ZyFlrbInfo;
import com.devplatform.common.service.MyBaseService;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* 资阳西站风冷热泵机组信息的service接口
* <br>
* <b>功能:</b>FlrbInfoService<br>
* @author 代码生成器产生
*/
public interface ZyFlrbInfoService extends MyBaseService<ZyFlrbInfo> {
List<Map<String, Object>> getList();
ZyFlrbInfo selectZyFlrbInfo(String resourceId,String time);
BigDecimal getTotalEnergy(String time);
}
package com.devplatform.admin.modules.eq.service;
import com.devplatform.admin.modules.eq.bean.ZyJfktpInfo;
import com.devplatform.common.service.MyBaseService;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* 资阳西站空调机组信息的service接口
* <br>
* <b>功能:</b>JfktpInfoService<br>
* @author 代码生成器产生
*/
public interface ZyJfktpInfoService extends MyBaseService<ZyJfktpInfo> {
List<Map<String, Object>> getList();
ZyJfktpInfo selectZyJfktpInfo(String resourceId,String time);
BigDecimal getTotalEnergy(String time);
}
......@@ -69,7 +69,8 @@ public class FlrbInfoServiceImpl extends MyBaseServiceImpl<FlrbInfoDao, FlrbInfo
@Override
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
List<Map<String,Object>> list = new ArrayList<>();
int type = DateUtil.checkTimeToType(startTime,endTime);
//int type = DateUtil.checkTimeToType(startTime,endTime);
int type = 1;
if(type == Constants.INT_1){
list = flrbInfoHourService.queryListByParam(startTime,endTime);
}else if(type == Constants.INT_2 || type == Constants.INT_3){
......
......@@ -70,7 +70,8 @@ public class JfktpInfoServiceImpl extends MyBaseServiceImpl<JfktpInfoDao, JfktpI
@Override
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
List<Map<String,Object>> list = new ArrayList<>();
int type = DateUtil.checkTimeToType(startTime,endTime);
//int type = DateUtil.checkTimeToType(startTime,endTime);
int type = 1;
if(type == Constants.INT_1){
list = jfktpInfoHourService.queryListByParam(startTime,endTime);
}else if(type == Constants.INT_2|| type == Constants.INT_3){
......
package com.devplatform.admin.modules.eq.service.impl;
import com.devplatform.admin.modules.eq.bean.KqcljInfoHour;
import com.devplatform.admin.modules.eq.dao.KqcljInfoHourDao;
import com.devplatform.admin.modules.eq.service.KqcljInfoHourService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* 空气处理机机组信息-时的service接口实现类
* <br>
* <b>功能:</b>KqcljInfoHourServiceImpl<br>
* @author 代码生成器产生
*/
@Service("kqcljInfoHourService")
public class KqcljInfoHourServiceImpl extends MyBaseServiceImpl<KqcljInfoHourDao, KqcljInfoHour> implements KqcljInfoHourService {
@Override
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.modules.eq.bean.KqcljInfo;
import com.devplatform.admin.modules.eq.dao.KqcljInfoDao;
import com.devplatform.admin.modules.eq.service.KqcljInfoHourService;
import com.devplatform.admin.modules.eq.service.KqcljInfoService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 空气处理机信息的service接口实现类
* <br>
* <b>功能:</b>KqcljServiceImpl<br>
* @author 代码生成器产生
*/
@Service("kqcljInfoService")
public class KqcljServiceImpl extends MyBaseServiceImpl<KqcljInfoDao, KqcljInfo> implements KqcljInfoService {
@Autowired
private KqcljInfoHourService kqcljInfoHourService;
@Override
public List<Map<String, Object>> getList() {
return baseMapper.getList();
}
@Override
public BigDecimal getTotalEnergy(String time) {
return baseMapper.getTotalEnergy(time);
}
@Override
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
List<Map<String,Object>> list = new ArrayList<>();
int type = 1;
if(type == Constants.INT_1){
list = kqcljInfoHourService.queryListByParam(startTime,endTime);
}
return list;
}
}
......@@ -30,4 +30,9 @@ public class SnqxzInfoServiceImpl extends MyBaseServiceImpl<SnqxzInfoDao, SnqxzI
public List<Map<String, Object>> getList() {
return baseMapper.getList();
}
@Override
public List<Map<String, Object>> getList2(String time) {
return baseMapper.getList2(time);
}
}
......@@ -30,4 +30,8 @@ public class SwqxzInfoServiceImpl extends MyBaseServiceImpl<SwqxzInfoDao, SwqxzI
public List<Map<String, Object>> getList() {
return baseMapper.getList();
}
@Override
public List<Map<String, Object>> getList2() {
return baseMapper.getList2();
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.devplatform.admin.modules.eq.bean.WarnInfo;
import com.devplatform.admin.modules.eq.dao.WarnInfoDao;
import com.devplatform.admin.modules.eq.service.WarnInfoService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* 算法模块预警信息service接口实现类
* <br>
* <b>功能:</b>WarnInfoServiceImpl<br>
* @author 代码生成器产生
*/
@Service("warnInfoService")
public class WarnInfoServiceImpl extends MyBaseServiceImpl<WarnInfoDao, WarnInfo> implements WarnInfoService {
}
package com.devplatform.admin.modules.eq.service.impl;
import com.devplatform.admin.modules.eq.bean.ZyFlrbInfo;
import com.devplatform.admin.modules.eq.dao.ZyFlrbInfoDao;
import com.devplatform.admin.modules.eq.service.ZyFlrbInfoService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* 资阳西站风冷热泵机组信息的service接口实现类
* <br>
* <b>功能:</b>ZyFlrbInfoServiceImpl<br>
* @author 代码生成器产生
*/
@Service("zyFlrbInfoService")
public class ZyFlrbInfoServiceImpl extends MyBaseServiceImpl<ZyFlrbInfoDao, ZyFlrbInfo> implements ZyFlrbInfoService {
@Override
public List<Map<String, Object>> getList() {
return baseMapper.getList();
}
@Override
public ZyFlrbInfo selectZyFlrbInfo(String resourceId, String time) {
return baseMapper.selectZyFlrbInfo(resourceId,time);
}
@Override
public BigDecimal getTotalEnergy(String time) {
return baseMapper.getTotalEnergy(time);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.devplatform.admin.modules.eq.bean.ZyJfktpInfo;
import com.devplatform.admin.modules.eq.dao.ZyJfktpInfoDao;
import com.devplatform.admin.modules.eq.service.ZyJfktpInfoService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* 资阳西站空调机组信息的service接口实现类
* <br>
* <b>功能:</b>ZyJfktpInfoServiceImpl<br>
* @author 代码生成器产生
*/
@Service("zyJfktpInfoService")
public class ZyJfktpInfoServiceImpl extends MyBaseServiceImpl<ZyJfktpInfoDao, ZyJfktpInfo> implements ZyJfktpInfoService {
@Override
public List<Map<String, Object>> getList() {
return baseMapper.getList();
}
@Override
public ZyJfktpInfo selectZyJfktpInfo(String resourceId, String time) {
return baseMapper.selectZyJfktpInfo(resourceId,time);
}
@Override
public BigDecimal getTotalEnergy(String time) {
return baseMapper.getTotalEnergy(time);
}
}
......@@ -67,4 +67,6 @@ public interface LiResourceDao extends MyBaseMapper<LiResource> {
* @return
*/
List<LiResource> queryListByParam(String modeTypes);
List<LiResource> selectResourceList();
}
......@@ -61,4 +61,6 @@ public interface LiResourceService extends MyBaseService<LiResource> {
* @return
*/
List<LiResource> queryListByParam(String modeTypes);
List<LiResource> selectResourceList();
}
......@@ -51,4 +51,8 @@ public class LiResourceServiceImpl extends MyBaseServiceImpl<LiResourceDao, LiRe
return baseMapper.queryListByParam(modeTypes);
}
@Override
public List<LiResource> selectResourceList() {
return baseMapper.selectResourceList();
}
}
......@@ -99,10 +99,10 @@ public class SysLoginController extends AbstractController {
@ApiImplicitParam(name = "form", value = "用户实体类", required = true, paramType = "query", dataType = "SysLoginForm")
@PostMapping("/sys/login")
public Map<String, Object> login(@RequestBody SysLoginForm form) {
String str = LicenseAuth.authLicense(environment);
if(!str.equals("YES")) {
return R.error(str);
}
// String str = LicenseAuth.authLicense(environment);
// if(!str.equals("YES")) {
// return R.error(str);
// }
boolean captcha = sysCaptchaService.validate(form.getUuid(), form.getCaptcha());
if(!captcha){
return R.error("验证码不正确");
......
......@@ -16,5 +16,9 @@ mybatis-plus:
#cache-enabled: false
#call-setters-on-nulls: true
#节能大循环节能算法间隔30分钟
bigTime: 30
#节能小循环节能算法间隔10分钟
smallTime: 10
......@@ -3,38 +3,38 @@
<mapper namespace="com.devplatform.admin.modules.eq.dao.FlrbInfoDao">
<!-- Result Map -->
<resultMap id="BaseResultMap" type="com.devplatform.admin.modules.eq.bean.FlrbInfo">
<result column="id" property="id"/>
<result column="resource_id" property="resourceId"/>
<result column="phase_a_voltage" property="phaseAVoltage"/>
<result column="phase_b_voltage" property="phaseBVoltage"/>
<result column="phase_c_voltage" property="phaseCVoltage"/>
<result column="phase_a_current" property="phaseACurrent"/>
<result column="phase_b_current" property="phaseBCurrent"/>
<result column="phase_c_current" property="phaseCCurrent"/>
<result column="phase_a_power_factor" property="phaseAPowerFactor"/>
<result column="phase_b_power_factor" property="phaseBPowerFactor"/>
<result column="phase_c_power_factor" property="phaseCPowerFactor"/>
<result column="phase_a_power" property="phaseAPower"/>
<result column="phase_b_power" property="phaseBPower"/>
<result column="phase_c_power" property="phaseCPower"/>
<result column="electric_energy" property="electricEnergy"/>
<result column="power_protection_alarm" property="powerProtectionAlarm"/>
<result column="water_flow_alarm" property="waterFlowAlarm"/>
<result column="feng_shui_mode" property="fengShuiMode"/>
<result column="hot_water_mode" property="hotWaterMode"/>
<result column="water_supply_temperature" property="waterSupplyTemperature"/>
<result column="return_water_temperature" property="returnWaterTemperature"/>
<result column="heating_start_temperature" property="heatingStartTemperature"/>
<result column="heating_stop_temperature" property="heatingStopTemperature"/>
<result column="indoor_ambient_temperature" property="indoorAmbientTemperature"/>
<result column="outlet_temperature" property="outletTemperature"/>
<result column="return_air_temperature" property="returnAirTemperature"/>
<result column="hot_air_start_temperature" property="hotAirStartTemperature"/>
<result column="hot_air_stop_temperature" property="hotAirStopTemperature"/>
<result column="communication_failure" property="communicationFailure"/>
<result column="type" property="type"/>
<result column="station_id" property="stationId"/>
<result column="create_time" property="createTime"/>
<result column="id" property="id"/>
<result column="resource_id" property="resourceId"/>
<result column="phase_a_voltage" property="phaseAVoltage"/>
<result column="phase_b_voltage" property="phaseBVoltage"/>
<result column="phase_c_voltage" property="phaseCVoltage"/>
<result column="phase_a_current" property="phaseACurrent"/>
<result column="phase_b_current" property="phaseBCurrent"/>
<result column="phase_c_current" property="phaseCCurrent"/>
<result column="phase_a_power_factor" property="phaseAPowerFactor"/>
<result column="phase_b_power_factor" property="phaseBPowerFactor"/>
<result column="phase_c_power_factor" property="phaseCPowerFactor"/>
<result column="phase_a_power" property="phaseAPower"/>
<result column="phase_b_power" property="phaseBPower"/>
<result column="phase_c_power" property="phaseCPower"/>
<result column="electric_energy" property="electricEnergy"/>
<result column="power_protection_alarm" property="powerProtectionAlarm"/>
<result column="water_flow_alarm" property="waterFlowAlarm"/>
<result column="feng_shui_mode" property="fengShuiMode"/>
<result column="hot_water_mode" property="hotWaterMode"/>
<result column="water_supply_temperature" property="waterSupplyTemperature"/>
<result column="return_water_temperature" property="returnWaterTemperature"/>
<result column="heating_start_temperature" property="heatingStartTemperature"/>
<result column="heating_stop_temperature" property="heatingStopTemperature"/>
<result column="indoor_ambient_temperature" property="indoorAmbientTemperature"/>
<result column="outlet_temperature" property="outletTemperature"/>
<result column="return_air_temperature" property="returnAirTemperature"/>
<result column="hot_air_start_temperature" property="hotAirStartTemperature"/>
<result column="hot_air_stop_temperature" property="hotAirStopTemperature"/>
<result column="communication_failure" property="communicationFailure"/>
<result column="type" property="type"/>
<result column="station_id" property="stationId"/>
<result column="create_time" property="createTime"/>
</resultMap>
<!-- flrb_info table all fields -->
......
......@@ -11,7 +11,7 @@
<result column="power" property="power"/>
<result column="electric_energy" property="electricEnergy"/>
<result column="communication_failure" property="communicationFailure"/>
<result column="type" property="type"/>
<result column="type" property="type"/>
<result column="station_id" property="stationId"/>
<result column="create_time" property="createTime"/>
</resultMap>
......
<?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.KqcljInfoHourDao">
<!-- Result Map -->
<resultMap id="BaseResultMap" type="com.devplatform.admin.modules.eq.bean.KqcljInfoHour">
<result column="id" property="id"/>
<result column="resource_id" property="resourceId"/>
<result column="electric_energy" property="electricEnergy"/>
<result column="type" property="type"/>
<result column="station_id" property="stationId"/>
<result column="create_time" property="createTime"/>
</resultMap>
<!-- flrb_info_hour table all fields -->
<sql id="Base_Column_List">
id,resource_id,electric_energy,type,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="resourceId!=null and resourceId!=''">and t.resource_id = #{resourceId}</if>
<if test="electricEnergy!=null and electricEnergy!=''">and t.electric_energy = #{electricEnergy}</if>
<if test="type!=null ">and t.type = #{type}</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="queryListByParam" resultType="java.util.Map">
select create_time,cast(sum(cast(electric_energy as decimal(10, 2))) as decimal(10, 2)) as electric_energy
from kqclj_info_hour
where 1=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>
</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.KqcljInfoDao">
<!-- Result Map -->
<resultMap id="BaseResultMap" type="com.devplatform.admin.modules.eq.bean.KqcljInfo">
<result column="id" property="id"/>
<result column="resource_id" property="resourceId"/>
<result column="energy" property="energy"/>
<result column="type" property="type"/>
<result column="station_id" property="stationId"/>
<result column="create_time" property="createTime"/>
</resultMap>
<!-- kqclj_info table all fields -->
<sql id="Base_Column_List">
id,resource_id,energy,type,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="resourceId!=null and resourceId!=''">and t.resource_id = #{resourceId}</if>
<if test="energy!=null and energy!=''">and t.energy = #{energy}</if>
<if test="type!=null ">and t.type = #{type}</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="getList" resultType="java.util.Map">
SELECT t1.*,li.name as resourceName,li.remark as remark,li.deploy_location as deployLocation,li.status as status,li.region as region
FROM kqclj_info AS t1
INNER JOIN
(SELECT t2.resource_id, MAX(t2.create_time) AS maxdate
FROM kqclj_info AS t2
GROUP BY t2.resource_id) AS t3 ON t1.resource_id = t3.resource_id AND t1.create_time = t3.maxdate
left join li_resource li on li.id = t1.resource_id
</select>
<select id="getTotalEnergy" resultType="java.math.BigDecimal">
SELECT
cast(sum(cast(energy as decimal(10, 2))) as decimal(10, 2)) as totalEnergy
FROM
kqclj_info
WHERE 1 = 1
AND date_format( create_time, '%Y%m%d' ) = #{time}
</select>
</mapper>
......@@ -57,7 +57,15 @@
GROUP BY t2.resource_id) AS t3 ON t1.resource_id = t3.resource_id AND t1.create_time = t3.maxdate
left join li_resource li on li.id = t1.resource_id
</select>
<select id="getList2" resultType="java.util.Map">
SELECT
cast(AVG(cast(temperature as decimal(10, 1))) as decimal(10, 1)) as temperature,
cast(AVG(cast(humidity as decimal(10, 1))) as decimal(10, 1)) as humidity
FROM
snqxz_info_hour
where
date_format(create_time,'%Y%m%d%H') = #{time}
</select>
</mapper>
......@@ -13,6 +13,7 @@
<result column="carbon_dioxide" property="carbonDioxide"/>
<result column="fine_particles" property="fineParticles"/>
<result column="radiation" property="radiation"/>
<result column="pressure" property="pressure"/>
<result column="type" property="type"/>
<result column="station_id" property="stationId"/>
<result column="create_time" property="createTime"/>
......@@ -20,7 +21,7 @@
<!-- swqxz_info_hour table all fields -->
<sql id="Base_Column_List">
id,resource_id,temperature,humidity,wind_speed,wind_direction,illuminance,carbon_dioxide,fine_particles,radiation,type,station_id,create_time
id,resource_id,temperature,humidity,wind_speed,wind_direction,illuminance,carbon_dioxide,fine_particles,radiation,pressure,type,station_id,create_time
</sql>
<!-- 公共查询条件 -->
......@@ -39,6 +40,7 @@
<if test="type!=null ">and t.type = #{type}</if>
<if test="stationId!=null and stationId!=''">and t.station_id = #{stationId}</if>
<if test="createTime!=null ">and t.create_time = #{createTime}</if>
<if test="pressure!=null and pressure!=''">and t.pressure = #{pressure}</if>
</sql>
<select id="queryPageByCount" parameterType="Object" resultType="java.lang.Integer">
......
......@@ -9,19 +9,21 @@
<result column="humidity" property="humidity"/>
<result column="wind_speed" property="windSpeed"/>
<result column="wind_direction" property="windDirection"/>
<result column="wind_direction_num" property="windDirectionNum"/>
<result column="illuminance" property="illuminance"/>
<result column="carbon_dioxide" property="carbonDioxide"/>
<result column="fine_particles" property="fineParticles"/>
<result column="radiation" property="radiation"/>
<result column="communication_failure" property="communicationFailure"/>
<result column="type" property="type"/>
<result column="pressure" property="pressure"/>
<result column="type" property="type"/>
<result column="station_id" property="stationId"/>
<result column="create_time" property="createTime"/>
</resultMap>
<!-- swqxz_info table all fields -->
<sql id="Base_Column_List">
id,resource_id,temperature,humidity,wind_speed,wind_direction,illuminance,carbon_dioxide,fine_particles,radiation,communication_failure,type,station_id,create_time
id,resource_id,temperature,humidity,wind_speed,wind_direction,wind_direction_num,illuminance,carbon_dioxide,fine_particles,radiation,communication_failure,pressure,type,station_id,create_time
</sql>
<!-- 公共查询条件 -->
......@@ -33,11 +35,13 @@
<if test="humidity!=null and humidity!=''">and t.humidity = #{humidity}</if>
<if test="windSpeed!=null and windSpeed!=''">and t.wind_speed = #{windSpeed}</if>
<if test="windDirection!=null and windDirection!=''">and t.wind_direction = #{windDirection}</if>
<if test="windDirectionNum!=null and windDirectionNum!=''">and t.wind_direction_num = #{windDirectionNum}</if>
<if test="illuminance!=null and illuminance!=''">and t.illuminance = #{illuminance}</if>
<if test="carbonDioxide!=null and carbonDioxide!=''">and t.carbon_dioxide = #{carbonDioxide}</if>
<if test="fineParticles!=null and fineParticles!=''">and t.fine_particles = #{fineParticles}</if>
<if test="radiation!=null and radiation!=''">and t.radiation = #{radiation}</if>
<if test="communicationFailure!=null and communicationFailure!=''">and t.communication_failure = #{communicationFailure}</if>
<if test="pressure!=null and pressure!=''">and t.pressure = #{pressure}</if>
<if test="type!=null ">and t.type = #{type}</if>
<if test="stationId!=null and stationId!=''">and t.station_id = #{stationId}</if>
<if test="createTime!=null ">and t.create_time = #{createTime}</if>
......@@ -67,7 +71,9 @@
GROUP BY t2.resource_id) AS t3 ON t1.resource_id = t3.resource_id AND t1.create_time = t3.maxdate
left join li_resource li on li.id = t1.resource_id
</select>
<select id="getList2" resultType="java.util.Map">
SELECT * FROM swqxz_info order by create_time desc limit 1
</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.WarnInfoDao">
</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.ZyFlrbInfoDao">
<!-- Result Map -->
<resultMap id="BaseResultMap" type="com.devplatform.admin.modules.eq.bean.ZyFlrbInfo">
<result column="id" property="id"/>
<result column="resource_id" property="resourceId"/>
<result column="water_supply_temperature" property="waterSupplyTemperature"/>
<result column="return_water_temperature" property="returnWaterTemperature"/>
<result column="water_rate" property="waterRate"/>
<result column="heating_tem" property="heatingTem"/>
<result column="refrigeration_tem" property="refrigerationTem"/>
<result column="switch_mode" property="switchMode"/>
<result column="host_status" property="hostStatus"/>
<result column="energy" property="energy"/>
<result column="type" property="type"/>
<result column="station_id" property="stationId"/>
<result column="create_time" property="createTime"/>
</resultMap>
<!-- zy_flrb_info table all fields -->
<sql id="Base_Column_List">
id,resource_id,water_supply_temperature,return_water_temperature,water_rate,heating_tem,refrigeration_tem,switch_mode,host_status,energy,type,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="resourceId!=null and resourceId!=''">and t.resource_id = #{resourceId}</if>
<if test="waterSupplyTemperature!=null and waterSupplyTemperature!=''">and t.water_supply_temperature = #{waterSupplyTemperature}</if>
<if test="returnWaterTemperature!=null and returnWaterTemperature!=''">and t.return_water_temperature = #{returnWaterTemperature}</if>
<if test="waterRate!=null and waterRate!=''">and t.water_rate = #{waterRate}</if>
<if test="heatingTem!=null and heatingTem!=''">and t.heating_tem = #{heatingTem}</if>
<if test="refrigerationTem!=null and refrigerationTem!=''">and t.refrigeration_tem = #{refrigerationTem}</if>
<if test="switchMode!=null and switchMode!=''">and t.switch_mode = #{switchMode}</if>
<if test="hostStatus!=null and hostStatus!=''">and t.host_status = #{hostStatus}</if>
<if test="energy!=null and energy!=''">and t.energy = #{energy}</if>
<if test="type!=null ">and t.type = #{type}</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="getList" resultType="java.util.Map">
SELECT t1.*,li.name as resourceName,li.remark as remark,li.deploy_location as deployLocation,li.status as status,li.region as region
FROM zy_flrb_info AS t1
INNER JOIN
(SELECT t2.resource_id, MAX(t2.create_time) AS maxdate
FROM zy_flrb_info AS t2
GROUP BY t2.resource_id) AS t3 ON t1.resource_id = t3.resource_id AND t1.create_time = t3.maxdate
left join li_resource li on li.id = t1.resource_id
</select>
<select id="selectZyFlrbInfo" resultType="com.devplatform.admin.modules.eq.bean.ZyFlrbInfo">
SELECT * FROM zy_flrb_info WHERE 1 = 1 AND date_format( create_time, '%Y%m%d%H' ) = #{time}
AND resource_id = #{resourceId} ORDER BY create_time DESC LIMIT 1
</select>
<select id="getTotalEnergy" resultType="java.math.BigDecimal">
SELECT
cast(sum(cast(energy as decimal(10, 2))) as decimal(10, 2)) as totalEnergy
FROM
zy_flrb_info
WHERE 1 = 1
AND date_format( create_time, '%Y%m%d' ) = #{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.ZyJfktpInfoDao">
<!-- Result Map -->
<resultMap id="BaseResultMap" type="com.devplatform.admin.modules.eq.bean.ZyJfktpInfo">
<result column="id" property="id"/>
<result column="resource_id" property="resourceId"/>
<result column="wind_tem" property="windTem"/>
<result column="water_feedback" property="waterFeedback"/>
<result column="new_tem" property="newTem"/>
<result column="season" property="season"/>
<result column="filter_pressure" property="filterPressure"/>
<result column="fan_pressure" property="fanPressure"/>
<result column="status" property="status"/>
<result column="failure" property="failure"/>
<result column="automatic" property="automatic"/>
<result column="energy" property="energy"/>
<result column="type" property="type"/>
<result column="station_id" property="stationId"/>
<result column="create_time" property="createTime"/>
</resultMap>
<!-- zy_jfktp_info table all fields -->
<sql id="Base_Column_List">
id,resource_id,wind_tem,water_feedback,new_tem,season,filter_pressure,fan_pressure,status,failure,automatic,energy,type,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="resourceId!=null and resourceId!=''">and t.resource_id = #{resourceId}</if>
<if test="windTem!=null and windTem!=''">and t.wind_tem = #{windTem}</if>
<if test="waterFeedback!=null and waterFeedback!=''">and t.water_feedback = #{waterFeedback}</if>
<if test="newTem!=null and newTem!=''">and t.new_tem = #{newTem}</if>
<if test="season!=null and season!=''">and t.season = #{season}</if>
<if test="filterPressure!=null and filterPressure!=''">and t.filter_pressure = #{filterPressure}</if>
<if test="fanPressure!=null and fanPressure!=''">and t.fan_pressure = #{fanPressure}</if>
<if test="status!=null and status!=''">and t.status = #{status}</if>
<if test="failure!=null and failure!=''">and t.failure = #{failure}</if>
<if test="automatic!=null and automatic!=''">and t.automatic = #{automatic}</if>
<if test="energy!=null and energy!=''">and t.energy = #{energy}</if>
<if test="type!=null ">and t.type = #{type}</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="getList" resultType="java.util.Map">
SELECT t1.*,li.name as resourceName,li.remark as remark,li.deploy_location as deployLocation,li.status as status
FROM zy_jfktp_info AS t1
INNER JOIN
(SELECT t2.resource_id, MAX(t2.create_time) AS maxdate
FROM zy_jfktp_info AS t2
GROUP BY t2.resource_id) AS t3 ON t1.resource_id = t3.resource_id AND t1.create_time = t3.maxdate
left join li_resource li on li.id = t1.resource_id
</select>
<select id="selectZyJfktpInfo" resultType="com.devplatform.admin.modules.eq.bean.ZyJfktpInfo">
SELECT * FROM zy_jfktp_info WHERE 1 = 1 AND date_format( create_time, '%Y%m%d%H' ) = #{time}
AND resource_id = #{resourceId} ORDER BY create_time DESC LIMIT 1
</select>
<select id="getTotalEnergy" resultType="java.math.BigDecimal">
SELECT
cast(sum(cast(energy as decimal(10, 2))) as decimal(10, 2)) as totalEnergy
FROM
zy_jfktp_info
WHERE 1 = 1
AND date_format( create_time, '%Y%m%d' ) = #{time}
</select>
</mapper>
......@@ -251,6 +251,11 @@
from li_resource lr
where lr.deleted = 0 and FIND_IN_SET(#{modeTypes},lr.mode_types)
</select>
<select id="selectResourceList" resultType="com.devplatform.admin.modules.liresource.bean.LiResource">
select lr.id,lr.name
from li_resource lr
where lr.deleted = 0
</select>
</mapper>
......@@ -92,7 +92,8 @@
<if test="endTime != null and endTime != ''">
and start_time &lt;= #{endTime}
</if>
GROUP BY date_format(start_time,'%Y%m%d%H')
-- GROUP BY date_format(start_time,'%Y%m%d%H')
GROUP BY start_time
order by start_time
</select>
......
......@@ -60,13 +60,13 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://localhost:3306/energy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false
url: jdbc:mysql://localhost:3306/energy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false
# username: root
# password: 123456
# url: jdbc:mysql://47.94.207.62:3306/energy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false
# username: root
# password: superAdmin&321
url: jdbc:mysql://10.20.2.33:3306/energy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false
# url: jdbc:mysql://10.20.2.33:3306/energy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false
username: root
password: root
initialSize: 5
......
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