qg.uuid, qg.name, qg.is_built_in as isBuiltIn, qg.ai_code_supported as aiCodeSupported, qg.created_at as createdAt, qg.updated_at as updatedAt
m.short_name as description,
qgc.operator as operator,
m.val_type as valueType,
qgc.value_error as errorThreshold
insert into quality_gates (uuid, name, is_built_in, ai_code_supported, created_at, updated_at)
values (#{uuid, jdbcType=VARCHAR}, #{name, jdbcType=VARCHAR}, #{isBuiltIn, jdbcType=BOOLEAN}, #{aiCodeSupported, jdbcType=BOOLEAN},
#{createdAt, jdbcType=TIMESTAMP}, #{updatedAt, jdbcType=TIMESTAMP})
delete from quality_gates where uuid=#{uuid}
delete from quality_gates
where uuid in
#{uuid, jdbcType=VARCHAR}
update quality_gates set
name=#{name},
is_built_in=#{isBuiltIn, jdbcType=BOOLEAN},
ai_code_supported=#{aiCodeSupported, jdbcType=BOOLEAN},
updated_at=#{updatedAt, jdbcType=TIMESTAMP}
where uuid=#{uuid, jdbcType=VARCHAR}
UPDATE quality_gates
SET
is_built_in=${_false}
WHERE
is_built_in=${_true}
AND name not in
#{name, jdbcType=VARCHAR}