From 33d5d22121c33fde074faa15c1d755b21c44cab6 Mon Sep 17 00:00:00 2001 From: sunliang <593170460@qq.com> Date: Sat, 18 Nov 2023 18:23:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E7=9A=84=E6=A8=A1=E7=B3=8A=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=EF=BC=8C=E6=97=B6=E9=97=B4=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MinioController/MinioApiController.cs | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/IBKLinker-Minio/Controller/MinioController/MinioApiController.cs b/IBKLinker-Minio/Controller/MinioController/MinioApiController.cs index 0eeb085..a5ac32f 100644 --- a/IBKLinker-Minio/Controller/MinioController/MinioApiController.cs +++ b/IBKLinker-Minio/Controller/MinioController/MinioApiController.cs @@ -990,22 +990,43 @@ namespace IBKLinker_Minio.Controller.MinioController /// /// [HttpPost, Route("GetStoragePath")] - public RequestEntity GetStoragePath(string FileName) + public RequestEntity GetStoragePath(GetStoragePathModel PathData) { - RequestEntity request = new RequestEntity(); + RequestEntity request = new RequestEntity();//定义返回集合 try { using (IDbContext db = ObjectContainer.GetObject("db")) { string sql = string.Empty; - IList result = new List(); - if (!string.IsNullOrEmpty(FileName.ToString())) + IList result = new List();//定义查询到的list + if (PathData != null)//传输数据不为空 { - sql += " and FILE_NAME like'%" + FileName + "%'"; + if (!string.IsNullOrEmpty(PathData.FileName.ToString()))//如果有名称模糊查询 + { + sql += " and FILE_NAME like'%" + PathData.FileName + "%'"; + } + if (PathData.Upk >0) //如果在子文件夹内 + { + sql += " and UPK = '"+ PathData .Upk+ "'"; + } + if (!string.IsNullOrEmpty(PathData.BeginTime))//如果有开始时间 + { + sql += string.Format(" and CREATE_TIME >= to_date('{0}', 'yyyy/mm/dd hh24:mi:ss')", PathData.BeginTime);//开始时间 + } + if (!string.IsNullOrEmpty(PathData.EndTime))//如果有结束时间 + { + sql += string.Format(" and CREATE_TIME <= to_date('{0}', 'yyyy/mm/dd hh24:mi:ss')", PathData.EndTime);//结束时间 + } + + request.data = db.Query("select * from MINIO_STORAGE_PATH where 1=1 " + sql + " and CLEAR_FLAG='0' ORDER BY PK"); + request.code = "0"; } + else + { + request.code = "1"; + request.msg = "查询失败,请检查查询条件!"; - request.data = db.Query("select * from MINIO_STORAGE_PATH where 1=1 " + sql + " and CLEAR_FLAG='0' ORDER BY PK"); - request.code = "0"; + } } } catch (Exception ex)