Browse Source

feat: 添加查询逻辑

master
fajiao 2 years ago
parent
commit
f4aa364190
  1. 35
      Cis.Application/Cb/Service/CbCameraParamsService.cs
  2. 37
      Cis.Application/Cb/Service/CbCameraService.cs
  3. 66
      Cis.Application/Cis.Application.xml
  4. 33
      Cis.Application/Cm/Service/CmMarkGroupService.cs
  5. 37
      Cis.Application/Cm/Service/CmMarkLabelService.cs
  6. 35
      Cis.Application/Sys/Service/SysDictDataService.cs
  7. 35
      Cis.Application/Sys/Service/SysDictTypeService.cs
  8. 11
      Cis.Core/Cis.Core.xml
  9. 37
      Cis.Core/Common/Entity/ServiceBase.cs

35
Cis.Application/Cb/Service/CbCameraParamsService.cs

@ -16,7 +16,34 @@ public class CbCameraParamsService : ServiceBase<CbCameraParams>, ITransient
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="queryJson">equal:cameraType; like:name; between:[startTime,endTime];</param> /// <param name="queryJson">equal:cameraType,isDelete; like:name; between:[startTime,endTime];</param>
/// <returns></returns>
[HttpGet]
public override async Task<CbCameraParams> GetQ(string queryJson)
{
JObject queryObj = queryJson.ToJObject();
var exp = Expressionable.Create<CbCameraParams>();
if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name))
exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("cameraType", StringComparison.OrdinalIgnoreCase, out JToken cameraType))
exp.And(it => it.CameraType.Equals(cameraType));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());
var entity = await _baseRep.AsQueryable()
.Where(exp.ToExpression())
.FirstAsync();
return entity;
}
/// <summary>
///
/// </summary>
/// <param name="queryJson">equal:cameraType,isDelete; like:name; between:[startTime,endTime];</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public override async Task<List<CbCameraParams>> GetList(string queryJson = "") public override async Task<List<CbCameraParams>> GetList(string queryJson = "")
@ -28,6 +55,8 @@ public class CbCameraParamsService : ServiceBase<CbCameraParams>, ITransient
exp.And(it => it.Name.Contains(name.ToString())); exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("cameraType", StringComparison.OrdinalIgnoreCase, out JToken cameraType)) if (queryObj.TryGetValue("cameraType", StringComparison.OrdinalIgnoreCase, out JToken cameraType))
exp.And(it => it.CameraType.Equals(cameraType)); exp.And(it => it.CameraType.Equals(cameraType));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) && queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());
@ -41,7 +70,7 @@ public class CbCameraParamsService : ServiceBase<CbCameraParams>, ITransient
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="queryJson">equal:cameraType; like:name; between:[startTime,endTime];</param> /// <param name="queryJson">equal:cameraType,isDelete; like:name; between:[startTime,endTime];</param>
/// <param name="pagination">index,size</param> /// <param name="pagination">index,size</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
@ -55,6 +84,8 @@ public class CbCameraParamsService : ServiceBase<CbCameraParams>, ITransient
exp.And(it => it.Name.Contains(name.ToString())); exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("cameraType", StringComparison.OrdinalIgnoreCase, out JToken cameraType)) if (queryObj.TryGetValue("cameraType", StringComparison.OrdinalIgnoreCase, out JToken cameraType))
exp.And(it => it.CameraType.Equals(cameraType)); exp.And(it => it.CameraType.Equals(cameraType));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) && queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());

37
Cis.Application/Cb/Service/CbCameraService.cs

