--insert organ,struvar_organ_name :='BPM员工'|| to_char(i);
var_organ_id :='vorgan_id'|| to_char(i);
var_stru_id:='vstru_id'|| to_char(i);
var_stru_path :=p_stru_path ||'#'|| var_stru_id;
insertintoTEST_ORGAN (ORGAN_ID, ORGAN_CODE, ORGAN_NAME, SHORT_NAME, ORGAN_TYPE, WORKPLACE_ID, BEGIN_DATE, END_DATE, SCN, IN_USE)
values(var_organ_id, var_organ_id, var_organ_name, var_organ_name,'8','1','20080904','99991231',57,'1');
insertintoTEST_STRU (STRU_ID, ORGAN_ID, ORGAN_ALIAS, STRU_TYPE, PARENT_ID, PRINCIPAL_ID, CORPORATION_ID, STRU_LEVEL, STRU_PATH, STRU_ORDER, GLOBAL_ORDER, BEGIN_DATE, END_DATE, SCN, IS_LEAF, IN_USE, DEPARTMENT_ID, PERMISSION_STRU_ID)
values(var_stru_id, var_organ_id, var_organ_name,'00', p_organ_id,null,'1',3, var_stru_path,200,1,'20080904','99991231',58,'1','1', p_organ_id,'1');--insert useraccount := testuser || to_char(i);
insertintoTEST_USERS (USER_ID, EXTERNAL_USER, USER_NAME, PASSWORD, ACCOUNT_STATUS, SECURITY_LEVEL, MAX_SESSIONS, IS_SYS, IS_CPUBLIC, CREATE_TIME, LOCK_TIME, EXPIRED_TIME, PSWD_UPT_TIME, PSWD_TIME, CORPORATION_ID, DEPARTMENT_ID, EMPLOYEE_ID, E_MAIL, MSN, QQ, MOBILE, CHAR_1, CHAR_2, NUM_1, NUM_2, PERMISSION_STRU_ID)
values(account,'01', var_organ_name,' 99c6b157085564b43b85711360ec6166','11',0, -1,'0','0','20080904 16:12:57',null,'99991231 23:59:59','20080904 16:12:57','20081103 16:12:57','1', p_stru_id, var_stru_id,null,null,null,null,null,null,0,0,'1');
insertintoTEST_USER_DATAREF (REF_ID, USER_ID, RES_VALUE, DATA_RES_TYPE, IS_DEFAULT, IN_USE, STRU_ID, STRU_TYPE, DATE_BEGIN, DATE_END, IS_WRITABLE)
values(account, account,'1','permitOrgT','1','1',null,null,'20000101','99991231','1');
insertintoTEST_USER_PROXY (USER_ID, PROXY_USER_ID)
values('CPUBLIC', account);
insertintoTEST_USER_PROXY (USER_ID, PROXY_USER_ID)
values('GPUBLIC', account);
insertintoTEST_USER_ROLE (USER_ID, GRANTED_ROLE, ADMIN_OPTION, DEFAULT_ROLE)
values(account,'GPUBLIC','1','1');
insertintoTEST_USER_ROLE (USER_ID, GRANTED_ROLE, ADMIN_OPTION, DEFAULT_ROLE)
values(account,'SYSADMIN','1','1');
insertintoTEST_USER_ROLE (USER_ID, GRANTED_ROLE, ADMIN_OPTION, DEFAULT_ROLE)
values(account,'WORKFLOWADMIN','1','1');
insertintoTEST_USER_ROLE (USER_ID, GRANTED_ROLE, ADMIN_OPTION, DEFAULT_ROLE)
values(account,'WORKFLOWCOMUSER','1','1');
insertintoTEST_STRU_TYPE_REF (USER_ID, STRU_TYPE, STRU_ID, ORGAN_NAME)
values(account,'00','1','State Grid');
endloop;
commit;