|
|
@@ -76,26 +76,27 @@ namespace CallCenterApi.Interface.Controllers.RegRecords
|
|
76
|
76
|
//转入
|
|
77
|
77
|
|
|
78
|
78
|
//已接收非本部门的数据不可看到
|
|
79
|
|
- sql += @" and (isnull((
|
|
80
|
|
-select top 1 F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 order by F_Id desc),0)=0 or
|
|
|
79
|
+ sql += @" and (
|
|
81
|
80
|
isnull((
|
|
82
|
81
|
select top 1 F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 order by F_Id desc ),0)=
|
|
83
|
82
|
" + CurrentUser.UserData.F_DeptId + ")";
|
|
84
|
|
-
|
|
|
83
|
+ // isnull((
|
|
|
84
|
+//select top 1 F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId = T_Rec_RegRecords.F_Id and F_type = 1 order by F_Id desc),0)= 0 or
|
|
85
|
85
|
|
|
86
|
86
|
}
|
|
87
|
87
|
else {
|
|
88
|
88
|
|
|
89
|
89
|
//已接收非本部门的数据不可看到
|
|
90
|
|
- sql += @" and (isnull((
|
|
91
|
|
-select top 1 F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 order by F_Id desc ),0)=0 or
|
|
|
90
|
+ sql += @" and ((isnull((
|
|
|
91
|
+select top 1 F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 order by F_Id desc ),0)=0 and ( F_ZXZType='" + Zsz + @"') )or
|
|
92
|
92
|
isnull((
|
|
93
|
93
|
select top 1 F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 order by F_Id desc ),0)=
|
|
94
|
|
-" + CurrentUser.UserData.F_DeptId + ")";
|
|
95
|
|
- if (Zsz != "")
|
|
96
|
|
- {
|
|
97
|
|
- sql += " and ( F_ZXZType='" + Zsz + "')";
|
|
98
|
|
- }
|
|
|
94
|
+" + CurrentUser.UserData.F_DeptId +
|
|
|
95
|
+")";
|
|
|
96
|
+ //if (Zsz != "")
|
|
|
97
|
+ //{
|
|
|
98
|
+ // sql += " and ( F_ZXZType='" + Zsz + "')";
|
|
|
99
|
+ //}
|
|
99
|
100
|
}
|
|
100
|
101
|
|
|
101
|
102
|
|
|
|
@@ -107,7 +108,7 @@ select top 1 F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegReco
|
|
107
|
108
|
(select F_Name from T_Cus_Customer where F_Id=F_CusID) CusName,
|
|
108
|
109
|
(select top 1 F_CreateUserName from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id order by F_Id desc ) as Auser,
|
|
109
|
110
|
(select top 1 F_CreateDate from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id order by F_Id desc ) as ADate,
|
|
110
|
|
- ( select top 1 F_deptname from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id order by F_Id desc ) as Adepname,
|
|
|
111
|
+(select F_DeptName from T_Sys_Department where F_DeptId= ( select top 1 F_deptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id order by F_Id desc )) as Adepname,
|
|
111
|
112
|
(select top 1 F_Bdeptname from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id order by F_Id desc ) as ABDepName,
|
|
112
|
113
|
(select top 1 F_type from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id order by F_Id desc ) as AType,
|
|
113
|
114
|
(select top 1 F_Id from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id order by F_Id desc ) as Aid,
|