@ -16,7 +16,36 @@ public class CbCameraService : ServiceBase<CbCamera>, ITransient
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="queryJson">equal:cbCameraParamsId; like:ip,name; between:[startTime,endTime];</param> /// <param name="queryJson">equal:cbCameraParamsId,isDelete; like:ip,name; between:[startTime,endTime];</param>
/// <returns></returns>
[HttpGet]
public override async Task<CbCamera> GetQ(string queryJson)
{
JObject queryObj = queryJson.ToJObject();
var exp = Expressionable.Create<CbCamera>();
if (queryObj.TryGetValue("cbCameraParamsId", StringComparison.OrdinalIgnoreCase, out JToken cbCameraParamsId))
exp.And(it => it.CbCameraParamsId.Equals(cbCameraParamsId));
if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name))
exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("ip", StringComparison.OrdinalIgnoreCase, out JToken ip))
exp.And(it => it.Ip.Contains(ip.ToString()));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());
var entity = await _baseRep.AsQueryable()
.Where(exp.ToExpression())
.FirstAsync();
return entity;
}
/// <summary>
///
/// </summary>
/// <param name="queryJson">equal:cbCameraParamsId,isDelete; like:ip,name; between:[startTime,endTime];</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public override async Task<List<CbCamera>> GetList(string queryJson = "") public override async Task<List<CbCamera>> GetList(string queryJson = "")
@ -30,6 +59,8 @@ public class CbCameraService : ServiceBase<CbCamera>, ITransient
exp.And(it => it.Name.Contains(name.ToString())); exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("ip", StringComparison.OrdinalIgnoreCase, out JToken ip)) if (queryObj.TryGetValue("ip", StringComparison.OrdinalIgnoreCase, out JToken ip))
exp.And(it => it.Ip.Contains(ip.ToString())); exp.And(it => it.Ip.Contains(ip.ToString()));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) && queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());
@ -43,7 +74,7 @@ public class CbCameraService : ServiceBase<CbCamera>, ITransient
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="queryJson">equal:cbCameraParamsId; like:ip,name; between:[startTime,endTime];</param> /// <param name="queryJson">equal:cbCameraParamsId,isDelete; like:ip,name; between:[startTime,endTime];</param>
/// <param name="pagination">index,size</param> /// <param name="pagination">index,size</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
@ -59,6 +90,8 @@ public class CbCameraService : ServiceBase<CbCamera>, ITransient
exp.And(it => it.Name.Contains(name.ToString())); exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("ip", StringComparison.OrdinalIgnoreCase, out JToken ip)) if (queryObj.TryGetValue("ip", StringComparison.OrdinalIgnoreCase, out JToken ip))
exp.And(it => it.Ip.Contains(ip.ToString())); exp.And(it => it.Ip.Contains(ip.ToString()));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) && queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());

66
Cis.Application/Cis.Application.xml

