|
@ -16,18 +16,20 @@ public class CbCameraParamsService : ServiceBase<CbCameraParams>, ITransient |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 获取实体类
|
|
|
/// 获取实体类
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="queryJson">equal:cameraType,id,isDelete; like:name; between:[startTime,endTime];</param>
|
|
|
/// <param name="queryJson">equal:manufactor,type,id,isDelete; like:name; between:[startTime,endTime];</param>
|
|
|
/// <returns></returns>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet] |
|
|
[HttpGet] |
|
|
public override async Task<CbCameraParams> GetQ([Required] string queryJson) |
|
|
public override async Task<CbCameraParams> GetByQ([Required] string queryJson) |
|
|
{ |
|
|
{ |
|
|
JObject queryObj = queryJson.ToJObject(); |
|
|
JObject queryObj = queryJson.ToJObject(); |
|
|
|
|
|
|
|
|
var exp = Expressionable.Create<CbCameraParams>(); |
|
|
var exp = Expressionable.Create<CbCameraParams>(); |
|
|
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("cameraType", StringComparison.OrdinalIgnoreCase, out JToken cameraType)) |
|
|
if (queryObj.TryGetValue("manufactor", StringComparison.OrdinalIgnoreCase, out JToken manufactor)) |
|
|
exp.And(it => it.CameraType.Equals(cameraType)); |
|
|
exp.And(it => it.Manufactor.Equals(manufactor)); |
|
|
|
|
|
if (queryObj.TryGetValue("type", StringComparison.OrdinalIgnoreCase, out JToken type)) |
|
|
|
|
|
exp.And(it => it.Type.Equals(type)); |
|
|
if (queryObj.TryGetValue("Id", StringComparison.OrdinalIgnoreCase, out JToken Id)) |
|
|
if (queryObj.TryGetValue("Id", StringComparison.OrdinalIgnoreCase, out JToken Id)) |
|
|
exp.And(it => it.Id.Equals(Id)); |
|
|
exp.And(it => it.Id.Equals(Id)); |
|
|
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete)) |
|
|
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete)) |
|
@ -45,7 +47,7 @@ public class CbCameraParamsService : ServiceBase<CbCameraParams>, ITransient |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 批量获取实体类
|
|
|
/// 批量获取实体类
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="queryJson">equal:cameraType,isDelete; like:name; between:[startTime,endTime];</param>
|
|
|
/// <param name="queryJson">equal:manufactor,type,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 = "") |
|
@ -55,8 +57,10 @@ public class CbCameraParamsService : ServiceBase<CbCameraParams>, ITransient |
|
|
var exp = Expressionable.Create<CbCameraParams>(); |
|
|
var exp = Expressionable.Create<CbCameraParams>(); |
|
|
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("cameraType", StringComparison.OrdinalIgnoreCase, out JToken cameraType)) |
|
|
if (queryObj.TryGetValue("manufactor", StringComparison.OrdinalIgnoreCase, out JToken manufactor)) |
|
|
exp.And(it => it.CameraType.Equals(cameraType)); |
|
|
exp.And(it => it.Manufactor.Equals(manufactor)); |
|
|
|
|
|
if (queryObj.TryGetValue("type", StringComparison.OrdinalIgnoreCase, out JToken type)) |
|
|
|
|
|
exp.And(it => it.Type.Equals(type)); |
|
|
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete)) |
|
|
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete)) |
|
|
exp.And(it => it.IsDelete.Equals(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) |
|
@ -72,7 +76,7 @@ public class CbCameraParamsService : ServiceBase<CbCameraParams>, ITransient |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 批量获取分页实体类
|
|
|
/// 批量获取分页实体类
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="queryJson">equal:cameraType,isDelete; like:name; between:[startTime,endTime];</param>
|
|
|
/// <param name="queryJson">equal:manufactor,type,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] |
|
@ -84,8 +88,10 @@ public class CbCameraParamsService : ServiceBase<CbCameraParams>, ITransient |
|
|
var exp = Expressionable.Create<CbCameraParams>(); |
|
|
var exp = Expressionable.Create<CbCameraParams>(); |
|
|
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("cameraType", StringComparison.OrdinalIgnoreCase, out JToken cameraType)) |
|
|
if (queryObj.TryGetValue("manufactor", StringComparison.OrdinalIgnoreCase, out JToken manufactor)) |
|
|
exp.And(it => it.CameraType.Equals(cameraType)); |
|
|
exp.And(it => it.Manufactor.Equals(manufactor)); |
|
|
|
|
|
if (queryObj.TryGetValue("type", StringComparison.OrdinalIgnoreCase, out JToken type)) |
|
|
|
|
|
exp.And(it => it.Type.Equals(type)); |
|
|
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete)) |
|
|
if (queryObj.TryGetValue("IsDelete", StringComparison.OrdinalIgnoreCase, out JToken isDelete)) |
|
|
exp.And(it => it.IsDelete.Equals(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) |
|
|