Commit 0ee5d9af authored by 耿迪迪's avatar 耿迪迪

燃气问题优化 gengdidi

parent f26fb104
package com.zehong.web.controller.dataMonitoring; package com.zehong.web.controller.dataMonitoring;
import java.util.Calendar;
import java.util.Date;
import java.util.List; import java.util.List;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
...@@ -45,6 +47,12 @@ public class TDeviceReportDataController extends BaseController ...@@ -45,6 +47,12 @@ public class TDeviceReportDataController extends BaseController
public TableDataInfo list(DeviceReportDataForm deviceReportDataForm) public TableDataInfo list(DeviceReportDataForm deviceReportDataForm)
{ {
startPage(); startPage();
if(null == deviceReportDataForm.getStartReportTime() && null == deviceReportDataForm.getEndReportTime()){
Calendar startTime = Calendar.getInstance();
startTime.add(Calendar.DATE, - 7);
deviceReportDataForm.setStartReportTime(startTime.getTime());
deviceReportDataForm.setEndReportTime(new Date());
}
PageInfo<DeviceReportDataVo> page = tDeviceReportDataService.selectTDeviceReportDataPage(deviceReportDataForm); PageInfo<DeviceReportDataVo> page = tDeviceReportDataService.selectTDeviceReportDataPage(deviceReportDataForm);
return getDataTable(page); return getDataTable(page);
} }
......
...@@ -79,8 +79,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -79,8 +79,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> d.is_del = '0' <where> d.is_del = '0'
<if test="deviceCode != null and deviceCode != ''"> and d.device_code like concat('%',#{deviceCode},'%')</if> <if test="deviceCode != null and deviceCode != ''"> and d.device_code like concat('%',#{deviceCode},'%')</if>
<if test="deviceType != null and deviceType != ''"> and d.device_type = #{deviceType}</if> <if test="deviceType != null and deviceType != ''"> and d.device_type = #{deviceType}</if>
<if test="startReportTime != null "> and t.report_time &gt;= #{startReportTime}</if> <if test="startReportTime != null "> and t.create_time &gt;= #{startReportTime}</if>
<if test="endReportTime != null "> and t.report_time &lt;= #{endReportTime}</if> <if test="endReportTime != null "> and t.create_time &lt;= #{endReportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and t.communication_status = #{communicationStatus}</if> <if test="communicationStatus != null and communicationStatus != ''"> and t.communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and t.device_status = #{deviceStatus}</if> <if test="deviceStatus != null and deviceStatus != ''"> and t.device_status = #{deviceStatus}</if>
</where> </where>
...@@ -127,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -127,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
'报警' '报警'
END AS device_status END AS device_status
FROM FROM
t_device_report_data t (select tt1.* from t_device_report_data tt1, (select max(device_report_data_id)device_report_data_id,device_num from t_device_report_data group by device_num) tt2 where tt1.device_report_data_id =tt2.device_report_data_id ) t
JOIN t_device_info d ON t.device_num = d.iot_no JOIN t_device_info d ON t.device_num = d.iot_no
WHERE WHERE
( (
......
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