@ -114,18 +114,25 @@
相机参数服务 相机参数服务
</summary> </summary>
</member> </member>
<member name="M:Cis.Application.Cb.CbCameraParamsService.GetQ(System.String)">
<summary>
</summary>
<param name="queryJson">equal:cameraType,isDelete; like:name; between:[startTime,endTime];</param>
<returns></returns>
</member>
<member name="M:Cis.Application.Cb.CbCameraParamsService.GetList(System.String)"> <member name="M:Cis.Application.Cb.CbCameraParamsService.GetList(System.String)">
<summary> <summary>
</summary> </summary>
<param name="queryJson">equal:cameraType; like:name; between:[startTime,endTime];</param> <param name="queryJson">equal:cameraType,isDelete; like:name; between:[startTime,endTime];</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Cis.Application.Cb.CbCameraParamsService.GetPageList(System.String,System.String)"> <member name="M:Cis.Application.Cb.CbCameraParamsService.GetPageList(System.String,System.String)">
<summary> <summary>
</summary> </summary>
<param name="queryJson">equal:cameraType; like:name; between:[startTime,endTime];</param> <param name="queryJson">equal:cameraType,isDelete; like:name; between:[startTime,endTime];</param>
<param name="pagination">index,size</param> <param name="pagination">index,size</param>
<returns></returns> <returns></returns>
</member> </member>
@ -134,18 +141,25 @@
相机服务 相机服务
</summary> </summary>
</member> </member>
<member name="M:Cis.Application.Cb.CbCameraService.GetQ(System.String)">
<summary>
</summary>
<param name="queryJson">equal:cbCameraParamsId,isDelete; like:ip,name; between:[startTime,endTime];</param>
<returns></returns>
</member>
<member name="M:Cis.Application.Cb.CbCameraService.GetList(System.String)"> <member name="M:Cis.Application.Cb.CbCameraService.GetList(System.String)">
<summary> <summary>
</summary> </summary>
<param name="queryJson">equal:cbCameraParamsId; like:ip,name; between:[startTime,endTime];</param> <param name="queryJson">equal:cbCameraParamsId,isDelete; like:ip,name; between:[startTime,endTime];</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Cis.Application.Cb.CbCameraService.GetPageList(System.String,System.String)"> <member name="M:Cis.Application.Cb.CbCameraService.GetPageList(System.String,System.String)">
<summary> <summary>
</summary> </summary>
<param name="queryJson">equal:cbCameraParamsId; like:ip,name; between:[startTime,endTime];</param> <param name="queryJson">equal:cbCameraParamsId,isDelete; like:ip,name; between:[startTime,endTime];</param>
<param name="pagination">index,size</param> <param name="pagination">index,size</param>
<returns></returns> <returns></returns>
</member> </member>
@ -274,18 +288,25 @@
标记分组服务 标记分组服务
</summary> </summary>
</member> </member>
<member name="M:Cis.Application.Cm.CmMarkGroupService.GetQ(System.String)">
<summary>
</summary>
<param name="queryJson">equal:isDelete; like:name; between:[startTime,endTime];</param>
<returns></returns>
</member>
<member name="M:Cis.Application.Cm.CmMarkGroupService.GetList(System.String)"> <member name="M:Cis.Application.Cm.CmMarkGroupService.GetList(System.String)">
<summary> <summary>
</summary> </summary>
<param name="queryJson">like:name; between:[startTime,endTime];</param> <param name="queryJson">equal:isDelete; like:name; between:[startTime,endTime];</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Cis.Application.Cm.CmMarkGroupService.GetPageList(System.String,System.String)"> <member name="M:Cis.Application.Cm.CmMarkGroupService.GetPageList(System.String,System.String)">
<summary> <summary>
</summary> </summary>
<param name="queryJson">like:name; between:[startTime,endTime];</param> <param name="queryJson">equal:isDelete; like:name; between:[startTime,endTime];</param>
<param name="pagination">index,size</param> <param name="pagination">index,size</param>
<returns></returns> <returns></returns>
</member> </member>
@ -294,18 +315,25 @@
标签服务 标签服务
</summary> </summary>
</member> </member>
<member name="M:Cis.Application.Cm.CmMarkLabelService.GetQ(System.String)">
<summary>
</summary>
<param name="queryJson">equal:cbCameraId,cmMarkGroupId,isDelete; like:name; between:[startTime,endTime];</param>
<returns></returns>
</member>
<member name="M:Cis.Application.Cm.CmMarkLabelService.GetList(System.String)"> <member name="M:Cis.Application.Cm.CmMarkLabelService.GetList(System.String)">
<summary> <summary>
</summary> </summary>
<param name="queryJson">equal:cbCameraId,cmMarkGroupId; like:name; between:[startTime,endTime];</param> <param name="queryJson">equal:cbCameraId,cmMarkGroupId,isDelete; like:name; between:[startTime,endTime];</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Cis.Application.Cm.CmMarkLabelService.GetPageList(System.String,System.String)"> <member name="M:Cis.Application.Cm.CmMarkLabelService.GetPageList(System.String,System.String)">
<summary> <summary>
</summary> </summary>
<param name="queryJson">equal:cbCameraId,cmMarkGroupId; like:name; between:[startTime,endTime];</param> <param name="queryJson">equal:cbCameraId,cmMarkGroupId,isDelete; like:name; between:[startTime,endTime];</param>
<param name="pagination">index,size</param> <param name="pagination">index,size</param>
<returns></returns> <returns></returns>
</member> </member>
@ -961,18 +989,25 @@
系统字典值服务 系统字典值服务
</summary> </summary>
</member> </member>
<member name="M:Cis.Application.Sys.SysDictDataService.GetQ(System.String)">
<summary>
</summary>
<param name="queryJson">equal:sysDictTypeId,code,isDelete; between:[startTime,endTime];</param>
<returns></returns>
</member>
<member name="M:Cis.Application.Sys.SysDictDataService.GetList(System.String)"> <member name="M:Cis.Application.Sys.SysDictDataService.GetList(System.String)">
<summary> <summary>
</summary> </summary>
<param name="queryJson">equal:sysDictTypeId; like:code; between:[startTime,endTime];</param> <param name="queryJson">equal:sysDictTypeId,code,isDelete; between:[startTime,endTime];</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Cis.Application.Sys.SysDictDataService.GetPageList(System.String,System.String)"> <member name="M:Cis.Application.Sys.SysDictDataService.GetPageList(System.String,System.String)">
<summary> <summary>
</summary> </summary>
<param name="queryJson">equal:sysDictTypeId; like:code; between:[startTime,endTime];</param> <param name="queryJson">equal:sysDictTypeId,code,isDelete; between:[startTime,endTime];</param>
<param name="pagination">index,size</param> <param name="pagination">index,size</param>
<returns></returns> <returns></returns>
</member> </member>
@ -981,18 +1016,25 @@
系统字典类型服务 系统字典类型服务
</summary> </summary>
</member> </member>
<member name="M:Cis.Application.Sys.SysDictTypeService.GetQ(System.String)">
<summary>
</summary>
<param name="queryJson">equal:code,isDelete; like:name; between:[startTime,endTime];</param>
<returns></returns>
</member>
<member name="M:Cis.Application.Sys.SysDictTypeService.GetList(System.String)"> <member name="M:Cis.Application.Sys.SysDictTypeService.GetList(System.String)">
<summary> <summary>
</summary> </summary>
<param name="queryJson">equal:code; like:name; between:[startTime,endTime];</param> <param name="queryJson">equal:code,isDelete; like:name; between:[startTime,endTime];</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Cis.Application.Sys.SysDictTypeService.GetPageList(System.String,System.String)"> <member name="M:Cis.Application.Sys.SysDictTypeService.GetPageList(System.String,System.String)">
<summary> <summary>
</summary> </summary>
<param name="queryJson">equal:code; like:name; between:[startTime,endTime];</param> <param name="queryJson">equal:code,isDelete; like:name; between:[startTime,endTime];</param>
<param name="pagination">index,size</param> <param name="pagination">index,size</param>
<returns></returns> <returns></returns>
</member> </member>

