From 1b9a56fcf3ffcf0f69ed8b7447322d0a75ba99ac Mon Sep 17 00:00:00 2001
From: wzp <2040239371@qq.com>
Date: 星期四, 02 三月 2023 15:31:14 +0800
Subject: [PATCH] 清理dataAccess,避免报错

---
 web/Dao/GwClientDao.cs |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/web/Dao/GwClientDao.cs b/web/Dao/GwClientDao.cs
index 4b8cc89..5753d21 100644
--- a/web/Dao/GwClientDao.cs
+++ b/web/Dao/GwClientDao.cs
@@ -29,7 +29,7 @@
         /// <param name="productId">浜у搧ID</param>
         /// <returns></returns>
         //public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string clientName, string telphone, string agent)
-        public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string clientName, string telephone, string agent, string company, string salesman, string supportStaff, string productId, int isEnable, string permissionsSQL )
+        public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string clientName, string telephone, string agent, string company, string salesman, string supportStaff, string productId, int isEnable,int isSub, string permissionsSQL )
         {
 
             List<GwClient> list = new List<GwClient>();
@@ -46,7 +46,7 @@
                 stringBuilder.Append(" ) t on t.client_id = gwc.client_id ");
                 //stringBuilder.Append("from GW_CLIENT where 1=1");
                 stringBuilder.Append(" WHERE 1=1");
-                OracleParameter[] oracleParameterArray = new OracleParameter[8];
+                OracleParameter[] oracleParameterArray = new OracleParameter[9];
                 if (clientID != null && clientID != "")
                 {
                     oracleParameterArray[0] = new OracleParameter(":ClientID", (OracleDbType)126);
@@ -97,11 +97,27 @@
                     stringBuilder.Append(" and gwc.IS_ENABLE = :IS_ENABLE");
                 }
 
+                //鏄惁涓�绾ц处鎴枫��0涓轰竴绾�
+                if (isSub == 0)
+                {
+                    oracleParameterArray[8] = new OracleParameter(":CLIENT_PARENTID", OracleDbType.Int32);
+                    ((DbParameter)oracleParameterArray[8]).Value = (object)(isSub);
+                    stringBuilder.Append(" and gwc.CLIENT_PARENTID = :CLIENT_PARENTID");
+                }
+                else
+                {
+                    oracleParameterArray[8] = new OracleParameter(":CLIENT_PARENTID", OracleDbType.Int32);
+                    ((DbParameter)oracleParameterArray[8]).Value = (object)(isSub);
+                    stringBuilder.Append(" and gwc.CLIENT_PARENTID != :CLIENT_PARENTID");
+                }
+
+
                 if (productId != null && productId != "")
                 {
                     stringBuilder.Append(" and gwc.CLIENT_ID IN ( SELECT distinct CLIENT_ID  FROM GW_SP WHERE PRODUCT_ID = '" + productId + "' )");
                 }
 
+
                 //瀹㈡埛鏉冮檺SQL鑴氭湰
                 stringBuilder.Append(permissionsSQL);
 

--
Gitblit v1.9.1