create view myview as select concat(_tis620'leave_doc:',leave_flow.doc_id,_tis620':',leave_flow.running,_tis620':',flow_control.approve_action) as code_doc,
leave_doc.leave_title as leave_title,leave_doc.leave_type as leave_type,
substr(leave_doc.start_leave,1,10) as start_leave,
substr(leave_doc.finish_leave,1,10) as finish_leave,
substr(leave_doc.leave_adjust,1,10) as leave_adjust,
leave_doc.leave_status as leave_status,leave_doc.leave_day as leave_day,leave_doc.cc_permission as cc_permission,leave_doc.attach_desc as attach_desc,leave_doc.sys_checkdoc as sys_checkdoc,leave_flow.doc_id as doc_id,_tis620'leave_doc' as doc_type,leave_doc.emp_code as emp_code,system_user.user_name as user_name,system_user.user_flow as user_flow,leave_flow.approve_code as approve_code,leave_flow.cc_code as cc_code,leave_flow.approve_result as approve_result,leave_flow.flow_step as flow_step,
system_user.sys_statusdata as status_approve,system_codedata.cod_option as repName
from (((leave_doc join system_user on((leave_doc.emp_code = system_user.emp_code))) join leave_flow on((concat(_tis620'leave_doc:',leave_doc.running) = concat(_tis620'leave_doc:',leave_flow.doc_id)))) join flow_control on(((leave_doc.leave_type = flow_control.leave_type) and (system_user.user_flow = flow_control.user_flow) and (leave_flow.flow_step = flow_control.flow_step)))) join system_codedata on(system_codedata.cod_code = leave_doc.leave_type)