33
Cis.Application/Cm/Service/CmMarkGroupService.cs

@ -16,7 +16,32 @@ public class CmMarkGroupService : ServiceBase<CmMarkGroup>, ITransient
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="queryJson">like:name; between:[startTime,endTime];</param> /// <param name="queryJson">equal:isDelete; like:name; between:[startTime,endTime];</param>
/// <returns></returns>
[HttpGet]
public override async Task<CmMarkGroup> GetQ(string queryJson)
{
JObject queryObj = queryJson.ToJObject();
var exp = Expressionable.Create<CmMarkGroup>();
if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name))
exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());
var entity = await _baseRep.AsQueryable()
.Where(exp.ToExpression())
.FirstAsync();
return entity;
}
/// <summary>
///
/// </summary>
/// <param name="queryJson">equal:isDelete; like:name; between:[startTime,endTime];</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public override async Task<List<CmMarkGroup>> GetList(string queryJson) public override async Task<List<CmMarkGroup>> GetList(string queryJson)
@ -26,6 +51,8 @@ public class CmMarkGroupService : ServiceBase<CmMarkGroup>, ITransient
var exp = Expressionable.Create<CmMarkGroup>(); var exp = Expressionable.Create<CmMarkGroup>();
if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name)) if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name))
exp.And(it => it.Name.Contains(name.ToString())); exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) && queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());
@ -39,7 +66,7 @@ public class CmMarkGroupService : ServiceBase<CmMarkGroup>, ITransient
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="queryJson">like:name; between:[startTime,endTime];</param> /// <param name="queryJson">equal:isDelete; like:name; between:[startTime,endTime];</param>
/// <param name="pagination">index,size</param> /// <param name="pagination">index,size</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
@ -51,6 +78,8 @@ public class CmMarkGroupService : ServiceBase<CmMarkGroup>, ITransient
var exp = Expressionable.Create<CmMarkGroup>(); var exp = Expressionable.Create<CmMarkGroup>();
if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name)) if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name))
exp.And(it => it.Name.Contains(name.ToString())); exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) && queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());

37
Cis.Application/Cm/Service/CmMarkLabelService.cs

