delete from tb_security_check_item where org_id=#{orgId} and item_id=#{itemId} update tb_security_check_item set type_id=#{typeId}, item_name=#{itemName}, item_content=#{itemContent}, check_way=#{checkWay} where item_id=#{itemId} and org_id=#{orgId} select replace(uuid(), '-', '') as itemId insert into tb_security_check_item(item_id, type_id, org_id, item_name, item_content, create_time, check_way, create_user_id) values (#{itemId}, #{typeId}, #{orgId}, #{itemName}, #{itemContent}, date_format(now(),'%Y-%m-%d %H:%i:%S'), #{checkWay}, #{createUserId} ) select replace(uuid(), '-', '') as typeId insert into tb_security_type(type_id, org_id, type_name, create_time, create_user_id ) values(#{typeId}, #{orgId}, #{typeName}, date_format(now(),'%Y-%m-%d %H:%i:%S'), #{createUserId} ) update tb_security_type set type_name=#{typeName} where type_id=#{typeId} and org_id=#{orgId} delete from tb_security_type where org_id=#{orgId} and type_id not in #{item.typeId} and not exists (select 1 from tb_security_check_item i where i.type_id=tb_security_type.type_id )