UPDATE `templatemanager` SET `TEMPLATENAME` = #{templateName}, `UPDATEUSER` = #{updateUser}, `UPDATEDATETIME` = CURRENT_TIME() WHERE ( `FORMID` = #{formID} ) AND (`TENANTID` = #{tenantID}); INSERT INTO TEMPLATECATEGORY ( TENANTID, BUSINESSCATEGORYID, TEMPLATECATEGORYID, TEMPLATECATEGORYNAME, DELETEFLG, CREATEUSER, CREATEDATETIME, UPDATEUSER, UPDATEDATETIME ) VALUES( #{tenantID}, #{businessCategoryID}, #{templateCategoryID}, #{templateCategoryName}, "0", #{createUser}, current_timestamp(), #{updateUser}, current_timestamp() ) UPDATE TEMPLATECATEGORY SET TEMPLATECATEGORYNAME = #{templateCategoryName}, UPDATEUSER = #{updateUser} WHERE TEMPLATECATEGORYID = #{templateCategoryID} AND TENANTID = #{tenantID} AND BUSINESSCATEGORYID = #{businessCategoryID} UPDATE TEMPLATECATEGORY SET DELETEFLG = "1", UPDATEUSER = #{updateUser} WHERE TEMPLATECATEGORYID = #{templateCategoryID} AND TENANTID = #{tenantID} AND BUSINESSCATEGORYID = #{businessCategoryID} UPDATE TEMPLATEMANAGER SET DELETEFLG = "1", UPDATEUSER = #{updateUser} WHERE TEMPLATEID = #{templateID} AND TENANTID = #{tenantID} INSERT INTO TEMPLATEMANAGER ( TEMPLATEID, TENANTID, FORMID, BUSINESSCATEGORYID, TEMPLATECATEGORYID, TEMPLATENAME, DESCRIPTION, ICONPATH, ENABLESETTING, DESIGNMODE, DELETEFLG, CREATEUSER, CREATEDATETIME, UPDATEUSER, UPDATEDATETIME ) VALUES( #{templateID}, #{tenantID}, #{formID}, #{businessCategoryID}, #{templateCategoryID}, #{templateName}, #{description}, #{iconpath}, #{enablesetting}, #{designMode}, "0", #{createUser}, current_timestamp(), #{updateUser}, current_timestamp() ) UPDATE TEMPLATEMANAGER SET TEMPLATENAME = #{templateName}, DESCRIPTION = #{description}, ENABLESETTING = #{enablesetting}, UPDATEUSER = #{updateUser} WHERE TEMPLATEID = #{templateID}