温度监测
This commit is contained in:
parent
37c70de44e
commit
03be6c5adf
|
|
@ -66,6 +66,7 @@ public class HeatsourceController extends JeecgController<Heatsource, Heatsource
|
||||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||||
customeRuleMap.put("companyId", QueryRuleEnum.LIKE_WITH_OR);
|
customeRuleMap.put("companyId", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
|
customeRuleMap.put("sourceName", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
QueryWrapper<Heatsource> queryWrapper = QueryGenerator.initQueryWrapper(heatsource, req.getParameterMap(),customeRuleMap);
|
QueryWrapper<Heatsource> queryWrapper = QueryGenerator.initQueryWrapper(heatsource, req.getParameterMap(),customeRuleMap);
|
||||||
Page<Heatsource> page = new Page<Heatsource>(pageNo, pageSize);
|
Page<Heatsource> page = new Page<Heatsource>(pageNo, pageSize);
|
||||||
IPage<Heatsource> pageList = heatsourceService.page(page, queryWrapper);
|
IPage<Heatsource> pageList = heatsourceService.page(page, queryWrapper);
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ public class ThermalcompanyController extends JeecgController<Thermalcompany, Th
|
||||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||||
customeRuleMap.put("companyType", QueryRuleEnum.LIKE_WITH_OR);
|
customeRuleMap.put("companyType", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
|
customeRuleMap.put("companyName", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
QueryWrapper<Thermalcompany> queryWrapper = QueryGenerator.initQueryWrapper(thermalcompany, req.getParameterMap(),customeRuleMap);
|
QueryWrapper<Thermalcompany> queryWrapper = QueryGenerator.initQueryWrapper(thermalcompany, req.getParameterMap(),customeRuleMap);
|
||||||
Page<Thermalcompany> page = new Page<Thermalcompany>(pageNo, pageSize);
|
Page<Thermalcompany> page = new Page<Thermalcompany>(pageNo, pageSize);
|
||||||
IPage<Thermalcompany> pageList = thermalcompanyService.page(page, queryWrapper);
|
IPage<Thermalcompany> pageList = thermalcompanyService.page(page, queryWrapper);
|
||||||
|
|
|
||||||
|
|
@ -40,4 +40,7 @@ public class Temperature extends JeecgEntity {
|
||||||
private String EDate;//结束时间
|
private String EDate;//结束时间
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String tableName;//表名字
|
private String tableName;//表名字
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String houseName;//房屋名字
|
||||||
}
|
}
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
<select id="findOne" resultType="org.jeecg.modules.temperature.entity.Temperature">
|
<select id="findOne" resultType="org.jeecg.modules.temperature.entity.Temperature">
|
||||||
SELECT
|
SELECT
|
||||||
id,
|
a.id,
|
||||||
code,
|
a.code,
|
||||||
up_peri,
|
up_peri,
|
||||||
csq,
|
csq,
|
||||||
bat,
|
bat,
|
||||||
|
|
@ -17,13 +17,20 @@
|
||||||
room_temp,
|
room_temp,
|
||||||
humidity,
|
humidity,
|
||||||
report_time,
|
report_time,
|
||||||
create_time
|
create_time,
|
||||||
|
(select b.house_name from bl_temperature_house b where a.code = b.code and b.del_flag = '0' limit 1) houseName
|
||||||
FROM
|
FROM
|
||||||
${tableName}
|
${tableName} a
|
||||||
<where>
|
<where>
|
||||||
<if test="code != null and code != ''">
|
<if test="code != null and code != ''">
|
||||||
AND code = #{code}
|
AND code = #{code}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="SDate != null and SDate != ''">
|
||||||
|
AND report_time >= #{SDate}
|
||||||
|
</if>
|
||||||
|
<if test="EDate != null and EDate != ''">
|
||||||
|
AND report_time <#{EDate}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY
|
ORDER BY
|
||||||
report_time DESC
|
report_time DESC
|
||||||
|
|
@ -34,8 +41,9 @@
|
||||||
SELECT code,
|
SELECT code,
|
||||||
max(room_temp) as roomTemp,
|
max(room_temp) as roomTemp,
|
||||||
DATE_FORMAT(report_time, '%H') reportHour,
|
DATE_FORMAT(report_time, '%H') reportHour,
|
||||||
concat(DATE_FORMAT(now(), '%Y-%m-%d %H'),':00') reportTime
|
concat(DATE_FORMAT(now(), '%Y-%m-%d %H'),':00') reportTime,
|
||||||
FROM ${tableName}
|
(select b.house_name from bl_temperature_house b where a.code = b.code and b.del_flag = '0' limit 1) houseName
|
||||||
|
FROM ${tableName} a
|
||||||
<where>
|
<where>
|
||||||
<if test="code != null and code != ''">
|
<if test="code != null and code != ''">
|
||||||
AND code = #{code}
|
AND code = #{code}
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,29 @@ public class TemperatureServiceImpl extends JeecgServiceImpl<TemperatureMapper,
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Temperature findOne(Temperature temperature){
|
public Temperature findOne(Temperature temperature){
|
||||||
String dateStr = temperature.getSDate();
|
|
||||||
String suffix = "";
|
String suffix = "";
|
||||||
if(dateStr==null||dateStr.equals("")){
|
String SDate = temperature.getSDate();
|
||||||
|
if(SDate==null||SDate.equals("")){
|
||||||
|
SDate = new SimpleDateFormat("YYYY-MM-dd").format(new Date())+" 00:00:00";
|
||||||
suffix = new SimpleDateFormat("YYMM").format(new Date());
|
suffix = new SimpleDateFormat("YYMM").format(new Date());
|
||||||
}else{
|
}else{
|
||||||
suffix = dateStr.substring(2, 4)+dateStr.substring(5, 7);
|
suffix = SDate.substring(2, 4)+SDate.substring(5, 7);
|
||||||
}
|
}
|
||||||
temperature.setTableName("bl_temperature_"+suffix);
|
temperature.setTableName("bl_temperature_"+suffix);
|
||||||
|
if(SDate.length()<=10){
|
||||||
|
SDate = SDate +" 00:00:00";
|
||||||
|
}
|
||||||
|
temperature.setSDate(SDate);
|
||||||
|
|
||||||
|
String EDate = temperature.getEDate();
|
||||||
|
if(EDate==null||EDate.equals("")) {
|
||||||
|
// EDate = new SimpleDateFormat("YYYY-MM-dd").format(new Date()) + " 23:59:59";
|
||||||
|
EDate = SDate.substring(0,10)+ " 23:59:59";
|
||||||
|
}
|
||||||
|
if(EDate.length()<=10){
|
||||||
|
EDate = EDate +" 23:59:59";
|
||||||
|
}
|
||||||
|
temperature.setEDate(EDate);
|
||||||
return baseMapper.findOne(temperature);
|
return baseMapper.findOne(temperature);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue