From 92d68fe5ecb24f070a9b46e0409f52d5dd0d9081 Mon Sep 17 00:00:00 2001
From: 沈泽 <211959439@qq.com>
Date: 星期一, 06 九月 2021 09:31:28 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs |   45 ++++++++++++++++++++++++++++++++++++---------
 1 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
index 1733451..dc8b188 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
@@ -9,6 +9,7 @@
     public class Sb_EquipDotCheckPlanBillController : ApiController
     {
         private json objJsonResult = new json();
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
         public DataSet ds = new DataSet();
 
         #region 璁惧鐐规璁″垝琛�
@@ -23,12 +24,38 @@
         {
             try
             {
-                ds = Sb_EquipDotCheckPlanBillList_s(sWhere);
-                objJsonResult.code = "1";
-                objJsonResult.count = 1;
-                objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
-                objJsonResult.data = ds.Tables[0];
-                return objJsonResult;
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Sb_EquipDotCheckPlanBillList " + sWhere + " order by hmainid desc", "h_v_Sb_EquipDotCheckPlanBillList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Sb_EquipDotCheckPlanBillList where 1 = 1";
+                    string sql = sql1 + sWhere + " order by hmainid desc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckPlanBillList");
+                }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁浣犺鎵剧殑璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+                //ds = Sb_EquipDotCheckPlanBillList_s(sWhere);
+                //objJsonResult.code = "1";
+                //objJsonResult.count = 1;
+                //objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+                //objJsonResult.data = ds.Tables[0];
+                //return objJsonResult;
             }
             catch (Exception ex)
             {
@@ -285,7 +312,7 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart ,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,HManagerID from h_v_Sb_EquipDotCheckPlanBillList_Edit", "h_v_Sb_EquipDotCheckPlanBillList_Edit");
+                    ds = oCN.RunProcReturn("select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart ,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,璐熻矗浜轰唬鐮� HManagerID,璐熻矗浜� HManagerName from h_v_Sb_EquipDotCheckPlanBillList", "h_v_Sb_EquipDotCheckPlanBillList");
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
@@ -293,9 +320,9 @@
                 }
                 else
                 {
-                    string sql1 = "select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,HManagerID from h_v_Sb_EquipDotCheckPlanBillList_Edit where 1 = 1 ";
+                    string sql1 = "select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart ,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,璐熻矗浜轰唬鐮� HManagerID,璐熻矗浜� HManagerName from h_v_Sb_EquipDotCheckPlanBillList where 1 = 1 ";
                     string sql = sql1 + sqlWhere;
-                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckPlanBillList_Edit");
+                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckPlanBillList");
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";

--
Gitblit v1.9.1