,Case When a.ConfirmUserClass='PG' Then '程序' When a.ConfirmUserClass='PE' Then '承辦人' When a.ConfirmUserClass='Leader' Then '主管' else '其他' End as ConfirmUserClass
,Case When a.ConfirmMethod='CF' Then '確認' When a.ConfirmMethod='RJ' Then '退回' When a.ConfirmMethod='RV' Then '撤回' else '其他' End as ConfirmMethod
,a.Create_time,a.Create_User_id,b.Step_Text as ""From"",c.Step_Text as ""To"",a.Description
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 c on a.ToType_id = c.id
SELECT @seq = ISNULL(MAX(seq),0)+1 FROM dbo.i_fee_type WHERE is_work_item=1;
MERGE INTO i_fee_type a
USING(select @case_type_id as case_type_id, @business_type_id as business_type_id,@country_id as country_id, @apply_type_id as apply_type_id, @fc_cate_id as fc_cate_id
,@fee_type_zh_tw as fee_type_zh_tw, @fee_cate_workitem as fee_cate_workitem) b
ON a.case_type_id = b.case_type_id and a.business_type_id = b.business_type_id and a.country_id = b.country_id and a.apply_type_id = b.apply_type_id
and a.fc_cate_id = b.fc_cate_id and a.fee_type_zh_tw = b.fee_type_zh_tw and a.fee_cate_workitem = b.fee_cate_workitem and a.is_work_item=1
WHEN MATCHED THEN fee_from=@fee_from,fee_to=@fee_to,currency_id=@currency_id,basic_fee_small=@basic_fee_small,basic_fee_micro=@basic_fee_micro,item_exceed=@item_exceed
stringstr=@"SELECT case_type_id,case_type_zh_tw FROM dbo.i_case_type; SELECT apply_type_id,apply_type_zh_tw FROM dbo.i_apply_type
SELECT ctrl_proc_id,case_type_id,ctrl_proc_zh_tw FROM dbo.i_ctrl_proc where is_enabled=1;
SELECT business_type_id,business_type_zh_tw FROM dbo.i_business_type where isnull(business_type_zh_tw,'') <> ''; SELECT fc_cate_id,text_zh_tw FROM dbo.i_fc_category where is_enabled=1;
select customer_id,customer_name_en,customer_name from c_customer a where is_enabled=1 and isnull(customer_name,'') <> '';SELECT case_status_id,case_status_zh_tw FROM i_case_status where isnull(case_status_zh_tw,'') <> '';
SELECT dictionary_id,value,text_zh_tw FROM dbo.s_dictionary WHERE dictionary_name = 'fee_cate_workitem'; SELECT dictionary_id,value,text_zh_tw FROM dbo.s_dictionary WHERE dictionary_name ='fo_tax_rate_name';
select currency_id,currency_name_zh_tw from i_currency a;select country_id,country_zh_tw from i_country a";