|
|
@ -1,6 +1,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
using System.Data; |
|
|
|
using System.Data; |
|
|
|
using AgileObjects.AgileMapper; |
|
|
|
using AgileObjects.AgileMapper; |
|
|
|
|
|
|
|
using MathNet.Numerics.Distributions; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using Newtonsoft.Json.Linq; |
|
|
|
using Newtonsoft.Json.Linq; |
|
|
|
using SqlSugar; |
|
|
|
using SqlSugar; |
|
|
@ -37,7 +38,7 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt |
|
|
|
_ghre_CourseClassServices = ghre_CourseClassServices; |
|
|
|
_ghre_CourseClassServices = ghre_CourseClassServices; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public override async Task<ServicePageResult<Ghre_QuestionDto>> QueryFilterPage(QueryBody filter) |
|
|
|
public async Task<ServicePageResult<Ghre_QuestionDto>> QueryFilterPage1(QueryBody filter) |
|
|
|
{ |
|
|
|
{ |
|
|
|
//var data1 = await BaseDal.QueryFilterPage(body); |
|
|
|
//var data1 = await BaseDal.QueryFilterPage(body); |
|
|
|
|
|
|
|
|
|
|
@ -154,6 +155,69 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt |
|
|
|
|
|
|
|
|
|
|
|
return new ServicePageResult<Ghre_QuestionDto>(filter.pageNum, data1.result.DT_TablePageInfoT1.TotalCount, filter.pageSize, data); |
|
|
|
return new ServicePageResult<Ghre_QuestionDto>(filter.pageNum, data1.result.DT_TablePageInfoT1.TotalCount, filter.pageSize, data); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public override async Task<ServicePageResult<Ghre_QuestionDto>> QueryFilterPage(QueryBody filter) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RefAsync<int> totalCount = 0; |
|
|
|
|
|
|
|
string sql = @"SELECT *
|
|
|
|
|
|
|
|
FROM (SELECT A.*, |
|
|
|
|
|
|
|
B.CourseName, |
|
|
|
|
|
|
|
C.Id CourseTypeId, |
|
|
|
|
|
|
|
C.ClassName CourseType |
|
|
|
|
|
|
|
FROM Ghre_Question A |
|
|
|
|
|
|
|
LEFT JOIN Ghre_Course B ON A.CourseId = B.Id |
|
|
|
|
|
|
|
LEFT JOIN Ghre_CourseClass C ON B.CourseClassId = C.Id |
|
|
|
|
|
|
|
WHERE A.IsEnable = 1) A";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(filter.orderBy)) |
|
|
|
|
|
|
|
filter.orderBy = "CreateTime DESC"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string conditions = "1=1"; |
|
|
|
|
|
|
|
if (filter.jsonParam != null) |
|
|
|
|
|
|
|
foreach (JProperty jProperty in filter.jsonParam.Properties()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var name = jProperty.Name; |
|
|
|
|
|
|
|
var value = jProperty.Value.ToString(); |
|
|
|
|
|
|
|
if (name == "page" || name == "pageSize") |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(value)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var jsonParam = JsonConvert.DeserializeObject<JsonParam>(value); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (jsonParam.operationKey) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
case "Include": |
|
|
|
|
|
|
|
conditions += $" AND {name} LIKE '%{jsonParam.columnValue}%'"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "NotInclude": |
|
|
|
|
|
|
|
conditions += $" AND {name} NOT LIKE '%{jsonParam.columnValue}%'"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "IsNull": |
|
|
|
|
|
|
|
conditions += $" AND {name} IS NULL"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "NotNull": |
|
|
|
|
|
|
|
conditions += $" AND {name} IS NOT NULL"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "Equal": |
|
|
|
|
|
|
|
conditions += $" AND {name} ='{jsonParam.columnValue}'"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "NotEqual": |
|
|
|
|
|
|
|
conditions += $" AND {name} !='{jsonParam.columnValue}'"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (filter.pageSize == 0) |
|
|
|
|
|
|
|
filter.pageSize = 10000; |
|
|
|
|
|
|
|
var data = await Db.SqlQueryable<Ghre_QuestionDto>(sql) |
|
|
|
|
|
|
|
.OrderBy(filter.orderBy) |
|
|
|
|
|
|
|
.ToPageListAsync(filter.pageNum, filter.pageSize, totalCount); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new ServicePageResult<Ghre_QuestionDto>(filter.pageNum, totalCount, filter.pageSize, data); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// |
|
|
|
/// |
|
|
|