Commit 09e82548 authored by 赵啸非's avatar 赵啸非

短信界面修改

parent e8c9f5de
...@@ -48,3 +48,10 @@ INSERT INTO `mortals_xhx_menu` VALUES (null, '设备日志', '/device/log/list', ...@@ -48,3 +48,10 @@ INSERT INTO `mortals_xhx_menu` VALUES (null, '设备日志', '/device/log/list',
-- ---------------------------- -- ----------------------------
INSERT INTO `mortals_xhx_resource` VALUES (null, '设备日志-菜单管理-查看', '/device/log/list,/device/log/view,/device/log/info,/device/log/export,/device/log/exportExcel,/device/log/downloadTemplate,/device/log/download', 3, 0, NULL, NULL, NULL, 0); INSERT INTO `mortals_xhx_resource` VALUES (null, '设备日志-菜单管理-查看', '/device/log/list,/device/log/view,/device/log/info,/device/log/export,/device/log/exportExcel,/device/log/downloadTemplate,/device/log/download', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (null, '设备日志-菜单管理-维护', '/device/log/add,/device/log/edit,/device/log/delete,/device/log/logicDelete,/device/log/save,/device/log/importData', 3, 0, NULL, NULL, NULL, 0); INSERT INTO `mortals_xhx_resource` VALUES (null, '设备日志-菜单管理-维护', '/device/log/add,/device/log/edit,/device/log/delete,/device/log/logicDelete,/device/log/save,/device/log/importData', 3, 0, NULL, NULL, NULL, 0);
-- ----------------------------
-- 设备统计资源路径 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_resource` VALUES (null, '设备统计-菜单管理-查看', '/device/stat/list,/device/stat/view,/device/stat/info,/device/stat/export,/device/stat/exportExcel,/device/stat/downloadTemplate,/device/stat/download', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (null, '设备统计-菜单管理-维护', '/device/stat/add,/device/stat/edit,/device/stat/delete,/device/stat/logicDelete,/device/stat/save,/device/stat/importData', 3, 0, NULL, NULL, NULL, 0);
...@@ -235,3 +235,34 @@ CREATE TABLE mortals_xhx_sitestat( ...@@ -235,3 +235,34 @@ CREATE TABLE mortals_xhx_sitestat(
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='站点统计'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='站点统计';
-- ----------------------------
-- 设备统计表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_device_stat`;
CREATE TABLE mortals_xhx_device_stat(
`id` bigint(20) AUTO_INCREMENT COMMENT 'ID',
`deviceTotalCount` int(9) COMMENT '设备总数',
`deviceAddCount` int(9) COMMENT '昨日新增减少设备数量',
`siteTotalCount` int(9) COMMENT '监控站点数量',
`siteAddCount` int(9) COMMENT '昨日新增站点数量',
`deviceOnlineCount` int(9) COMMENT '在线设备数量',
`deviceOnlineRatio` double COMMENT '在线率',
`deviceOfflineCount` int(9) NOT NULL COMMENT '离线设备数量',
`deviceOfflineRatio` double NOT NULL COMMENT '离线率',
`deviceStopCount` int(9) NOT NULL COMMENT '停用设备数量',
`deviceStopRatio` double NOT NULL COMMENT '停用率',
`alarmTotalCount` int(9) NOT NULL COMMENT '今日告警数量',
`alarmAddCount` int(9) NOT NULL COMMENT '昨日新增减少数量',
`pushTotalCount` int(9) NOT NULL COMMENT '今日消息推送数量',
`pushAddCount` int(9) NOT NULL COMMENT '昨日新增减少数量',
`uploadMessageTotalCount` int(9) NOT NULL COMMENT '今日上行消息数量',
`downloadMessageTotalCount` int(9) NOT NULL COMMENT '今日下行消息数量',
`year` int(9) NOT NULL COMMENT '年',
`month` int(9) NOT NULL COMMENT '月',
`day` int(9) NOT NULL COMMENT '日',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备统计';
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
"dependencies": { "dependencies": {
"@chenfengyuan/vue-qrcode": "^1.0.2", "@chenfengyuan/vue-qrcode": "^1.0.2",
"@riophae/vue-treeselect": "0.4.0", "@riophae/vue-treeselect": "0.4.0",
"@vue/babel-preset-app": "^4.5.13",
"@xunlei/vue-context-menu": "^1.0.2", "@xunlei/vue-context-menu": "^1.0.2",
"axios": "^0.18.0", "axios": "^0.18.0",
"core-js": "3.8.1", "core-js": "3.8.1",
...@@ -21,6 +22,7 @@ ...@@ -21,6 +22,7 @@
"js-cookie": "2.2.1", "js-cookie": "2.2.1",
"jsencrypt": "3.0.0-rc.1", "jsencrypt": "3.0.0-rc.1",
"json-bigint": "^0.3.0", "json-bigint": "^0.3.0",
"muse-ui": "^3.0.2",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"quill": "1.3.7", "quill": "1.3.7",
"screenfull": "5.0.2", "screenfull": "5.0.2",
......
<template> <template>
<div class="page page-home" style="min-height: 100vh;"> <div class="page page-home" style="min-height: 100vh">
欢迎你,{{userData}}
</div>
<el-row :gutter="10" >
<el-row style="margin-left:50px;margin-right:50px" type="flex" justify="end" :gutter="10" >
<el-button type="text">数据更新:{{ statData.updateTime}}</el-button>
<el-button icon='el-icon-refresh' type="text">手动刷新</el-button>
</el-row>
<el-card style="margin-left:50px;margin-right:50px;margin-top:10px">
<el-col :span="3" >
<span style="font-size:20px"><b>{{ statData.deviceTotalCount}}</b></span>
<el-row><span style="font-size:14px">昨日 {{ statData.deviceAddCount}}</span></el-row>
<el-button icon='el-icon-mobile' type="text">设备总数</el-button>
<!-- <el-row > <i size="mini" :class="'el-icon-mobile'"> </i><span style="font-size:14px">设备总数</span></el-row> -->
</el-col>
<el-col :span="3" >
<el-row><span style="font-size:20px"><b>{{ statData.siteTotalCount}}</b></span></el-row>
<el-row><span style="font-size:14px">昨日 {{ statData.siteAddCount}}</span></el-row>
<el-row > <i size="mini" :class="'el-icon-mobile'"> </i><span style="font-size:13px">监控站点数</span></el-row>
</el-col>
<el-col :span="3" >
<el-row><span style="font-size:20px"><b>{{ statData.deviceOnlineCount}}</b></span></el-row>
<el-row><span style="font-size:14px">昨日 {{ statData.deviceOnlineRatio}}</span></el-row>
<el-row > <i size="mini" :class="'el-icon-mobile'"> </i><span style="font-size:14px">在线设备</span></el-row>
</el-col>
<el-col :span="3">
<el-row><span style="font-size:20px"><b>{{ statData.deviceOfflineCount}}</b></span></el-row>
<el-row><span style="font-size:14px">在线率 {{ statData.deviceOfflineRatio*100}}%</span></el-row>
<el-row > <i size="mini" :class="'el-icon-mobile'"> </i><span style="font-size:14px">离线设备</span></el-row>
</el-col>
<el-col :span="3" >
<el-row><span style="font-size:20px"><b>{{ statData.deviceStopRatio}}</b></span></el-row>
<el-row><span style="font-size:14px">停用率 {{ statData.deviceStopRatio}}</span></el-row>
<el-row > <i size="mini" :class="'el-icon-mobile'"> </i><span style="font-size:14px">停用设备</span></el-row>
</el-col>
<el-col :span="3" >
<el-row><span style="font-size:20px"><b>{{ statData.alarmTotalCount}}</b></span></el-row>
<el-row><span style="font-size:14px">昨日 {{ statData.alarmAddCount}}</span></el-row>
<el-row > <i size="mini" :class="'el-icon-mobile'"> </i><span style="font-size:14px">今日告警次数</span></el-row>
</el-col>
<el-col :span="3" >
<el-row><span style="font-size:20px"><b>{{ statData.pushTotalCount}}</b></span></el-row>
<el-row><span style="font-size:14px">昨日 {{ statData.pushAddCount}}</span></el-row>
<el-row > <i size="mini" :class="'el-icon-mobile'"> </i><span style="font-size:14px">今日消息推送</span></el-row>
</el-col>
<el-col :span="3" >
<el-row><span style="font-size:14px">今日下发命令 <b>{{ statData.uploadMessageTotalCount}}</b></span></el-row>
<el-row><span style="font-size:14px">今日下发命令 <b>{{ statData.downloadMessageTotalCount}}</b></span></el-row>
<el-row > <i size="mini" :class="'el-icon-mobile'"> </i><span style="font-size:14px">数据获取</span></el-row>
</el-col>
</el-card>
</el-row>
</div>
</template> </template>
<script> <script>
export default { export default {
computed: { computed: {
userData() { userData() {
return this.$store.state.userData.currUserName; return this.$store.state.userData.currUserName;
},
}, },
},
created() {
let query={year:2022,month:7,day:5}
//查询今日设备统计
this.loading=true;
this.$post("/device/stat/list", query)
.then((res) => {
if (res.code == 1) {
console.log("res",res)
this.statData=res.data.data[0]
console.log("statData",this.statData)
}
this.loading=false;
})
.catch((error) => {
this.$message.error(error.message);
});
},
data() {
return {
loading: false,
indexStatInfo: {},
recordListLoading: false,
statData: {},
dayProjectList: [],
pendList: [],
weekPerDay: {
xData: [],
yData: [],
},
dict: {},
value: new Date(),
};
},
}; };
</script> </script>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -8,6 +8,10 @@ import java.io.Serializable; ...@@ -8,6 +8,10 @@ import java.io.Serializable;
@Data @Data
public class ServerInfo implements Serializable { public class ServerInfo implements Serializable {
private String ip;
private Integer port;
/** /**
* 设备注册API * 设备注册API
*/ */
......
package com.mortals.xhx.daemon.netty.server.controlserver.handler; package com.mortals.xhx.daemon.netty.server.controlserver.handler;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.URLUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.ap.GlobalSysInfo; import com.mortals.framework.ap.GlobalSysInfo;
...@@ -20,6 +21,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -20,6 +21,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.URL;
import static com.mortals.xhx.common.key.Constant.*; import static com.mortals.xhx.common.key.Constant.*;
...@@ -72,12 +74,16 @@ public class NettyUDPServerHandler extends SimpleChannelInboundHandler<DatagramP ...@@ -72,12 +74,16 @@ public class NettyUDPServerHandler extends SimpleChannelInboundHandler<DatagramP
resp.setMsg("获取服务端地址成功!"); resp.setMsg("获取服务端地址成功!");
if (!ObjectUtils.isEmpty(action) && "findserver".equals(action)) { if (!ObjectUtils.isEmpty(action) && "findserver".equals(action)) {
String domain = GlobalSysInfo.getParamValue(PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11091"); String domain = GlobalSysInfo.getParamValue(PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11091");
String deviceRegisterApi = domain + servletPath + registerApiPath; URL url = URLUtil.url(domain);
String deviceInitApi = domain + servletPath + deviceInitApiPath;
String deviceUpdateApi = domain + servletPath + deviceUpdateApiPath; String deviceRegisterApi = servletPath + registerApiPath;
String deviceInitApi = servletPath + deviceInitApiPath;
String deviceUpdateApi = servletPath + deviceUpdateApiPath;
ServerInfo serverInfo = new ServerInfo(); ServerInfo serverInfo = new ServerInfo();
serverInfo.setIp(url.getHost());
serverInfo.setPort(url.getPort());
serverInfo.setDeviceRegisterApi(deviceRegisterApi); serverInfo.setDeviceRegisterApi(deviceRegisterApi);
serverInfo.setDeviceInitApi(deviceInitApi); serverInfo.setDeviceInitApi(deviceInitApi);
serverInfo.setDeviceUpdateApi(deviceUpdateApi); serverInfo.setDeviceUpdateApi(deviceUpdateApi);
......
package com.mortals.xhx.daemon.task;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.base.framework.ws.message.SendToAllRequest;
import com.mortals.xhx.base.framework.ws.util.WebSocketUtil;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.DeviceOnlineStatusEnum;
import com.mortals.xhx.common.code.DeviceMethodEnum;
import com.mortals.xhx.common.code.DeviceStatusEnum;
import com.mortals.xhx.common.key.ParamKey;
import com.mortals.xhx.module.device.model.*;
import com.mortals.xhx.module.device.service.DeviceLogService;
import com.mortals.xhx.module.device.service.DeviceModuleService;
import com.mortals.xhx.module.device.service.DeviceModuleUseService;
import com.mortals.xhx.module.device.service.DeviceService;
import com.mortals.xhx.module.platform.model.PlatformEntity;
import com.mortals.xhx.module.platform.service.PlatformService;
import com.mortals.xhx.module.product.model.ProductEntity;
import com.mortals.xhx.module.product.service.ProductService;
import lombok.extern.apachecommons.CommonsLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 设备模块使用统计任务
*
* @author: zxfei
* @date: 2022/3/9 15:19
*/
@CommonsLog
@Service("DeviceModuleUseTask")
public class DeviceModuleUseTaskImpl implements ITaskExcuteService {
@Autowired
private DeviceService deviceService;
@Autowired
private DeviceLogService deviceLogService;
@Autowired
private DeviceModuleUseService deviceModuleUseService;
@Autowired
private ProductService productService;
@Autowired
private PlatformService platformService;
@Autowired
private DeviceModuleService moduleService;
@Override
public void excuteTask(ITask task) throws AppException {
log.debug("设备统计,开始执行");
doDeviceModuleUse();
//doDeviceUpOrDown();
//doDeviceLogDel();
log.debug("设备统计,结束执行");
}
/**
* 统计设备模块使用率
*/
private void doDeviceModuleUse() {
Map<String, DeviceModuleEntity> moduleMap = moduleService.find(new DeviceModuleQuery()).stream().collect(Collectors.toMap(x -> x.getModuleMsgCode(), y -> y, (o, n) -> n));
try {
// TODO: 2022/7/2 根据每个设备单独查询统计 计算数据量会减少
List<DeviceModuleUseEntity> moduleUseEntityList = deviceService.getCacheList().stream().flatMap(device -> {
//查询当前设备日志
List<DeviceLogEntity> deviceLogList = deviceLogService.find(new DeviceLogQuery().deviceId(device.getId()));
//分组统计每个模块头使用率
Map<String, Long> modelCollect = deviceLogList.parallelStream().collect(Collectors.groupingBy(DeviceLogEntity::getMessageHead, Collectors.counting()));
return modelCollect.entrySet().stream().map(item -> {
if (moduleMap.containsKey(item.getKey())) {
DeviceModuleUseEntity deviceModuleUseEntity = new DeviceModuleUseEntity();
deviceModuleUseEntity.initAttrValue();
DeviceModuleEntity deviceModuleEntity = moduleMap.get(item.getKey());
deviceModuleUseEntity.setDeviceId(device.getId());
deviceModuleUseEntity.setModuleMsgCode(deviceModuleEntity.getModuleMsgCode());
deviceModuleUseEntity.setModuleName(deviceModuleEntity.getModuleName());
deviceModuleUseEntity.setUseNum(item.getValue());
deviceModuleUseEntity.setCreateUserId(1L);
deviceModuleUseEntity.setCreateTime(new Date());
return deviceModuleUseEntity;
}
return null;
}).filter(f -> f != null);
}).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(moduleUseEntityList)) {
//遍历,更新统计数据表 标识 设备id与消息头
Map<String, DeviceModuleUseEntity> collect = deviceModuleUseService.find(new DeviceModuleUseQuery()).stream().collect(Collectors.toMap(x -> x.getDeviceId() + "#" + x.getModuleMsgCode(), y -> y, (o, n) -> n));
moduleUseEntityList.stream().forEach(mudule -> {
String key = mudule.getDeviceId() + "#" + mudule.getModuleMsgCode();
if (collect.containsKey(key)) {
//更新
DeviceModuleUseEntity deviceModuleUseEntity = collect.get(key);
mudule.setId(deviceModuleUseEntity.getId());
mudule.setUpdateTime(new Date());
mudule.setUpdateUserId(1L);
deviceModuleUseService.update(mudule, null);
} else {
//新增
deviceModuleUseService.save(mudule, null);
}
});
}
} catch (Exception e) {
log.error("更新任务异常,结束执行", e);
}
}
/**
* 统计更新设备状态
*/
private void doDeviceUpOrDown() {
int timeout = GlobalSysInfo.getParamIntValue(ParamKey.SYS_PARAM_HEADBEAT_TIMEOUT, 60) * 1000;
try {
//获取所有设备,针对每个设备查询最近指定秒的日志,如果没有则更新下线
deviceService.getCacheList().stream()
.filter(f -> f.getDeviceStatus() == DeviceStatusEnum.在线.getValue())
.peek(device -> {
DeviceLogQuery query = new DeviceLogQuery();
query.setCreateTimeStart(DateUtils.getStrDateTime(new Date(System.currentTimeMillis() - timeout)));
DeviceLogEntity deviceLogEntity = deviceLogService.selectOne(query);
if (ObjectUtils.isEmpty(deviceLogEntity)) {
//更新设备下线
device.setOfflineTime(new Date());
device.setDeviceStatus(DeviceStatusEnum.离线.getValue());
deviceService.update(device);
String msg = String.format("%s设备:%s ,离线!", device.getProductName(), device.getDeviceCode());
WebSocketUtil.broadcast(SendToAllRequest.TYPE, new SendToAllRequest().setContent(msg));
PlatformEntity platformEntity = platformService.get(device.getPlatformId());
ProductEntity productEntity = productService.get(device.getProductId());
if (!ObjectUtils.isEmpty(platformEntity) && !ObjectUtils.isEmpty(productEntity)) {
//新增设备通知第三方平台
deviceService.sendThirdParty(device, productEntity, platformEntity, DeviceMethodEnum.OFFLINE);
}
}
}).count();
} catch (Exception e) {
log.error("更新设备状态任务异常,结束执行", e);
}
log.debug("更新设备状态任务,结束执行");
}
/**
* 定时清除设备日志
*/
private void doDeviceLogDel() {
//默认保存30天日志
int timeout = -GlobalSysInfo.getParamIntValue(ParamKey.SYS_PARAM_LOG_TIME, 30);
try {
DeviceLogQuery query = new DeviceLogQuery();
query.setCreateTimeEnd(DateUtils.getStrDateTime(DateUtils.addCurrDate(timeout)));
Long[] ids = deviceLogService.find(query).stream().map(DeviceLogEntity::getId).toArray(Long[]::new);
if (!ObjectUtils.isEmpty(ids)) {
deviceLogService.remove(ids, null);
}
} catch (Exception e) {
log.error("设备日志删除任务异常,结束执行", e);
}
log.debug("设备日志删除任务,结束执行");
}
@Override
public void stopTask(ITask task) throws AppException {
}
}
package com.mortals.xhx.daemon.task; package com.mortals.xhx.daemon.task;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.mortals.framework.ap.GlobalSysInfo; import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask; import com.mortals.framework.service.ITask;
...@@ -7,16 +10,16 @@ import com.mortals.framework.service.ITaskExcuteService; ...@@ -7,16 +10,16 @@ import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.base.framework.ws.message.SendToAllRequest; import com.mortals.xhx.base.framework.ws.message.SendToAllRequest;
import com.mortals.xhx.base.framework.ws.util.WebSocketUtil; import com.mortals.xhx.base.framework.ws.util.WebSocketUtil;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.busiz.rsp.SiteInfo;
import com.mortals.xhx.common.code.DeviceOnlineStatusEnum; import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.code.DeviceMethodEnum;
import com.mortals.xhx.common.code.DeviceStatusEnum;
import com.mortals.xhx.common.key.ParamKey; import com.mortals.xhx.common.key.ParamKey;
import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.module.alarm.model.AlarmSmsSendEntity;
import com.mortals.xhx.module.alarm.model.AlarmSmsSendQuery;
import com.mortals.xhx.module.alarm.service.AlarmSmsSendService;
import com.mortals.xhx.module.device.model.*; import com.mortals.xhx.module.device.model.*;
import com.mortals.xhx.module.device.service.DeviceLogService; import com.mortals.xhx.module.device.service.*;
import com.mortals.xhx.module.device.service.DeviceModuleService;
import com.mortals.xhx.module.device.service.DeviceModuleUseService;
import com.mortals.xhx.module.device.service.DeviceService;
import com.mortals.xhx.module.platform.model.PlatformEntity; import com.mortals.xhx.module.platform.model.PlatformEntity;
import com.mortals.xhx.module.platform.service.PlatformService; import com.mortals.xhx.module.platform.service.PlatformService;
import com.mortals.xhx.module.product.model.ProductEntity; import com.mortals.xhx.module.product.model.ProductEntity;
...@@ -26,13 +29,18 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -26,13 +29,18 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static java.math.BigDecimal.ROUND_HALF_DOWN;
import static java.util.stream.Collectors.counting;
/** /**
* 设备状态任务 * 设备统计任务,生成当天统计数据
* *
* @author: zxfei * @author: zxfei
* @date: 2022/3/9 15:19 * @date: 2022/3/9 15:19
...@@ -48,143 +56,144 @@ public class DeviceStatTaskImpl implements ITaskExcuteService { ...@@ -48,143 +56,144 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
@Autowired @Autowired
private DeviceModuleUseService deviceModuleUseService; private DeviceModuleUseService deviceModuleUseService;
@Autowired
private ParamService paramService;
@Autowired @Autowired
private ProductService productService; private ProductService productService;
@Autowired @Autowired
private PlatformService platformService; private PlatformService platformService;
@Autowired
private DeviceStatService deviceStatService;
@Autowired @Autowired
private DeviceModuleService moduleService; private ISiteFeign siteFeign;
@Autowired
private DeviceAlarmInfoService deviceAlarmInfoService;
@Autowired
private AlarmSmsSendService alarmSmsSendService;
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
log.debug("设备统计,开始执行"); log.debug("设备统计,开始执行");
doDeviceModuleUse(); doDeviceStat();
//doDeviceUpOrDown();
//doDeviceLogDel();
log.debug("设备统计,结束执行"); log.debug("设备统计,结束执行");
} }
/** /**
* 统计设备模块使用率 * 统计设备
*/ */
private void doDeviceModuleUse() { private void doDeviceStat() {
Map<String, DeviceModuleEntity> moduleMap = moduleService.find(new DeviceModuleQuery()).stream().collect(Collectors.toMap(x -> x.getModuleMsgCode(), y -> y, (o, n) -> n));
try { //查询当天统计,如果有 则更新统计结果,否则新增
DeviceStatEntity deviceStatEntity = deviceStatService.selectOne(new DeviceStatQuery()
.year(DateUtil.year(new Date()))
.month(DateUtil.month(new Date()) + 1)
.day(DateUtil.dayOfMonth(new Date())));
if (ObjectUtils.isEmpty(deviceStatEntity)) {
deviceStatEntity = new DeviceStatEntity();
deviceStatEntity.initAttrValue();
deviceStatEntity.setCreateTime(new Date());
deviceStatEntity.setYear(DateUtil.year(new Date()));
deviceStatEntity.setMonth(DateUtil.month(new Date()) + 1);
deviceStatEntity.setDay(DateUtil.dayOfMonth(new Date()));
}
// TODO: 2022/7/2 根据每个设备单独查询统计 计算数据量会减少 //获取昨天统计数据
List<DeviceModuleUseEntity> moduleUseEntityList = deviceService.getCacheList().stream().flatMap(device -> { DeviceStatEntity yesterdayDeviceStat = deviceStatService.selectOne(new DeviceStatQuery()
//查询当前设备日志 .year(DateUtil.year(DateUtil.yesterday()))
List<DeviceLogEntity> deviceLogList = deviceLogService.find(new DeviceLogQuery().deviceId(device.getId())); .month(DateUtil.month(DateUtil.yesterday()) + 1)
//分组统计每个模块头使用率 .day(DateUtil.dayOfMonth(DateUtil.yesterday())));
Map<String, Long> modelCollect = deviceLogList.parallelStream().collect(Collectors.groupingBy(DeviceLogEntity::getMessageHead, Collectors.counting())); if (ObjectUtils.isEmpty(yesterdayDeviceStat)) {
return modelCollect.entrySet().stream().map(item -> { yesterdayDeviceStat = new DeviceStatEntity();
if (moduleMap.containsKey(item.getKey())) { yesterdayDeviceStat.initAttrValue();
DeviceModuleUseEntity deviceModuleUseEntity = new DeviceModuleUseEntity(); }
deviceModuleUseEntity.initAttrValue(); try {
DeviceModuleEntity deviceModuleEntity = moduleMap.get(item.getKey()); //获取设备总数
List<DeviceEntity> deviceList = deviceService.find(new DeviceQuery());
deviceModuleUseEntity.setDeviceId(device.getId()); Integer deviceTotalCount = deviceList.size();
deviceModuleUseEntity.setModuleMsgCode(deviceModuleEntity.getModuleMsgCode());
deviceModuleUseEntity.setModuleName(deviceModuleEntity.getModuleName()); deviceStatEntity.setDeviceTotalCount(deviceTotalCount);
deviceModuleUseEntity.setUseNum(item.getValue()); deviceStatEntity.setDeviceAddCount(deviceTotalCount - yesterdayDeviceStat.getDeviceTotalCount());
deviceModuleUseEntity.setCreateUserId(1L);
deviceModuleUseEntity.setCreateTime(new Date()); //站点数量
return deviceModuleUseEntity; String resp = siteFeign.list(new SitePdu());
} JSONObject jsonObject = JSONObject.parseObject(resp);
return null; if (jsonObject.getInteger("code") == 1) {
}).filter(f -> f != null); List<SitePdu> sitePduList = jsonObject.getJSONObject("data").getObject("data", new TypeReference<List<SitePdu>>() {
}).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(moduleUseEntityList)) {
//遍历,更新统计数据表 标识 设备id与消息头
Map<String, DeviceModuleUseEntity> collect = deviceModuleUseService.find(new DeviceModuleUseQuery()).stream().collect(Collectors.toMap(x -> x.getDeviceId() + "#" + x.getModuleMsgCode(), y -> y, (o, n) -> n));
moduleUseEntityList.stream().forEach(mudule -> {
String key = mudule.getDeviceId() + "#" + mudule.getModuleMsgCode();
if (collect.containsKey(key)) {
//更新
DeviceModuleUseEntity deviceModuleUseEntity = collect.get(key);
mudule.setId(deviceModuleUseEntity.getId());
mudule.setUpdateTime(new Date());
mudule.setUpdateUserId(1L);
deviceModuleUseService.update(mudule, null);
} else {
//新增
deviceModuleUseService.save(mudule, null);
}
}); });
deviceStatEntity.setSiteTotalCount(sitePduList.size());
deviceStatEntity.setSiteAddCount(sitePduList.size() - yesterdayDeviceStat.getSiteTotalCount());
}
//在线数量
Long deviceOnlineCount = deviceList.parallelStream().filter(f -> f.getDeviceStatus() == DeviceStatusEnum.在线.getValue()).count();
deviceStatEntity.setDeviceOnlineCount(deviceOnlineCount.intValue());
deviceStatEntity.setDeviceOnlineRatio(new BigDecimal(deviceOnlineCount).divide(new BigDecimal(deviceList.size()),ROUND_HALF_DOWN).setScale(2));
//离线数量
Long deviceOfflineCount = deviceList.parallelStream().filter(f -> f.getDeviceStatus() == DeviceStatusEnum.离线.getValue()).count();
deviceStatEntity.setDeviceOfflineCount(deviceOfflineCount.intValue());
deviceStatEntity.setDeviceOfflineRatio(new BigDecimal(deviceOfflineCount).divide(new BigDecimal(deviceList.size()),ROUND_HALF_DOWN).setScale(2));
//停用数量
Long deviceStopCount = deviceList.parallelStream().filter(f -> f.getEnabled() == YesNoEnum.NO.getValue()).count();
deviceStatEntity.setDeviceStopCount(deviceStopCount.intValue());
deviceStatEntity.setDeviceStopRatio(new BigDecimal(deviceStopCount).divide(new BigDecimal(deviceList.size()),ROUND_HALF_DOWN).setScale(2));
//今日告警数量
DeviceAlarmInfoQuery deviceAlarmInfoQuery = new DeviceAlarmInfoQuery();
deviceAlarmInfoQuery.setCreateTimeStart(DateUtils.getCurrStrDate());
deviceAlarmInfoQuery.setCreateTimeEnd(DateUtils.getCurrStrDate());
List<DeviceAlarmInfoEntity> deviceAlarmInfoList = deviceAlarmInfoService.find(deviceAlarmInfoQuery);
deviceStatEntity.setAlarmTotalCount(deviceAlarmInfoList.size());
deviceStatEntity.setAlarmAddCount(deviceAlarmInfoList.size() - yesterdayDeviceStat.getAlarmTotalCount());
//推送数量
AlarmSmsSendQuery alarmSmsSendQuery = new AlarmSmsSendQuery();
alarmSmsSendQuery.setSendTimeStart(DateUtils.getCurrStrDate());
alarmSmsSendQuery.setSendTimeEnd(DateUtils.getCurrStrDate());
alarmSmsSendQuery.setSendStatus(SendStatusEnum.发送成功.getValue());
List<AlarmSmsSendEntity> alarmSmsSendEntities = alarmSmsSendService.find(alarmSmsSendQuery);
deviceStatEntity.setPushTotalCount(alarmSmsSendEntities.size());
deviceStatEntity.setPushAddCount(alarmSmsSendEntities.size()-yesterdayDeviceStat.getPushTotalCount());
//上行下行数量
DeviceLogQuery deviceLogQuery = new DeviceLogQuery();
deviceLogQuery.setCreateTimeStart(DateUtils.getCurrStrDate());
deviceLogQuery.setCreateTimeEnd(DateUtils.getCurrStrDate());
Map<Boolean, Long> collect = deviceLogService.find(deviceLogQuery).parallelStream().collect(Collectors.partitioningBy(x -> x.getLogType() == LogTypeEnum.上报事件.getValue(), counting()));
deviceStatEntity.setUploadMessageTotalCount(collect.getOrDefault(true,0L).intValue());
deviceStatEntity.setDownloadMessageTotalCount(collect.getOrDefault(false,0L).intValue());
if (deviceStatEntity.newEntity()) {
deviceStatEntity.setCreateTime(new Date());
deviceStatService.save(deviceStatEntity);
} else {
deviceStatEntity.setUpdateTime(new Date());
deviceStatService.update(deviceStatEntity);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("更新任务异常,结束执行", e); log.error("更新任务异常,结束执行", e);
} }
} }
/** @Override
* 统计更新设备状态 public void stopTask(ITask task) throws AppException {
*/
private void doDeviceUpOrDown() {
int timeout = GlobalSysInfo.getParamIntValue(ParamKey.SYS_PARAM_HEADBEAT_TIMEOUT, 60) * 1000;
try {
//获取所有设备,针对每个设备查询最近指定秒的日志,如果没有则更新下线
deviceService.getCacheList().stream()
.filter(f -> f.getDeviceStatus() == DeviceStatusEnum.在线.getValue())
.peek(device -> {
DeviceLogQuery query = new DeviceLogQuery();
query.setCreateTimeStart(DateUtils.getStrDateTime(new Date(System.currentTimeMillis() - timeout)));
DeviceLogEntity deviceLogEntity = deviceLogService.selectOne(query);
if (ObjectUtils.isEmpty(deviceLogEntity)) {
//更新设备下线
device.setOfflineTime(new Date());
device.setDeviceStatus(DeviceStatusEnum.离线.getValue());
deviceService.update(device);
String msg = String.format("%s设备:%s ,离线!", device.getProductName(), device.getDeviceCode());
WebSocketUtil.broadcast(SendToAllRequest.TYPE, new SendToAllRequest().setContent(msg));
PlatformEntity platformEntity = platformService.get(device.getPlatformId());
ProductEntity productEntity = productService.get(device.getProductId());
if (!ObjectUtils.isEmpty(platformEntity) && !ObjectUtils.isEmpty(productEntity)) {
//新增设备通知第三方平台
deviceService.sendThirdParty(device, productEntity, platformEntity, DeviceMethodEnum.OFFLINE);
}
}
}).count();
} catch (Exception e) {
log.error("更新设备状态任务异常,结束执行", e);
}
log.debug("更新设备状态任务,结束执行");
} }
public static void main(String[] args) {
/** System.out.println(DateUtil.month(new Date()));
* 定时清除设备日志
*/
private void doDeviceLogDel() {
//默认保存30天日志
int timeout = -GlobalSysInfo.getParamIntValue(ParamKey.SYS_PARAM_LOG_TIME, 30);
try {
DeviceLogQuery query = new DeviceLogQuery();
query.setCreateTimeEnd(DateUtils.getStrDateTime(DateUtils.addCurrDate(timeout)));
Long[] ids = deviceLogService.find(query).stream().map(DeviceLogEntity::getId).toArray(Long[]::new);
if (!ObjectUtils.isEmpty(ids)) {
deviceLogService.remove(ids, null);
}
} catch (Exception e) {
log.error("设备日志删除任务异常,结束执行", e);
}
log.debug("设备日志删除任务,结束执行");
}
System.out.println(DateUtil.year(new Date()));
System.out.println(DateUtil.dayOfMonth(new Date()));
@Override
public void stopTask(ITask task) throws AppException {
} }
......
package com.mortals.xhx.daemon.task;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.xhx.common.code.SendStatusEnum;
import com.mortals.xhx.common.utils.SendSmsTask;
import com.mortals.xhx.common.utils.SendTaskThreadPool;
import com.mortals.xhx.module.alarm.model.AlarmSmsSendEntity;
import com.mortals.xhx.module.alarm.model.AlarmSmsSendQuery;
import com.mortals.xhx.module.alarm.service.AlarmSmsSendService;
import lombok.extern.apachecommons.CommonsLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.security.DenyAll;
import java.util.List;
/**
* 短信发送任务
*
* @author: zxfei
* @date: 2022/3/9 15:19
*/
@CommonsLog
@Service("SmsSendTask")
public class SmsSendTaskImpl implements ITaskExcuteService {
@Autowired
private AlarmSmsSendService alarmSmsSendService;
@Autowired
private SendTaskThreadPool sendTaskThreadPool;
@Override
public void excuteTask(ITask task) throws AppException {
List<AlarmSmsSendEntity> sendList = alarmSmsSendService.find(new AlarmSmsSendQuery().sendStatus(SendStatusEnum.未发送.getValue()));
sendList.stream().forEach(sms->{
SendSmsTask sendSmsTask = new SendSmsTask(sms, "xxx");
sendTaskThreadPool.execute(sendSmsTask);
});
}
@Override
public void stopTask(ITask task) throws AppException {
}
}
package com.mortals.xhx.module.device.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.device.model.DeviceStatEntity;
import java.util.List;
/**
* 设备统计Dao
* 设备统计 DAO接口
*
* @author zxfei
* @date 2022-07-05
*/
public interface DeviceStatDao extends ICRUDDao<DeviceStatEntity,Long>{
}
package com.mortals.xhx.module.device.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.device.dao.DeviceStatDao;
import com.mortals.xhx.module.device.model.DeviceStatEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 设备统计DaoImpl DAO接口
*
* @author zxfei
* @date 2022-07-05
*/
@Repository("deviceStatDao")
public class DeviceStatDaoImpl extends BaseCRUDDaoMybatis<DeviceStatEntity,Long> implements DeviceStatDao {
}
package com.mortals.xhx.module.device.model;
import java.math.BigDecimal;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.device.model.vo.DeviceStatVo;
/**
* 设备统计实体对象
*
* @author zxfei
* @date 2022-07-05
*/
public class DeviceStatEntity extends DeviceStatVo {
private static final long serialVersionUID = 1L;
/**
* 设备总数
*/
private Integer deviceTotalCount;
/**
* 昨日新增减少设备数量
*/
private Integer deviceAddCount;
/**
* 监控站点数量
*/
private Integer siteTotalCount;
/**
* 昨日新增站点数量
*/
private Integer siteAddCount;
/**
* 在线设备数量
*/
private Integer deviceOnlineCount;
/**
* 在线率
*/
private BigDecimal deviceOnlineRatio;
/**
* 离线设备数量
*/
private Integer deviceOfflineCount;
/**
* 离线率
*/
private BigDecimal deviceOfflineRatio;
/**
* 停用设备数量
*/
private Integer deviceStopCount;
/**
* 停用率
*/
private BigDecimal deviceStopRatio;
/**
* 今日告警数量
*/
private Integer alarmTotalCount;
/**
* 昨日新增减少数量
*/
private Integer alarmAddCount;
/**
* 今日消息推送数量
*/
private Integer pushTotalCount;
/**
* 昨日新增减少数量
*/
private Integer pushAddCount;
/**
* 今日上行消息数量
*/
private Integer uploadMessageTotalCount;
/**
* 今日下行消息数量
*/
private Integer downloadMessageTotalCount;
/**
* 年
*/
private Integer year;
/**
* 月
*/
private Integer month;
/**
* 日
*/
private Integer day;
public DeviceStatEntity(){}
/**
* 获取 设备总数
* @return Integer
*/
public Integer getDeviceTotalCount(){
return deviceTotalCount;
}
/**
* 设置 设备总数
* @param deviceTotalCount
*/
public void setDeviceTotalCount(Integer deviceTotalCount){
this.deviceTotalCount = deviceTotalCount;
}
/**
* 获取 昨日新增减少设备数量
* @return Integer
*/
public Integer getDeviceAddCount(){
return deviceAddCount;
}
/**
* 设置 昨日新增减少设备数量
* @param deviceAddCount
*/
public void setDeviceAddCount(Integer deviceAddCount){
this.deviceAddCount = deviceAddCount;
}
/**
* 获取 监控站点数量
* @return Integer
*/
public Integer getSiteTotalCount(){
return siteTotalCount;
}
/**
* 设置 监控站点数量
* @param siteTotalCount
*/
public void setSiteTotalCount(Integer siteTotalCount){
this.siteTotalCount = siteTotalCount;
}
/**
* 获取 昨日新增站点数量
* @return Integer
*/
public Integer getSiteAddCount(){
return siteAddCount;
}
/**
* 设置 昨日新增站点数量
* @param siteAddCount
*/
public void setSiteAddCount(Integer siteAddCount){
this.siteAddCount = siteAddCount;
}
/**
* 获取 在线设备数量
* @return Integer
*/
public Integer getDeviceOnlineCount(){
return deviceOnlineCount;
}
/**
* 设置 在线设备数量
* @param deviceOnlineCount
*/
public void setDeviceOnlineCount(Integer deviceOnlineCount){
this.deviceOnlineCount = deviceOnlineCount;
}
/**
* 获取 在线率
* @return BigDecimal
*/
public BigDecimal getDeviceOnlineRatio(){
return deviceOnlineRatio;
}
/**
* 设置 在线率
* @param deviceOnlineRatio
*/
public void setDeviceOnlineRatio(BigDecimal deviceOnlineRatio){
this.deviceOnlineRatio = deviceOnlineRatio;
}
/**
* 获取 离线设备数量
* @return Integer
*/
public Integer getDeviceOfflineCount(){
return deviceOfflineCount;
}
/**
* 设置 离线设备数量
* @param deviceOfflineCount
*/
public void setDeviceOfflineCount(Integer deviceOfflineCount){
this.deviceOfflineCount = deviceOfflineCount;
}
/**
* 获取 离线率
* @return BigDecimal
*/
public BigDecimal getDeviceOfflineRatio(){
return deviceOfflineRatio;
}
/**
* 设置 离线率
* @param deviceOfflineRatio
*/
public void setDeviceOfflineRatio(BigDecimal deviceOfflineRatio){
this.deviceOfflineRatio = deviceOfflineRatio;
}
/**
* 获取 停用设备数量
* @return Integer
*/
public Integer getDeviceStopCount(){
return deviceStopCount;
}
/**
* 设置 停用设备数量
* @param deviceStopCount
*/
public void setDeviceStopCount(Integer deviceStopCount){
this.deviceStopCount = deviceStopCount;
}
/**
* 获取 停用率
* @return BigDecimal
*/
public BigDecimal getDeviceStopRatio(){
return deviceStopRatio;
}
/**
* 设置 停用率
* @param deviceStopRatio
*/
public void setDeviceStopRatio(BigDecimal deviceStopRatio){
this.deviceStopRatio = deviceStopRatio;
}
/**
* 获取 今日告警数量
* @return Integer
*/
public Integer getAlarmTotalCount(){
return alarmTotalCount;
}
/**
* 设置 今日告警数量
* @param alarmTotalCount
*/
public void setAlarmTotalCount(Integer alarmTotalCount){
this.alarmTotalCount = alarmTotalCount;
}
/**
* 获取 昨日新增减少数量
* @return Integer
*/
public Integer getAlarmAddCount(){
return alarmAddCount;
}
/**
* 设置 昨日新增减少数量
* @param alarmAddCount
*/
public void setAlarmAddCount(Integer alarmAddCount){
this.alarmAddCount = alarmAddCount;
}
/**
* 获取 今日消息推送数量
* @return Integer
*/
public Integer getPushTotalCount(){
return pushTotalCount;
}
/**
* 设置 今日消息推送数量
* @param pushTotalCount
*/
public void setPushTotalCount(Integer pushTotalCount){
this.pushTotalCount = pushTotalCount;
}
/**
* 获取 昨日新增减少数量
* @return Integer
*/
public Integer getPushAddCount(){
return pushAddCount;
}
/**
* 设置 昨日新增减少数量
* @param pushAddCount
*/
public void setPushAddCount(Integer pushAddCount){
this.pushAddCount = pushAddCount;
}
/**
* 获取 今日上行消息数量
* @return Integer
*/
public Integer getUploadMessageTotalCount(){
return uploadMessageTotalCount;
}
/**
* 设置 今日上行消息数量
* @param uploadMessageTotalCount
*/
public void setUploadMessageTotalCount(Integer uploadMessageTotalCount){
this.uploadMessageTotalCount = uploadMessageTotalCount;
}
/**
* 获取 今日下行消息数量
* @return Integer
*/
public Integer getDownloadMessageTotalCount(){
return downloadMessageTotalCount;
}
/**
* 设置 今日下行消息数量
* @param downloadMessageTotalCount
*/
public void setDownloadMessageTotalCount(Integer downloadMessageTotalCount){
this.downloadMessageTotalCount = downloadMessageTotalCount;
}
/**
* 获取 年
* @return Integer
*/
public Integer getYear(){
return year;
}
/**
* 设置 年
* @param year
*/
public void setYear(Integer year){
this.year = year;
}
/**
* 获取 月
* @return Integer
*/
public Integer getMonth(){
return month;
}
/**
* 设置 月
* @param month
*/
public void setMonth(Integer month){
this.month = month;
}
/**
* 获取 日
* @return Integer
*/
public Integer getDay(){
return day;
}
/**
* 设置 日
* @param day
*/
public void setDay(Integer day){
this.day = day;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof DeviceStatEntity) {
DeviceStatEntity tmp = (DeviceStatEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",deviceTotalCount:").append(getDeviceTotalCount());
sb.append(",deviceAddCount:").append(getDeviceAddCount());
sb.append(",siteTotalCount:").append(getSiteTotalCount());
sb.append(",siteAddCount:").append(getSiteAddCount());
sb.append(",deviceOnlineCount:").append(getDeviceOnlineCount());
sb.append(",deviceOnlineRatio:").append(getDeviceOnlineRatio());
sb.append(",deviceOfflineCount:").append(getDeviceOfflineCount());
sb.append(",deviceOfflineRatio:").append(getDeviceOfflineRatio());
sb.append(",deviceStopCount:").append(getDeviceStopCount());
sb.append(",deviceStopRatio:").append(getDeviceStopRatio());
sb.append(",alarmTotalCount:").append(getAlarmTotalCount());
sb.append(",alarmAddCount:").append(getAlarmAddCount());
sb.append(",pushTotalCount:").append(getPushTotalCount());
sb.append(",pushAddCount:").append(getPushAddCount());
sb.append(",uploadMessageTotalCount:").append(getUploadMessageTotalCount());
sb.append(",downloadMessageTotalCount:").append(getDownloadMessageTotalCount());
sb.append(",year:").append(getYear());
sb.append(",month:").append(getMonth());
sb.append(",day:").append(getDay());
return sb.toString();
}
public void initAttrValue(){
this.deviceTotalCount = 0;
this.deviceAddCount = 0;
this.siteTotalCount = 0;
this.siteAddCount = 0;
this.deviceOnlineCount = 0;
this.deviceOnlineRatio = BigDecimal.valueOf(0.00);
this.deviceOfflineCount = 0;
this.deviceOfflineRatio = BigDecimal.valueOf(0.00);
this.deviceStopCount = 0;
this.deviceStopRatio = BigDecimal.valueOf(0.00);
this.alarmTotalCount = 0;
this.alarmAddCount = 0;
this.pushTotalCount = 0;
this.pushAddCount = 0;
this.uploadMessageTotalCount = 0;
this.downloadMessageTotalCount = 0;
this.year = null;
this.month = null;
this.day = null;
}
}
\ No newline at end of file
package com.mortals.xhx.module.device.model;
import java.math.BigDecimal;
import java.util.List;
import com.mortals.xhx.module.device.model.DeviceStatEntity;
/**
* 设备统计查询对象
*
* @author zxfei
* @date 2022-07-05
*/
public class DeviceStatQuery extends DeviceStatEntity {
/** 开始 ID */
private Long idStart;
/** 结束 ID */
private Long idEnd;
/** 增加 ID */
private Long idIncrement;
/** ID列表 */
private List <Long> idList;
/** 开始 设备总数 */
private Integer deviceTotalCountStart;
/** 结束 设备总数 */
private Integer deviceTotalCountEnd;
/** 增加 设备总数 */
private Integer deviceTotalCountIncrement;
/** 设备总数列表 */
private List <Integer> deviceTotalCountList;
/** 开始 昨日新增减少设备数量 */
private Integer deviceAddCountStart;
/** 结束 昨日新增减少设备数量 */
private Integer deviceAddCountEnd;
/** 增加 昨日新增减少设备数量 */
private Integer deviceAddCountIncrement;
/** 昨日新增减少设备数量列表 */
private List <Integer> deviceAddCountList;
/** 开始 监控站点数量 */
private Integer siteTotalCountStart;
/** 结束 监控站点数量 */
private Integer siteTotalCountEnd;
/** 增加 监控站点数量 */
private Integer siteTotalCountIncrement;
/** 监控站点数量列表 */
private List <Integer> siteTotalCountList;
/** 开始 昨日新增站点数量 */
private Integer siteAddCountStart;
/** 结束 昨日新增站点数量 */
private Integer siteAddCountEnd;
/** 增加 昨日新增站点数量 */
private Integer siteAddCountIncrement;
/** 昨日新增站点数量列表 */
private List <Integer> siteAddCountList;
/** 开始 在线设备数量 */
private Integer deviceOnlineCountStart;
/** 结束 在线设备数量 */
private Integer deviceOnlineCountEnd;
/** 增加 在线设备数量 */
private Integer deviceOnlineCountIncrement;
/** 在线设备数量列表 */
private List <Integer> deviceOnlineCountList;
/** 开始 在线率 */
private BigDecimal deviceOnlineRatioStart;
/** 结束 在线率 */
private BigDecimal deviceOnlineRatioEnd;
/** 增加 在线率 */
private BigDecimal deviceOnlineRatioIncrement;
/** 在线率列表 */
private List <BigDecimal> deviceOnlineRatioList;
/** 开始 离线设备数量 */
private Integer deviceOfflineCountStart;
/** 结束 离线设备数量 */
private Integer deviceOfflineCountEnd;
/** 增加 离线设备数量 */
private Integer deviceOfflineCountIncrement;
/** 离线设备数量列表 */
private List <Integer> deviceOfflineCountList;
/** 开始 离线率 */
private BigDecimal deviceOfflineRatioStart;
/** 结束 离线率 */
private BigDecimal deviceOfflineRatioEnd;
/** 增加 离线率 */
private BigDecimal deviceOfflineRatioIncrement;
/** 离线率列表 */
private List <BigDecimal> deviceOfflineRatioList;
/** 开始 停用设备数量 */
private Integer deviceStopCountStart;
/** 结束 停用设备数量 */
private Integer deviceStopCountEnd;
/** 增加 停用设备数量 */
private Integer deviceStopCountIncrement;
/** 停用设备数量列表 */
private List <Integer> deviceStopCountList;
/** 开始 停用率 */
private BigDecimal deviceStopRatioStart;
/** 结束 停用率 */
private BigDecimal deviceStopRatioEnd;
/** 增加 停用率 */
private BigDecimal deviceStopRatioIncrement;
/** 停用率列表 */
private List <BigDecimal> deviceStopRatioList;
/** 开始 今日告警数量 */
private Integer alarmTotalCountStart;
/** 结束 今日告警数量 */
private Integer alarmTotalCountEnd;
/** 增加 今日告警数量 */
private Integer alarmTotalCountIncrement;
/** 今日告警数量列表 */
private List <Integer> alarmTotalCountList;
/** 开始 昨日新增减少数量 */
private Integer alarmAddCountStart;
/** 结束 昨日新增减少数量 */
private Integer alarmAddCountEnd;
/** 增加 昨日新增减少数量 */
private Integer alarmAddCountIncrement;
/** 昨日新增减少数量列表 */
private List <Integer> alarmAddCountList;
/** 开始 今日消息推送数量 */
private Integer pushTotalCountStart;
/** 结束 今日消息推送数量 */
private Integer pushTotalCountEnd;
/** 增加 今日消息推送数量 */
private Integer pushTotalCountIncrement;
/** 今日消息推送数量列表 */
private List <Integer> pushTotalCountList;
/** 开始 昨日新增减少数量 */
private Integer pushAddCountStart;
/** 结束 昨日新增减少数量 */
private Integer pushAddCountEnd;
/** 增加 昨日新增减少数量 */
private Integer pushAddCountIncrement;
/** 昨日新增减少数量列表 */
private List <Integer> pushAddCountList;
/** 开始 今日上行消息数量 */
private Integer uploadMessageTotalCountStart;
/** 结束 今日上行消息数量 */
private Integer uploadMessageTotalCountEnd;
/** 增加 今日上行消息数量 */
private Integer uploadMessageTotalCountIncrement;
/** 今日上行消息数量列表 */
private List <Integer> uploadMessageTotalCountList;
/** 开始 今日下行消息数量 */
private Integer downloadMessageTotalCountStart;
/** 结束 今日下行消息数量 */
private Integer downloadMessageTotalCountEnd;
/** 增加 今日下行消息数量 */
private Integer downloadMessageTotalCountIncrement;
/** 今日下行消息数量列表 */
private List <Integer> downloadMessageTotalCountList;
/** 开始 年 */
private Integer yearStart;
/** 结束 年 */
private Integer yearEnd;
/** 增加 年 */
private Integer yearIncrement;
/** 年列表 */
private List <Integer> yearList;
/** 开始 月 */
private Integer monthStart;
/** 结束 月 */
private Integer monthEnd;
/** 增加 月 */
private Integer monthIncrement;
/** 月列表 */
private List <Integer> monthList;
/** 开始 日 */
private Integer dayStart;
/** 结束 日 */
private Integer dayEnd;
/** 增加 日 */
private Integer dayIncrement;
/** 日列表 */
private List <Integer> dayList;
/** 开始 创建时间 */
private String createTimeStart;
/** 结束 创建时间 */
private String createTimeEnd;
/** 开始 更新用户 */
private Long updateUserIdStart;
/** 结束 更新用户 */
private Long updateUserIdEnd;
/** 增加 更新用户 */
private Long updateUserIdIncrement;
/** 更新用户列表 */
private List <Long> updateUserIdList;
/** 开始 更新时间 */
private String updateTimeStart;
/** 结束 更新时间 */
private String updateTimeEnd;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<DeviceStatQuery> orConditionList;
/** AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4) */
private List<DeviceStatQuery> andConditionList;
public DeviceStatQuery(){}
/**
* 获取 开始 ID
* @return idStart
*/
public Long getIdStart(){
return this.idStart;
}
/**
* 设置 开始 ID
* @param idStart
*/
public void setIdStart(Long idStart){
this.idStart = idStart;
}
/**
* 获取 结束 ID
* @return $idEnd
*/
public Long getIdEnd(){
return this.idEnd;
}
/**
* 设置 结束 ID
* @param idEnd
*/
public void setIdEnd(Long idEnd){
this.idEnd = idEnd;
}
/**
* 获取 增加 ID
* @return idIncrement
*/
public Long getIdIncrement(){
return this.idIncrement;
}
/**
* 设置 增加 ID
* @param idIncrement
*/
public void setIdIncrement(Long idIncrement){
this.idIncrement = idIncrement;
}
/**
* 获取 ID
* @return idList
*/
public List<Long> getIdList(){
return this.idList;
}
/**
* 设置 ID
* @param idList
*/
public void setIdList(List<Long> idList){
this.idList = idList;
}
/**
* 获取 开始 设备总数
* @return deviceTotalCountStart
*/
public Integer getDeviceTotalCountStart(){
return this.deviceTotalCountStart;
}
/**
* 设置 开始 设备总数
* @param deviceTotalCountStart
*/
public void setDeviceTotalCountStart(Integer deviceTotalCountStart){
this.deviceTotalCountStart = deviceTotalCountStart;
}
/**
* 获取 结束 设备总数
* @return $deviceTotalCountEnd
*/
public Integer getDeviceTotalCountEnd(){
return this.deviceTotalCountEnd;
}
/**
* 设置 结束 设备总数
* @param deviceTotalCountEnd
*/
public void setDeviceTotalCountEnd(Integer deviceTotalCountEnd){
this.deviceTotalCountEnd = deviceTotalCountEnd;
}
/**
* 获取 增加 设备总数
* @return deviceTotalCountIncrement
*/
public Integer getDeviceTotalCountIncrement(){
return this.deviceTotalCountIncrement;
}
/**
* 设置 增加 设备总数
* @param deviceTotalCountIncrement
*/
public void setDeviceTotalCountIncrement(Integer deviceTotalCountIncrement){
this.deviceTotalCountIncrement = deviceTotalCountIncrement;
}
/**
* 获取 设备总数
* @return deviceTotalCountList
*/
public List<Integer> getDeviceTotalCountList(){
return this.deviceTotalCountList;
}
/**
* 设置 设备总数
* @param deviceTotalCountList
*/
public void setDeviceTotalCountList(List<Integer> deviceTotalCountList){
this.deviceTotalCountList = deviceTotalCountList;
}
/**
* 获取 开始 昨日新增减少设备数量
* @return deviceAddCountStart
*/
public Integer getDeviceAddCountStart(){
return this.deviceAddCountStart;
}
/**
* 设置 开始 昨日新增减少设备数量
* @param deviceAddCountStart
*/
public void setDeviceAddCountStart(Integer deviceAddCountStart){
this.deviceAddCountStart = deviceAddCountStart;
}
/**
* 获取 结束 昨日新增减少设备数量
* @return $deviceAddCountEnd
*/
public Integer getDeviceAddCountEnd(){
return this.deviceAddCountEnd;
}
/**
* 设置 结束 昨日新增减少设备数量
* @param deviceAddCountEnd
*/
public void setDeviceAddCountEnd(Integer deviceAddCountEnd){
this.deviceAddCountEnd = deviceAddCountEnd;
}
/**
* 获取 增加 昨日新增减少设备数量
* @return deviceAddCountIncrement
*/
public Integer getDeviceAddCountIncrement(){
return this.deviceAddCountIncrement;
}
/**
* 设置 增加 昨日新增减少设备数量
* @param deviceAddCountIncrement
*/
public void setDeviceAddCountIncrement(Integer deviceAddCountIncrement){
this.deviceAddCountIncrement = deviceAddCountIncrement;
}
/**
* 获取 昨日新增减少设备数量
* @return deviceAddCountList
*/
public List<Integer> getDeviceAddCountList(){
return this.deviceAddCountList;
}
/**
* 设置 昨日新增减少设备数量
* @param deviceAddCountList
*/
public void setDeviceAddCountList(List<Integer> deviceAddCountList){
this.deviceAddCountList = deviceAddCountList;
}
/**
* 获取 开始 监控站点数量
* @return siteTotalCountStart
*/
public Integer getSiteTotalCountStart(){
return this.siteTotalCountStart;
}
/**
* 设置 开始 监控站点数量
* @param siteTotalCountStart
*/
public void setSiteTotalCountStart(Integer siteTotalCountStart){
this.siteTotalCountStart = siteTotalCountStart;
}
/**
* 获取 结束 监控站点数量
* @return $siteTotalCountEnd
*/
public Integer getSiteTotalCountEnd(){
return this.siteTotalCountEnd;
}
/**
* 设置 结束 监控站点数量
* @param siteTotalCountEnd
*/
public void setSiteTotalCountEnd(Integer siteTotalCountEnd){
this.siteTotalCountEnd = siteTotalCountEnd;
}
/**
* 获取 增加 监控站点数量
* @return siteTotalCountIncrement
*/
public Integer getSiteTotalCountIncrement(){
return this.siteTotalCountIncrement;
}
/**
* 设置 增加 监控站点数量
* @param siteTotalCountIncrement
*/
public void setSiteTotalCountIncrement(Integer siteTotalCountIncrement){
this.siteTotalCountIncrement = siteTotalCountIncrement;
}
/**
* 获取 监控站点数量
* @return siteTotalCountList
*/
public List<Integer> getSiteTotalCountList(){
return this.siteTotalCountList;
}
/**
* 设置 监控站点数量
* @param siteTotalCountList
*/
public void setSiteTotalCountList(List<Integer> siteTotalCountList){
this.siteTotalCountList = siteTotalCountList;
}
/**
* 获取 开始 昨日新增站点数量
* @return siteAddCountStart
*/
public Integer getSiteAddCountStart(){
return this.siteAddCountStart;
}
/**
* 设置 开始 昨日新增站点数量
* @param siteAddCountStart
*/
public void setSiteAddCountStart(Integer siteAddCountStart){
this.siteAddCountStart = siteAddCountStart;
}
/**
* 获取 结束 昨日新增站点数量
* @return $siteAddCountEnd
*/
public Integer getSiteAddCountEnd(){
return this.siteAddCountEnd;
}
/**
* 设置 结束 昨日新增站点数量
* @param siteAddCountEnd
*/
public void setSiteAddCountEnd(Integer siteAddCountEnd){
this.siteAddCountEnd = siteAddCountEnd;
}
/**
* 获取 增加 昨日新增站点数量
* @return siteAddCountIncrement
*/
public Integer getSiteAddCountIncrement(){
return this.siteAddCountIncrement;
}
/**
* 设置 增加 昨日新增站点数量
* @param siteAddCountIncrement
*/
public void setSiteAddCountIncrement(Integer siteAddCountIncrement){
this.siteAddCountIncrement = siteAddCountIncrement;
}
/**
* 获取 昨日新增站点数量
* @return siteAddCountList
*/
public List<Integer> getSiteAddCountList(){
return this.siteAddCountList;
}
/**
* 设置 昨日新增站点数量
* @param siteAddCountList
*/
public void setSiteAddCountList(List<Integer> siteAddCountList){
this.siteAddCountList = siteAddCountList;
}
/**
* 获取 开始 在线设备数量
* @return deviceOnlineCountStart
*/
public Integer getDeviceOnlineCountStart(){
return this.deviceOnlineCountStart;
}
/**
* 设置 开始 在线设备数量
* @param deviceOnlineCountStart
*/
public void setDeviceOnlineCountStart(Integer deviceOnlineCountStart){
this.deviceOnlineCountStart = deviceOnlineCountStart;
}
/**
* 获取 结束 在线设备数量
* @return $deviceOnlineCountEnd
*/
public Integer getDeviceOnlineCountEnd(){
return this.deviceOnlineCountEnd;
}
/**
* 设置 结束 在线设备数量
* @param deviceOnlineCountEnd
*/
public void setDeviceOnlineCountEnd(Integer deviceOnlineCountEnd){
this.deviceOnlineCountEnd = deviceOnlineCountEnd;
}
/**
* 获取 增加 在线设备数量
* @return deviceOnlineCountIncrement
*/
public Integer getDeviceOnlineCountIncrement(){
return this.deviceOnlineCountIncrement;
}
/**
* 设置 增加 在线设备数量
* @param deviceOnlineCountIncrement
*/
public void setDeviceOnlineCountIncrement(Integer deviceOnlineCountIncrement){
this.deviceOnlineCountIncrement = deviceOnlineCountIncrement;
}
/**
* 获取 在线设备数量
* @return deviceOnlineCountList
*/
public List<Integer> getDeviceOnlineCountList(){
return this.deviceOnlineCountList;
}
/**
* 设置 在线设备数量
* @param deviceOnlineCountList
*/
public void setDeviceOnlineCountList(List<Integer> deviceOnlineCountList){
this.deviceOnlineCountList = deviceOnlineCountList;
}
/**
* 获取 开始 在线率
* @return deviceOnlineRatioStart
*/
public BigDecimal getDeviceOnlineRatioStart(){
return this.deviceOnlineRatioStart;
}
/**
* 设置 开始 在线率
* @param deviceOnlineRatioStart
*/
public void setDeviceOnlineRatioStart(BigDecimal deviceOnlineRatioStart){
this.deviceOnlineRatioStart = deviceOnlineRatioStart;
}
/**
* 获取 结束 在线率
* @return $deviceOnlineRatioEnd
*/
public BigDecimal getDeviceOnlineRatioEnd(){
return this.deviceOnlineRatioEnd;
}
/**
* 设置 结束 在线率
* @param deviceOnlineRatioEnd
*/
public void setDeviceOnlineRatioEnd(BigDecimal deviceOnlineRatioEnd){
this.deviceOnlineRatioEnd = deviceOnlineRatioEnd;
}
/**
* 获取 增加 在线率
* @return deviceOnlineRatioIncrement
*/
public BigDecimal getDeviceOnlineRatioIncrement(){
return this.deviceOnlineRatioIncrement;
}
/**
* 设置 增加 在线率
* @param deviceOnlineRatioIncrement
*/
public void setDeviceOnlineRatioIncrement(BigDecimal deviceOnlineRatioIncrement){
this.deviceOnlineRatioIncrement = deviceOnlineRatioIncrement;
}
/**
* 获取 在线率
* @return deviceOnlineRatioList
*/
public List<BigDecimal> getDeviceOnlineRatioList(){
return this.deviceOnlineRatioList;
}
/**
* 设置 在线率
* @param deviceOnlineRatioList
*/
public void setDeviceOnlineRatioList(List<BigDecimal> deviceOnlineRatioList){
this.deviceOnlineRatioList = deviceOnlineRatioList;
}
/**
* 获取 开始 离线设备数量
* @return deviceOfflineCountStart
*/
public Integer getDeviceOfflineCountStart(){
return this.deviceOfflineCountStart;
}
/**
* 设置 开始 离线设备数量
* @param deviceOfflineCountStart
*/
public void setDeviceOfflineCountStart(Integer deviceOfflineCountStart){
this.deviceOfflineCountStart = deviceOfflineCountStart;
}
/**
* 获取 结束 离线设备数量
* @return $deviceOfflineCountEnd
*/
public Integer getDeviceOfflineCountEnd(){
return this.deviceOfflineCountEnd;
}
/**
* 设置 结束 离线设备数量
* @param deviceOfflineCountEnd
*/
public void setDeviceOfflineCountEnd(Integer deviceOfflineCountEnd){
this.deviceOfflineCountEnd = deviceOfflineCountEnd;
}
/**
* 获取 增加 离线设备数量
* @return deviceOfflineCountIncrement
*/
public Integer getDeviceOfflineCountIncrement(){
return this.deviceOfflineCountIncrement;
}
/**
* 设置 增加 离线设备数量
* @param deviceOfflineCountIncrement
*/
public void setDeviceOfflineCountIncrement(Integer deviceOfflineCountIncrement){
this.deviceOfflineCountIncrement = deviceOfflineCountIncrement;
}
/**
* 获取 离线设备数量
* @return deviceOfflineCountList
*/
public List<Integer> getDeviceOfflineCountList(){
return this.deviceOfflineCountList;
}
/**
* 设置 离线设备数量
* @param deviceOfflineCountList
*/
public void setDeviceOfflineCountList(List<Integer> deviceOfflineCountList){
this.deviceOfflineCountList = deviceOfflineCountList;
}
/**
* 获取 开始 离线率
* @return deviceOfflineRatioStart
*/
public BigDecimal getDeviceOfflineRatioStart(){
return this.deviceOfflineRatioStart;
}
/**
* 设置 开始 离线率
* @param deviceOfflineRatioStart
*/
public void setDeviceOfflineRatioStart(BigDecimal deviceOfflineRatioStart){
this.deviceOfflineRatioStart = deviceOfflineRatioStart;
}
/**
* 获取 结束 离线率
* @return $deviceOfflineRatioEnd
*/
public BigDecimal getDeviceOfflineRatioEnd(){
return this.deviceOfflineRatioEnd;
}
/**
* 设置 结束 离线率
* @param deviceOfflineRatioEnd
*/
public void setDeviceOfflineRatioEnd(BigDecimal deviceOfflineRatioEnd){
this.deviceOfflineRatioEnd = deviceOfflineRatioEnd;
}
/**
* 获取 增加 离线率
* @return deviceOfflineRatioIncrement
*/
public BigDecimal getDeviceOfflineRatioIncrement(){
return this.deviceOfflineRatioIncrement;
}
/**
* 设置 增加 离线率
* @param deviceOfflineRatioIncrement
*/
public void setDeviceOfflineRatioIncrement(BigDecimal deviceOfflineRatioIncrement){
this.deviceOfflineRatioIncrement = deviceOfflineRatioIncrement;
}
/**
* 获取 离线率
* @return deviceOfflineRatioList
*/
public List<BigDecimal> getDeviceOfflineRatioList(){
return this.deviceOfflineRatioList;
}
/**
* 设置 离线率
* @param deviceOfflineRatioList
*/
public void setDeviceOfflineRatioList(List<BigDecimal> deviceOfflineRatioList){
this.deviceOfflineRatioList = deviceOfflineRatioList;
}
/**
* 获取 开始 停用设备数量
* @return deviceStopCountStart
*/
public Integer getDeviceStopCountStart(){
return this.deviceStopCountStart;
}
/**
* 设置 开始 停用设备数量
* @param deviceStopCountStart
*/
public void setDeviceStopCountStart(Integer deviceStopCountStart){
this.deviceStopCountStart = deviceStopCountStart;
}
/**
* 获取 结束 停用设备数量
* @return $deviceStopCountEnd
*/
public Integer getDeviceStopCountEnd(){
return this.deviceStopCountEnd;
}
/**
* 设置 结束 停用设备数量
* @param deviceStopCountEnd
*/
public void setDeviceStopCountEnd(Integer deviceStopCountEnd){
this.deviceStopCountEnd = deviceStopCountEnd;
}
/**
* 获取 增加 停用设备数量
* @return deviceStopCountIncrement
*/
public Integer getDeviceStopCountIncrement(){
return this.deviceStopCountIncrement;
}
/**
* 设置 增加 停用设备数量
* @param deviceStopCountIncrement
*/
public void setDeviceStopCountIncrement(Integer deviceStopCountIncrement){
this.deviceStopCountIncrement = deviceStopCountIncrement;
}
/**
* 获取 停用设备数量
* @return deviceStopCountList
*/
public List<Integer> getDeviceStopCountList(){
return this.deviceStopCountList;
}
/**
* 设置 停用设备数量
* @param deviceStopCountList
*/
public void setDeviceStopCountList(List<Integer> deviceStopCountList){
this.deviceStopCountList = deviceStopCountList;
}
/**
* 获取 开始 停用率
* @return deviceStopRatioStart
*/
public BigDecimal getDeviceStopRatioStart(){
return this.deviceStopRatioStart;
}
/**
* 设置 开始 停用率
* @param deviceStopRatioStart
*/
public void setDeviceStopRatioStart(BigDecimal deviceStopRatioStart){
this.deviceStopRatioStart = deviceStopRatioStart;
}
/**
* 获取 结束 停用率
* @return $deviceStopRatioEnd
*/
public BigDecimal getDeviceStopRatioEnd(){
return this.deviceStopRatioEnd;
}
/**
* 设置 结束 停用率
* @param deviceStopRatioEnd
*/
public void setDeviceStopRatioEnd(BigDecimal deviceStopRatioEnd){
this.deviceStopRatioEnd = deviceStopRatioEnd;
}
/**
* 获取 增加 停用率
* @return deviceStopRatioIncrement
*/
public BigDecimal getDeviceStopRatioIncrement(){
return this.deviceStopRatioIncrement;
}
/**
* 设置 增加 停用率
* @param deviceStopRatioIncrement
*/
public void setDeviceStopRatioIncrement(BigDecimal deviceStopRatioIncrement){
this.deviceStopRatioIncrement = deviceStopRatioIncrement;
}
/**
* 获取 停用率
* @return deviceStopRatioList
*/
public List<BigDecimal> getDeviceStopRatioList(){
return this.deviceStopRatioList;
}
/**
* 设置 停用率
* @param deviceStopRatioList
*/
public void setDeviceStopRatioList(List<BigDecimal> deviceStopRatioList){
this.deviceStopRatioList = deviceStopRatioList;
}
/**
* 获取 开始 今日告警数量
* @return alarmTotalCountStart
*/
public Integer getAlarmTotalCountStart(){
return this.alarmTotalCountStart;
}
/**
* 设置 开始 今日告警数量
* @param alarmTotalCountStart
*/
public void setAlarmTotalCountStart(Integer alarmTotalCountStart){
this.alarmTotalCountStart = alarmTotalCountStart;
}
/**
* 获取 结束 今日告警数量
* @return $alarmTotalCountEnd
*/
public Integer getAlarmTotalCountEnd(){
return this.alarmTotalCountEnd;
}
/**
* 设置 结束 今日告警数量
* @param alarmTotalCountEnd
*/
public void setAlarmTotalCountEnd(Integer alarmTotalCountEnd){
this.alarmTotalCountEnd = alarmTotalCountEnd;
}
/**
* 获取 增加 今日告警数量
* @return alarmTotalCountIncrement
*/
public Integer getAlarmTotalCountIncrement(){
return this.alarmTotalCountIncrement;
}
/**
* 设置 增加 今日告警数量
* @param alarmTotalCountIncrement
*/
public void setAlarmTotalCountIncrement(Integer alarmTotalCountIncrement){
this.alarmTotalCountIncrement = alarmTotalCountIncrement;
}
/**
* 获取 今日告警数量
* @return alarmTotalCountList
*/
public List<Integer> getAlarmTotalCountList(){
return this.alarmTotalCountList;
}
/**
* 设置 今日告警数量
* @param alarmTotalCountList
*/
public void setAlarmTotalCountList(List<Integer> alarmTotalCountList){
this.alarmTotalCountList = alarmTotalCountList;
}
/**
* 获取 开始 昨日新增减少数量
* @return alarmAddCountStart
*/
public Integer getAlarmAddCountStart(){
return this.alarmAddCountStart;
}
/**
* 设置 开始 昨日新增减少数量
* @param alarmAddCountStart
*/
public void setAlarmAddCountStart(Integer alarmAddCountStart){
this.alarmAddCountStart = alarmAddCountStart;
}
/**
* 获取 结束 昨日新增减少数量
* @return $alarmAddCountEnd
*/
public Integer getAlarmAddCountEnd(){
return this.alarmAddCountEnd;
}
/**
* 设置 结束 昨日新增减少数量
* @param alarmAddCountEnd
*/
public void setAlarmAddCountEnd(Integer alarmAddCountEnd){
this.alarmAddCountEnd = alarmAddCountEnd;
}
/**
* 获取 增加 昨日新增减少数量
* @return alarmAddCountIncrement
*/
public Integer getAlarmAddCountIncrement(){
return this.alarmAddCountIncrement;
}
/**
* 设置 增加 昨日新增减少数量
* @param alarmAddCountIncrement
*/
public void setAlarmAddCountIncrement(Integer alarmAddCountIncrement){
this.alarmAddCountIncrement = alarmAddCountIncrement;
}
/**
* 获取 昨日新增减少数量
* @return alarmAddCountList
*/
public List<Integer> getAlarmAddCountList(){
return this.alarmAddCountList;
}
/**
* 设置 昨日新增减少数量
* @param alarmAddCountList
*/
public void setAlarmAddCountList(List<Integer> alarmAddCountList){
this.alarmAddCountList = alarmAddCountList;
}
/**
* 获取 开始 今日消息推送数量
* @return pushTotalCountStart
*/
public Integer getPushTotalCountStart(){
return this.pushTotalCountStart;
}
/**
* 设置 开始 今日消息推送数量
* @param pushTotalCountStart
*/
public void setPushTotalCountStart(Integer pushTotalCountStart){
this.pushTotalCountStart = pushTotalCountStart;
}
/**
* 获取 结束 今日消息推送数量
* @return $pushTotalCountEnd
*/
public Integer getPushTotalCountEnd(){
return this.pushTotalCountEnd;
}
/**
* 设置 结束 今日消息推送数量
* @param pushTotalCountEnd
*/
public void setPushTotalCountEnd(Integer pushTotalCountEnd){
this.pushTotalCountEnd = pushTotalCountEnd;
}
/**
* 获取 增加 今日消息推送数量
* @return pushTotalCountIncrement
*/
public Integer getPushTotalCountIncrement(){
return this.pushTotalCountIncrement;
}
/**
* 设置 增加 今日消息推送数量
* @param pushTotalCountIncrement
*/
public void setPushTotalCountIncrement(Integer pushTotalCountIncrement){
this.pushTotalCountIncrement = pushTotalCountIncrement;
}
/**
* 获取 今日消息推送数量
* @return pushTotalCountList
*/
public List<Integer> getPushTotalCountList(){
return this.pushTotalCountList;
}
/**
* 设置 今日消息推送数量
* @param pushTotalCountList
*/
public void setPushTotalCountList(List<Integer> pushTotalCountList){
this.pushTotalCountList = pushTotalCountList;
}
/**
* 获取 开始 昨日新增减少数量
* @return pushAddCountStart
*/
public Integer getPushAddCountStart(){
return this.pushAddCountStart;
}
/**
* 设置 开始 昨日新增减少数量
* @param pushAddCountStart
*/
public void setPushAddCountStart(Integer pushAddCountStart){
this.pushAddCountStart = pushAddCountStart;
}
/**
* 获取 结束 昨日新增减少数量
* @return $pushAddCountEnd
*/
public Integer getPushAddCountEnd(){
return this.pushAddCountEnd;
}
/**
* 设置 结束 昨日新增减少数量
* @param pushAddCountEnd
*/
public void setPushAddCountEnd(Integer pushAddCountEnd){
this.pushAddCountEnd = pushAddCountEnd;
}
/**
* 获取 增加 昨日新增减少数量
* @return pushAddCountIncrement
*/
public Integer getPushAddCountIncrement(){
return this.pushAddCountIncrement;
}
/**
* 设置 增加 昨日新增减少数量
* @param pushAddCountIncrement
*/
public void setPushAddCountIncrement(Integer pushAddCountIncrement){
this.pushAddCountIncrement = pushAddCountIncrement;
}
/**
* 获取 昨日新增减少数量
* @return pushAddCountList
*/
public List<Integer> getPushAddCountList(){
return this.pushAddCountList;
}
/**
* 设置 昨日新增减少数量
* @param pushAddCountList
*/
public void setPushAddCountList(List<Integer> pushAddCountList){
this.pushAddCountList = pushAddCountList;
}
/**
* 获取 开始 今日上行消息数量
* @return uploadMessageTotalCountStart
*/
public Integer getUploadMessageTotalCountStart(){
return this.uploadMessageTotalCountStart;
}
/**
* 设置 开始 今日上行消息数量
* @param uploadMessageTotalCountStart
*/
public void setUploadMessageTotalCountStart(Integer uploadMessageTotalCountStart){
this.uploadMessageTotalCountStart = uploadMessageTotalCountStart;
}
/**
* 获取 结束 今日上行消息数量
* @return $uploadMessageTotalCountEnd
*/
public Integer getUploadMessageTotalCountEnd(){
return this.uploadMessageTotalCountEnd;
}
/**
* 设置 结束 今日上行消息数量
* @param uploadMessageTotalCountEnd
*/
public void setUploadMessageTotalCountEnd(Integer uploadMessageTotalCountEnd){
this.uploadMessageTotalCountEnd = uploadMessageTotalCountEnd;
}
/**
* 获取 增加 今日上行消息数量
* @return uploadMessageTotalCountIncrement
*/
public Integer getUploadMessageTotalCountIncrement(){
return this.uploadMessageTotalCountIncrement;
}
/**
* 设置 增加 今日上行消息数量
* @param uploadMessageTotalCountIncrement
*/
public void setUploadMessageTotalCountIncrement(Integer uploadMessageTotalCountIncrement){
this.uploadMessageTotalCountIncrement = uploadMessageTotalCountIncrement;
}
/**
* 获取 今日上行消息数量
* @return uploadMessageTotalCountList
*/
public List<Integer> getUploadMessageTotalCountList(){
return this.uploadMessageTotalCountList;
}
/**
* 设置 今日上行消息数量
* @param uploadMessageTotalCountList
*/
public void setUploadMessageTotalCountList(List<Integer> uploadMessageTotalCountList){
this.uploadMessageTotalCountList = uploadMessageTotalCountList;
}
/**
* 获取 开始 今日下行消息数量
* @return downloadMessageTotalCountStart
*/
public Integer getDownloadMessageTotalCountStart(){
return this.downloadMessageTotalCountStart;
}
/**
* 设置 开始 今日下行消息数量
* @param downloadMessageTotalCountStart
*/
public void setDownloadMessageTotalCountStart(Integer downloadMessageTotalCountStart){
this.downloadMessageTotalCountStart = downloadMessageTotalCountStart;
}
/**
* 获取 结束 今日下行消息数量
* @return $downloadMessageTotalCountEnd
*/
public Integer getDownloadMessageTotalCountEnd(){
return this.downloadMessageTotalCountEnd;
}
/**
* 设置 结束 今日下行消息数量
* @param downloadMessageTotalCountEnd
*/
public void setDownloadMessageTotalCountEnd(Integer downloadMessageTotalCountEnd){
this.downloadMessageTotalCountEnd = downloadMessageTotalCountEnd;
}
/**
* 获取 增加 今日下行消息数量
* @return downloadMessageTotalCountIncrement
*/
public Integer getDownloadMessageTotalCountIncrement(){
return this.downloadMessageTotalCountIncrement;
}
/**
* 设置 增加 今日下行消息数量
* @param downloadMessageTotalCountIncrement
*/
public void setDownloadMessageTotalCountIncrement(Integer downloadMessageTotalCountIncrement){
this.downloadMessageTotalCountIncrement = downloadMessageTotalCountIncrement;
}
/**
* 获取 今日下行消息数量
* @return downloadMessageTotalCountList
*/
public List<Integer> getDownloadMessageTotalCountList(){
return this.downloadMessageTotalCountList;
}
/**
* 设置 今日下行消息数量
* @param downloadMessageTotalCountList
*/
public void setDownloadMessageTotalCountList(List<Integer> downloadMessageTotalCountList){
this.downloadMessageTotalCountList = downloadMessageTotalCountList;
}
/**
* 获取 开始 年
* @return yearStart
*/
public Integer getYearStart(){
return this.yearStart;
}
/**
* 设置 开始 年
* @param yearStart
*/
public void setYearStart(Integer yearStart){
this.yearStart = yearStart;
}
/**
* 获取 结束 年
* @return $yearEnd
*/
public Integer getYearEnd(){
return this.yearEnd;
}
/**
* 设置 结束 年
* @param yearEnd
*/
public void setYearEnd(Integer yearEnd){
this.yearEnd = yearEnd;
}
/**
* 获取 增加 年
* @return yearIncrement
*/
public Integer getYearIncrement(){
return this.yearIncrement;
}
/**
* 设置 增加 年
* @param yearIncrement
*/
public void setYearIncrement(Integer yearIncrement){
this.yearIncrement = yearIncrement;
}
/**
* 获取 年
* @return yearList
*/
public List<Integer> getYearList(){
return this.yearList;
}
/**
* 设置 年
* @param yearList
*/
public void setYearList(List<Integer> yearList){
this.yearList = yearList;
}
/**
* 获取 开始 月
* @return monthStart
*/
public Integer getMonthStart(){
return this.monthStart;
}
/**
* 设置 开始 月
* @param monthStart
*/
public void setMonthStart(Integer monthStart){
this.monthStart = monthStart;
}
/**
* 获取 结束 月
* @return $monthEnd
*/
public Integer getMonthEnd(){
return this.monthEnd;
}
/**
* 设置 结束 月
* @param monthEnd
*/
public void setMonthEnd(Integer monthEnd){
this.monthEnd = monthEnd;
}
/**
* 获取 增加 月
* @return monthIncrement
*/
public Integer getMonthIncrement(){
return this.monthIncrement;
}
/**
* 设置 增加 月
* @param monthIncrement
*/
public void setMonthIncrement(Integer monthIncrement){
this.monthIncrement = monthIncrement;
}
/**
* 获取 月
* @return monthList
*/
public List<Integer> getMonthList(){
return this.monthList;
}
/**
* 设置 月
* @param monthList
*/
public void setMonthList(List<Integer> monthList){
this.monthList = monthList;
}
/**
* 获取 开始 日
* @return dayStart
*/
public Integer getDayStart(){
return this.dayStart;
}
/**
* 设置 开始 日
* @param dayStart
*/
public void setDayStart(Integer dayStart){
this.dayStart = dayStart;
}
/**
* 获取 结束 日
* @return $dayEnd
*/
public Integer getDayEnd(){
return this.dayEnd;
}
/**
* 设置 结束 日
* @param dayEnd
*/
public void setDayEnd(Integer dayEnd){
this.dayEnd = dayEnd;
}
/**
* 获取 增加 日
* @return dayIncrement
*/
public Integer getDayIncrement(){
return this.dayIncrement;
}
/**
* 设置 增加 日
* @param dayIncrement
*/
public void setDayIncrement(Integer dayIncrement){
this.dayIncrement = dayIncrement;
}
/**
* 获取 日
* @return dayList
*/
public List<Integer> getDayList(){
return this.dayList;
}
/**
* 设置 日
* @param dayList
*/
public void setDayList(List<Integer> dayList){
this.dayList = dayList;
}
/**
* 获取 开始 创建时间
* @return createTimeStart
*/
public String getCreateTimeStart(){
return this.createTimeStart;
}
/**
* 设置 开始 创建时间
* @param createTimeStart
*/
public void setCreateTimeStart(String createTimeStart){
this.createTimeStart = createTimeStart;
}
/**
* 获取 结束 创建时间
* @return createTimeEnd
*/
public String getCreateTimeEnd(){
return this.createTimeEnd;
}
/**
* 设置 结束 创建时间
* @param createTimeEnd
*/
public void setCreateTimeEnd(String createTimeEnd){
this.createTimeEnd = createTimeEnd;
}
/**
* 获取 开始 更新用户
* @return updateUserIdStart
*/
public Long getUpdateUserIdStart(){
return this.updateUserIdStart;
}
/**
* 设置 开始 更新用户
* @param updateUserIdStart
*/
public void setUpdateUserIdStart(Long updateUserIdStart){
this.updateUserIdStart = updateUserIdStart;
}
/**
* 获取 结束 更新用户
* @return $updateUserIdEnd
*/
public Long getUpdateUserIdEnd(){
return this.updateUserIdEnd;
}
/**
* 设置 结束 更新用户
* @param updateUserIdEnd
*/
public void setUpdateUserIdEnd(Long updateUserIdEnd){
this.updateUserIdEnd = updateUserIdEnd;
}
/**
* 获取 增加 更新用户
* @return updateUserIdIncrement
*/
public Long getUpdateUserIdIncrement(){
return this.updateUserIdIncrement;
}
/**
* 设置 增加 更新用户
* @param updateUserIdIncrement
*/
public void setUpdateUserIdIncrement(Long updateUserIdIncrement){
this.updateUserIdIncrement = updateUserIdIncrement;
}
/**
* 获取 更新用户
* @return updateUserIdList
*/
public List<Long> getUpdateUserIdList(){
return this.updateUserIdList;
}
/**
* 设置 更新用户
* @param updateUserIdList
*/
public void setUpdateUserIdList(List<Long> updateUserIdList){
this.updateUserIdList = updateUserIdList;
}
/**
* 获取 开始 更新时间
* @return updateTimeStart
*/
public String getUpdateTimeStart(){
return this.updateTimeStart;
}
/**
* 设置 开始 更新时间
* @param updateTimeStart
*/
public void setUpdateTimeStart(String updateTimeStart){
this.updateTimeStart = updateTimeStart;
}
/**
* 获取 结束 更新时间
* @return updateTimeEnd
*/
public String getUpdateTimeEnd(){
return this.updateTimeEnd;
}
/**
* 设置 结束 更新时间
* @param updateTimeEnd
*/
public void setUpdateTimeEnd(String updateTimeEnd){
this.updateTimeEnd = updateTimeEnd;
}
/**
* 设置 ID
* @param id
*/
public DeviceStatQuery id(Long id){
setId(id);
return this;
}
/**
* 设置 开始 ID
* @param idStart
*/
public DeviceStatQuery idStart(Long idStart){
this.idStart = idStart;
return this;
}
/**
* 设置 结束 ID
* @param idEnd
*/
public DeviceStatQuery idEnd(Long idEnd){
this.idEnd = idEnd;
return this;
}
/**
* 设置 增加 ID
* @param idIncrement
*/
public DeviceStatQuery idIncrement(Long idIncrement){
this.idIncrement = idIncrement;
return this;
}
/**
* 设置 ID
* @param idList
*/
public DeviceStatQuery idList(List<Long> idList){
this.idList = idList;
return this;
}
/**
* 设置 设备总数
* @param deviceTotalCount
*/
public DeviceStatQuery deviceTotalCount(Integer deviceTotalCount){
setDeviceTotalCount(deviceTotalCount);
return this;
}
/**
* 设置 开始 设备总数
* @param deviceTotalCountStart
*/
public DeviceStatQuery deviceTotalCountStart(Integer deviceTotalCountStart){
this.deviceTotalCountStart = deviceTotalCountStart;
return this;
}
/**
* 设置 结束 设备总数
* @param deviceTotalCountEnd
*/
public DeviceStatQuery deviceTotalCountEnd(Integer deviceTotalCountEnd){
this.deviceTotalCountEnd = deviceTotalCountEnd;
return this;
}
/**
* 设置 增加 设备总数
* @param deviceTotalCountIncrement
*/
public DeviceStatQuery deviceTotalCountIncrement(Integer deviceTotalCountIncrement){
this.deviceTotalCountIncrement = deviceTotalCountIncrement;
return this;
}
/**
* 设置 设备总数
* @param deviceTotalCountList
*/
public DeviceStatQuery deviceTotalCountList(List<Integer> deviceTotalCountList){
this.deviceTotalCountList = deviceTotalCountList;
return this;
}
/**
* 设置 昨日新增减少设备数量
* @param deviceAddCount
*/
public DeviceStatQuery deviceAddCount(Integer deviceAddCount){
setDeviceAddCount(deviceAddCount);
return this;
}
/**
* 设置 开始 昨日新增减少设备数量
* @param deviceAddCountStart
*/
public DeviceStatQuery deviceAddCountStart(Integer deviceAddCountStart){
this.deviceAddCountStart = deviceAddCountStart;
return this;
}
/**
* 设置 结束 昨日新增减少设备数量
* @param deviceAddCountEnd
*/
public DeviceStatQuery deviceAddCountEnd(Integer deviceAddCountEnd){
this.deviceAddCountEnd = deviceAddCountEnd;
return this;
}
/**
* 设置 增加 昨日新增减少设备数量
* @param deviceAddCountIncrement
*/
public DeviceStatQuery deviceAddCountIncrement(Integer deviceAddCountIncrement){
this.deviceAddCountIncrement = deviceAddCountIncrement;
return this;
}
/**
* 设置 昨日新增减少设备数量
* @param deviceAddCountList
*/
public DeviceStatQuery deviceAddCountList(List<Integer> deviceAddCountList){
this.deviceAddCountList = deviceAddCountList;
return this;
}
/**
* 设置 监控站点数量
* @param siteTotalCount
*/
public DeviceStatQuery siteTotalCount(Integer siteTotalCount){
setSiteTotalCount(siteTotalCount);
return this;
}
/**
* 设置 开始 监控站点数量
* @param siteTotalCountStart
*/
public DeviceStatQuery siteTotalCountStart(Integer siteTotalCountStart){
this.siteTotalCountStart = siteTotalCountStart;
return this;
}
/**
* 设置 结束 监控站点数量
* @param siteTotalCountEnd
*/
public DeviceStatQuery siteTotalCountEnd(Integer siteTotalCountEnd){
this.siteTotalCountEnd = siteTotalCountEnd;
return this;
}
/**
* 设置 增加 监控站点数量
* @param siteTotalCountIncrement
*/
public DeviceStatQuery siteTotalCountIncrement(Integer siteTotalCountIncrement){
this.siteTotalCountIncrement = siteTotalCountIncrement;
return this;
}
/**
* 设置 监控站点数量
* @param siteTotalCountList
*/
public DeviceStatQuery siteTotalCountList(List<Integer> siteTotalCountList){
this.siteTotalCountList = siteTotalCountList;
return this;
}
/**
* 设置 昨日新增站点数量
* @param siteAddCount
*/
public DeviceStatQuery siteAddCount(Integer siteAddCount){
setSiteAddCount(siteAddCount);
return this;
}
/**
* 设置 开始 昨日新增站点数量
* @param siteAddCountStart
*/
public DeviceStatQuery siteAddCountStart(Integer siteAddCountStart){
this.siteAddCountStart = siteAddCountStart;
return this;
}
/**
* 设置 结束 昨日新增站点数量
* @param siteAddCountEnd
*/
public DeviceStatQuery siteAddCountEnd(Integer siteAddCountEnd){
this.siteAddCountEnd = siteAddCountEnd;
return this;
}
/**
* 设置 增加 昨日新增站点数量
* @param siteAddCountIncrement
*/
public DeviceStatQuery siteAddCountIncrement(Integer siteAddCountIncrement){
this.siteAddCountIncrement = siteAddCountIncrement;
return this;
}
/**
* 设置 昨日新增站点数量
* @param siteAddCountList
*/
public DeviceStatQuery siteAddCountList(List<Integer> siteAddCountList){
this.siteAddCountList = siteAddCountList;
return this;
}
/**
* 设置 在线设备数量
* @param deviceOnlineCount
*/
public DeviceStatQuery deviceOnlineCount(Integer deviceOnlineCount){
setDeviceOnlineCount(deviceOnlineCount);
return this;
}
/**
* 设置 开始 在线设备数量
* @param deviceOnlineCountStart
*/
public DeviceStatQuery deviceOnlineCountStart(Integer deviceOnlineCountStart){
this.deviceOnlineCountStart = deviceOnlineCountStart;
return this;
}
/**
* 设置 结束 在线设备数量
* @param deviceOnlineCountEnd
*/
public DeviceStatQuery deviceOnlineCountEnd(Integer deviceOnlineCountEnd){
this.deviceOnlineCountEnd = deviceOnlineCountEnd;
return this;
}
/**
* 设置 增加 在线设备数量
* @param deviceOnlineCountIncrement
*/
public DeviceStatQuery deviceOnlineCountIncrement(Integer deviceOnlineCountIncrement){
this.deviceOnlineCountIncrement = deviceOnlineCountIncrement;
return this;
}
/**
* 设置 在线设备数量
* @param deviceOnlineCountList
*/
public DeviceStatQuery deviceOnlineCountList(List<Integer> deviceOnlineCountList){
this.deviceOnlineCountList = deviceOnlineCountList;
return this;
}
/**
* 设置 在线率
* @param deviceOnlineRatio
*/
public DeviceStatQuery deviceOnlineRatio(BigDecimal deviceOnlineRatio){
setDeviceOnlineRatio(deviceOnlineRatio);
return this;
}
/**
* 设置 开始 在线率
* @param deviceOnlineRatioStart
*/
public DeviceStatQuery deviceOnlineRatioStart(BigDecimal deviceOnlineRatioStart){
this.deviceOnlineRatioStart = deviceOnlineRatioStart;
return this;
}
/**
* 设置 结束 在线率
* @param deviceOnlineRatioEnd
*/
public DeviceStatQuery deviceOnlineRatioEnd(BigDecimal deviceOnlineRatioEnd){
this.deviceOnlineRatioEnd = deviceOnlineRatioEnd;
return this;
}
/**
* 设置 增加 在线率
* @param deviceOnlineRatioIncrement
*/
public DeviceStatQuery deviceOnlineRatioIncrement(BigDecimal deviceOnlineRatioIncrement){
this.deviceOnlineRatioIncrement = deviceOnlineRatioIncrement;
return this;
}
/**
* 设置 在线率
* @param deviceOnlineRatioList
*/
public DeviceStatQuery deviceOnlineRatioList(List<BigDecimal> deviceOnlineRatioList){
this.deviceOnlineRatioList = deviceOnlineRatioList;
return this;
}
/**
* 设置 离线设备数量
* @param deviceOfflineCount
*/
public DeviceStatQuery deviceOfflineCount(Integer deviceOfflineCount){
setDeviceOfflineCount(deviceOfflineCount);
return this;
}
/**
* 设置 开始 离线设备数量
* @param deviceOfflineCountStart
*/
public DeviceStatQuery deviceOfflineCountStart(Integer deviceOfflineCountStart){
this.deviceOfflineCountStart = deviceOfflineCountStart;
return this;
}
/**
* 设置 结束 离线设备数量
* @param deviceOfflineCountEnd
*/
public DeviceStatQuery deviceOfflineCountEnd(Integer deviceOfflineCountEnd){
this.deviceOfflineCountEnd = deviceOfflineCountEnd;
return this;
}
/**
* 设置 增加 离线设备数量
* @param deviceOfflineCountIncrement
*/
public DeviceStatQuery deviceOfflineCountIncrement(Integer deviceOfflineCountIncrement){
this.deviceOfflineCountIncrement = deviceOfflineCountIncrement;
return this;
}
/**
* 设置 离线设备数量
* @param deviceOfflineCountList
*/
public DeviceStatQuery deviceOfflineCountList(List<Integer> deviceOfflineCountList){
this.deviceOfflineCountList = deviceOfflineCountList;
return this;
}
/**
* 设置 离线率
* @param deviceOfflineRatio
*/
public DeviceStatQuery deviceOfflineRatio(BigDecimal deviceOfflineRatio){
setDeviceOfflineRatio(deviceOfflineRatio);
return this;
}
/**
* 设置 开始 离线率
* @param deviceOfflineRatioStart
*/
public DeviceStatQuery deviceOfflineRatioStart(BigDecimal deviceOfflineRatioStart){
this.deviceOfflineRatioStart = deviceOfflineRatioStart;
return this;
}
/**
* 设置 结束 离线率
* @param deviceOfflineRatioEnd
*/
public DeviceStatQuery deviceOfflineRatioEnd(BigDecimal deviceOfflineRatioEnd){
this.deviceOfflineRatioEnd = deviceOfflineRatioEnd;
return this;
}
/**
* 设置 增加 离线率
* @param deviceOfflineRatioIncrement
*/
public DeviceStatQuery deviceOfflineRatioIncrement(BigDecimal deviceOfflineRatioIncrement){
this.deviceOfflineRatioIncrement = deviceOfflineRatioIncrement;
return this;
}
/**
* 设置 离线率
* @param deviceOfflineRatioList
*/
public DeviceStatQuery deviceOfflineRatioList(List<BigDecimal> deviceOfflineRatioList){
this.deviceOfflineRatioList = deviceOfflineRatioList;
return this;
}
/**
* 设置 停用设备数量
* @param deviceStopCount
*/
public DeviceStatQuery deviceStopCount(Integer deviceStopCount){
setDeviceStopCount(deviceStopCount);
return this;
}
/**
* 设置 开始 停用设备数量
* @param deviceStopCountStart
*/
public DeviceStatQuery deviceStopCountStart(Integer deviceStopCountStart){
this.deviceStopCountStart = deviceStopCountStart;
return this;
}
/**
* 设置 结束 停用设备数量
* @param deviceStopCountEnd
*/
public DeviceStatQuery deviceStopCountEnd(Integer deviceStopCountEnd){
this.deviceStopCountEnd = deviceStopCountEnd;
return this;
}
/**
* 设置 增加 停用设备数量
* @param deviceStopCountIncrement
*/
public DeviceStatQuery deviceStopCountIncrement(Integer deviceStopCountIncrement){
this.deviceStopCountIncrement = deviceStopCountIncrement;
return this;
}
/**
* 设置 停用设备数量
* @param deviceStopCountList
*/
public DeviceStatQuery deviceStopCountList(List<Integer> deviceStopCountList){
this.deviceStopCountList = deviceStopCountList;
return this;
}
/**
* 设置 停用率
* @param deviceStopRatio
*/
public DeviceStatQuery deviceStopRatio(BigDecimal deviceStopRatio){
setDeviceStopRatio(deviceStopRatio);
return this;
}
/**
* 设置 开始 停用率
* @param deviceStopRatioStart
*/
public DeviceStatQuery deviceStopRatioStart(BigDecimal deviceStopRatioStart){
this.deviceStopRatioStart = deviceStopRatioStart;
return this;
}
/**
* 设置 结束 停用率
* @param deviceStopRatioEnd
*/
public DeviceStatQuery deviceStopRatioEnd(BigDecimal deviceStopRatioEnd){
this.deviceStopRatioEnd = deviceStopRatioEnd;
return this;
}
/**
* 设置 增加 停用率
* @param deviceStopRatioIncrement
*/
public DeviceStatQuery deviceStopRatioIncrement(BigDecimal deviceStopRatioIncrement){
this.deviceStopRatioIncrement = deviceStopRatioIncrement;
return this;
}
/**
* 设置 停用率
* @param deviceStopRatioList
*/
public DeviceStatQuery deviceStopRatioList(List<BigDecimal> deviceStopRatioList){
this.deviceStopRatioList = deviceStopRatioList;
return this;
}
/**
* 设置 今日告警数量
* @param alarmTotalCount
*/
public DeviceStatQuery alarmTotalCount(Integer alarmTotalCount){
setAlarmTotalCount(alarmTotalCount);
return this;
}
/**
* 设置 开始 今日告警数量
* @param alarmTotalCountStart
*/
public DeviceStatQuery alarmTotalCountStart(Integer alarmTotalCountStart){
this.alarmTotalCountStart = alarmTotalCountStart;
return this;
}
/**
* 设置 结束 今日告警数量
* @param alarmTotalCountEnd
*/
public DeviceStatQuery alarmTotalCountEnd(Integer alarmTotalCountEnd){
this.alarmTotalCountEnd = alarmTotalCountEnd;
return this;
}
/**
* 设置 增加 今日告警数量
* @param alarmTotalCountIncrement
*/
public DeviceStatQuery alarmTotalCountIncrement(Integer alarmTotalCountIncrement){
this.alarmTotalCountIncrement = alarmTotalCountIncrement;
return this;
}
/**
* 设置 今日告警数量
* @param alarmTotalCountList
*/
public DeviceStatQuery alarmTotalCountList(List<Integer> alarmTotalCountList){
this.alarmTotalCountList = alarmTotalCountList;
return this;
}
/**
* 设置 昨日新增减少数量
* @param alarmAddCount
*/
public DeviceStatQuery alarmAddCount(Integer alarmAddCount){
setAlarmAddCount(alarmAddCount);
return this;
}
/**
* 设置 开始 昨日新增减少数量
* @param alarmAddCountStart
*/
public DeviceStatQuery alarmAddCountStart(Integer alarmAddCountStart){
this.alarmAddCountStart = alarmAddCountStart;
return this;
}
/**
* 设置 结束 昨日新增减少数量
* @param alarmAddCountEnd
*/
public DeviceStatQuery alarmAddCountEnd(Integer alarmAddCountEnd){
this.alarmAddCountEnd = alarmAddCountEnd;
return this;
}
/**
* 设置 增加 昨日新增减少数量
* @param alarmAddCountIncrement
*/
public DeviceStatQuery alarmAddCountIncrement(Integer alarmAddCountIncrement){
this.alarmAddCountIncrement = alarmAddCountIncrement;
return this;
}
/**
* 设置 昨日新增减少数量
* @param alarmAddCountList
*/
public DeviceStatQuery alarmAddCountList(List<Integer> alarmAddCountList){
this.alarmAddCountList = alarmAddCountList;
return this;
}
/**
* 设置 今日消息推送数量
* @param pushTotalCount
*/
public DeviceStatQuery pushTotalCount(Integer pushTotalCount){
setPushTotalCount(pushTotalCount);
return this;
}
/**
* 设置 开始 今日消息推送数量
* @param pushTotalCountStart
*/
public DeviceStatQuery pushTotalCountStart(Integer pushTotalCountStart){
this.pushTotalCountStart = pushTotalCountStart;
return this;
}
/**
* 设置 结束 今日消息推送数量
* @param pushTotalCountEnd
*/
public DeviceStatQuery pushTotalCountEnd(Integer pushTotalCountEnd){
this.pushTotalCountEnd = pushTotalCountEnd;
return this;
}
/**
* 设置 增加 今日消息推送数量
* @param pushTotalCountIncrement
*/
public DeviceStatQuery pushTotalCountIncrement(Integer pushTotalCountIncrement){
this.pushTotalCountIncrement = pushTotalCountIncrement;
return this;
}
/**
* 设置 今日消息推送数量
* @param pushTotalCountList
*/
public DeviceStatQuery pushTotalCountList(List<Integer> pushTotalCountList){
this.pushTotalCountList = pushTotalCountList;
return this;
}
/**
* 设置 昨日新增减少数量
* @param pushAddCount
*/
public DeviceStatQuery pushAddCount(Integer pushAddCount){
setPushAddCount(pushAddCount);
return this;
}
/**
* 设置 开始 昨日新增减少数量
* @param pushAddCountStart
*/
public DeviceStatQuery pushAddCountStart(Integer pushAddCountStart){
this.pushAddCountStart = pushAddCountStart;
return this;
}
/**
* 设置 结束 昨日新增减少数量
* @param pushAddCountEnd
*/
public DeviceStatQuery pushAddCountEnd(Integer pushAddCountEnd){
this.pushAddCountEnd = pushAddCountEnd;
return this;
}
/**
* 设置 增加 昨日新增减少数量
* @param pushAddCountIncrement
*/
public DeviceStatQuery pushAddCountIncrement(Integer pushAddCountIncrement){
this.pushAddCountIncrement = pushAddCountIncrement;
return this;
}
/**
* 设置 昨日新增减少数量
* @param pushAddCountList
*/
public DeviceStatQuery pushAddCountList(List<Integer> pushAddCountList){
this.pushAddCountList = pushAddCountList;
return this;
}
/**
* 设置 今日上行消息数量
* @param uploadMessageTotalCount
*/
public DeviceStatQuery uploadMessageTotalCount(Integer uploadMessageTotalCount){
setUploadMessageTotalCount(uploadMessageTotalCount);
return this;
}
/**
* 设置 开始 今日上行消息数量
* @param uploadMessageTotalCountStart
*/
public DeviceStatQuery uploadMessageTotalCountStart(Integer uploadMessageTotalCountStart){
this.uploadMessageTotalCountStart = uploadMessageTotalCountStart;
return this;
}
/**
* 设置 结束 今日上行消息数量
* @param uploadMessageTotalCountEnd
*/
public DeviceStatQuery uploadMessageTotalCountEnd(Integer uploadMessageTotalCountEnd){
this.uploadMessageTotalCountEnd = uploadMessageTotalCountEnd;
return this;
}
/**
* 设置 增加 今日上行消息数量
* @param uploadMessageTotalCountIncrement
*/
public DeviceStatQuery uploadMessageTotalCountIncrement(Integer uploadMessageTotalCountIncrement){
this.uploadMessageTotalCountIncrement = uploadMessageTotalCountIncrement;
return this;
}
/**
* 设置 今日上行消息数量
* @param uploadMessageTotalCountList
*/
public DeviceStatQuery uploadMessageTotalCountList(List<Integer> uploadMessageTotalCountList){
this.uploadMessageTotalCountList = uploadMessageTotalCountList;
return this;
}
/**
* 设置 今日下行消息数量
* @param downloadMessageTotalCount
*/
public DeviceStatQuery downloadMessageTotalCount(Integer downloadMessageTotalCount){
setDownloadMessageTotalCount(downloadMessageTotalCount);
return this;
}
/**
* 设置 开始 今日下行消息数量
* @param downloadMessageTotalCountStart
*/
public DeviceStatQuery downloadMessageTotalCountStart(Integer downloadMessageTotalCountStart){
this.downloadMessageTotalCountStart = downloadMessageTotalCountStart;
return this;
}
/**
* 设置 结束 今日下行消息数量
* @param downloadMessageTotalCountEnd
*/
public DeviceStatQuery downloadMessageTotalCountEnd(Integer downloadMessageTotalCountEnd){
this.downloadMessageTotalCountEnd = downloadMessageTotalCountEnd;
return this;
}
/**
* 设置 增加 今日下行消息数量
* @param downloadMessageTotalCountIncrement
*/
public DeviceStatQuery downloadMessageTotalCountIncrement(Integer downloadMessageTotalCountIncrement){
this.downloadMessageTotalCountIncrement = downloadMessageTotalCountIncrement;
return this;
}
/**
* 设置 今日下行消息数量
* @param downloadMessageTotalCountList
*/
public DeviceStatQuery downloadMessageTotalCountList(List<Integer> downloadMessageTotalCountList){
this.downloadMessageTotalCountList = downloadMessageTotalCountList;
return this;
}
/**
* 设置 年
* @param year
*/
public DeviceStatQuery year(Integer year){
setYear(year);
return this;
}
/**
* 设置 开始 年
* @param yearStart
*/
public DeviceStatQuery yearStart(Integer yearStart){
this.yearStart = yearStart;
return this;
}
/**
* 设置 结束 年
* @param yearEnd
*/
public DeviceStatQuery yearEnd(Integer yearEnd){
this.yearEnd = yearEnd;
return this;
}
/**
* 设置 增加 年
* @param yearIncrement
*/
public DeviceStatQuery yearIncrement(Integer yearIncrement){
this.yearIncrement = yearIncrement;
return this;
}
/**
* 设置 年
* @param yearList
*/
public DeviceStatQuery yearList(List<Integer> yearList){
this.yearList = yearList;
return this;
}
/**
* 设置 月
* @param month
*/
public DeviceStatQuery month(Integer month){
setMonth(month);
return this;
}
/**
* 设置 开始 月
* @param monthStart
*/
public DeviceStatQuery monthStart(Integer monthStart){
this.monthStart = monthStart;
return this;
}
/**
* 设置 结束 月
* @param monthEnd
*/
public DeviceStatQuery monthEnd(Integer monthEnd){
this.monthEnd = monthEnd;
return this;
}
/**
* 设置 增加 月
* @param monthIncrement
*/
public DeviceStatQuery monthIncrement(Integer monthIncrement){
this.monthIncrement = monthIncrement;
return this;
}
/**
* 设置 月
* @param monthList
*/
public DeviceStatQuery monthList(List<Integer> monthList){
this.monthList = monthList;
return this;
}
/**
* 设置 日
* @param day
*/
public DeviceStatQuery day(Integer day){
setDay(day);
return this;
}
/**
* 设置 开始 日
* @param dayStart
*/
public DeviceStatQuery dayStart(Integer dayStart){
this.dayStart = dayStart;
return this;
}
/**
* 设置 结束 日
* @param dayEnd
*/
public DeviceStatQuery dayEnd(Integer dayEnd){
this.dayEnd = dayEnd;
return this;
}
/**
* 设置 增加 日
* @param dayIncrement
*/
public DeviceStatQuery dayIncrement(Integer dayIncrement){
this.dayIncrement = dayIncrement;
return this;
}
/**
* 设置 日
* @param dayList
*/
public DeviceStatQuery dayList(List<Integer> dayList){
this.dayList = dayList;
return this;
}
/**
* 设置 更新用户
* @param updateUserId
*/
public DeviceStatQuery updateUserId(Long updateUserId){
setUpdateUserId(updateUserId);
return this;
}
/**
* 设置 开始 更新用户
* @param updateUserIdStart
*/
public DeviceStatQuery updateUserIdStart(Long updateUserIdStart){
this.updateUserIdStart = updateUserIdStart;
return this;
}
/**
* 设置 结束 更新用户
* @param updateUserIdEnd
*/
public DeviceStatQuery updateUserIdEnd(Long updateUserIdEnd){
this.updateUserIdEnd = updateUserIdEnd;
return this;
}
/**
* 设置 增加 更新用户
* @param updateUserIdIncrement
*/
public DeviceStatQuery updateUserIdIncrement(Long updateUserIdIncrement){
this.updateUserIdIncrement = updateUserIdIncrement;
return this;
}
/**
* 设置 更新用户
* @param updateUserIdList
*/
public DeviceStatQuery updateUserIdList(List<Long> updateUserIdList){
this.updateUserIdList = updateUserIdList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
*/
public List<DeviceStatQuery> getOrConditionList(){
return this.orConditionList;
}
/**
* 设置 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @param orConditionList
*/
public void setOrConditionList(List<DeviceStatQuery> orConditionList){
this.orConditionList = orConditionList;
}
/**
* 获取 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @return andConditionList
*/
public List<DeviceStatQuery> getAndConditionList(){
return this.andConditionList;
}
/**
* 设置 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @param andConditionList
*/
public void setAndConditionList(List<DeviceStatQuery> andConditionList){
this.andConditionList = andConditionList;
}
}
\ No newline at end of file
package com.mortals.xhx.module.device.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.device.model.DeviceStatEntity;
import java.util.ArrayList;
import java.util.List;
/**
* 设备统计视图对象
*
* @author zxfei
* @date 2022-07-05
*/
public class DeviceStatVo extends BaseEntityLong {
}
\ No newline at end of file
package com.mortals.xhx.module.device.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.device.model.DeviceStatEntity;
/**
* DeviceStatService
*
* 设备统计 service接口
*
* @author zxfei
* @date 2022-07-05
*/
public interface DeviceStatService extends ICRUDService<DeviceStatEntity,Long>{
}
\ No newline at end of file
package com.mortals.xhx.module.device.service.impl;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.device.dao.DeviceStatDao;
import com.mortals.xhx.module.device.model.DeviceStatEntity;
import com.mortals.xhx.module.device.service.DeviceStatService;
/**
* DeviceStatService
* 设备统计 service实现
*
* @author zxfei
* @date 2022-07-05
*/
@Service("deviceStatService")
public class DeviceStatServiceImpl extends AbstractCRUDServiceImpl<DeviceStatDao, DeviceStatEntity, Long> implements DeviceStatService {
}
\ No newline at end of file
...@@ -9,6 +9,7 @@ import com.mortals.framework.model.Context; ...@@ -9,6 +9,7 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.message.MessageService; import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.busiz.rsp.ApiResp; import com.mortals.xhx.busiz.rsp.ApiResp;
import com.mortals.xhx.common.code.ApiRespCodeEnum; import com.mortals.xhx.common.code.ApiRespCodeEnum;
import com.mortals.xhx.common.code.DeviceStatusEnum; import com.mortals.xhx.common.code.DeviceStatusEnum;
...@@ -18,6 +19,7 @@ import com.mortals.xhx.common.model.DefaultTbQueueMsgHeaders; ...@@ -18,6 +19,7 @@ import com.mortals.xhx.common.model.DefaultTbQueueMsgHeaders;
import com.mortals.xhx.common.model.MessageHeader; import com.mortals.xhx.common.model.MessageHeader;
import com.mortals.xhx.feign.site.ISiteFeign; import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.module.device.model.DeviceEntity; import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceQuery;
import com.mortals.xhx.module.device.service.DeviceService; import com.mortals.xhx.module.device.service.DeviceService;
import com.mortals.xhx.module.firm.model.FirmEntity; import com.mortals.xhx.module.firm.model.FirmEntity;
import com.mortals.xhx.module.firm.service.FirmService; import com.mortals.xhx.module.firm.service.FirmService;
...@@ -190,4 +192,56 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe ...@@ -190,4 +192,56 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
} }
return super.doListAfter(query, model, context); return super.doListAfter(query, model, context);
} }
/**
* 首页统计
*/
@PostMapping(value = "indexStat")
public String indexStat() {
JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>();
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "");
try {
//设备基础统计
/*UserEntity userEntity = userService.get(getContext().getUser().getId());
if(userEntity == null){
throw new AppException("暂未登录!");
}
//登录名
model.put("loginName", userEntity.getRealName());
//最后登陆时间
model.put("LastLoginTime", userEntity.getLastLoginTime());
//供应商数量
model.put("supplierCount", supplierService.count(new SupplierQuery(),getContext()));
//工作人员数量
model.put("workmanCount", workmanService.count(new WorkmanQuery(), getContext()));
//房间数量
model.put("roomCount", roomService.count(new RoomQuery(), getContext()));
//设备数量
model.put("deviceCount", deviceService.count(new DeviceQuery(), getContext()));
//专家数量
model.put("specialistCount", specialistService.count(new SpecialistQuery(), getContext()));
//待办
List<ProjectEntity> list = this.service.pendTask(getContext());
model.put("pendList", list);
//统计信息
ProjectStat projectStat = this.service.projectStat(getContext());
model.put("projectStat", projectStat);
//查询当天项目情况
List<ProjectEntity> dayProjectList = this.service.getProjectByDay(null, getContext());
model.put("dayProjectList", dayProjectList);
this.init(request, response, null, model, getContext());*/
jsonObject.put(KEY_RESULT_DATA, model);
recordSysLog(request, "首页统计 【成功】");
} catch (Exception e) {
log.error("异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
} }
\ No newline at end of file
package com.mortals.xhx.module.device.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.device.model.DeviceStatEntity;
import com.mortals.xhx.module.device.service.DeviceStatService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 设备统计
*
* @author zxfei
* @date 2022-07-05
*/
@RestController
@RequestMapping("device/stat")
public class DeviceStatController extends BaseCRUDJsonBodyMappingController<DeviceStatService,DeviceStatEntity,Long> {
@Autowired
private ParamService paramService;
public DeviceStatController(){
super.setModuleDesc( "设备统计");
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.device.dao.ibatis.DeviceStatDaoImpl">
<!-- 字段和属性映射 -->
<resultMap type="DeviceStatEntity" id="DeviceStatEntity-Map">
<id property="id" column="id" />
<result property="deviceTotalCount" column="deviceTotalCount" />
<result property="deviceAddCount" column="deviceAddCount" />
<result property="siteTotalCount" column="siteTotalCount" />
<result property="siteAddCount" column="siteAddCount" />
<result property="deviceOnlineCount" column="deviceOnlineCount" />
<result property="deviceOnlineRatio" column="deviceOnlineRatio" />
<result property="deviceOfflineCount" column="deviceOfflineCount" />
<result property="deviceOfflineRatio" column="deviceOfflineRatio" />
<result property="deviceStopCount" column="deviceStopCount" />
<result property="deviceStopRatio" column="deviceStopRatio" />
<result property="alarmTotalCount" column="alarmTotalCount" />
<result property="alarmAddCount" column="alarmAddCount" />
<result property="pushTotalCount" column="pushTotalCount" />
<result property="pushAddCount" column="pushAddCount" />
<result property="uploadMessageTotalCount" column="uploadMessageTotalCount" />
<result property="downloadMessageTotalCount" column="downloadMessageTotalCount" />
<result property="year" column="year" />
<result property="month" column="month" />
<result property="day" column="day" />
<result property="createTime" column="createTime" />
<result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" />
</resultMap>
<!-- 表所有列 -->
<sql id="_columns">
<trim suffixOverrides="," suffix="">
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
a.id,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceTotalCount') or colPickMode == 1 and data.containsKey('deviceTotalCount')))">
a.deviceTotalCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceAddCount') or colPickMode == 1 and data.containsKey('deviceAddCount')))">
a.deviceAddCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteTotalCount') or colPickMode == 1 and data.containsKey('siteTotalCount')))">
a.siteTotalCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteAddCount') or colPickMode == 1 and data.containsKey('siteAddCount')))">
a.siteAddCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceOnlineCount') or colPickMode == 1 and data.containsKey('deviceOnlineCount')))">
a.deviceOnlineCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceOnlineRatio') or colPickMode == 1 and data.containsKey('deviceOnlineRatio')))">
a.deviceOnlineRatio,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceOfflineCount') or colPickMode == 1 and data.containsKey('deviceOfflineCount')))">
a.deviceOfflineCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceOfflineRatio') or colPickMode == 1 and data.containsKey('deviceOfflineRatio')))">
a.deviceOfflineRatio,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceStopCount') or colPickMode == 1 and data.containsKey('deviceStopCount')))">
a.deviceStopCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceStopRatio') or colPickMode == 1 and data.containsKey('deviceStopRatio')))">
a.deviceStopRatio,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('alarmTotalCount') or colPickMode == 1 and data.containsKey('alarmTotalCount')))">
a.alarmTotalCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('alarmAddCount') or colPickMode == 1 and data.containsKey('alarmAddCount')))">
a.alarmAddCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('pushTotalCount') or colPickMode == 1 and data.containsKey('pushTotalCount')))">
a.pushTotalCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('pushAddCount') or colPickMode == 1 and data.containsKey('pushAddCount')))">
a.pushAddCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('uploadMessageTotalCount') or colPickMode == 1 and data.containsKey('uploadMessageTotalCount')))">
a.uploadMessageTotalCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('downloadMessageTotalCount') or colPickMode == 1 and data.containsKey('downloadMessageTotalCount')))">
a.downloadMessageTotalCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('year') or colPickMode == 1 and data.containsKey('year')))">
a.year,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('month') or colPickMode == 1 and data.containsKey('month')))">
a.month,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('day') or colPickMode == 1 and data.containsKey('day')))">
a.day,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
a.createTime,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateUserId') or colPickMode == 1 and data.containsKey('updateUserId')))">
a.updateUserId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DeviceStatEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_device_stat
(deviceTotalCount,deviceAddCount,siteTotalCount,siteAddCount,deviceOnlineCount,deviceOnlineRatio,deviceOfflineCount,deviceOfflineRatio,deviceStopCount,deviceStopRatio,alarmTotalCount,alarmAddCount,pushTotalCount,pushAddCount,uploadMessageTotalCount,downloadMessageTotalCount,year,month,day,createTime,updateUserId,updateTime)
VALUES
(#{deviceTotalCount},#{deviceAddCount},#{siteTotalCount},#{siteAddCount},#{deviceOnlineCount},#{deviceOnlineRatio},#{deviceOfflineCount},#{deviceOfflineRatio},#{deviceStopCount},#{deviceStopRatio},#{alarmTotalCount},#{alarmAddCount},#{pushTotalCount},#{pushAddCount},#{uploadMessageTotalCount},#{downloadMessageTotalCount},#{year},#{month},#{day},#{createTime},#{updateUserId},#{updateTime})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_device_stat
(deviceTotalCount,deviceAddCount,siteTotalCount,siteAddCount,deviceOnlineCount,deviceOnlineRatio,deviceOfflineCount,deviceOfflineRatio,deviceStopCount,deviceStopRatio,alarmTotalCount,alarmAddCount,pushTotalCount,pushAddCount,uploadMessageTotalCount,downloadMessageTotalCount,year,month,day,createTime,updateUserId,updateTime)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.deviceTotalCount},#{item.deviceAddCount},#{item.siteTotalCount},#{item.siteAddCount},#{item.deviceOnlineCount},#{item.deviceOnlineRatio},#{item.deviceOfflineCount},#{item.deviceOfflineRatio},#{item.deviceStopCount},#{item.deviceStopRatio},#{item.alarmTotalCount},#{item.alarmAddCount},#{item.pushTotalCount},#{item.pushAddCount},#{item.uploadMessageTotalCount},#{item.downloadMessageTotalCount},#{item.year},#{item.month},#{item.day},#{item.createTime},#{item.updateUserId},#{item.updateTime})
</foreach>
</insert>
<!-- 根据ParamDto更新 -->
<update id="update" parameterType="paramDto">
update mortals_xhx_device_stat as a
set
<trim suffixOverrides="," suffix="">
<if test="(colPickMode==0 and data.containsKey('deviceTotalCount')) or (colPickMode==1 and !data.containsKey('deviceTotalCount'))">
a.deviceTotalCount=#{data.deviceTotalCount},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceTotalCountIncrement')) or (colPickMode==1 and !data.containsKey('deviceTotalCountIncrement'))">
a.deviceTotalCount=ifnull(a.deviceTotalCount,0) + #{data.deviceTotalCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceAddCount')) or (colPickMode==1 and !data.containsKey('deviceAddCount'))">
a.deviceAddCount=#{data.deviceAddCount},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceAddCountIncrement')) or (colPickMode==1 and !data.containsKey('deviceAddCountIncrement'))">
a.deviceAddCount=ifnull(a.deviceAddCount,0) + #{data.deviceAddCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('siteTotalCount')) or (colPickMode==1 and !data.containsKey('siteTotalCount'))">
a.siteTotalCount=#{data.siteTotalCount},
</if>
<if test="(colPickMode==0 and data.containsKey('siteTotalCountIncrement')) or (colPickMode==1 and !data.containsKey('siteTotalCountIncrement'))">
a.siteTotalCount=ifnull(a.siteTotalCount,0) + #{data.siteTotalCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('siteAddCount')) or (colPickMode==1 and !data.containsKey('siteAddCount'))">
a.siteAddCount=#{data.siteAddCount},
</if>
<if test="(colPickMode==0 and data.containsKey('siteAddCountIncrement')) or (colPickMode==1 and !data.containsKey('siteAddCountIncrement'))">
a.siteAddCount=ifnull(a.siteAddCount,0) + #{data.siteAddCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceOnlineCount')) or (colPickMode==1 and !data.containsKey('deviceOnlineCount'))">
a.deviceOnlineCount=#{data.deviceOnlineCount},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceOnlineCountIncrement')) or (colPickMode==1 and !data.containsKey('deviceOnlineCountIncrement'))">
a.deviceOnlineCount=ifnull(a.deviceOnlineCount,0) + #{data.deviceOnlineCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceOnlineRatio')) or (colPickMode==1 and !data.containsKey('deviceOnlineRatio'))">
a.deviceOnlineRatio=#{data.deviceOnlineRatio},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceOnlineRatioIncrement')) or (colPickMode==1 and !data.containsKey('deviceOnlineRatioIncrement'))">
a.deviceOnlineRatio=ifnull(a.deviceOnlineRatio,0) + #{data.deviceOnlineRatioIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceOfflineCount')) or (colPickMode==1 and !data.containsKey('deviceOfflineCount'))">
a.deviceOfflineCount=#{data.deviceOfflineCount},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceOfflineCountIncrement')) or (colPickMode==1 and !data.containsKey('deviceOfflineCountIncrement'))">
a.deviceOfflineCount=ifnull(a.deviceOfflineCount,0) + #{data.deviceOfflineCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceOfflineRatio')) or (colPickMode==1 and !data.containsKey('deviceOfflineRatio'))">
a.deviceOfflineRatio=#{data.deviceOfflineRatio},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceOfflineRatioIncrement')) or (colPickMode==1 and !data.containsKey('deviceOfflineRatioIncrement'))">
a.deviceOfflineRatio=ifnull(a.deviceOfflineRatio,0) + #{data.deviceOfflineRatioIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceStopCount')) or (colPickMode==1 and !data.containsKey('deviceStopCount'))">
a.deviceStopCount=#{data.deviceStopCount},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceStopCountIncrement')) or (colPickMode==1 and !data.containsKey('deviceStopCountIncrement'))">
a.deviceStopCount=ifnull(a.deviceStopCount,0) + #{data.deviceStopCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceStopRatio')) or (colPickMode==1 and !data.containsKey('deviceStopRatio'))">
a.deviceStopRatio=#{data.deviceStopRatio},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceStopRatioIncrement')) or (colPickMode==1 and !data.containsKey('deviceStopRatioIncrement'))">
a.deviceStopRatio=ifnull(a.deviceStopRatio,0) + #{data.deviceStopRatioIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('alarmTotalCount')) or (colPickMode==1 and !data.containsKey('alarmTotalCount'))">
a.alarmTotalCount=#{data.alarmTotalCount},
</if>
<if test="(colPickMode==0 and data.containsKey('alarmTotalCountIncrement')) or (colPickMode==1 and !data.containsKey('alarmTotalCountIncrement'))">
a.alarmTotalCount=ifnull(a.alarmTotalCount,0) + #{data.alarmTotalCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('alarmAddCount')) or (colPickMode==1 and !data.containsKey('alarmAddCount'))">
a.alarmAddCount=#{data.alarmAddCount},
</if>
<if test="(colPickMode==0 and data.containsKey('alarmAddCountIncrement')) or (colPickMode==1 and !data.containsKey('alarmAddCountIncrement'))">
a.alarmAddCount=ifnull(a.alarmAddCount,0) + #{data.alarmAddCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('pushTotalCount')) or (colPickMode==1 and !data.containsKey('pushTotalCount'))">
a.pushTotalCount=#{data.pushTotalCount},
</if>
<if test="(colPickMode==0 and data.containsKey('pushTotalCountIncrement')) or (colPickMode==1 and !data.containsKey('pushTotalCountIncrement'))">
a.pushTotalCount=ifnull(a.pushTotalCount,0) + #{data.pushTotalCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('pushAddCount')) or (colPickMode==1 and !data.containsKey('pushAddCount'))">
a.pushAddCount=#{data.pushAddCount},
</if>
<if test="(colPickMode==0 and data.containsKey('pushAddCountIncrement')) or (colPickMode==1 and !data.containsKey('pushAddCountIncrement'))">
a.pushAddCount=ifnull(a.pushAddCount,0) + #{data.pushAddCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('uploadMessageTotalCount')) or (colPickMode==1 and !data.containsKey('uploadMessageTotalCount'))">
a.uploadMessageTotalCount=#{data.uploadMessageTotalCount},
</if>
<if test="(colPickMode==0 and data.containsKey('uploadMessageTotalCountIncrement')) or (colPickMode==1 and !data.containsKey('uploadMessageTotalCountIncrement'))">
a.uploadMessageTotalCount=ifnull(a.uploadMessageTotalCount,0) + #{data.uploadMessageTotalCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('downloadMessageTotalCount')) or (colPickMode==1 and !data.containsKey('downloadMessageTotalCount'))">
a.downloadMessageTotalCount=#{data.downloadMessageTotalCount},
</if>
<if test="(colPickMode==0 and data.containsKey('downloadMessageTotalCountIncrement')) or (colPickMode==1 and !data.containsKey('downloadMessageTotalCountIncrement'))">
a.downloadMessageTotalCount=ifnull(a.downloadMessageTotalCount,0) + #{data.downloadMessageTotalCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('year')) or (colPickMode==1 and !data.containsKey('year'))">
a.year=#{data.year},
</if>
<if test="(colPickMode==0 and data.containsKey('yearIncrement')) or (colPickMode==1 and !data.containsKey('yearIncrement'))">
a.year=ifnull(a.year,0) + #{data.yearIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('month')) or (colPickMode==1 and !data.containsKey('month'))">
a.month=#{data.month},
</if>
<if test="(colPickMode==0 and data.containsKey('monthIncrement')) or (colPickMode==1 and !data.containsKey('monthIncrement'))">
a.month=ifnull(a.month,0) + #{data.monthIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('day')) or (colPickMode==1 and !data.containsKey('day'))">
a.day=#{data.day},
</if>
<if test="(colPickMode==0 and data.containsKey('dayIncrement')) or (colPickMode==1 and !data.containsKey('dayIncrement'))">
a.day=ifnull(a.day,0) + #{data.dayIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
a.createTime=#{data.createTime},
</if>
<if test="(colPickMode==0 and data.containsKey('updateUserId')) or (colPickMode==1 and !data.containsKey('updateUserId'))">
a.updateUserId=#{data.updateUserId},
</if>
<if test="(colPickMode==0 and data.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !data.containsKey('updateUserIdIncrement'))">
a.updateUserId=ifnull(a.updateUserId,0) + #{data.updateUserIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.updateTime=#{data.updateTime},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</update>
<!-- 批量更新 -->
<update id="updateBatch" parameterType="paramDto">
update mortals_xhx_device_stat as a
<trim prefix="set" suffixOverrides=",">
<trim prefix="deviceTotalCount=(case" suffix="ELSE deviceTotalCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deviceTotalCount')) or (colPickMode==1 and !item.containsKey('deviceTotalCount'))">
when a.id=#{item.id} then #{item.deviceTotalCount}
</when>
<when test="(colPickMode==0 and item.containsKey('deviceTotalCountIncrement')) or (colPickMode==1 and !item.containsKey('deviceTotalCountIncrement'))">
when a.id=#{item.id} then ifnull(a.deviceTotalCount,0) + #{item.deviceTotalCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deviceAddCount=(case" suffix="ELSE deviceAddCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deviceAddCount')) or (colPickMode==1 and !item.containsKey('deviceAddCount'))">
when a.id=#{item.id} then #{item.deviceAddCount}
</when>
<when test="(colPickMode==0 and item.containsKey('deviceAddCountIncrement')) or (colPickMode==1 and !item.containsKey('deviceAddCountIncrement'))">
when a.id=#{item.id} then ifnull(a.deviceAddCount,0) + #{item.deviceAddCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="siteTotalCount=(case" suffix="ELSE siteTotalCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('siteTotalCount')) or (colPickMode==1 and !item.containsKey('siteTotalCount'))">
when a.id=#{item.id} then #{item.siteTotalCount}
</when>
<when test="(colPickMode==0 and item.containsKey('siteTotalCountIncrement')) or (colPickMode==1 and !item.containsKey('siteTotalCountIncrement'))">
when a.id=#{item.id} then ifnull(a.siteTotalCount,0) + #{item.siteTotalCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="siteAddCount=(case" suffix="ELSE siteAddCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('siteAddCount')) or (colPickMode==1 and !item.containsKey('siteAddCount'))">
when a.id=#{item.id} then #{item.siteAddCount}
</when>
<when test="(colPickMode==0 and item.containsKey('siteAddCountIncrement')) or (colPickMode==1 and !item.containsKey('siteAddCountIncrement'))">
when a.id=#{item.id} then ifnull(a.siteAddCount,0) + #{item.siteAddCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deviceOnlineCount=(case" suffix="ELSE deviceOnlineCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deviceOnlineCount')) or (colPickMode==1 and !item.containsKey('deviceOnlineCount'))">
when a.id=#{item.id} then #{item.deviceOnlineCount}
</when>
<when test="(colPickMode==0 and item.containsKey('deviceOnlineCountIncrement')) or (colPickMode==1 and !item.containsKey('deviceOnlineCountIncrement'))">
when a.id=#{item.id} then ifnull(a.deviceOnlineCount,0) + #{item.deviceOnlineCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deviceOnlineRatio=(case" suffix="ELSE deviceOnlineRatio end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deviceOnlineRatio')) or (colPickMode==1 and !item.containsKey('deviceOnlineRatio'))">
when a.id=#{item.id} then #{item.deviceOnlineRatio}
</when>
<when test="(colPickMode==0 and item.containsKey('deviceOnlineRatioIncrement')) or (colPickMode==1 and !item.containsKey('deviceOnlineRatioIncrement'))">
when a.id=#{item.id} then ifnull(a.deviceOnlineRatio,0) + #{item.deviceOnlineRatioIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deviceOfflineCount=(case" suffix="ELSE deviceOfflineCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deviceOfflineCount')) or (colPickMode==1 and !item.containsKey('deviceOfflineCount'))">
when a.id=#{item.id} then #{item.deviceOfflineCount}
</when>
<when test="(colPickMode==0 and item.containsKey('deviceOfflineCountIncrement')) or (colPickMode==1 and !item.containsKey('deviceOfflineCountIncrement'))">
when a.id=#{item.id} then ifnull(a.deviceOfflineCount,0) + #{item.deviceOfflineCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deviceOfflineRatio=(case" suffix="ELSE deviceOfflineRatio end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deviceOfflineRatio')) or (colPickMode==1 and !item.containsKey('deviceOfflineRatio'))">
when a.id=#{item.id} then #{item.deviceOfflineRatio}
</when>
<when test="(colPickMode==0 and item.containsKey('deviceOfflineRatioIncrement')) or (colPickMode==1 and !item.containsKey('deviceOfflineRatioIncrement'))">
when a.id=#{item.id} then ifnull(a.deviceOfflineRatio,0) + #{item.deviceOfflineRatioIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deviceStopCount=(case" suffix="ELSE deviceStopCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deviceStopCount')) or (colPickMode==1 and !item.containsKey('deviceStopCount'))">
when a.id=#{item.id} then #{item.deviceStopCount}
</when>
<when test="(colPickMode==0 and item.containsKey('deviceStopCountIncrement')) or (colPickMode==1 and !item.containsKey('deviceStopCountIncrement'))">
when a.id=#{item.id} then ifnull(a.deviceStopCount,0) + #{item.deviceStopCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deviceStopRatio=(case" suffix="ELSE deviceStopRatio end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deviceStopRatio')) or (colPickMode==1 and !item.containsKey('deviceStopRatio'))">
when a.id=#{item.id} then #{item.deviceStopRatio}
</when>
<when test="(colPickMode==0 and item.containsKey('deviceStopRatioIncrement')) or (colPickMode==1 and !item.containsKey('deviceStopRatioIncrement'))">
when a.id=#{item.id} then ifnull(a.deviceStopRatio,0) + #{item.deviceStopRatioIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="alarmTotalCount=(case" suffix="ELSE alarmTotalCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('alarmTotalCount')) or (colPickMode==1 and !item.containsKey('alarmTotalCount'))">
when a.id=#{item.id} then #{item.alarmTotalCount}
</when>
<when test="(colPickMode==0 and item.containsKey('alarmTotalCountIncrement')) or (colPickMode==1 and !item.containsKey('alarmTotalCountIncrement'))">
when a.id=#{item.id} then ifnull(a.alarmTotalCount,0) + #{item.alarmTotalCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="alarmAddCount=(case" suffix="ELSE alarmAddCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('alarmAddCount')) or (colPickMode==1 and !item.containsKey('alarmAddCount'))">
when a.id=#{item.id} then #{item.alarmAddCount}
</when>
<when test="(colPickMode==0 and item.containsKey('alarmAddCountIncrement')) or (colPickMode==1 and !item.containsKey('alarmAddCountIncrement'))">
when a.id=#{item.id} then ifnull(a.alarmAddCount,0) + #{item.alarmAddCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="pushTotalCount=(case" suffix="ELSE pushTotalCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('pushTotalCount')) or (colPickMode==1 and !item.containsKey('pushTotalCount'))">
when a.id=#{item.id} then #{item.pushTotalCount}
</when>
<when test="(colPickMode==0 and item.containsKey('pushTotalCountIncrement')) or (colPickMode==1 and !item.containsKey('pushTotalCountIncrement'))">
when a.id=#{item.id} then ifnull(a.pushTotalCount,0) + #{item.pushTotalCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="pushAddCount=(case" suffix="ELSE pushAddCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('pushAddCount')) or (colPickMode==1 and !item.containsKey('pushAddCount'))">
when a.id=#{item.id} then #{item.pushAddCount}
</when>
<when test="(colPickMode==0 and item.containsKey('pushAddCountIncrement')) or (colPickMode==1 and !item.containsKey('pushAddCountIncrement'))">
when a.id=#{item.id} then ifnull(a.pushAddCount,0) + #{item.pushAddCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="uploadMessageTotalCount=(case" suffix="ELSE uploadMessageTotalCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('uploadMessageTotalCount')) or (colPickMode==1 and !item.containsKey('uploadMessageTotalCount'))">
when a.id=#{item.id} then #{item.uploadMessageTotalCount}
</when>
<when test="(colPickMode==0 and item.containsKey('uploadMessageTotalCountIncrement')) or (colPickMode==1 and !item.containsKey('uploadMessageTotalCountIncrement'))">
when a.id=#{item.id} then ifnull(a.uploadMessageTotalCount,0) + #{item.uploadMessageTotalCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="downloadMessageTotalCount=(case" suffix="ELSE downloadMessageTotalCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('downloadMessageTotalCount')) or (colPickMode==1 and !item.containsKey('downloadMessageTotalCount'))">
when a.id=#{item.id} then #{item.downloadMessageTotalCount}
</when>
<when test="(colPickMode==0 and item.containsKey('downloadMessageTotalCountIncrement')) or (colPickMode==1 and !item.containsKey('downloadMessageTotalCountIncrement'))">
when a.id=#{item.id} then ifnull(a.downloadMessageTotalCount,0) + #{item.downloadMessageTotalCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="year=(case" suffix="ELSE year end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('year')) or (colPickMode==1 and !item.containsKey('year'))">
when a.id=#{item.id} then #{item.year}
</when>
<when test="(colPickMode==0 and item.containsKey('yearIncrement')) or (colPickMode==1 and !item.containsKey('yearIncrement'))">
when a.id=#{item.id} then ifnull(a.year,0) + #{item.yearIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="month=(case" suffix="ELSE month end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('month')) or (colPickMode==1 and !item.containsKey('month'))">
when a.id=#{item.id} then #{item.month}
</when>
<when test="(colPickMode==0 and item.containsKey('monthIncrement')) or (colPickMode==1 and !item.containsKey('monthIncrement'))">
when a.id=#{item.id} then ifnull(a.month,0) + #{item.monthIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="day=(case" suffix="ELSE day end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('day')) or (colPickMode==1 and !item.containsKey('day'))">
when a.id=#{item.id} then #{item.day}
</when>
<when test="(colPickMode==0 and item.containsKey('dayIncrement')) or (colPickMode==1 and !item.containsKey('dayIncrement'))">
when a.id=#{item.id} then ifnull(a.day,0) + #{item.dayIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="createTime=(case" suffix="ELSE createTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
when a.id=#{item.id} then #{item.createTime}
</if>
</foreach>
</trim>
<trim prefix="updateUserId=(case" suffix="ELSE updateUserId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('updateUserId')) or (colPickMode==1 and !item.containsKey('updateUserId'))">
when a.id=#{item.id} then #{item.updateUserId}
</when>
<when test="(colPickMode==0 and item.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !item.containsKey('updateUserIdIncrement'))">
when a.id=#{item.id} then ifnull(a.updateUserId,0) + #{item.updateUserIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="updateTime=(case" suffix="ELSE updateTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
when a.id=#{item.id} then #{item.updateTime}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</update>
<!-- 根据主健查询 -->
<select id="getByKey" parameterType="paramDto" resultMap="DeviceStatEntity-Map">
select <include refid="_columns"/>
from mortals_xhx_device_stat as a
where a.id=#{condition.id}
</select>
<!-- 根据主健删除 -->
<delete id="deleteByKey" parameterType="paramDto">
delete a.* from mortals_xhx_device_stat as a where a.id=#{condition.id}
</delete>
<!-- 根据主健删除一批,针对单一主健有效 -->
<delete id="deleteByKeys">
delete from mortals_xhx_device_stat where id in
<foreach collection="array" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据paramDto删除一批 -->
<delete id="deleteByMap" parameterType="paramDto">
delete a.* from mortals_xhx_device_stat as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</delete>
<!-- 获取列表 -->
<select id="getList" parameterType="paramDto" resultMap="DeviceStatEntity-Map">
select <include refid="_columns"/>
from mortals_xhx_device_stat as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
<include refid="_orderCols_"/>
</select>
<!-- 获取 -->
<select id="getListCount" parameterType="paramDto" resultType="int">
select count(1)
from mortals_xhx_device_stat as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</select>
<!-- 条件映射 -->
<sql id="_condition_">
<if test="condition != null and !condition.isEmpty()">
<!-- 条件映射-普通条件 -->
<include refid="_condition_param_">
<property name="_conditionParam_" value="condition"/>
<property name="_conditionType_" value="and"/>
</include>
<!-- 条件映射-集合之间使用AND,集合中元素使用OR-(list[0].1 or list[0].2) and (list[1].3 or list[1].4) -->
<if test="condition.containsKey('andConditionList') and !condition.andConditionList.isEmpty()">
and
<foreach collection="condition.andConditionList" open="(" close=")" index="index" item="andCondition" separator=" and ">
<trim prefixOverrides="or" prefix="(" suffix=")">
<include refid="_condition_param_">
<property name="_conditionParam_" value="andCondition"/>
<property name="_conditionType_" value="or"/>
</include>
</trim>
</foreach>
</if>
<!-- 条件映射-集合之间使用OR,集合中元素使用AND-(list[0].1 and list[0].2) or (list[1].3 and list[1].4) -->
<if test="condition.containsKey('orConditionList') and !condition.orConditionList.isEmpty()">
and
<foreach collection="condition.orConditionList" open="(" close=")" index="index" item="orCondition" separator=" or ">
<trim prefixOverrides="and" prefix="(" suffix=")">
<include refid="_condition_param_">
<property name="_conditionParam_" value="orCondition"/>
<property name="_conditionType_" value="and"/>
</include>
</trim>
</foreach>
</if>
</if>
</sql>
<!-- 条件映射-代参数 -->
<sql id="_condition_param_">
<bind name="conditionParamRef" value="${_conditionParam_}"/>
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null">
${_conditionType_} a.id=#{${_conditionParam_}.id}
</if>
</if>
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null ">
${_conditionType_} a.id = #{${_conditionParam_}.id}
</if>
<if test="conditionParamRef.id == null">
${_conditionType_} a.id is null
</if>
</if>
<if test="conditionParamRef.containsKey('idList')">
${_conditionType_} a.id in
<foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
</if>
<if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null">
${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd}
</if>
<if test="conditionParamRef.containsKey('deviceTotalCount')">
<if test="conditionParamRef.deviceTotalCount != null ">
${_conditionType_} a.deviceTotalCount = #{${_conditionParam_}.deviceTotalCount}
</if>
<if test="conditionParamRef.deviceTotalCount == null">
${_conditionType_} a.deviceTotalCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('deviceTotalCountList')">
${_conditionType_} a.deviceTotalCount in
<foreach collection="conditionParamRef.deviceTotalCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deviceTotalCountStart') and conditionParamRef.deviceTotalCountStart != null">
${_conditionType_} a.deviceTotalCount <![CDATA[ >= ]]> #{${_conditionParam_}.deviceTotalCountStart}
</if>
<if test="conditionParamRef.containsKey('deviceTotalCountEnd') and conditionParamRef.deviceTotalCountEnd != null">
${_conditionType_} a.deviceTotalCount <![CDATA[ <= ]]> #{${_conditionParam_}.deviceTotalCountEnd}
</if>
<if test="conditionParamRef.containsKey('deviceAddCount')">
<if test="conditionParamRef.deviceAddCount != null ">
${_conditionType_} a.deviceAddCount = #{${_conditionParam_}.deviceAddCount}
</if>
<if test="conditionParamRef.deviceAddCount == null">
${_conditionType_} a.deviceAddCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('deviceAddCountList')">
${_conditionType_} a.deviceAddCount in
<foreach collection="conditionParamRef.deviceAddCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deviceAddCountStart') and conditionParamRef.deviceAddCountStart != null">
${_conditionType_} a.deviceAddCount <![CDATA[ >= ]]> #{${_conditionParam_}.deviceAddCountStart}
</if>
<if test="conditionParamRef.containsKey('deviceAddCountEnd') and conditionParamRef.deviceAddCountEnd != null">
${_conditionType_} a.deviceAddCount <![CDATA[ <= ]]> #{${_conditionParam_}.deviceAddCountEnd}
</if>
<if test="conditionParamRef.containsKey('siteTotalCount')">
<if test="conditionParamRef.siteTotalCount != null ">
${_conditionType_} a.siteTotalCount = #{${_conditionParam_}.siteTotalCount}
</if>
<if test="conditionParamRef.siteTotalCount == null">
${_conditionType_} a.siteTotalCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('siteTotalCountList')">
${_conditionType_} a.siteTotalCount in
<foreach collection="conditionParamRef.siteTotalCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteTotalCountStart') and conditionParamRef.siteTotalCountStart != null">
${_conditionType_} a.siteTotalCount <![CDATA[ >= ]]> #{${_conditionParam_}.siteTotalCountStart}
</if>
<if test="conditionParamRef.containsKey('siteTotalCountEnd') and conditionParamRef.siteTotalCountEnd != null">
${_conditionType_} a.siteTotalCount <![CDATA[ <= ]]> #{${_conditionParam_}.siteTotalCountEnd}
</if>
<if test="conditionParamRef.containsKey('siteAddCount')">
<if test="conditionParamRef.siteAddCount != null ">
${_conditionType_} a.siteAddCount = #{${_conditionParam_}.siteAddCount}
</if>
<if test="conditionParamRef.siteAddCount == null">
${_conditionType_} a.siteAddCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('siteAddCountList')">
${_conditionType_} a.siteAddCount in
<foreach collection="conditionParamRef.siteAddCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteAddCountStart') and conditionParamRef.siteAddCountStart != null">
${_conditionType_} a.siteAddCount <![CDATA[ >= ]]> #{${_conditionParam_}.siteAddCountStart}
</if>
<if test="conditionParamRef.containsKey('siteAddCountEnd') and conditionParamRef.siteAddCountEnd != null">
${_conditionType_} a.siteAddCount <![CDATA[ <= ]]> #{${_conditionParam_}.siteAddCountEnd}
</if>
<if test="conditionParamRef.containsKey('deviceOnlineCount')">
<if test="conditionParamRef.deviceOnlineCount != null ">
${_conditionType_} a.deviceOnlineCount = #{${_conditionParam_}.deviceOnlineCount}
</if>
<if test="conditionParamRef.deviceOnlineCount == null">
${_conditionType_} a.deviceOnlineCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('deviceOnlineCountList')">
${_conditionType_} a.deviceOnlineCount in
<foreach collection="conditionParamRef.deviceOnlineCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deviceOnlineCountStart') and conditionParamRef.deviceOnlineCountStart != null">
${_conditionType_} a.deviceOnlineCount <![CDATA[ >= ]]> #{${_conditionParam_}.deviceOnlineCountStart}
</if>
<if test="conditionParamRef.containsKey('deviceOnlineCountEnd') and conditionParamRef.deviceOnlineCountEnd != null">
${_conditionType_} a.deviceOnlineCount <![CDATA[ <= ]]> #{${_conditionParam_}.deviceOnlineCountEnd}
</if>
<if test="conditionParamRef.containsKey('deviceOnlineRatio')">
<if test="conditionParamRef.deviceOnlineRatio != null ">
${_conditionType_} a.deviceOnlineRatio = #{${_conditionParam_}.deviceOnlineRatio}
</if>
<if test="conditionParamRef.deviceOnlineRatio == null">
${_conditionType_} a.deviceOnlineRatio is null
</if>
</if>
<if test="conditionParamRef.containsKey('deviceOnlineRatioList')">
${_conditionType_} a.deviceOnlineRatio in
<foreach collection="conditionParamRef.deviceOnlineRatioList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deviceOnlineRatioStart') and conditionParamRef.deviceOnlineRatioStart != null">
${_conditionType_} a.deviceOnlineRatio <![CDATA[ >= ]]> #{${_conditionParam_}.deviceOnlineRatioStart}
</if>
<if test="conditionParamRef.containsKey('deviceOnlineRatioEnd') and conditionParamRef.deviceOnlineRatioEnd != null">
${_conditionType_} a.deviceOnlineRatio <![CDATA[ <= ]]> #{${_conditionParam_}.deviceOnlineRatioEnd}
</if>
<if test="conditionParamRef.containsKey('deviceOfflineCount')">
<if test="conditionParamRef.deviceOfflineCount != null ">
${_conditionType_} a.deviceOfflineCount = #{${_conditionParam_}.deviceOfflineCount}
</if>
<if test="conditionParamRef.deviceOfflineCount == null">
${_conditionType_} a.deviceOfflineCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('deviceOfflineCountList')">
${_conditionType_} a.deviceOfflineCount in
<foreach collection="conditionParamRef.deviceOfflineCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deviceOfflineCountStart') and conditionParamRef.deviceOfflineCountStart != null">
${_conditionType_} a.deviceOfflineCount <![CDATA[ >= ]]> #{${_conditionParam_}.deviceOfflineCountStart}
</if>
<if test="conditionParamRef.containsKey('deviceOfflineCountEnd') and conditionParamRef.deviceOfflineCountEnd != null">
${_conditionType_} a.deviceOfflineCount <![CDATA[ <= ]]> #{${_conditionParam_}.deviceOfflineCountEnd}
</if>
<if test="conditionParamRef.containsKey('deviceOfflineRatio')">
<if test="conditionParamRef.deviceOfflineRatio != null ">
${_conditionType_} a.deviceOfflineRatio = #{${_conditionParam_}.deviceOfflineRatio}
</if>
<if test="conditionParamRef.deviceOfflineRatio == null">
${_conditionType_} a.deviceOfflineRatio is null
</if>
</if>
<if test="conditionParamRef.containsKey('deviceOfflineRatioList')">
${_conditionType_} a.deviceOfflineRatio in
<foreach collection="conditionParamRef.deviceOfflineRatioList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deviceOfflineRatioStart') and conditionParamRef.deviceOfflineRatioStart != null">
${_conditionType_} a.deviceOfflineRatio <![CDATA[ >= ]]> #{${_conditionParam_}.deviceOfflineRatioStart}
</if>
<if test="conditionParamRef.containsKey('deviceOfflineRatioEnd') and conditionParamRef.deviceOfflineRatioEnd != null">
${_conditionType_} a.deviceOfflineRatio <![CDATA[ <= ]]> #{${_conditionParam_}.deviceOfflineRatioEnd}
</if>
<if test="conditionParamRef.containsKey('deviceStopCount')">
<if test="conditionParamRef.deviceStopCount != null ">
${_conditionType_} a.deviceStopCount = #{${_conditionParam_}.deviceStopCount}
</if>
<if test="conditionParamRef.deviceStopCount == null">
${_conditionType_} a.deviceStopCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('deviceStopCountList')">
${_conditionType_} a.deviceStopCount in
<foreach collection="conditionParamRef.deviceStopCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deviceStopCountStart') and conditionParamRef.deviceStopCountStart != null">
${_conditionType_} a.deviceStopCount <![CDATA[ >= ]]> #{${_conditionParam_}.deviceStopCountStart}
</if>
<if test="conditionParamRef.containsKey('deviceStopCountEnd') and conditionParamRef.deviceStopCountEnd != null">
${_conditionType_} a.deviceStopCount <![CDATA[ <= ]]> #{${_conditionParam_}.deviceStopCountEnd}
</if>
<if test="conditionParamRef.containsKey('deviceStopRatio')">
<if test="conditionParamRef.deviceStopRatio != null ">
${_conditionType_} a.deviceStopRatio = #{${_conditionParam_}.deviceStopRatio}
</if>
<if test="conditionParamRef.deviceStopRatio == null">
${_conditionType_} a.deviceStopRatio is null
</if>
</if>
<if test="conditionParamRef.containsKey('deviceStopRatioList')">
${_conditionType_} a.deviceStopRatio in
<foreach collection="conditionParamRef.deviceStopRatioList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deviceStopRatioStart') and conditionParamRef.deviceStopRatioStart != null">
${_conditionType_} a.deviceStopRatio <![CDATA[ >= ]]> #{${_conditionParam_}.deviceStopRatioStart}
</if>
<if test="conditionParamRef.containsKey('deviceStopRatioEnd') and conditionParamRef.deviceStopRatioEnd != null">
${_conditionType_} a.deviceStopRatio <![CDATA[ <= ]]> #{${_conditionParam_}.deviceStopRatioEnd}
</if>
<if test="conditionParamRef.containsKey('alarmTotalCount')">
<if test="conditionParamRef.alarmTotalCount != null ">
${_conditionType_} a.alarmTotalCount = #{${_conditionParam_}.alarmTotalCount}
</if>
<if test="conditionParamRef.alarmTotalCount == null">
${_conditionType_} a.alarmTotalCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('alarmTotalCountList')">
${_conditionType_} a.alarmTotalCount in
<foreach collection="conditionParamRef.alarmTotalCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('alarmTotalCountStart') and conditionParamRef.alarmTotalCountStart != null">
${_conditionType_} a.alarmTotalCount <![CDATA[ >= ]]> #{${_conditionParam_}.alarmTotalCountStart}
</if>
<if test="conditionParamRef.containsKey('alarmTotalCountEnd') and conditionParamRef.alarmTotalCountEnd != null">
${_conditionType_} a.alarmTotalCount <![CDATA[ <= ]]> #{${_conditionParam_}.alarmTotalCountEnd}
</if>
<if test="conditionParamRef.containsKey('alarmAddCount')">
<if test="conditionParamRef.alarmAddCount != null ">
${_conditionType_} a.alarmAddCount = #{${_conditionParam_}.alarmAddCount}
</if>
<if test="conditionParamRef.alarmAddCount == null">
${_conditionType_} a.alarmAddCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('alarmAddCountList')">
${_conditionType_} a.alarmAddCount in
<foreach collection="conditionParamRef.alarmAddCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('alarmAddCountStart') and conditionParamRef.alarmAddCountStart != null">
${_conditionType_} a.alarmAddCount <![CDATA[ >= ]]> #{${_conditionParam_}.alarmAddCountStart}
</if>
<if test="conditionParamRef.containsKey('alarmAddCountEnd') and conditionParamRef.alarmAddCountEnd != null">
${_conditionType_} a.alarmAddCount <![CDATA[ <= ]]> #{${_conditionParam_}.alarmAddCountEnd}
</if>
<if test="conditionParamRef.containsKey('pushTotalCount')">
<if test="conditionParamRef.pushTotalCount != null ">
${_conditionType_} a.pushTotalCount = #{${_conditionParam_}.pushTotalCount}
</if>
<if test="conditionParamRef.pushTotalCount == null">
${_conditionType_} a.pushTotalCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('pushTotalCountList')">
${_conditionType_} a.pushTotalCount in
<foreach collection="conditionParamRef.pushTotalCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('pushTotalCountStart') and conditionParamRef.pushTotalCountStart != null">
${_conditionType_} a.pushTotalCount <![CDATA[ >= ]]> #{${_conditionParam_}.pushTotalCountStart}
</if>
<if test="conditionParamRef.containsKey('pushTotalCountEnd') and conditionParamRef.pushTotalCountEnd != null">
${_conditionType_} a.pushTotalCount <![CDATA[ <= ]]> #{${_conditionParam_}.pushTotalCountEnd}
</if>
<if test="conditionParamRef.containsKey('pushAddCount')">
<if test="conditionParamRef.pushAddCount != null ">
${_conditionType_} a.pushAddCount = #{${_conditionParam_}.pushAddCount}
</if>
<if test="conditionParamRef.pushAddCount == null">
${_conditionType_} a.pushAddCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('pushAddCountList')">
${_conditionType_} a.pushAddCount in
<foreach collection="conditionParamRef.pushAddCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('pushAddCountStart') and conditionParamRef.pushAddCountStart != null">
${_conditionType_} a.pushAddCount <![CDATA[ >= ]]> #{${_conditionParam_}.pushAddCountStart}
</if>
<if test="conditionParamRef.containsKey('pushAddCountEnd') and conditionParamRef.pushAddCountEnd != null">
${_conditionType_} a.pushAddCount <![CDATA[ <= ]]> #{${_conditionParam_}.pushAddCountEnd}
</if>
<if test="conditionParamRef.containsKey('uploadMessageTotalCount')">
<if test="conditionParamRef.uploadMessageTotalCount != null ">
${_conditionType_} a.uploadMessageTotalCount = #{${_conditionParam_}.uploadMessageTotalCount}
</if>
<if test="conditionParamRef.uploadMessageTotalCount == null">
${_conditionType_} a.uploadMessageTotalCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('uploadMessageTotalCountList')">
${_conditionType_} a.uploadMessageTotalCount in
<foreach collection="conditionParamRef.uploadMessageTotalCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('uploadMessageTotalCountStart') and conditionParamRef.uploadMessageTotalCountStart != null">
${_conditionType_} a.uploadMessageTotalCount <![CDATA[ >= ]]> #{${_conditionParam_}.uploadMessageTotalCountStart}
</if>
<if test="conditionParamRef.containsKey('uploadMessageTotalCountEnd') and conditionParamRef.uploadMessageTotalCountEnd != null">
${_conditionType_} a.uploadMessageTotalCount <![CDATA[ <= ]]> #{${_conditionParam_}.uploadMessageTotalCountEnd}
</if>
<if test="conditionParamRef.containsKey('downloadMessageTotalCount')">
<if test="conditionParamRef.downloadMessageTotalCount != null ">
${_conditionType_} a.downloadMessageTotalCount = #{${_conditionParam_}.downloadMessageTotalCount}
</if>
<if test="conditionParamRef.downloadMessageTotalCount == null">
${_conditionType_} a.downloadMessageTotalCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('downloadMessageTotalCountList')">
${_conditionType_} a.downloadMessageTotalCount in
<foreach collection="conditionParamRef.downloadMessageTotalCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('downloadMessageTotalCountStart') and conditionParamRef.downloadMessageTotalCountStart != null">
${_conditionType_} a.downloadMessageTotalCount <![CDATA[ >= ]]> #{${_conditionParam_}.downloadMessageTotalCountStart}
</if>
<if test="conditionParamRef.containsKey('downloadMessageTotalCountEnd') and conditionParamRef.downloadMessageTotalCountEnd != null">
${_conditionType_} a.downloadMessageTotalCount <![CDATA[ <= ]]> #{${_conditionParam_}.downloadMessageTotalCountEnd}
</if>
<if test="conditionParamRef.containsKey('year')">
<if test="conditionParamRef.year != null ">
${_conditionType_} a.year = #{${_conditionParam_}.year}
</if>
<if test="conditionParamRef.year == null">
${_conditionType_} a.year is null
</if>
</if>
<if test="conditionParamRef.containsKey('yearList')">
${_conditionType_} a.year in
<foreach collection="conditionParamRef.yearList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('yearStart') and conditionParamRef.yearStart != null">
${_conditionType_} a.year <![CDATA[ >= ]]> #{${_conditionParam_}.yearStart}
</if>
<if test="conditionParamRef.containsKey('yearEnd') and conditionParamRef.yearEnd != null">
${_conditionType_} a.year <![CDATA[ <= ]]> #{${_conditionParam_}.yearEnd}
</if>
<if test="conditionParamRef.containsKey('month')">
<if test="conditionParamRef.month != null ">
${_conditionType_} a.month = #{${_conditionParam_}.month}
</if>
<if test="conditionParamRef.month == null">
${_conditionType_} a.month is null
</if>
</if>
<if test="conditionParamRef.containsKey('monthList')">
${_conditionType_} a.month in
<foreach collection="conditionParamRef.monthList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('monthStart') and conditionParamRef.monthStart != null">
${_conditionType_} a.month <![CDATA[ >= ]]> #{${_conditionParam_}.monthStart}
</if>
<if test="conditionParamRef.containsKey('monthEnd') and conditionParamRef.monthEnd != null">
${_conditionType_} a.month <![CDATA[ <= ]]> #{${_conditionParam_}.monthEnd}
</if>
<if test="conditionParamRef.containsKey('day')">
<if test="conditionParamRef.day != null ">
${_conditionType_} a.day = #{${_conditionParam_}.day}
</if>
<if test="conditionParamRef.day == null">
${_conditionType_} a.day is null
</if>
</if>
<if test="conditionParamRef.containsKey('dayList')">
${_conditionType_} a.day in
<foreach collection="conditionParamRef.dayList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('dayStart') and conditionParamRef.dayStart != null">
${_conditionType_} a.day <![CDATA[ >= ]]> #{${_conditionParam_}.dayStart}
</if>
<if test="conditionParamRef.containsKey('dayEnd') and conditionParamRef.dayEnd != null">
${_conditionType_} a.day <![CDATA[ <= ]]> #{${_conditionParam_}.dayEnd}
</if>
<if test="conditionParamRef.containsKey('createTime')">
<if test="conditionParamRef.createTime != null ">
${_conditionType_} a.createTime = #{${_conditionParam_}.createTime}
</if>
<if test="conditionParamRef.createTime == null">
${_conditionType_} a.createTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''">
${_conditionType_} a.createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('createTimeEnd') and conditionParamRef.createTimeEnd != null and conditionParamRef.createTimeEnd!=''">
${_conditionType_} a.createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('updateUserId')">
<if test="conditionParamRef.updateUserId != null ">
${_conditionType_} a.updateUserId = #{${_conditionParam_}.updateUserId}
</if>
<if test="conditionParamRef.updateUserId == null">
${_conditionType_} a.updateUserId is null
</if>
</if>
<if test="conditionParamRef.containsKey('updateUserIdList')">
${_conditionType_} a.updateUserId in
<foreach collection="conditionParamRef.updateUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('updateUserIdStart') and conditionParamRef.updateUserIdStart != null">
${_conditionType_} a.updateUserId <![CDATA[ >= ]]> #{${_conditionParam_}.updateUserIdStart}
</if>
<if test="conditionParamRef.containsKey('updateUserIdEnd') and conditionParamRef.updateUserIdEnd != null">
${_conditionType_} a.updateUserId <![CDATA[ <= ]]> #{${_conditionParam_}.updateUserIdEnd}
</if>
<if test="conditionParamRef.containsKey('updateTime')">
<if test="conditionParamRef.updateTime != null ">
${_conditionType_} a.updateTime = #{${_conditionParam_}.updateTime}
</if>
<if test="conditionParamRef.updateTime == null">
${_conditionType_} a.updateTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('updateTimeStart') and conditionParamRef.updateTimeStart != null and conditionParamRef.updateTimeStart!=''">
${_conditionType_} a.updateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
order by
<trim suffixOverrides="," suffix="">
<foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
${item.colName} ${item.sortKind}
</foreach>
</trim>
</if>
<if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
order by
<trim suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')">
a.id
<if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deviceTotalCount')">
a.deviceTotalCount
<if test='orderCol.deviceTotalCount != null and "DESC".equalsIgnoreCase(orderCol.deviceTotalCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deviceAddCount')">
a.deviceAddCount
<if test='orderCol.deviceAddCount != null and "DESC".equalsIgnoreCase(orderCol.deviceAddCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('siteTotalCount')">
a.siteTotalCount
<if test='orderCol.siteTotalCount != null and "DESC".equalsIgnoreCase(orderCol.siteTotalCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('siteAddCount')">
a.siteAddCount
<if test='orderCol.siteAddCount != null and "DESC".equalsIgnoreCase(orderCol.siteAddCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deviceOnlineCount')">
a.deviceOnlineCount
<if test='orderCol.deviceOnlineCount != null and "DESC".equalsIgnoreCase(orderCol.deviceOnlineCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deviceOnlineRatio')">
a.deviceOnlineRatio
<if test='orderCol.deviceOnlineRatio != null and "DESC".equalsIgnoreCase(orderCol.deviceOnlineRatio)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deviceOfflineCount')">
a.deviceOfflineCount
<if test='orderCol.deviceOfflineCount != null and "DESC".equalsIgnoreCase(orderCol.deviceOfflineCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deviceOfflineRatio')">
a.deviceOfflineRatio
<if test='orderCol.deviceOfflineRatio != null and "DESC".equalsIgnoreCase(orderCol.deviceOfflineRatio)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deviceStopCount')">
a.deviceStopCount
<if test='orderCol.deviceStopCount != null and "DESC".equalsIgnoreCase(orderCol.deviceStopCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deviceStopRatio')">
a.deviceStopRatio
<if test='orderCol.deviceStopRatio != null and "DESC".equalsIgnoreCase(orderCol.deviceStopRatio)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('alarmTotalCount')">
a.alarmTotalCount
<if test='orderCol.alarmTotalCount != null and "DESC".equalsIgnoreCase(orderCol.alarmTotalCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('alarmAddCount')">
a.alarmAddCount
<if test='orderCol.alarmAddCount != null and "DESC".equalsIgnoreCase(orderCol.alarmAddCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('pushTotalCount')">
a.pushTotalCount
<if test='orderCol.pushTotalCount != null and "DESC".equalsIgnoreCase(orderCol.pushTotalCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('pushAddCount')">
a.pushAddCount
<if test='orderCol.pushAddCount != null and "DESC".equalsIgnoreCase(orderCol.pushAddCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('uploadMessageTotalCount')">
a.uploadMessageTotalCount
<if test='orderCol.uploadMessageTotalCount != null and "DESC".equalsIgnoreCase(orderCol.uploadMessageTotalCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('downloadMessageTotalCount')">
a.downloadMessageTotalCount
<if test='orderCol.downloadMessageTotalCount != null and "DESC".equalsIgnoreCase(orderCol.downloadMessageTotalCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('year')">
a.year
<if test='orderCol.year != null and "DESC".equalsIgnoreCase(orderCol.year)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('month')">
a.month
<if test='orderCol.month != null and "DESC".equalsIgnoreCase(orderCol.month)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('day')">
a.day
<if test='orderCol.day != null and "DESC".equalsIgnoreCase(orderCol.day)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createTime')">
a.createTime
<if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateUserId')">
a.updateUserId
<if test='orderCol.updateUserId != null and "DESC".equalsIgnoreCase(orderCol.updateUserId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateTime')">
a.updateTime
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
<sql id="_group_by_">
<if test="groupList != null and !groupList.isEmpty()">
GROUP BY
<trim suffixOverrides="," suffix="">
<foreach collection="groupList" open="" close="" index="index" item="item" separator=",">
${item}
</foreach>
</trim>
</if>
</sql>
</mapper>
\ No newline at end of file
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###设备统计列表
POST {{baseUrl}}/device/stat/list
Authorization: {{authToken}}
Content-Type: application/json
{
"page":1,
"size":10
}
###设备统计更新与保存
POST {{baseUrl}}/device/stat/save
Authorization: {{authToken}}
Content-Type: application/json
{
"deviceTotalCount":0,
"deviceAddCount":0,
"siteTotalCount":0,
"siteAddCount":0,
"deviceOnlineCount":0,
"deviceOnlineRatio":0.00,
"deviceOfflineCount":0,
"deviceOfflineRatio":0.00,
"deviceStopCount":0,
"deviceStopRatio":0.00,
"alarmTotalCount":0,
"alarmAddCount":0,
"pushTotalCount":0,
"pushAddCount":0,
"uploadMessageTotalCount":0,
"downloadMessageTotalCount":0,
"year":164,
"month":627,
"day":805,
}
> {%
client.global.set("DeviceStat_id", JSON.parse(response.body).data.id);
%}
###设备统计查看
GET {{baseUrl}}/device/stat/info?id={{DeviceStat_id}}
Authorization: {{authToken}}
Accept: application/json
###设备统计编辑
GET {{baseUrl}}/device/stat/edit?id={{DeviceStat_id}}
Authorization: {{authToken}}
Accept: application/json
###设备统计删除
GET {{baseUrl}}/device/stat/delete?id={{DeviceStat_id}}
Authorization: {{authToken}}
Accept: application/json
...@@ -49,6 +49,8 @@ deviceNum|String|设备编码|是|- ...@@ -49,6 +49,8 @@ deviceNum|String|设备编码|是|-
code|Integer|结果码(-1.失败,1.成功)|- code|Integer|结果码(-1.失败,1.成功)|-
msg|String|消息|- msg|String|消息|-
data|Object|数据对象|- data|Object|数据对象|-
&emsp;ip|String|ip|-
&emsp;port|Integer|port|-
&emsp;deviceRegisterApi|String|设备注册API|- &emsp;deviceRegisterApi|String|设备注册API|-
&emsp;deviceInitApi|String|设备初始化信息API|- &emsp;deviceInitApi|String|设备初始化信息API|-
&emsp;deviceUpdateApi|String|设备页面修改API|- &emsp;deviceUpdateApi|String|设备页面修改API|-
...@@ -61,9 +63,12 @@ data|Object|数据对象|- ...@@ -61,9 +63,12 @@ data|Object|数据对象|-
"msg":"获取服务端地址成功", "msg":"获取服务端地址成功",
"code":1, "code":1,
"data":{ "data":{
"deviceRegisterApi":"http://192.168.0.98:11071/m/api/register", "ip":"192.168.0.98",
"deviceInitApi":"http://192.168.0.98:11071/m/api/deviceInit", "port":11091,
"deviceUpdateApi":"http://192.168.0.98:11071/m/api/deviceUpdate" "deviceRegisterApi":"/m/api/register",
"deviceRegisterApi":"/m/api/register",
"deviceInitApi":"/m/api/deviceInit",
"deviceUpdateApi":"/m/api/deviceUpdate"
} }
} }
``` ```
......
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