<%
|
Set rsDt = Server.CreateObject("ADODB.Recordset")
|
acc1=request("page")
|
if acc1=empty then acc1=clng(1)
|
QuantityInt = 100
|
acc2=0
|
acc3=0
|
|
if searchTXT<>"" Then
|
searchSql=" and (OA_Name like '%"&searchTXT&"%') "
|
else
|
searchSql=""
|
end If
|
If InStr(orderby," desc")>1 Then
|
orderbydesc=""
|
descTXT="↓"
|
Else
|
orderbydesc=" desc"
|
descTXT="↑"
|
End If
|
'sql="select * from (select vID,HospName,OutHosp=(select count(ServiceOrdPtOutHosp) from ServiceOrder where ServiceOrdPtOutHosp=vID and ServiceOrd_CC_Time "&SqlOrdDateType&"),InHosp=(select count(ServiceOrdPtInHosp) from ServiceOrder where ServiceOrdPtInHosp=vID and ServiceOrd_CC_Time "&SqlOrdDateType&") from HospData,dictionary where vtitle='HospName' and HospState=1 and vtext=HospName GROUP BY vID,HospName) as aa order by OutHosp+OutHosp desc"
|
If orderby="" Then
|
orderby="OA_DepartmentID,OA_User_ID"
|
descTXT="↓"
|
End If
|
'sql="select * from (select HospID,HospName,OutHosp=(select count(ServiceOrdPtOutHospID) from ServiceOrder where ServiceOrdPtOutHospID=HospID and ServiceOrd_CC_Time "&SqlOrdDateType&" and ServiceOrdState=3),OutHospPrice=isnull((select SUM(ServiceOrdTraTxnPrice) from ServiceOrder where ServiceOrdPtOutHospID=HospID and ServiceOrd_CC_Time "&SqlOrdDateType&" and ServiceOrdState=3),0),InHosp=(select count(ServiceOrdPtInHospID) from ServiceOrder where ServiceOrdPtInHospID=HospID and ServiceOrd_CC_Time "&SqlOrdDateType&" and ServiceOrdState=3),InHospPrice=isnull((select SUM(ServiceOrdTraTxnPrice) from ServiceOrder where ServiceOrdPtInHospID=HospID and ServiceOrd_CC_Time "&SqlOrdDateType&" and ServiceOrdState=3),0) from HospData where HospState=1"&searchSql&" GROUP BY HospID,HospName) as aa where (OutHosp>0 or OutHospPrice>0 or InHosp>0 or InHospPrice>0) order by "&Replace(orderby,"|","+")
|
sql="select OA_User_ID,OA_Name,OA_DepartmentID,DispatchOrdInt=count(DispatchOrdID),sumMileage=sum(DispatchOrdMileage),sumWhenLong=sum(datediff(Minute,DispatchOrdActualDate,DispatchOrdReturnDate)),Guest_Point_sum1=isnull(sum(Guest_Point_1),0),Guest_Point_sum2=isnull(sum(Guest_Point_2),0) from DispatchOrd_Entourage,DispatchOrd,OA_User where OA_User_ID=EntourageOAid and DispatchOrdID=DispatchOrdIDDt and (OA_DepartmentID<=11 or OA_DepartmentID in (157,158,215)) and DispatchOrdState in (8,9) and EntourageState=3 and DispatchOrd_NS_Time "&SqlOrdDateType&searchSql&" GROUP BY OA_User_ID,OA_Name,OA_DepartmentID order by "&Replace(orderby,"|","+")
|
|
sql="select OA_User_ID,OA_Name,OA_DepartmentID,DispatchOrdInt=count(DispatchOrdID),sumMileage=sum(DispatchOrdMileage),sumWhenLong=sum(datediff(Minute,DispatchOrdActualDate,DispatchOrdReturnDate)),Guest_Point_sum1=isnull(sum(Guest_Point_1),0),Guest_Point_sum2=isnull(sum(Guest_Point_2),0),OT1_Int=sum(EntourageOT_is),OT2_Int=sum(EntourageOT2_is) from DispatchOrd_Entourage,DispatchOrd,OA_User where OA_User_ID=EntourageOAid and DispatchOrdID=DispatchOrdIDDt and (OA_DepartmentID<=11 or OA_DepartmentID in (157,158,215)) and DispatchOrdState in (8,9) and EntourageState<>4 and DispatchOrd_NS_Time "&SqlOrdDateType&searchSql&" GROUP BY OA_User_ID,OA_Name,OA_DepartmentID order by "&Replace(orderby,"|","+")
|
'If Right(sql,2)=", " Then sql=Left(sql,Len(sql)-2)
|
'Response.Write sql
|
rs.open sql,objConn,1,1
|
if not rs.eof then
|
rs.pagesize=QuantityInt
|
rs.absolutepage=acc1
|
acc2=rs.pagecount
|
acc3=rs.recordcount
|
else
|
SystemMessageType=2
|
SystemMessageTXT="数据库中相关无数据!"
|
end If
|
If SystemMessageType<>"2" then
|
Dim FormArray()
|
ArrayX=50
|
If acc3<QuantityInt Or (is_CSV=1 And acc3>QuantityInt) Then
|
ArrayY=acc3
|
Else
|
ArrayY=QuantityInt
|
End If
|
'表头
|
FormFields="序号,部门,员工,出车次数,累计公里数,累积时长,加班补贴单量,加班绩效单量,评分次数,技能水平平均分,服务态度平均分,操作"
|
FormFields=split(FormFields,",")
|
ArrayX=ubound(FormFields)+1
|
REDIM FormArray(ArrayX,ArrayY+1)
|
for i=0 to ubound(FormFields)
|
FormArray((i+1),0)=FormFields(i)
|
next
|
Y=1
|
do while not rs.Eof and Y<=ArrayY
|
'读取数据
|
OA_User_ID = rs("OA_User_ID")
|
OA_Name = rs("OA_Name")
|
OA_DepartmentID = rs("OA_DepartmentID")
|
OA_Department = OADepartment(OA_DepartmentID,"DepartmentName")
|
DispatchOrdInt = rs("DispatchOrdInt")
|
sumMileage = rs("sumMileage")
|
sumWhenLong = rs("sumWhenLong")
|
OT1_Int = rs("OT1_Int")
|
OT2_Int = rs("OT2_Int")
|
Guest_Point_sum1 = rs("Guest_Point_sum1")
|
Guest_Point_sum2 = rs("Guest_Point_sum2")
|
If Guest_Point_sum1>0 Or Guest_Point_sum2>0 Then
|
sql="select count(id) from DispatchOrd_Entourage,DispatchOrd where DispatchOrdID=DispatchOrdIDDt and DispatchOrdState in (8,9) and EntourageState=3 and DispatchOrd_NS_Time "&SqlOrdDateType&searchSql&" and EntourageOAid="&OA_User_ID&" and (Guest_Point_1>0 or Guest_Point_2>0)"
|
rsDt.open sql,objConn,1,1
|
Guest_Point_Int=rsDt(0)
|
rsDt.close()
|
Guest_Point_sum1=FormatNumber(Guest_Point_sum1/Guest_Point_Int,1)
|
Guest_Point_sum2=FormatNumber(Guest_Point_sum2/Guest_Point_Int,1)
|
Else
|
Guest_Point_Int=0
|
End If
|
|
Y=Y+1
|
'读取数据--End
|
|
'写入数组
|
FormArray(1,Y)=(Y-1)+((acc1-1)*QuantityInt)
|
FormArray(2,Y)="<a href=""DispatchOrder_List.gds?OrdDateType="&OrdDateType&"&OrdClassList=0&h_menu1_1=1&searchTXT=staff|"&OA_User_ID&"&OrdDateStart="&OrdDateStart&"&OrdDateEnd="&OrdDateEnd&""" target=""_blank"">"&OA_Department&"</a>"
|
FormArray(3,Y)="<a href=""DispatchOrder_List.gds?OrdDateType="&OrdDateType&"&OrdClassList=0&h_menu1_1=1&searchTXT=staff|"&OA_User_ID&"&OrdDateStart="&OrdDateStart&"&OrdDateEnd="&OrdDateEnd&""" target=""_blank"">"&OA_Name&"</a>"
|
FormArray(4,Y)=DispatchOrdInt
|
FormArray(5,Y)="<a href=""DispatchOrder_List.gds?OrdDateType="&OrdDateType&"&OrdClassList=0&h_menu1_1=1&searchTXT=staff|"&OA_User_ID&"&OrdDateStart="&OrdDateStart&"&OrdDateEnd="&OrdDateEnd&""" target=""_blank"">"&sumMileage&" 公里</a>"
|
FormArray(6,Y)="<a href=""DispatchOrder_List.gds?OrdDateType="&OrdDateType&"&OrdClassList=0&h_menu1_1=1&searchTXT=staff|"&OA_User_ID&"&OrdDateStart="&OrdDateStart&"&OrdDateEnd="&OrdDateEnd&""" target=""_blank"">"&mtodhm(sumWhenLong)&"</a>"
|
FormArray(7,Y)=OT1_Int
|
FormArray(8,Y)=OT2_Int
|
FormArray(9,Y)=Guest_Point_Int
|
FormArray(10,Y)=Guest_Point_sum1
|
FormArray(11,Y)=Guest_Point_sum2
|
FormArray(12,Y)="<a href=""DispatchOrder_List.gds?OrdDateType="&OrdDateType&"&OrdClassList=0&h_menu1_1=1&searchTXT=staff|"&OA_User_ID&"&OrdDateStart="&OrdDateStart&"&OrdDateEnd="&OrdDateEnd&""" target=""_blank"">查看明细</a>"
|
'写入数组--End
|
|
rs.movenext
|
Loop
|
'REDIM FormArray(ArrayX,Y)
|
rs.close()
|
End If
|
%>
|