Browse Source

with(nolock)拼写错误修改

zhoufan 7 years ago
parent
commit
55046ce8f8

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

672
         public DataSet GetList(string strWhere)
672
         public DataSet GetList(string strWhere)
673
         {
673
         {
674
             StringBuilder strSql = new StringBuilder();
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
             if (strWhere.Trim() != "")
676
             if (strWhere.Trim() != "")
677
             {
677
             {
678
                 strSql.Append(" where " + strWhere);
678
                 strSql.Append(" where " + strWhere);

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

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

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

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

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

153
         public DataSet GetList(string strWhere)
153
         public DataSet GetList(string strWhere)
154
         {
154
         {
155
             StringBuilder strSql = new StringBuilder();
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
             if (strWhere.Trim() != "")
158
             if (strWhere.Trim() != "")
159
             {
159
             {
160
                 strSql.Append(" where " + strWhere);
160
                 strSql.Append(" where " + strWhere);

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

943
             string sql = " ISNULL(a.IsDelete,0) = 0 AND ISNULL(c.F_DeleteFlag,0) = 0 "; // AND ISNULL(b.IsRead,0) = 0
943
             string sql = " ISNULL(a.IsDelete,0) = 0 AND ISNULL(c.F_DeleteFlag,0) = 0 "; // AND ISNULL(b.IsRead,0) = 0
944
             sql += " and b.ToUserId = " + userId + " and ISNULL(b.IsRead,0) = 0 ";
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
             dt = DbHelperSQL.Query(sql1).Tables[0];
947
             dt = DbHelperSQL.Query(sql1).Tables[0];
948
             recordCount = dt.Rows.Count;
948
             recordCount = dt.Rows.Count;
949
 
949
 

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

1378
             DataRow dr = dt.NewRow();
1378
             DataRow dr = dt.NewRow();
1379
             dr["TypeName"] = "工单总计";
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
             dr["Count"] = DbHelperSQL.GetSingle(sqlzj).ToString();
1382
             dr["Count"] = DbHelperSQL.GetSingle(sqlzj).ToString();
1383
 
1383
 
1384
             dt.Rows.InsertAt(dr, 0);
1384
             dt.Rows.InsertAt(dr, 0);
1386
             DataRow dr1 = dt.NewRow();
1386
             DataRow dr1 = dt.NewRow();
1387
             dr1["TypeName"] = "今日受理量";
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
             dr1["Count"] = DbHelperSQL.GetSingle(sqldayaccept).ToString();
1390
             dr1["Count"] = DbHelperSQL.GetSingle(sqldayaccept).ToString();
1391
 
1391
 
1392
             dt.Rows.InsertAt(dr1, 1);
1392
             dt.Rows.InsertAt(dr1, 1);
1394
             DataRow dr2 = dt.NewRow();
1394
             DataRow dr2 = dt.NewRow();
1395
             dr2["TypeName"] = "今日交办量";
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
             dr2["Count"] = DbHelperSQL.GetSingle(sqldayassign).ToString();
1398
             dr2["Count"] = DbHelperSQL.GetSingle(sqldayassign).ToString();
1399
 
1399
 
1400
             dt.Rows.InsertAt(dr2, 2);
1400
             dt.Rows.InsertAt(dr2, 2);
1424
 
1424
 
1425
             for (int i = 0; i < hours.Length; i++)
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
                     + " and datediff(day, BeginTime, '" + strdate + "') = 0  and datepart(hh,BeginTime)=" + hours[i];
1428
                     + " and datediff(day, BeginTime, '" + strdate + "') = 0  and datepart(hh,BeginTime)=" + hours[i];
1429
                 var c = Int32.Parse(DbHelperSQL.Query(sql).Tables[0].Rows[0][0].ToString());
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
                     + "and datediff(day, BeginTime,  '" + strdate + "') = 0 and datepart(hh,BeginTime)=" + hours[i];
1432
                     + "and datediff(day, BeginTime,  '" + strdate + "') = 0 and datepart(hh,BeginTime)=" + hours[i];
1433
                 var t = Int32.Parse(DbHelperSQL.Query(sql).Tables[0].Rows[0][0].ToString());
1433
                 var t = Int32.Parse(DbHelperSQL.Query(sql).Tables[0].Rows[0][0].ToString());
1434
 
1434
 
1460
             string strdate = date.Value.ToString("yyyy-MM-dd");
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
                 + "CallState=1 and datediff(day, BeginTime, '" + strdate + "') = 0 group by datepart(hh,BeginTime) ";
1464
                 + "CallState=1 and datediff(day, BeginTime, '" + strdate + "') = 0 group by datepart(hh,BeginTime) ";
1465
             DataTable dt = DbHelperSQL.Query(sql).Tables[0];
1465
             DataTable dt = DbHelperSQL.Query(sql).Tables[0];
1466
 
1466