INSERT INTO dsp_report_log (
platform_code, object_type, biz_key, request_id, request_path, http_status,
total, success, failed, error_code, error_msg, payload, cost_ms, client_ip, create_time
) VALUES (
#{platformCode}, #{objectType}, #{bizKey}, #{requestId}, #{requestPath}, #{httpStatus},
#{total}, #{success}, #{failed}, #{errorCode}, #{errorMsg}, #{payload}, #{costMs}, #{clientIp}, #{createTime}
)
CASE
WHEN failed > 0 AND success > 0 THEN 2
WHEN failed > 0 THEN 3
WHEN error_code IS NOT NULL AND error_code <> '0' THEN 3
ELSE 1
END
id, platform_code, object_type, biz_key, request_id, request_path, http_status,
total, success, failed, error_code, error_msg, cost_ms, client_ip, create_time
AND platform_code = #{q.platformCode}
AND object_type = #{q.objectType}
AND biz_key LIKE CONCAT('%', #{q.bizKey}, '%')
AND request_id = #{q.requestId}
AND create_time >= #{q.startTime}
AND create_time < #{q.endTime}
AND failed = 0 AND (error_code IS NULL OR error_code = '0')
AND failed > 0 AND success > 0
AND (failed > 0 OR (error_code IS NOT NULL AND error_code <> '0'))
AND NOT (failed > 0 AND success > 0)