select log_id, robotic_id, caller_id, run_time, run_param, result, status, create_time, record_path, content_list, caller_num, callee_num, uuid, call_create_time, call_answer_time, intention, company_id, company_user_id, call_time, cost, call_type, hangup_type, is_warning from company_voice_robotic_call_log_callphone insert into company_voice_robotic_call_log_callphone callback_uuid, robotic_id, caller_id, run_time, run_param, result, status, create_time, record_path, content_list, caller_num, callee_num, uuid, call_create_time, call_answer_time, intention, company_id, company_user_id, call_time, cost, call_type, hangup_type, is_warning, violation_num, #{callbackUuid}, #{roboticId}, #{callerId}, #{runTime}, #{runParam}, #{result}, #{status}, #{createTime}, #{recordPath}, #{contentList}, #{callerNum}, #{calleeNum}, #{uuid}, #{callCreateTime}, #{callAnswerTime}, #{intention}, #{companyId}, #{companyUserId}, #{callTime}, #{cost}, #{callType}, #{hangupType}, #{isWarning}, #{violationNum}, update company_voice_robotic_call_log_callphone robotic_id = #{roboticId}, caller_id = #{callerId}, run_time = #{runTime}, run_param = #{runParam}, result = #{result}, status = #{status}, create_time = #{createTime}, record_path = #{recordPath}, content_list = #{contentList}, caller_num = #{callerNum}, callee_num = #{calleeNum}, uuid = #{uuid}, call_create_time = #{callCreateTime}, call_answer_time = #{callAnswerTime}, intention = #{intention}, company_id = #{companyId}, company_user_id = #{companyUserId}, call_time = #{callTime}, cost = #{cost}, call_type = #{callType}, hangup_type = #{hangupType}, is_warning = #{isWarning}, violation_num = #{violationNum}, manual_answered = #{manualAnswered}, handle_flag = #{handleFlag}, answered_ext_num = #{answeredExtNum}, manual_answered_time = #{manualAnsweredTime}, manual_answered_time_len = #{manualAnsweredTimeLen}, where log_id = #{logId} delete from company_voice_robotic_call_log_callphone where log_id = #{logId} delete from company_voice_robotic_call_log_callphone where log_id in #{logId} FROM company_voice_robotic_call_log_callphone t1 inner join company_voice_robotic cvr on cvr.id = t1.robotic_id left join company_voice_robotic_callees ce on ce.id = t1.caller_id left join company t2 on t1.company_id = t2.company_id left join company_user t3 on t3.user_id = t1.company_user_id where cvr.company_id = #{companyId} and t1.robotic_id = #{roboticId} and t1.status = #{status} and (t1.caller_num like concat('%', #{phone}, '%') or ce.phone = #{encryptedPhone}) and (t1.intention is null or t1.intention = '' or t1.intention = '0') and t1.intention = #{intention} and t1.call_time > 0 and (t1.call_time is null or t1.call_time = 0) and t1.call_time >= #{minCallTime} and t1.call_time <= #{maxCallTime} and date_format(t1.run_time,'%Y-%m-%d') >= #{beginRunTime} and date_format(t1.run_time,'%Y-%m-%d') <= #{endRunTime} update company_voice_robotic_call_log_callphone retry_count = #{retryCount}, status = #{status}, where log_id = #{logId} UPDATE company_voice_robotic_call_log_callphone SET retry_count = IFNULL(retry_count, 0) + 1 WHERE log_id = #{logId} AND status = 1