不说了
今天的任务
前言
项目需求:
后面根据登录session的行业id来显示对应的心跳统计数据
就是加where子查询啦
页面实现:
最后效果:
过程
数据库
-------心跳统计-相关sql----------
–查询全部
SELECT dht_id, dht01, dht02, dht03, dht04, dht05, dht06, dht07 FROM dtm_heart_tongji;–分页查询总条数
SELECT count(1) from dtm_heart_tongji where 1=1–oracle查询时间段
Select * from dtm_heart_tongji where dht05 between to_date(‘2020-3-10’, ‘yyyy-mm-dd’) and to_date(‘2020-4-15’,‘yyyy-mm-dd’)
模糊查询以及分页列表
service
controller
**注意:**分页的这里总页数前台默认页数给了1
我们思考下为什么?
service发现这里查询条数的时候做了处理
strTable = strTable + "<td>" + formatDate(new Date((data.listDtmHeartTongJiFind[i].dht05).replace(/-/g, "/"))) + "</td>";
发生的问题
涉及到的demo
jsp
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<html>
<head>
<meta charset="utf-8" />
<meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<link rel="stylesheet" href="layuiadmin/layui/css/layui.css" media="all" />
<link rel="stylesheet" href="layuiadmin/style/admin.css" media="all" />
<script src="js/jquery-1.7.1.js"></script>
<script src="js/userjs/common.js"></script>
</head>
<body>
<div class="layui-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<div id="heartTongJiIndexDiv" class="test-table-reload-btn"
style="margin-bottom: 10px;">
<div class="layui-form" style="margin-bottom: 10px;">
开始时间:
<div class="layui-inline" style="width:163px">
<input type="text" class="layui-input"
id="heartTongJiIndexDht05Start"
name="heartTongJiIndexDht05Start" />
</div>
结束时间:
<div class="layui-inline" style="width:163px">
<input type="text" class="layui-input"
id="heartTongJiIndexDht05End" name="heartTongJiIndexDht05End" />
</div>
<button type="button" class="layui-btn"
onclick="heartTongJiIndexBtn();">
<i class="layui-icon layui-icon-search"></i>搜索
</button>
<button type="button" class="layui-btn"
id="heartTongJiIndeExportIndex"
name="heartTongJiIndeExportIndex">
<i class="layui-icon layui-icon-export"></i>导出
</button>
</div>
</div>
<div id="heartTongJiIndexList">
<table id="heartTongJiIndexdg" class="layui-table"
lay-filter="heartTongJiIndexTable"
lay-data="{height:'full-191',cellMinWidth: 80 }">
<thead id="heartTongJiIndexthead">
</thead>
<tbody id="heartTongJiIndextbody">
</tbody>
</table>
<div id="heartTongJiIndexPage"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="" id="heartTongJiIndeExportIndexA"
style="font-size: larger; font-weight: bold; color: blue;"></a>
<input type="hidden" id="heartTongJiIndexHiddenCpage"
name="heartTongJiIndexHiddenCpage" value="1" />
<input type="hidden" id="heartTongJiIndexHiddenTotalNum"
name="heartTongJiIndexHiddenTotalNum" value="-1" />
<script src="layuiadmin/layui/layui.js"></script>
<script>
layui.config({
base : 'layuiadmin/' //静态资源所在路径
}).extend({
index : 'lib/index' //主入口模块
}).use([ 'table', 'laypage', 'layer', 'index', 'form', 'laydate' ], function() {
var laypage = layui.laypage,
table = layui.table,
$ = layui.$,
admin = layui.admin,
element = layui.element,
layer = layui.layer,
laydate = layui.laydate,
form = layui.form;
//初始化分页
laypage.render({
elem : 'heartTongJiIndexPage',
count : 0,
limit : 15,
curr : 1,
layout : [ 'prev', 'page', 'next', 'count', 'skip' ]
});
//日期选择器初始化 开始时间
laydate.render({
elem : '#heartTongJiIndexDht05Start', //指定元素
value : new Date()
});
//日期选择器初始化 结束时间
laydate.render({
elem : '#heartTongJiIndexDht05End', //指定元素
value : new Date()
});
//表单重新渲染
form.render();
$("#heartTongJiIndeExportIndex").click(function() {
var indexs = layer.load(3);
//开始时间
var dht05Start = $("#heartTongJiIndexDht05Start").val();
//结束时间
var dht05End = $("#heartTongJiIndexDht05End").val();
//要请求的Url和携带的参数
var url = "heartTongJiIndeExportIndexJson.action?dht05Start=" + dht05Start + "&dht05End=" + dht05End;
var xhr = new XMLHttpRequest();
//设置响应类型为blob类型
xhr.responseType = "blob";
xhr.onload = function() {
if (this.status == "200") {
//获取响应文件流
var blob = this.response;
var aElem = document.getElementById("heartTongJiIndeExportIndexA");
//将文件流保存到a标签
aElem.href = window.URL.createObjectURL(blob);
aElem.download = "heartStatistic_" + formatDateTime(new Date()) + ".xls";
aElem.onload = function(e) {
window.URL.revokeObjectURL(aElem.href);
};
layer.close(indexs);
layer.confirm('文件已导出, 立即下载?', function(index) {
aElem.click();
layer.close(index);
});
}
}
xhr.open("post", url, true);
xhr.send();
})
});
/*
$.ajax({
url:"heartTongJiIndeExportIndexJson.action",
type:"POST",
data:{
dht05Start : dht05Start,
dht05End : dht05End
},
dataType:"json",
success: function(data){
if (data.jsonFlag == 1) {
//后台直接返回文件流,前台进行下载
/*
//加载数据层关闭
layer.close(indexs);
layer.open({
type: 1
,title: '下载'
,maxmin: false
,resize:false
,move: false
,area: ['700px', '500px']
,content: $('#heartTongJiIndeExportIndexDiv')
});
document.getElementById("heartTongJiIndeExportIndexA").href = data.downloadName;
}else{
layer.close(indexs);
layer.msg('导出失败!', {offset: '15px',icon: 1});
}
}
});
*/
//检索
function heartTongJiIndexBtn() {
//开始只需要分页查询
$("#heartTongJiIndexHiddenCpage").val(1);
$("#heartTongJiIndexHiddenTotalNum").val(-1);
heartTongJiIndexSubmit();
}
//提交检索
function heartTongJiIndexSubmit() {
//开始时间
var dht05Start = $("#heartTongJiIndexDht05Start").val();
//结束时间
var dht05End = $("#heartTongJiIndexDht05End").val();
//当前页
var Cpage = $("#heartTongJiIndexHiddenCpage").val();
//总页数
var totalNum = $("#heartTongJiIndexHiddenTotalNum").val();
//加载数据层
var indexs = layer.load(3);
$.ajax({
url : "heartTongJiIndexJsonAciton.action",
type : "POST",
data : {
dht05Start : dht05Start,
dht05End : dht05End,
Cpage : Cpage,
totalNum : totalNum
},
dataType : "json",
async : false,
success : function(data) {
console.log("------data-------" + data.listDtmHeartTongJiFind + "---flag---" + data.jsonFlag)
var strTable = "";
var intPageNum = data.intPageNum;
var totalPageSize = data.intAllCount;
$("#heartTongJiIndextbody").text(""); //先清空原先内容
if (data.jsonFlag == 1) {
//有数据
if (data.listDtmHeartTongJiFind != null && data.listDtmHeartTongJiFind.length > 0) {
for (var i = 0; i < data.listDtmHeartTongJiFind.length; i++) {
strTable = strTable + "<tr>";
if (data.listDtmHeartTongJiFind[i].dht02 != null && data.listDtmHeartTongJiFind[i].dht02 != "") {
strTable = strTable + "<td>" + data.listDtmHeartTongJiFind[i].dht02 + "</td>";
} else {
if (data.listDtmHeartTongJiFind[i].dht02 == "0") {
strTable = strTable + "<td>0</td>";
} else {
strTable = strTable + "<td></td>";
}
}
if (data.listDtmHeartTongJiFind[i].dht03 != null && data.listDtmHeartTongJiFind[i].dht03 != "") {
strTable = strTable + "<td>" + data.listDtmHeartTongJiFind[i].dht03 + "</td>";
} else {
if (data.listDtmHeartTongJiFind[i].dht03 == "0") {
strTable = strTable + "<td>0</td>";
} else {
strTable = strTable + "<td></td>";
}
}
if (data.listDtmHeartTongJiFind[i].dht04 != null && data.listDtmHeartTongJiFind[i].dht04 != "") {
strTable = strTable + "<td>" + data.listDtmHeartTongJiFind[i].dht04 + "</td>";
} else {
if (data.listDtmHeartTongJiFind[i].dht04 == "0") {
strTable = strTable + "<td>0</td>";
} else {
strTable = strTable + "<td></td>";
}
}
if (data.listDtmHeartTongJiFind[i].dht05 != null && data.listDtmHeartTongJiFind[i].dht05 != "") {
strTable = strTable + "<td>" + data.listDtmHeartTongJiFind[i].dht05 + "</td>";
} else {
strTable = strTable + "<td></td>";
}
strTable = strTable + "</tr>";
// console.log("-------aaaaqaaa------" + data.listDtmHeartTongJiFind[i].dht05.replace(/-/g, "/"));
// console.log("-------bbbbbbbb------" + data.listDtmHeartTongJiFind[i].dht05.substring(0, 10));
}
$("#heartTongJiIndextbody").html(strTable);
} else {
layer.msg('没有查询到数据!', {
offset : '15px',
icon : 1
});
}
//显示表格
layui.use([ 'table' ], function() { //------
var table = layui.table;
//初始化表格
table.init('heartTongJiIndexTable', {
height : 'full-191', //设置高度
limit : intPageNum, //支持所有基础参数
page : false //是否分页
});
}) //------
//分页
layui.use([ 'laypage' ], function() { //------
var laypage = layui.laypage;
//初始化分页
laypage.render({
elem : 'heartTongJiIndexPage',
count : totalPageSize,
limit : intPageNum,
curr : Cpage,
layout : [ 'prev', 'page', 'next', 'count', 'skip' ],
jump : function(obj, first) {
if (!first) {
$("#heartTongJiIndexHiddenCpage").val(obj.curr);
heartTongJiIndexSubmit();
}
}
});
}) //------
} else if (data.jsonFlag == -2) {
layer.msg("Session失效,请重新登录!", {
icon : 2,
time : 2000
}, function() {
window.location = "${pageContext.request.contextPath}/communitySessionError.jsp";
});
} else if (data.jsonFlag == -1) {
layer.msg('心跳统计查询失败!', {
offset : '15px',
icon : 2
});
} else {
layer.msg('心跳统计查询失败!', {
offset : '15px',
icon : 2
});
}
//加载数据层关闭
layer.close(indexs);
return false;
}
});
}
//表头初始化
function heartTongJiIndexTableInit() {
$("#heartTongJiIndexthead").text(""); //先清空原先内容
var thead = document.getElementById('heartTongJiIndexthead');
var tr = document.createElement("tr");
tr.innerHTML = '<th lay-data="{field:\'dht02\', width:265}">上线设备总数</th>' +
'<th lay-data="{field:\'dht03\', width:265}">在线设备总数</th>' +
'<th lay-data="{field:\'dht04\', width:265}">离线设备总数</th>' +
'<th lay-data="{field:\'dht05\', width:194}">统计时间</th>';
thead.appendChild(tr);
}
heartTongJiIndexTableInit();
</script>
</body>
</html>
TongJiJsonService
package svs.service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import svs.dao.ISearchDao;
import svs.dao.IUserSearchDao;
import svs.dto.DtmHeartTongji;
import svs.dto.userDto.UserDtmHeartTongji;
import svs.dto.userDto.UserDtmNeiBaoUser;
/**
* 心跳统计
*
* @author aolanjie01
*
*/
@Service("TongJiJsonService")
public class TongJiJsonService {
@Resource
private IUserSearchDao objUserSearchDao;
@Resource
private ISearchDao objSearchDao;
@Resource
private CommonJsonService objCommonJsonService;
/**
* 心跳统计 分页查询list
*
* @param startDate 开始时间
* @param endDate 结束时间
* @param intPageNum 页数
* @param intCpage 当前页
* @return
*/
public List<UserDtmHeartTongji> selectUserDtmHeartTongjiInfoSearch(String dht05Start, String dht05End,
int intPageNum, int intCpage, String dnu08) {
try {
String strSql = SqlConstant.sqlUserHeartTongJiSearch;
// 行业ID
if (dnu08 != null && "".equals(dnu08) == false) {// 用户角色id
strSql = strSql + " and dht01=" + dnu08 + "";
}
// 开始时间
if (dht05Start != null && "".equals(dht05Start) == false) {
strSql = strSql + " and dht05 >='" + dht05Start + " 00:00:00'";
}
// 结束时间
if (dht05End != null && "".equals(dht05End) == false) {
strSql = strSql + " and dht05 <='" + dht05End + " 23:59:59'";
}
strSql = strSql + " limit " + intPageNum + " offset " + (intCpage - 1) * intPageNum;
return objUserSearchDao.selectUserDtmHeartTongjiSearch(strSql);
} catch (Exception e) {
// TODO: handle exception
return null;
}
}
/**
* 心跳统计 分页 查询条数
*
* @param startDate 开始时间
* @param endDate 结束时间
* @param totalNum
* @return
*/
public int HeartTongjiSearchCount(String dht05Start, String dht05End, String totalNum, String dnu08) {
try {
int intTotalNum = Integer.valueOf(totalNum);
if (intTotalNum > 0) {
return intTotalNum;
} else {
String strSql = "SELECT count(1) from dtm_heart_tongji where 1=1";
// 开始时间
if (dnu08 != null && "".equals(dnu08) == false) {
if (dht05Start != null && "".equals(dht05Start) == false && dht05End != null
&& "".equals(dht05End) == false) {
strSql = strSql + " and dht05 between to_date('" + dht05Start + "', 'yyyy-mm-dd') and to_date('"
+ dht05End + "','yyyy-mm-dd') and dht01=" + dnu08 + "";
}
}
return objSearchDao.selectCountList(strSql);
}
} catch (Exception e) {
// TODO: handle exception
return -1;
}
}
}
TongJiController:做页面跳转
package svs.controller;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import svs.service.CommonJsonService;
@Controller
public class TongJiController {
@Resource
private CommonJsonService objCommonJsonService;
/**
* 心跳统计初始化
*
* @return
*/
@RequestMapping("/heartTongjiIndex")
public String heartTongjiIndex(HttpSession session,HttpServletRequest request,Model model){
try {
//判断Session是否失效
if (!objCommonJsonService.SystemBool(session)) {
request.setAttribute("strErrorMsg", "Session失效,请重新登录!");
return "communitySessionError";
}
return "tongji/heartTongji";
} catch (Exception e) {
e.printStackTrace();
return "communitySessionError";
}
}
/**
* 事件统计初始化
*
* @return
*/
@RequestMapping("/eventTongjiIndex")
public String eventTongjiIndex(HttpSession session,HttpServletRequest request,Model model){
try {
//判断Session是否失效
if (!objCommonJsonService.SystemBool(session)) {
request.setAttribute("strErrorMsg", "Session失效,请重新登录!");
return "communitySessionError";
}
return "tongji/eventTongji";
} catch (Exception e) {
e.printStackTrace();
return "communitySessionError";
}
}
}
TongJiJsonController:主要业务处理逻辑
package svs.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import svs.dao.ISearchDao;
import svs.dto.DtmHeartTongji;
import svs.dto.DtmSvssystemLog;
import svs.dto.userDto.UserDtmHeartTongji;
import svs.service.CommonJsonService;
import svs.service.TongJiJsonService;
@Controller
public class TongJiJsonController {
@Resource
private ISearchDao objSearchDao;
@Resource
private CommonJsonService objCommonJsonService;
@Resource
private TongJiJsonService objTongjiJsonService;
// 每页数量
private int intPageNum;
// 总记录数
private int intAllCount;
// 当前页
private int intCpage;
private String jsonMsg;
private int jsonFlag;
/**
* 心跳统计查询
*
* @param session
* @param request
* @param model
* @return
*/
@RequestMapping("/heartTongJiIndexJsonAciton")
@ResponseBody
public Map<String, Object> heartTongJiIndexJsonAciton(HttpSession session, HttpServletRequest request) {
Map<String, Object> mpList = new HashMap<String, Object>();
// 判断Session是否失效
if (!objCommonJsonService.SystemBool(session)) {
mpList.put("jsonFlag", -2);
mpList.put("jsonMsg", "Session失效,请重新登录!");
return mpList;
}
try {
// 创建应用系统日志对象,并且已经填写好了一些通用参数
// DtmSvssystemLog objDtmSvssystemLog =
// objCommonJsonService.createNewDtmSvssystemLog(session, request);
// 用户角色
String dnu08 = session.getAttribute("dnu08").toString();
// 开始时间
String dht05Start = request.getParameter("dht05Start");
// 结束时间
String dht05End = request.getParameter("dht05End");
// 当前页
intCpage = Integer.valueOf(request.getParameter("Cpage"));
// 总数据量
String totalNum = request.getParameter("totalNum");
List<UserDtmHeartTongji> listUserDtmHeartTongjiInfoSearch = objTongjiJsonService
.selectUserDtmHeartTongjiInfoSearch(dht05Start, dht05End, intPageNum, intCpage,dnu08);
// 心跳数据条数
intAllCount = objTongjiJsonService.HeartTongjiSearchCount(dht05Start, dht05End, totalNum,dnu08);
// 每页数据量
intPageNum = objCommonJsonService.PAGE_COUNT;
mpList.put("listDtmHeartTongJiFind", listUserDtmHeartTongjiInfoSearch);
mpList.put("intAllCount", intAllCount);
mpList.put("intPageNum", intPageNum);
mpList.put("jsonFlag", 1);
mpList.put("strMsg", "成功");
return mpList;
} catch (Exception e) {
e.printStackTrace();
mpList.put("jsonFlag", -1);
return mpList;
}
}
}
package svs.dto.userDto;
import java.util.Date;
public class UserDtmHeartTongji {
/**
* This field was generated by MyBatis Generator. This field corresponds to the database column public.dtm_heart_tongji.dht_id
* @mbg.generated Wed Apr 29 15:10:03 CST 2020
*/
private Integer dhtId;
/**
* This field was generated by MyBatis Generator. This field corresponds to the database column public.dtm_heart_tongji.dht02
* @mbg.generated Wed Apr 29 15:10:03 CST 2020
*/
private Integer dht02;
/**
* This field was generated by MyBatis Generator. This field corresponds to the database column public.dtm_heart_tongji.dht03
* @mbg.generated Wed Apr 29 15:10:03 CST 2020
*/
private Integer dht03;
/**
* This field was generated by MyBatis Generator. This field corresponds to the database column public.dtm_heart_tongji.dht04
* @mbg.generated Wed Apr 29 15:10:03 CST 2020
*/
private Integer dht04;
/**
* This field was generated by MyBatis Generator. This field corresponds to the database column public.dtm_heart_tongji.dht05
* @mbg.generated Wed Apr 29 15:10:03 CST 2020
*/
private String dht05;
public Integer getDhtId() {
return dhtId;
}
public void setDhtId(Integer dhtId) {
this.dhtId = dhtId;
}
public Integer getDht02() {
return dht02;
}
public void setDht02(Integer dht02) {
this.dht02 = dht02;
}
public Integer getDht03() {
return dht03;
}
public void setDht03(Integer dht03) {
this.dht03 = dht03;
}
public Integer getDht04() {
return dht04;
}
public void setDht04(Integer dht04) {
this.dht04 = dht04;
}
public String getDht05() {
return dht05;
}
public void setDht05(String dht05) {
this.dht05 = dht05;
}
}
package svs.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import svs.dto.userDto.*;
public interface IUserSearchDao {
//派出所权限
public List<UserDtmNeibaouserPolice> selectUserDtmNeibaouserPolice(@Param(value="value") String strSql) throws Exception;
//菜单权限
public List<UserDtmSystemMenu> selectUserDtmSystemMenu(@Param(value="value") String strSql) throws Exception;
//内保用户权限
public List<UserDtmNeiBaoUser> selectUserDtmNeiBaoUser(@Param(value="value") String strSql) throws Exception;
//单位信息
public List<UserDtmUsecompanyInfo> selectUserDtmUsecompanyInfo(@Param(value="value") String strSql) throws Exception;
//派出所
public List<UserDictionaryPoliceStation> selectUserDictionaryPoliceStation(@Param(value="value") String strSql) throws Exception;
//用户列表
public List<UserDtmNeiBaoUserSearch> selectUserDtmNeiBaoUserSearch(@Param(value="value") String strSql) throws Exception;
//单位信息
public List<UserDtmUsecompanyInfoSearch> selectUserDtmUsecompanyInfoSearch(@Param(value="value") String strSql) throws Exception;
//小区信息
public List<UserDtmCommunity> selectUserDtmCommunity(@Param(value="value") String strSql) throws Exception;
//实有装备信息
public List<UserDtmCommunityEquipment> selectUserDtmCommunityEquipment(@Param(value="value") String strSql) throws Exception;
//实有力量信息
public List<UserDtmCommunityPower> selectUserDtmCommunityPower(@Param(value="value") String strSql) throws Exception;
//人员信息列表
public List<UserDtmPersonInfoSearch> selectUserDtmPersonInfoSearch(@Param(value="value") String strSql) throws Exception;
//人员信息
public List<UserDtmPersonInfo> selectUserDtmPersonInfo(@Param(value="value") String strSql) throws Exception;
//人员标签信息
public List<UserDtmPersonLabelSearch> selectUserDtmPersonLabelSearch(@Param(value="value") String strSql) throws Exception;
//区域出入口信息表
public List<UserDtmCommunityEntrance> selectUserDtmCommunityEntrance(@Param(value="value") String strSql) throws Exception;
//系统输入信息表(设备信息)
public List<UserAgentSystemEnter> selectUserAgentSystemEnterSearch(@Param(value="value") String strSql) throws Exception;
//用户心跳信息表
public List<UserDtmHeartTongji> selectUserDtmHeartTongjiSearch(@Param(value="value") String strSql) throws Exception;
}
总结
1.js时间戳的问题
后台的实体类的用string来接收就无需转换
2.时间范围的问题
我的这种写法就有问题
举例:假如我可能用户只想按开始时间(结束时间)搜索,那么我这个逻辑,啥数据就没有
不:其实它是在查询全部
这是一个bug
注意:前台的数据得是动态的
解决办法
提高逻辑思维
这种写法灵活且通用
// 行业ID
if (dnu08 != null && "".equals(dnu08) == false) {// 用户角色id
strSql = strSql + " and dht01=" + dnu08 + "";
}
// 开始时间
if (dht05Start != null && "".equals(dht05Start) == false) {
strSql = strSql + " and dht05 >='" + dht05Start + " 00:00:00'";
}
// 结束时间
if (dht05End != null && "".equals(dht05End) == false) {
strSql = strSql + " and dht05 <='" + dht05End + " 23:59:59'";
}