INSERT INTO #{dynamic_securityFlow}.TLK_TRAININGPUNISH (
	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_companyName,
	ITEM_dataSoure,
	ITEM_code,
	ITEM_commendationRewardTime,
	ITEM_punishReason,
	ITEM_punishContent,
	ITEM_handleRegulatory,
	ITEM_handleOtherRegulatory,
	ITEM_beInspecter,
	ID,
	ITEM_DOMAIN,
	ITEM_PUNISHBASIS,
	ITEM_COMPANYNAME,
	ITEM_DATASOURE,
	ITEM_CODE,
	ITEM_COMMENDATIONREWARDTIME,
	ITEM_PUNISHREASON,
	ITEM_PUNISHCONTENT,
	ITEM_HANDLEREGULATORY,
	ITEM_HANDLEOTHERREGULATORY,
	ITEM_BEINSPECTER,
	ITEM_domain,
	ITEM_PENALTYAMOUNT 
)
VALUES
	(
		'#{PARENT}',
		'#{LASTMODIFIED}',
		'#{FORMNAME}',
		'#{STATE}',
		'#{AUDITUSER}',
		'#{AUDITDATE}',
		'#{AUTHOR}',
		'#{AUTHORDEPTID}',
		'#{AUTHOR_DEPT_INDEX}',
		'#{AUTHOR_USER_INDEX}',
		'#{CREATED}',
		'#{FORMID}',
		'#{SUBFORMIDS}',
		'#{INITIATOR}',
		0,
		1,
		'#{APPLICATIONID}',
		'#{STATEINT}',
		'#{STATELABEL}',
		'#{AUDITORNAMES}',
		'#{LASTFLOWOPERATION}',
		'#{LASTMODIFIER}',
		'#{dynamic_domain_id}',
		'#{AUDITORLIST}',
		'#{COAUDITORLIST}',
		'#{STATELABELINFO}',
		'#{PREVAUDITNODE}',
		'#{PREVAUDITUSER}',
		'#{OPTIONITEM}',
		'#{SIGN}',
		'#{KINGGRIDSIGNATURE}',
		'#{ITEM_companyName}',
		'#{ITEM_dataSoure}',
		'#{ITEM_code}',
		'#{ITEM_commendationRewardTime}',
		'#{ITEM_punishReason}',
		'#{ITEM_punishContent}',
		'#{ITEM_handleRegulatory}',
		'#{ITEM_handleOtherRegulatory}',
		'#{ITEM_beInspecter}',
		'#{ID}',
		'#{ITEM_DOMAIN}',
		'#{ITEM_PUNISHBASIS}',
		'#{ITEM_COMPANYNAME}',
		'#{ITEM_DATASOURE}',
		'#{ITEM_CODE}',
		'#{ITEM_COMMENDATIONREWARDTIME}',
		'#{ITEM_PUNISHREASON}',
		'#{ITEM_PUNISHCONTENT}',
		'#{ITEM_HANDLEREGULATORY}',
		'#{ITEM_HANDLEOTHERREGULATORY}',
		'#{ITEM_BEINSPECTER}',
		'#{ITEM_domain}',
		'#{ITEM_PENALTYAMOUNT}' 
	) 
	ON DUPLICATE KEY UPDATE LASTMODIFIED = '#{LASTMODIFIED}',
	ITEM_companyName = '#{ITEM_companyName}',
	ITEM_dataSoure = '#{ITEM_dataSoure}',
	ITEM_code = '#{ITEM_code}',
	ITEM_commendationRewardTime = '#{ITEM_commendationRewardTime}',
	ITEM_punishReason = '#{ITEM_punishReason}',
	ITEM_punishContent = '#{ITEM_punishContent}',
	ITEM_handleRegulatory = '#{ITEM_handleRegulatory}',
	ITEM_handleOtherRegulatory = '#{ITEM_handleOtherRegulatory}',
	ITEM_beInspecter = '#{ITEM_beInspecter}',
	ITEM_DOMAIN = '#{ITEM_DOMAIN}',
	ITEM_PUNISHBASIS = '#{ITEM_PUNISHBASIS}',
	ITEM_COMPANYNAME = '#{ITEM_COMPANYNAME}',
	ITEM_DATASOURE = '#{ITEM_DATASOURE}',
	ITEM_CODE = '#{ITEM_CODE}',
	ITEM_COMMENDATIONREWARDTIME = '#{ITEM_COMMENDATIONREWARDTIME}',
	ITEM_PUNISHREASON = '#{ITEM_PUNISHREASON}',
	ITEM_PUNISHCONTENT = '#{ITEM_PUNISHCONTENT}',
	ITEM_HANDLEREGULATORY = '#{ITEM_HANDLEREGULATORY}',
	ITEM_HANDLEOTHERREGULATORY = '#{ITEM_HANDLEOTHERREGULATORY}',
	ITEM_BEINSPECTER = '#{ITEM_BEINSPECTER}',
	ITEM_domain = '#{ITEM_domain}',
	ITEM_PENALTYAMOUNT = '#{ITEM_PENALTYAMOUNT}';
	
	update TLK_TRAININGPUNISH set 
  LASTMODIFIED = '#{LASTMODIFIED}',
	ITEM_companyName = '#{ITEM_companyName}',
	ITEM_dataSoure = '#{ITEM_dataSoure}',
	ITEM_code = '#{ITEM_code}',
	ITEM_commendationRewardTime = '#{ITEM_commendationRewardTime}',
	ITEM_punishReason = '#{ITEM_punishReason}',
	ITEM_punishContent = '#{ITEM_punishContent}',
	ITEM_handleRegulatory = '#{ITEM_handleRegulatory}',
	ITEM_handleOtherRegulatory = '#{ITEM_handleOtherRegulatory}',
	ITEM_beInspecter = '#{ITEM_beInspecter}',
	ITEM_DOMAIN = '#{ITEM_DOMAIN}',
	ITEM_PUNISHBASIS = '#{ITEM_PUNISHBASIS}',
	ITEM_COMPANYNAME = '#{ITEM_COMPANYNAME}',
	ITEM_DATASOURE = '#{ITEM_DATASOURE}',
	ITEM_CODE = '#{ITEM_CODE}',
	ITEM_COMMENDATIONREWARDTIME = '#{ITEM_COMMENDATIONREWARDTIME}',
	ITEM_PUNISHREASON = '#{ITEM_PUNISHREASON}',
	ITEM_PUNISHCONTENT = '#{ITEM_PUNISHCONTENT}',
	ITEM_HANDLEREGULATORY = '#{ITEM_HANDLEREGULATORY}',
	ITEM_HANDLEOTHERREGULATORY = '#{ITEM_HANDLEOTHERREGULATORY}',
	ITEM_BEINSPECTER = '#{ITEM_BEINSPECTER}',
	ITEM_domain = '#{ITEM_domain}',
	ITEM_PENALTYAMOUNT = '#{ITEM_PENALTYAMOUNT}'
  where id='#{id}' and LASTMODIFIED<'#{LASTMODIFIED}';