UPDATE coupon SET status = IF(status = 1, 0, 1) WHERE id = #{id} INSERT INTO coupon ( scenic_id, name, description, countdown, broadcast, config_ids, discount_price, type, discount_type, status, create_at, deleted, deleted_at ) VALUES ( #{scenicId}, #{name}, #{description}, #{countdown}, #{broadcast}, #{configIds}, #{discountPrice}, #{type}, #{discountType}, #{status}, #{createAt}, #{deleted}, #{deletedAt} ) UPDATE coupon SET scenic_id = #{scenicId}, name = #{name}, description = #{description}, countdown = #{countdown}, broadcast = #{broadcast}, config_ids = #{configIds}, discount_price = #{discountPrice}, type = #{type}, discount_type = #{discountType}, status = #{status}, create_at = #{createAt}, deleted = #{deleted}, deleted_at = #{deletedAt} WHERE id = #{id} UPDATE coupon SET deleted = 1, deleted_at = NOW() WHERE id = #{id}