|
|
@@ -27,7 +27,7 @@ namespace CallCenterApi.Interface.Controllers.RegRecords
|
|
27
|
27
|
}
|
|
28
|
28
|
if (!string.IsNullOrWhiteSpace(key))
|
|
29
|
29
|
{
|
|
30
|
|
- sql += " and (F_RecCode like '%" + key.Trim() + "%' or F_Complained like '%" + key.Trim() + "%' or F_Content like '%" + key.Trim() + "%' or F_Remark like '%" + key.Trim() + "%')";
|
|
|
30
|
+ sql += " and ( F_Unit like '%" + key.Trim() + "%' or F_RecCode like '%" + key.Trim() + "%' or F_Complained like '%" + key.Trim() + "%' or F_Content like '%" + key.Trim() + "%' or F_Remark like '%" + key.Trim() + "%')";
|
|
31
|
31
|
}
|
|
32
|
32
|
if (!string.IsNullOrWhiteSpace(tel))
|
|
33
|
33
|
{
|
|
|
@@ -48,39 +48,55 @@ namespace CallCenterApi.Interface.Controllers.RegRecords
|
|
48
|
48
|
{
|
|
49
|
49
|
sql += " and F_CreateOn < '" + Convert.ToDateTime(endtime.Trim()) + "' ";
|
|
50
|
50
|
}
|
|
51
|
|
- if (innerType==0) {
|
|
|
51
|
+ if (innerType == 0)
|
|
|
52
|
+ {
|
|
52
|
53
|
//转移
|
|
53
|
54
|
if (CurrentUser.UserData.F_DeptId == 1)
|
|
54
|
55
|
{
|
|
55
|
56
|
sql += " and( F_Id in(select F_CustomerId from T_Sys_ATheChangeLog where isnull(F_type,0)=0 ))";
|
|
56
|
57
|
}
|
|
57
|
|
- else {
|
|
|
58
|
+ else
|
|
|
59
|
+ {
|
|
58
|
60
|
sql += " and( F_Id in(select F_CustomerId from T_Sys_ATheChangeLog where isnull(F_type,0)=0 and F_Bdeptid=" + CurrentUser.UserData.F_DeptId + "))";
|
|
59
|
61
|
}
|
|
60
|
|
-
|
|
|
62
|
+
|
|
61
|
63
|
|
|
62
|
64
|
}
|
|
63
|
|
- if (innerType == 1)
|
|
|
65
|
+ else if (innerType == 1)
|
|
64
|
66
|
{
|
|
65
|
|
- if (CurrentUser.UserData.F_DeptId == 1) {
|
|
66
|
|
- sql += " and( F_Id in(select ( select F_CustomerId from T_Sys_ATheChangeLog where F_Id=F_ATheChangeLog) from T_Sys_BTheChangeLog ) )";
|
|
|
67
|
+ if (CurrentUser.UserData.F_DeptId == 1)
|
|
|
68
|
+ {
|
|
|
69
|
+ sql += " and( F_Id in(select ( select F_CustomerId from T_Sys_ATheChangeLog where F_Id=F_ATheChangeLog) from T_Sys_BTheChangeLog ) )";
|
|
67
|
70
|
//sql += " and (F_Id in( select F_CustomerId from T_Sys_ATheChangeLog ))";
|
|
68
|
71
|
}
|
|
69
|
|
- else{
|
|
|
72
|
+ else
|
|
|
73
|
+ {
|
|
70
|
74
|
sql += " and( F_Id in(select ( select F_CustomerId from T_Sys_ATheChangeLog where F_Id=F_ATheChangeLog) from T_Sys_BTheChangeLog where F_deptid=" + CurrentUser.UserData.F_DeptId + ") )";
|
|
71
|
75
|
}
|
|
72
|
76
|
//转入
|
|
73
|
|
-
|
|
74
|
|
- }
|
|
75
|
|
- if (Zsz!="") {
|
|
76
|
|
- sql += " and ( F_ZXZType='" + CurrentUser.UserData.F_SeartGroup+"')";
|
|
|
77
|
+
|
|
|
78
|
+ //已接收非本部门的数据不可看到
|
|
|
79
|
+ sql += @" and (isnull((
|
|
|
80
|
+select F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 ),0)=0 or
|
|
|
81
|
+isnull((
|
|
|
82
|
+select F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 ),0)=
|
|
|
83
|
+" + CurrentUser.UserData.F_DeptId + ")";
|
|
|
84
|
+
|
|
|
85
|
+
|
|
77
|
86
|
}
|
|
78
|
|
- //已接收非本部门的数据不可看到
|
|
79
|
|
- sql += @" and (isnull((
|
|
|
87
|
+ else {
|
|
|
88
|
+
|
|
|
89
|
+ //已接收非本部门的数据不可看到
|
|
|
90
|
+ sql += @" and (isnull((
|
|
80
|
91
|
select F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 ),0)=0 or
|
|
81
|
92
|
isnull((
|
|
82
|
93
|
select F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 ),0)<>
|
|
83
|
|
-"+ CurrentUser.UserData.F_DeptId +")";
|
|
|
94
|
+" + CurrentUser.UserData.F_DeptId + ")";
|
|
|
95
|
+ }
|
|
|
96
|
+ if (Zsz!="") {
|
|
|
97
|
+ sql += " and ( F_ZXZType='" + Zsz + "')";
|
|
|
98
|
+ }
|
|
|
99
|
+
|
|
84
|
100
|
|
|
85
|
101
|
#endregion
|
|
86
|
102
|
int recordCount = 0;
|