From 2e1c911889f8ff78f641f81db6a653d3c3f26afa Mon Sep 17 00:00:00 2001
From: gaofei1985 <181547018@qq.com>
Date: Wed, 27 Sep 2023 17:33:57 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
SGGL/BLL/API/HSSE/APIResourcesService.cs | 46 +++++++++++++++++-------
1 file changed, 33 insertions(+), 13 deletions(-)
diff --git a/SGGL/BLL/API/HSSE/APIResourcesService.cs b/SGGL/BLL/API/HSSE/APIResourcesService.cs
index 1aab6df0..21ccacce 100644
--- a/SGGL/BLL/API/HSSE/APIResourcesService.cs
+++ b/SGGL/BLL/API/HSSE/APIResourcesService.cs
@@ -357,22 +357,42 @@ namespace BLL
///
/// 1-checkType;2-专项检查;3-综合检查
///
- public static List getCheckItemSetListBySupCheckItemId(string supTypeId, string checkType)
+ public static List getCheckItemSetListBySupCheckItemId(string supTypeId, string checkType,string supName="")
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
- var getDataLists = from x in db.Technique_CheckItemSet
- where x.CheckType == checkType && (x.SupCheckItem == supTypeId || (supTypeId == null && x.SupCheckItem == "0"))
- orderby x.SortIndex
- select new Model.ResourcesItem
- {
- ResourcesId = x.CheckItemSetId,
- ResourcesCode = x.MapCode,
- ResourcesName = x.CheckItemName,
- SupResourcesId = x.SupCheckItem,
- IsEndLever = x.IsEndLever,
- };
- return getDataLists.ToList();
+ if (!string.IsNullOrEmpty(supName))
+ {
+ var getDataLists = from x in db.Technique_CheckItemSet
+ where x.CheckType == checkType && (x.SupCheckItem == supTypeId || (supTypeId == null && x.SupCheckItem == "0"))
+ && x.CheckItemName.Contains(supName)
+ orderby x.SortIndex
+ select new Model.ResourcesItem
+ {
+ ResourcesId = x.CheckItemSetId,
+ ResourcesCode = x.MapCode,
+ ResourcesName = x.CheckItemName,
+ SupResourcesId = x.SupCheckItem,
+ IsEndLever = x.IsEndLever,
+ };
+ return getDataLists.ToList();
+ }
+ else {
+ var getDataLists = from x in db.Technique_CheckItemSet
+ where x.CheckType == checkType && (x.SupCheckItem == supTypeId || (supTypeId == null && x.SupCheckItem == "0"))
+ orderby x.SortIndex
+ select new Model.ResourcesItem
+ {
+ ResourcesId = x.CheckItemSetId,
+ ResourcesCode = x.MapCode,
+ ResourcesName = x.CheckItemName,
+ SupResourcesId = x.SupCheckItem,
+ IsEndLever = x.IsEndLever,
+ };
+ return getDataLists.ToList();
+ }
+
+
}
}