Kaynağa Gözat

with(nolock)拼写错误修改

zhoufan 7 yıl önce
ebeveyn
işleme
55046ce8f8

+ 1 - 1
CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder.cs

@@ -672,7 +672,7 @@ namespace CallCenterApi.DAL
672 672
         public DataSet GetList(string strWhere)
673 673
         {
674 674
             StringBuilder strSql = new StringBuilder();
675
-            strSql.Append("select * FROM T_Bus_WorkOrder  WHTH(NOLOCK)");
675
+            strSql.Append("select * FROM T_Bus_WorkOrder  WITH(NOLOCK)");
676 676
             if (strWhere.Trim() != "")
677 677
             {
678 678
                 strSql.Append(" where " + strWhere);

+ 7 - 7
CallCenterApi/CallCenterApi.DAL/T_Call_CallRecords.cs

@@ -448,7 +448,7 @@ namespace CallCenterApi.DAL
448 448
         {
449 449
 
450 450
             StringBuilder strSql = new StringBuilder();
451
-            strSql.Append("select  top 1 * from T_Call_CallRecords  WHTH(NOLOCK)");
451
+            strSql.Append("select  top 1 * from T_Call_CallRecords  WITH(NOLOCK)");
452 452
             strSql.Append(" where CallRecordsId=@CallRecordsId");
453 453
             SqlParameter[] parameters = {
454 454
                     new SqlParameter("@CallRecordsId", SqlDbType.Int,4)
@@ -734,7 +734,7 @@ namespace CallCenterApi.DAL
734 734
         {
735 735
             StringBuilder strSql = new StringBuilder();
736 736
             strSql.Append("select * ");
737
-            strSql.Append(" FROM T_Call_CallRecords  WHTH(NOLOCK)");
737
+            strSql.Append(" FROM T_Call_CallRecords  WITH(NOLOCK)");
738 738
             if (strWhere.Trim() != "")
739 739
             {
740 740
                 strSql.Append(" where " + strWhere);
@@ -754,7 +754,7 @@ namespace CallCenterApi.DAL
754 754
                 strSql.Append(" top " + Top.ToString());
755 755
             }
756 756
             strSql.Append(" * ");
757
-            strSql.Append(" FROM T_Call_CallRecords  WHTH(NOLOCK)");
757
+            strSql.Append(" FROM T_Call_CallRecords  WITH(NOLOCK)");
758 758
             if (strWhere.Trim() != "")
759 759
             {
760 760
                 strSql.Append(" where " + strWhere);
@@ -769,7 +769,7 @@ namespace CallCenterApi.DAL
769 769
         public int GetRecordCount(string strWhere)
770 770
         {
771 771
             StringBuilder strSql = new StringBuilder();
772
-            strSql.Append("select count(1) FROM T_Call_CallRecords  WHTH(NOLOCK)");
772
+            strSql.Append("select count(1) FROM T_Call_CallRecords  WITH(NOLOCK)");
773 773
             if (strWhere.Trim() != "")
774 774
             {
775 775
                 strSql.Append(" where " + strWhere);
@@ -976,7 +976,7 @@ namespace CallCenterApi.DAL
976 976
         public Model.T_Call_CallRecords GetModelByTelphone(string CallNumber)
977 977
         {
978 978
             StringBuilder strSql = new StringBuilder();
979
-            strSql.Append("select  top 1 * from T_Call_CallRecords  WHTH(NOLOCK)");
979
+            strSql.Append("select  top 1 * from T_Call_CallRecords  WITH(NOLOCK)");
980 980
             strSql.Append(" where CallNumber=@CallNumber order by BeginTime desc");
981 981
             SqlParameter[] parameters = {
982 982
                     new SqlParameter("@CallNumber", SqlDbType.VarChar,100)
@@ -1000,7 +1000,7 @@ namespace CallCenterApi.DAL
1000 1000
         public Model.T_Call_CallRecords GetModelByCallId(string CallId)
1001 1001
         {
1002 1002
             StringBuilder strSql = new StringBuilder();
1003
-            strSql.Append("select  top 1 * from T_Call_CallRecords  WHTH(NOLOCK)");
1003
+            strSql.Append("select  top 1 * from T_Call_CallRecords  WITH(NOLOCK)");
1004 1004
             //strSql.Append(" where CallId=@CallId order by BeginTime desc");
1005 1005
             strSql.Append(" where CallId=@CallId order by BeginTime asc");//三方通话
1006 1006
             SqlParameter[] parameters = {
@@ -1022,7 +1022,7 @@ namespace CallCenterApi.DAL
1022 1022
         public Model.T_Call_CallRecords GetModelByRecordId(string CallId)
1023 1023
         {
1024 1024
             StringBuilder strSql = new StringBuilder();
1025
-            strSql.Append("select  top 1 * from T_Call_CallRecords  WHTH(NOLOCK)");
1025
+            strSql.Append("select  top 1 * from T_Call_CallRecords  WITH(NOLOCK)");
1026 1026
             strSql.Append(" where CallRecordsId=@CallRecordsId order by BeginTime desc");
1027 1027
             SqlParameter[] parameters = {
1028 1028
                     new SqlParameter("@CallRecordsId", SqlDbType.Int)

+ 4 - 4
CallCenterApi/CallCenterApi.DAL/T_Call_CallRecords_QC.cs

@@ -23,7 +23,7 @@ namespace CallCenterApi.DAL
23 23
         public bool Exists(int CallRecordsId)
24 24
         {
25 25
             StringBuilder strSql = new StringBuilder();
26
-            strSql.Append("select count(1) from T_Call_CallRecords  WHTH(NOLOCK)");
26
+            strSql.Append("select count(1) from T_Call_CallRecords  WITH(NOLOCK)");
27 27
             strSql.Append(" where CallRecordsId=@CallRecordsId");
28 28
             SqlParameter[] parameters = {
29 29
                     new SqlParameter("@CallRecordsId", SqlDbType.Int,4)
@@ -417,7 +417,7 @@ namespace CallCenterApi.DAL
417 417
         {
418 418
 
419 419
             StringBuilder strSql = new StringBuilder();
420
-            strSql.Append("select  top 1 * from T_Call_CallRecords  WHTH(NOLOCK)");
420
+            strSql.Append("select  top 1 * from T_Call_CallRecords  WITH(NOLOCK)");
421 421
             strSql.Append(" where CallRecordsId=@CallRecordsId");
422 422
             SqlParameter[] parameters = {
423 423
                     new SqlParameter("@CallRecordsId", SqlDbType.Int,4)
@@ -662,7 +662,7 @@ namespace CallCenterApi.DAL
662 662
                 strSql.Append(" top " + Top.ToString());
663 663
             }
664 664
             strSql.Append(" * ");
665
-            strSql.Append(" FROM T_Call_CallRecords  WHTH(NOLOCK)");
665
+            strSql.Append(" FROM T_Call_CallRecords  WITH(NOLOCK)");
666 666
             if (strWhere.Trim() != "")
667 667
             {
668 668
                 strSql.Append(" where " + strWhere);
@@ -677,7 +677,7 @@ namespace CallCenterApi.DAL
677 677
         public int GetRecordCount(string strWhere)
678 678
         {
679 679
             StringBuilder strSql = new StringBuilder();
680
-            strSql.Append("select count(1) FROM T_Call_CallRecords  WHTH(NOLOCK)");
680
+            strSql.Append("select count(1) FROM T_Call_CallRecords  WITH(NOLOCK)");
681 681
             if (strWhere.Trim() != "")
682 682
             {
683 683
                 strSql.Append(" where " + strWhere);

+ 2 - 2
CallCenterApi/CallCenterApi.DAL/T_Call_WorkOrder.cs

@@ -153,8 +153,8 @@ namespace CallCenterApi.DAL
153 153
         public DataSet GetList(string strWhere)
154 154
         {
155 155
             StringBuilder strSql = new StringBuilder();
156
-            strSql.Append("select F_WORKORDERID,CallId,F_WORKORDERSTATEID,TalkLongTime  WHTH(NOLOCK)");
157
-            strSql.Append(" FROM T_Call_WorkOrder ");
156
+            strSql.Append("select F_WORKORDERID,CallId,F_WORKORDERSTATEID,TalkLongTime  ");
157
+            strSql.Append(" FROM T_Call_WorkOrder WITH(NOLOCK) ");
158 158
             if (strWhere.Trim() != "")
159 159
             {
160 160
                 strSql.Append(" where " + strWhere);

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/IndexController.cs

@@ -943,7 +943,7 @@ namespace CallCenterApi.Interface.Controllers
943 943
             string sql = " ISNULL(a.IsDelete,0) = 0 AND ISNULL(c.F_DeleteFlag,0) = 0 "; // AND ISNULL(b.IsRead,0) = 0
944 944
             sql += " and b.ToUserId = " + userId + " and ISNULL(b.IsRead,0) = 0 ";
945 945
             //查询(聊天记录)
946
-            string sql1 = "SELECT TOP " + top + " a.Id FROM dbo.T_Msg_Chat a RIGHT JOIN dbo.T_Msg_Chat_Map b ON b.ChatId = a.Id LEFT JOIN dbo.T_Sys_UserAccount c ON c.F_UserId = a.FromUserId WHERE " + sql + " ORDER BY a.CreateDate ASC";
946
+            string sql1 = "SELECT TOP " + top + " a.Id FROM dbo.T_Msg_Chat a WITH (NOLOCK) RIGHT JOIN dbo.T_Msg_Chat_Map b WITH (NOLOCK) ON b.ChatId = a.Id LEFT JOIN dbo.T_Sys_UserAccount c WITH (NOLOCK) ON c.F_UserId = a.FromUserId WHERE " + sql + " ORDER BY a.CreateDate ASC";
947 947
             dt = DbHelperSQL.Query(sql1).Tables[0];
948 948
             recordCount = dt.Rows.Count;
949 949
 

+ 6 - 6
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/InfoController.cs

@@ -1378,7 +1378,7 @@ namespace CallCenterApi.Interface.Controllers
1378 1378
             DataRow dr = dt.NewRow();
1379 1379
             dr["TypeName"] = "工单总计";
1380 1380
 
1381
-            string sqlzj = "select COUNT(1) from T_Bus_WorkOrder  WHTH(NOLOCK) where F_IsDelete=0 ";
1381
+            string sqlzj = "select COUNT(1) from T_Bus_WorkOrder  WITH(NOLOCK) where F_IsDelete=0 ";
1382 1382
             dr["Count"] = DbHelperSQL.GetSingle(sqlzj).ToString();
1383 1383
 
1384 1384
             dt.Rows.InsertAt(dr, 0);
@@ -1386,7 +1386,7 @@ namespace CallCenterApi.Interface.Controllers
1386 1386
             DataRow dr1 = dt.NewRow();
1387 1387
             dr1["TypeName"] = "今日受理量";
1388 1388
 
1389
-            string sqldayaccept = "select COUNT(1) from T_Bus_WorkOrder  WHTH(NOLOCK) where F_IsDelete=0 and datediff(day,F_CreateTime,getdate())=0 ";
1389
+            string sqldayaccept = "select COUNT(1) from T_Bus_WorkOrder  WITH(NOLOCK) where F_IsDelete=0 and datediff(day,F_CreateTime,getdate())=0 ";
1390 1390
             dr1["Count"] = DbHelperSQL.GetSingle(sqldayaccept).ToString();
1391 1391
 
1392 1392
             dt.Rows.InsertAt(dr1, 1);
@@ -1394,7 +1394,7 @@ namespace CallCenterApi.Interface.Controllers
1394 1394
             DataRow dr2 = dt.NewRow();
1395 1395
             dr2["TypeName"] = "今日交办量";
1396 1396
 
1397
-            string sqldayassign = "select COUNT(1) from T_Bus_WorkOrder  WHTH(NOLOCK) where F_IsDelete=0 and datediff(day,F_CreateTime,getdate())=0 and isnull(F_IsResult,0)=0 and F_WorkState>1 ";
1397
+            string sqldayassign = "select COUNT(1) from T_Bus_WorkOrder  WITH(NOLOCK) where F_IsDelete=0 and datediff(day,F_CreateTime,getdate())=0 and isnull(F_IsResult,0)=0 and F_WorkState>1 ";
1398 1398
             dr2["Count"] = DbHelperSQL.GetSingle(sqldayassign).ToString();
1399 1399
 
1400 1400
             dt.Rows.InsertAt(dr2, 2);
@@ -1424,11 +1424,11 @@ namespace CallCenterApi.Interface.Controllers
1424 1424
 
1425 1425
             for (int i = 0; i < hours.Length; i++)
1426 1426
             {
1427
-                string sql = " select count(1) from dbo.T_Call_CallRecords  WHTH(NOLOCK) where CallType=0 and CallState=1 and UserCode is not null "
1427
+                string sql = " select count(1) from dbo.T_Call_CallRecords  WITH(NOLOCK) where CallType=0 and CallState=1 and UserCode is not null "
1428 1428
                     + " and datediff(day, BeginTime, '" + strdate + "') = 0  and datepart(hh,BeginTime)=" + hours[i];
1429 1429
                 var c = Int32.Parse(DbHelperSQL.Query(sql).Tables[0].Rows[0][0].ToString());
1430 1430
 
1431
-                sql = " select count(1) from dbo.T_Call_CallRecords  WHTH(NOLOCK) where CallType=0 and UserCode is not null "
1431
+                sql = " select count(1) from dbo.T_Call_CallRecords  WITH(NOLOCK) where CallType=0 and UserCode is not null "
1432 1432
                     + "and datediff(day, BeginTime,  '" + strdate + "') = 0 and datepart(hh,BeginTime)=" + hours[i];
1433 1433
                 var t = Int32.Parse(DbHelperSQL.Query(sql).Tables[0].Rows[0][0].ToString());
1434 1434
 
@@ -1460,7 +1460,7 @@ namespace CallCenterApi.Interface.Controllers
1460 1460
             string strdate = date.Value.ToString("yyyy-MM-dd");
1461 1461
 
1462 1462
             //接通量,通话时长
1463
-            string sql = " select datepart(hh,BeginTime) hor,count(1) con,sum(TalkLongTime) tltimes from T_Call_CallRecords  WHTH(NOLOCK) where "
1463
+            string sql = " select datepart(hh,BeginTime) hor,count(1) con,sum(TalkLongTime) tltimes from T_Call_CallRecords  WITH(NOLOCK) where "
1464 1464
                 + "CallState=1 and datediff(day, BeginTime, '" + strdate + "') = 0 group by datepart(hh,BeginTime) ";
1465 1465
             DataTable dt = DbHelperSQL.Query(sql).Tables[0];
1466 1466