INSERT INTO #{dynamic_securityFlow}.`tlk_attendance_site_person_info`(`PARENT`, `LASTMODIFIED`, `FORMNAME`, `STATE`, `AUDITUSER`, `AUDITDATE`, 
`AUTHOR`, `AUTHORDEPTID`, `AUTHOR_DEPT_INDEX`, `AUTHOR_USER_INDEX`, `CREATED`, `FORMID`, `SUBFORMIDS`, `INITIATOR`, `ISTMP`, `VERSIONS`, `APPLICATIONID`, `STATEINT`, `STATELABEL`, `AUDITORNAMES`, `LASTFLOWOPERATION`, `LASTMODIFIER`, `DOMAINID`, `AUDITORLIST`, `COAUDITORLIST`, `STATELABELINFO`, `PREVAUDITNODE`, `PREVAUDITUSER`, 
`OPTIONITEM`, `SIGN`, `KINGGRIDSIGNATURE`, 
`ITEM_SECURITYNAME`, `ITEM_SECURITYID`, `ITEM_ATTENDANCESITEID`, `ITEM_DOCUMENTTYPE`, `ITEM_DOCUMENTID`, `ITEM_PHONE`, `ITEM_DEPTNAME`, `ITEM_JOBTYPE`, `ITEM_ISCERTIFIED`, 
`ITEM_INSURANCESTATUS`, `ITEM_CREATEDUSER`, `ITEM_DOMAIN_ID`, `ITEM_SAAS_PERID`, `ITEM_SAAS_TASKID`, `ITEM_ISDELETED`, `ID`) 
VALUES (NULL, '#{LASTMODIFIED}', '#{FORMNAME}', NULL, NULL, NULL, 
'#{AUTHOR}', '#{AUTHORDEPTID}', NULL, NULL, '#{CREATED}', '__ZonSbMclP3mlexghoN3', NULL, NULL, 0, 1, '__wGomeHJBz6CpLFCCl4y', 0, '', '', 
'#{LASTFLOWOPERATION}', '#{LASTMODIFIER}', '#{dynamic_domain_id}', '{}', '{}', '[{\"nodes\":[{\"nodeId\":\"\",\"stateLabel\":\"\",\"state\":\"\",\"auditors\":[],\"coAuditors\":[]}]}]', NULL, NULL, NULL, NULL, NULL, 
'#{ITEM_SECURITYNAME}', '#{ITEM_SECURITYID}', '#{ITEM_ATTENDANCESITEID}', '#{ITEM_DOCUMENTTYPE}', '#{ITEM_DOCUMENTID}', '#{ITEM_PHONE}', '#{ITEM_DEPTNAME}', '#{ITEM_JOBTYPE}', '#{ITEM_ISCERTIFIED}', '#{ITEM_INSURANCESTATUS}', '#{ITEM_CREATEDUSER}', '#{DOMAINID}', '#{ITEM_SAAS_PERID}', '#{ITEM_SAAS_TASKID}', '#{ITEM_ISDELETED}', replace('#{ID}','__sgTQqGCJDqTyPf6vN1Q','__ZonSbMclP3mlexghoN3')) 
ON DUPLICATE KEY UPDATE ITEM_SECURITYNAME='#{ITEM_SECURITYNAME}',ITEM_SECURITYID='#{ITEM_SECURITYID}',ITEM_ATTENDANCESITEID='#{ITEM_ATTENDANCESITEID}',ITEM_DOCUMENTTYPE='#{ITEM_DOCUMENTTYPE}',
ITEM_DOCUMENTID='#{ITEM_DOCUMENTID}',ITEM_PHONE='#{ITEM_PHONE}',ITEM_DEPTNAME='#{ITEM_DEPTNAME}',ITEM_JOBTYPE='#{ITEM_JOBTYPE}',ITEM_ISCERTIFIED='#{ITEM_ISCERTIFIED}',
ITEM_INSURANCESTATUS='#{ITEM_INSURANCESTATUS}',ITEM_CREATEDUSER='#{ITEM_CREATEDUSER}',ITEM_DOMAIN_ID='#{DOMAINID}',ITEM_SAAS_PERID='#{ITEM_SAAS_PERID}',
ITEM_SAAS_TASKID='#{ITEM_SAAS_TASKID}',ITEM_ISDELETED='#{ITEM_ISDELETED}';

UPDATE #{dynamic_securityFlow}.tlk_securityman SET ITEM_ATTENDANCESITENAME=(SELECT tla.ITEM_ATTENDANCESITENAME FROM tlk_attendance_site_base_info tla where tla.id='#{ITEM_ATTENDANCESITEID}') 
where ITEM_domain_id='#{DOMAINID}' and ITEM_documentID='#{ITEM_DOCUMENTID}';