From e8aabe70a082301a74bd4da5155c849a465462cb Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Mon, 3 Jun 2024 17:08:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=AF=95=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=80=83=E8=AF=95=E6=97=A5=E6=9C=9F=20=E5=8C=BA=E9=97=B4?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Common/Attribute/QueryFilter.cs | 9 +++- .../Ghre/Ghre_ExamServices.cs | 45 ++++++++++++++----- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/Tiobon.Core.Common/Attribute/QueryFilter.cs b/Tiobon.Core.Common/Attribute/QueryFilter.cs index 0fee06e0..6c5a5e10 100644 --- a/Tiobon.Core.Common/Attribute/QueryFilter.cs +++ b/Tiobon.Core.Common/Attribute/QueryFilter.cs @@ -102,6 +102,13 @@ public class JsonParam public string operationKey { get; set; } public string token { get; set; } +} +public class JsonParam1 +{ + public List columnValue { get; set; } + public string operationKey { get; set; } + public string token { get; set; } + } /// @@ -180,7 +187,7 @@ public class QueryExportColumn public string elementType { get; set; } public string commentText { get; set; } - + } public class QueryExportReturn diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs index 83b4d392..48df07c9 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs @@ -213,12 +213,14 @@ public class Ghre_ExamServices : BaseServices totalCount = 0; string sql = @"SELECT * - FROM (SELECT A.*, - B.CourseName, - C.Id CourseTypeId, - C.ClassName CourseType - FROM Ghre_Exam 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"; + FROM (SELECT A.*, + CASE + WHEN A.LinkType = 'CourseId' THEN B.CourseName + WHEN A.LinkType = 'CourseSceneId' THEN D.SceneName + END CourseName, + C.Id CourseTypeId, + C.ClassName CourseType, + E.PaperName ExamPaperName + FROM Ghre_Exam A + LEFT JOIN Ghre_Course B ON A.CourseId = B.Id + LEFT JOIN Ghre_CourseClass C ON B.CourseClassId = C.Id + LEFT JOIN Ghre_CourseScene D ON A.CourseSceneId = D.Id + LEFT JOIN Ghre_ExamPaper E ON A.ExamPaperId = E.Id + WHERE A.IsEnable = 1) A"; if (string.IsNullOrWhiteSpace(filter.orderBy)) filter.orderBy = "CreateTime DESC"; @@ -259,6 +267,14 @@ public class Ghre_ExamServices : BaseServices(value); + conditions += $" AND ((BeginTime BETWEEN '{jsonParam.columnValue[0]}' AND '{jsonParam.columnValue[1]}') OR (EndTime BETWEEN '{jsonParam.columnValue[0]}' AND '{jsonParam.columnValue[1]}'))"; + + continue; + } + if (!string.IsNullOrWhiteSpace(value)) { var jsonParam = JsonConvert.DeserializeObject(value); @@ -313,6 +329,13 @@ public class Ghre_ExamServices : BaseServices(filter.pageNum, totalCount, filter.pageSize, data);