@ -44,7 +44,36 @@ public class CmMarkLabelService : ServiceBase<CmMarkLabel>, ITransient
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="queryJson">equal:cbCameraId,cmMarkGroupId; like:name; between:[startTime,endTime];</param> /// <param name="queryJson">equal:cbCameraId,cmMarkGroupId,isDelete; like:name; between:[startTime,endTime];</param>
/// <returns></returns>
[HttpGet]
public override async Task<CmMarkLabel> GetQ(string queryJson)
{
JObject queryObj = queryJson.ToJObject();
var exp = Expressionable.Create<CmMarkLabel>();
if (queryObj.TryGetValue("cbCameraId", StringComparison.OrdinalIgnoreCase, out JToken cbCameraId))
exp.And(it => it.CbCameraId.Equals(cbCameraId));
if (queryObj.TryGetValue("cmMarkGroupId", StringComparison.OrdinalIgnoreCase, out JToken cmMarkGroupId))
exp.And(it => it.CmMarkGroupId.Equals(cmMarkGroupId));
if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name))
exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());
var entity = await _baseRep.AsQueryable()
.Where(exp.ToExpression())
.FirstAsync();
return entity;
}
/// <summary>
///
/// </summary>
/// <param name="queryJson">equal:cbCameraId,cmMarkGroupId,isDelete; like:name; between:[startTime,endTime];</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public override async Task<List<CmMarkLabel>> GetList(string queryJson = "") public override async Task<List<CmMarkLabel>> GetList(string queryJson = "")
@ -58,6 +87,8 @@ public class CmMarkLabelService : ServiceBase<CmMarkLabel>, ITransient
exp.And(it => it.CmMarkGroupId.Equals(cmMarkGroupId)); exp.And(it => it.CmMarkGroupId.Equals(cmMarkGroupId));
if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name)) if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name))
exp.And(it => it.Name.Contains(name.ToString())); exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) && queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());
@ -71,7 +102,7 @@ public class CmMarkLabelService : ServiceBase<CmMarkLabel>, ITransient
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="queryJson">equal:cbCameraId,cmMarkGroupId; like:name; between:[startTime,endTime];</param> /// <param name="queryJson">equal:cbCameraId,cmMarkGroupId,isDelete; like:name; between:[startTime,endTime];</param>
/// <param name="pagination">index,size</param> /// <param name="pagination">index,size</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
@ -87,6 +118,8 @@ public class CmMarkLabelService : ServiceBase<CmMarkLabel>, ITransient
exp.And(it => it.CmMarkGroupId.Equals(cmMarkGroupId)); exp.And(it => it.CmMarkGroupId.Equals(cmMarkGroupId));
if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name)) if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name))
exp.And(it => it.Name.Contains(name.ToString())); exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) && queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());

35
Cis.Application/Sys/Service/SysDictDataService.cs

