增加时间过滤
This commit is contained in:
parent
4f891569b9
commit
59f78e8f05
|
|
@ -200,7 +200,7 @@ namespace Waste.Application.Device
|
||||||
temquery = temquery.Where(x => SqlFunc.Subqueryable<W_Business>().Where(sql).Any());
|
temquery = temquery.Where(x => SqlFunc.Subqueryable<W_Business>().Where(sql).Any());
|
||||||
}
|
}
|
||||||
string sorts = string.Format("{0} {1}", param.sort, param.order);
|
string sorts = string.Format("{0} {1}", param.sort, param.order);
|
||||||
var query = await temquery.OrderBy(x => x.LastHeartTime, OrderByType.Desc)
|
var query = await temquery.OrderBy(sorts)
|
||||||
.Select(x => new DeviceList
|
.Select(x => new DeviceList
|
||||||
{
|
{
|
||||||
Id = x.Id,
|
Id = x.Id,
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<div class="layui-inline">
|
<div class="layui-inline">
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<select id="BusinessId" lay-search>
|
<select id="BusinessId" lay-search>
|
||||||
<option value="">请选择服务商</option>
|
<option value="">请选择商户</option>
|
||||||
@foreach (var item in Model.blist)
|
@foreach (var item in Model.blist)
|
||||||
{
|
{
|
||||||
<option value="@item.Id">@item.Name</option>
|
<option value="@item.Id">@item.Name</option>
|
||||||
|
|
@ -32,6 +32,11 @@
|
||||||
<input type="text" class="layui-input" name="Name" id="Name" placeholder="请输入设备名称" />
|
<input type="text" class="layui-input" name="Name" id="Name" placeholder="请输入设备名称" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" class="layui-input" data-time="ysdatetime" name="lasthearttime" id="lasthearttime" placeholder="请选择最近上报时间" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="layui-inline">
|
<div class="layui-inline">
|
||||||
<button class="btn btn-primary btn-lg js-search" type="button">查询</button>
|
<button class="btn btn-primary btn-lg js-search" type="button">查询</button>
|
||||||
<button class="btn btn-primary btn-lg js-add" type="button">添加</button>
|
<button class="btn btn-primary btn-lg js-add" type="button">添加</button>
|
||||||
|
|
@ -207,6 +212,11 @@
|
||||||
field: 'iccid', title: 'ICCID', hide: true
|
field: 'iccid', title: 'ICCID', hide: true
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
|
{
|
||||||
|
field: 'lasthearttime', title: '最近上报时间',sort:true
|
||||||
|
}
|
||||||
|
,
|
||||||
|
,
|
||||||
{
|
{
|
||||||
field: 'lastbeattime', title: '心跳时间'
|
field: 'lastbeattime', title: '心跳时间'
|
||||||
}
|
}
|
||||||
|
|
@ -233,9 +243,7 @@
|
||||||
]]
|
]]
|
||||||
});
|
});
|
||||||
$(".js-search").on("click", function () {
|
$(".js-search").on("click", function () {
|
||||||
common.reloadtable("list", {
|
var queryParam = [{
|
||||||
where: {
|
|
||||||
queryParam: [{
|
|
||||||
"Name": 'FacEcode',
|
"Name": 'FacEcode',
|
||||||
"Type": QueryCond.Like,
|
"Type": QueryCond.Like,
|
||||||
"Value": $("#FacEcode").val()
|
"Value": $("#FacEcode").val()
|
||||||
|
|
@ -251,7 +259,24 @@
|
||||||
"Name": 'BusinessId',
|
"Name": 'BusinessId',
|
||||||
"Type": QueryCond.Equal,
|
"Type": QueryCond.Equal,
|
||||||
"Value": $("#BusinessId").val()
|
"Value": $("#BusinessId").val()
|
||||||
}]
|
}];
|
||||||
|
var starttime = $("#lasthearttime").val();
|
||||||
|
if (starttime != "") {
|
||||||
|
var times = starttime.split('~');
|
||||||
|
queryParam.push({
|
||||||
|
"Name": 'lasthearttime',
|
||||||
|
"Type": QueryCond.GreaterThanOrEqual,
|
||||||
|
"Value": times[0].trim()
|
||||||
|
});
|
||||||
|
queryParam.push({
|
||||||
|
"Name": 'lasthearttime',
|
||||||
|
"Type": QueryCond.LessThanOrEqual,
|
||||||
|
"Value": times[1].trim()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
common.reloadtable("list", {
|
||||||
|
where: {
|
||||||
|
queryParam: queryParam
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue