insert into #{dynamic_securityFlow}.tlk_emplsupervisionrecord (LASTMODIFIED,FORMNAME,STATE,CREATED,FORMID,ISTMP,VERSIONS,APPLICATIONID,DOMAINID,ITEM_SECURITYNAME,ITEM_DUTYSTATION,ITEM_OFFICEPOLICEADDRESS,ITEM_INSPECTER,ITEM_INSPECTTIME,ITEM_DATASOURE,ITEM_Q1,ITEM_Q1REMARK,ITEM_Q2,ITEM_Q2REMARK,ITEM_Q3,ITEM_Q3REMARK,ITEM_Q4,ITEM_Q4REMARK,ITEM_Q5,ITEM_Q5REMARK,ITEM_Q6,ITEM_Q6REMARK,ITEM_Q7,ITEM_Q7REMARK,ITEM_Q8,ITEM_Q8REMARK,ITEM_Q9,ITEM_Q9REMARK,ITEM_Q10,ITEM_Q10REMARK,ITEM_Q11,ITEM_Q11REMARK,ITEM_Q12,ITEM_Q12REMARK,ITEM_Q13,ITEM_Q13REMARK,ITEM_Q14,ITEM_Q14REMARK,ITEM_Q15,ITEM_Q15REMARK,ITEM_Q16,ITEM_Q16REMARK,ITEM_Q17,ITEM_Q17REMARK,ITEM_REGISTERPOLICEADDRESS,ITEM_CREATER,ITEM_SOURCESIGNATURE,ITEM_TARGETSIGNATURE,ITEM_CREATETIME,ID,ITEM_DOCUMENTID,ITEM_COMPANYNAME,ITEM_DOMAIN) VALUES ('#{LASTMODIFIED}','#{FORMNAME}','#{STATE}','#{CREATED}','#{FORMID}',0,1,'#{APPLICATIONID}','#{dynamic_domain_id}','#{ITEM_SECURITYNAME}','#{ITEM_DUTYSTATION}','#{ITEM_OFFICEPOLICEADDRESS}','#{ITEM_INSPECTER}','#{ITEM_INSPECTTIME}','#{ITEM_DATASOURE}','#{ITEM_Q1}','#{ITEM_Q1REMARK}','#{ITEM_Q2}','#{ITEM_Q2REMARK}','#{ITEM_Q3}','#{ITEM_Q3REMARK}','#{ITEM_Q4}','#{ITEM_Q4REMARK}','#{ITEM_Q5}','#{ITEM_Q5REMARK}','#{ITEM_Q6}','#{ITEM_Q6REMARK}','#{ITEM_Q7}','#{ITEM_Q7REMARK}','#{ITEM_Q8}','#{ITEM_Q8REMARK}','#{ITEM_Q9}','#{ITEM_Q9REMARK}','#{ITEM_Q10}','#{ITEM_Q10REMARK}','#{ITEM_Q11}','#{ITEM_Q11REMARK}','#{ITEM_Q12}','#{ITEM_Q12REMARK}','#{ITEM_Q13}','#{ITEM_Q13REMARK}','#{ITEM_Q14}','#{ITEM_Q14REMARK}','#{ITEM_Q15}','#{ITEM_Q15REMARK}','#{ITEM_Q16}','#{ITEM_Q16REMARK}','#{ITEM_Q17}','#{ITEM_Q17REMARK}','#{ITEM_REGISTERPOLICEADDRESS}','#{ITEM_CREATER}','#{ITEM_SOURCESIGNATURE}','#{ITEM_TARGETSIGNATURE}','#{ITEM_CREATETIME}','#{ID}','#{ITEM_DOCUMENTID}','#{ITEM_COMPANYNAME}','#{ITEM_DOMAIN}') ON DUPLICATE KEY UPDATE domainid='#{dynamic_domain_id}';

update #{dynamic_securityFlow}.tlk_emplsupervisionrecord set LASTMODIFIED = '#{LASTMODIFIED}',FORMNAME = '#{FORMNAME}',STATE = '#{STATE}',CREATED = '#{CREATED}',FORMID = '#{FORMID}',ISTMP = 0,VERSIONS = 1,APPLICATIONID = '#{APPLICATIONID}',ITEM_SECURITYNAME = '#{ITEM_SECURITYNAME}',ITEM_DUTYSTATION = '#{ITEM_DUTYSTATION}',ITEM_OFFICEPOLICEADDRESS = '#{ITEM_OFFICEPOLICEADDRESS}',ITEM_INSPECTER = '#{ITEM_INSPECTER}',ITEM_INSPECTTIME = '#{ITEM_INSPECTTIME}',ITEM_DATASOURE = '#{ITEM_DATASOURE}',ITEM_Q1 = '#{ITEM_Q1}',ITEM_Q1REMARK = '#{ITEM_Q1REMARK}',ITEM_Q2 = '#{ITEM_Q2}',ITEM_Q2REMARK = '#{ITEM_Q2REMARK}',ITEM_Q3 = '#{ITEM_Q3}',ITEM_Q3REMARK = '#{ITEM_Q3REMARK}',ITEM_Q4 = '#{ITEM_Q4}',ITEM_Q4REMARK = '#{ITEM_Q4REMARK}',ITEM_Q5 = '#{ITEM_Q5}',ITEM_Q5REMARK = '#{ITEM_Q5REMARK}',ITEM_Q6 = '#{ITEM_Q6}',ITEM_Q6REMARK = '#{ITEM_Q6REMARK}',ITEM_Q7 = '#{ITEM_Q7}',ITEM_Q7REMARK = '#{ITEM_Q7REMARK}',ITEM_Q8 = '#{ITEM_Q8}',ITEM_Q8REMARK = '#{ITEM_Q8REMARK}',ITEM_Q9 = '#{ITEM_Q9}',ITEM_Q9REMARK = '#{ITEM_Q9REMARK}',ITEM_Q10 = '#{ITEM_Q10}',ITEM_Q10REMARK = '#{ITEM_Q10REMARK}',ITEM_Q11 = '#{ITEM_Q11}',ITEM_Q11REMARK = '#{ITEM_Q11REMARK}',ITEM_Q12 = '#{ITEM_Q12}',ITEM_Q12REMARK = '#{ITEM_Q12REMARK}',ITEM_Q13 = '#{ITEM_Q13}',ITEM_Q13REMARK = '#{ITEM_Q13REMARK}',ITEM_Q14 = '#{ITEM_Q14}',ITEM_Q14REMARK = '#{ITEM_Q14REMARK}',ITEM_Q15 = '#{ITEM_Q15}',ITEM_Q15REMARK = '#{ITEM_Q15REMARK}',ITEM_Q16 = '#{ITEM_Q16}',ITEM_Q16REMARK = '#{ITEM_Q16REMARK}',ITEM_Q17 = '#{ITEM_Q17}',ITEM_Q17REMARK = '#{ITEM_Q17REMARK}',ITEM_REGISTERPOLICEADDRESS = '#{ITEM_REGISTERPOLICEADDRESS}',ITEM_CREATER = '#{ITEM_CREATER}',ITEM_SOURCESIGNATURE = '#{ITEM_SOURCESIGNATURE}',ITEM_TARGETSIGNATURE = '#{ITEM_TARGETSIGNATURE}',ITEM_CREATETIME = '#{ITEM_CREATETIME}',ITEM_DOCUMENTID = '#{ITEM_DOCUMENTID}',ITEM_COMPANYNAME = '#{ITEM_COMPANYNAME}' where id = '#{ID}' and LASTMODIFIED > '#{LASTMODIFIED}';