@ -16,7 +16,34 @@ public class SysDictDataService : ServiceBase<SysDictData>, ITransient
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="queryJson">equal:sysDictTypeId; like:code; between:[startTime,endTime];</param> /// <param name="queryJson">equal:sysDictTypeId,code,isDelete; between:[startTime,endTime];</param>
/// <returns></returns>
[HttpGet]
public override async Task<SysDictData> GetQ(string queryJson)
{
JObject queryObj = queryJson.ToJObject();
var exp = Expressionable.Create<SysDictData>();
if (queryObj.TryGetValue("sysDictTypeId", StringComparison.OrdinalIgnoreCase, out JToken sysDictTypeId))
exp.And(it => it.SysDictTypeId.Equals(sysDictTypeId));
if (queryObj.TryGetValue("code", StringComparison.OrdinalIgnoreCase, out JToken code))
exp.And(it => it.Code.Equals(code));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());
var entity = await _baseRep.AsQueryable()
.Where(exp.ToExpression())
.FirstAsync();
return entity;
}
/// <summary>
///
/// </summary>
/// <param name="queryJson">equal:sysDictTypeId,code,isDelete; between:[startTime,endTime];</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public override async Task<List<SysDictData>> GetList(string queryJson) public override async Task<List<SysDictData>> GetList(string queryJson)
@ -28,6 +55,8 @@ public class SysDictDataService : ServiceBase<SysDictData>, ITransient
exp.And(it => it.SysDictTypeId.Equals(sysDictTypeId)); exp.And(it => it.SysDictTypeId.Equals(sysDictTypeId));
if (queryObj.TryGetValue("code", StringComparison.OrdinalIgnoreCase, out JToken code)) if (queryObj.TryGetValue("code", StringComparison.OrdinalIgnoreCase, out JToken code))
exp.And(it => it.Code.Equals(code)); exp.And(it => it.Code.Equals(code));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) && queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());
@ -41,7 +70,7 @@ public class SysDictDataService : ServiceBase<SysDictData>, ITransient
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="queryJson">equal:sysDictTypeId; like:code; between:[startTime,endTime];</param> /// <param name="queryJson">equal:sysDictTypeId,code,isDelete; between:[startTime,endTime];</param>
/// <param name="pagination">index,size</param> /// <param name="pagination">index,size</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
@ -55,6 +84,8 @@ public class SysDictDataService : ServiceBase<SysDictData>, ITransient
exp.And(it => it.SysDictTypeId.Equals(sysDictTypeId)); exp.And(it => it.SysDictTypeId.Equals(sysDictTypeId));
if (queryObj.TryGetValue("code", StringComparison.OrdinalIgnoreCase, out JToken code)) if (queryObj.TryGetValue("code", StringComparison.OrdinalIgnoreCase, out JToken code))
exp.And(it => it.Code.Equals(code)); exp.And(it => it.Code.Equals(code));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) && queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());

35
Cis.Application/Sys/Service/SysDictTypeService.cs

@ -16,7 +16,34 @@ public class SysDictTypeService : ServiceBase<SysDictType>, ITransient
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="queryJson">equal:code; like:name; between:[startTime,endTime];</param> /// <param name="queryJson">equal:code,isDelete; like:name; between:[startTime,endTime];</param>
/// <returns></returns>
[HttpGet]
public override async Task<SysDictType> GetQ(string queryJson)
{
JObject queryObj = queryJson.ToJObject();
var exp = Expressionable.Create<SysDictType>();
if (queryObj.TryGetValue("name", StringComparison.OrdinalIgnoreCase, out JToken name))
exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("code", StringComparison.OrdinalIgnoreCase, out JToken code))
exp.And(it => it.Code.Equals(code));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());
var entity = await _baseRep.AsQueryable()
.Where(exp.ToExpression())
.FirstAsync();
return entity;
}
/// <summary>
///
/// </summary>
/// <param name="queryJson">equal:code,isDelete; like:name; between:[startTime,endTime];</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public override async Task<List<SysDictType>> GetList(string queryJson) public override async Task<List<SysDictType>> GetList(string queryJson)
@ -28,6 +55,8 @@ public class SysDictTypeService : ServiceBase<SysDictType>, ITransient
exp.And(it => it.Name.Contains(name.ToString())); exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("code", StringComparison.OrdinalIgnoreCase, out JToken code)) if (queryObj.TryGetValue("code", StringComparison.OrdinalIgnoreCase, out JToken code))
exp.And(it => it.Code.Equals(code)); exp.And(it => it.Code.Equals(code));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) && queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());
@ -41,7 +70,7 @@ public class SysDictTypeService : ServiceBase<SysDictType>, ITransient
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="queryJson">equal:code; like:name; between:[startTime,endTime];</param> /// <param name="queryJson">equal:code,isDelete; like:name; between:[startTime,endTime];</param>
/// <param name="pagination">index,size</param> /// <param name="pagination">index,size</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
@ -55,6 +84,8 @@ public class SysDictTypeService : ServiceBase<SysDictType>, ITransient
exp.And(it => it.Name.Contains(name.ToString())); exp.And(it => it.Name.Contains(name.ToString()));
if (queryObj.TryGetValue("code", StringComparison.OrdinalIgnoreCase, out JToken code)) if (queryObj.TryGetValue("code", StringComparison.OrdinalIgnoreCase, out JToken code))
exp.And(it => it.Code.Equals(code)); exp.And(it => it.Code.Equals(code));
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) && queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());

11
Cis.Core/Cis.Core.xml

