CommandText=@" select a.ConfirmTime,Case When isnull(e.Names,'')='' then '其他' else e.Names End as ConfirmUserClass
,Case When a.ConfirmUserClass='PG' Then '程序' When a.ConfirmUserClass='PE' Then '承辦人' When a.ConfirmUserClass='Leader' Then '主管' else '其他' End as ConfirmUserClass
,Case When isnull(f.Names,'')='' then '其他' else f.Names end as ConfirmMethod
,Case When a.ConfirmMethod='CF' Then '確認' When a.ConfirmMethod='RJ' Then '退回' When a.ConfirmMethod='RV' Then '撤回'
When a.ConfirmMethod='RJTOp' Then '轉運營辦' When a.ConfirmMethod='CFTLd' Then '待轉運營辦' When a.ConfirmMethod='SL' Then '結算' else '其他' End as ConfirmMethod
,a.Create_time,d.cn_name as Create_User_Name,b.Step_Text as ""From"",c.Step_Text as ""To"",a.Description
,a.Create_time,d.cn_name as Create_User_Name,b.Step_Text as ""From"",c.Step_Text as ""To"",a.Description
from esn_Todos_flow_his a
from esn_Todos_flow_his a
left join esn_todos_Flow_StepType b on a.FromType_id = b.id
left join esn_todos_Flow_StepType b on a.FromType_id = b.id
left join esn_todos_Flow_StepType c on a.ToType_id = c.id
left join esn_todos_Flow_StepType c on a.ToType_id = c.id
left join evw_Employee d on a.Create_User_id = d.user_id
left join evw_Employee d on a.Create_User_id = d.user_id
left join esn_category e on e.ParentId='Flow_Role' and a.ConfirmUserClass = e.QryKey1
left join esn_category f on f.ParentId='Flow_Method' and a.ConfirmMethod = f.QryKey1