@ -257,18 +257,25 @@
<param name="id"></param> <param name="id"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Cis.Core.Common.ServiceBase`1.GetQ(System.String)">
<summary>
</summary>
<param name="queryJson">equal:isDelete; between:[startTime,endTime];</param>
<returns></returns>
</member>
<member name="M:Cis.Core.Common.ServiceBase`1.GetList(System.String)"> <member name="M:Cis.Core.Common.ServiceBase`1.GetList(System.String)">
<summary> <summary>
</summary> </summary>
<param name="queryJson">between:[startTime,endTime];</param> <param name="queryJson">equal:isDelete; between:[startTime,endTime];</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Cis.Core.Common.ServiceBase`1.GetPageList(System.String,System.String)"> <member name="M:Cis.Core.Common.ServiceBase`1.GetPageList(System.String,System.String)">
<summary> <summary>
</summary> </summary>
<param name="queryJson">between:[startTime,endTime];</param> <param name="queryJson">equal:isDelete; between:[startTime,endTime];</param>
<param name="pagination">index,size</param> <param name="pagination">index,size</param>
<returns></returns> <returns></returns>
</member> </member>

37
Cis.Core/Common/Entity/ServiceBase.cs

@ -100,10 +100,8 @@ public class ServiceBase<T> : IDynamicApiController where T : EntityBase, new()
[HttpPost] [HttpPost]
public virtual async Task<bool> FakeDelete(long id) public virtual async Task<bool> FakeDelete(long id)
{ {
return await _baseRep.AsUpdateable() return await _baseRep.AsUpdateable(new T { Id = id, IsDelete = true })
.Where(it => it.Id.Equals(id)) .UpdateColumns(it => it.IsDelete)
.Where("limit 1")
.ReSetValue(it => it.IsDelete = true)
.ExecuteCommandAsync() > 0; .ExecuteCommandAsync() > 0;
} }
@ -122,7 +120,30 @@ public class ServiceBase<T> : IDynamicApiController where T : EntityBase, new()
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="queryJson">between:[startTime,endTime];</param> /// <param name="queryJson">equal:isDelete; between:[startTime,endTime];</param>
/// <returns></returns>
[HttpGet]
public virtual async Task<T> GetQ(string queryJson)
{
JObject queryObj = queryJson.ToJObject();
var exp = Expressionable.Create<T>();
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());
var entity = await _baseRep.AsQueryable()
.Where(exp.ToExpression())
.FirstAsync();
return entity;
}
/// <summary>
///
/// </summary>
/// <param name="queryJson">equal:isDelete; between:[startTime,endTime];</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public virtual async Task<List<T>> GetList(string queryJson = "") public virtual async Task<List<T>> GetList(string queryJson = "")
@ -130,6 +151,8 @@ public class ServiceBase<T> : IDynamicApiController where T : EntityBase, new()
JObject queryObj = queryJson.ToJObject(); JObject queryObj = queryJson.ToJObject();
var exp = Expressionable.Create<T>(); var exp = Expressionable.Create<T>();
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) && queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());
@ -143,7 +166,7 @@ public class ServiceBase<T> : IDynamicApiController where T : EntityBase, new()
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="queryJson">between:[startTime,endTime];</param> /// <param name="queryJson">equal:isDelete; between:[startTime,endTime];</param>
/// <param name="pagination">index,size</param> /// <param name="pagination">index,size</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
@ -153,6 +176,8 @@ public class ServiceBase<T> : IDynamicApiController where T : EntityBase, new()
Pagination pageObj = pagination.ToObject<Pagination>(); Pagination pageObj = pagination.ToObject<Pagination>();
var exp = Expressionable.Create<T>(); var exp = Expressionable.Create<T>();
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete))
exp.And(it => it.IsDelete.Equals(isDelete));
if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime) if (queryObj.TryGetValue("StartTime", StringComparison.OrdinalIgnoreCase, out JToken startTime)
&& queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime)) && queryObj.TryGetValue("EndTime", StringComparison.OrdinalIgnoreCase, out JToken endTime))
exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime()); exp.And(it => it.CreateTime >= startTime.ToDateTime() && it.CreateTime <= endTime.ToDateTime());

Loading…
Cancel
Save