INSERT INTO agenda_tarefa (idPrimario, assunto, observacao, vendedor, dataCriacao, data, horario_inicial, horario_final, status, usuario, supervisor, clientes, idOriginal, resumo, dataRota) values ('-1725881376627','7','Confecção reunião ','0','2024-09-09','2024-09-09','12:00:00','18:00:00','Pendente','40','40','','-1725881376627','','') - 40; UPDATE agenda_tarefa SET idPrimario = 34560 WHERE idPrimario = -1725881376627 - 40; UPDATE agenda_resposta_desenvolvimento_equipe SET tarefa = 34560 WHERE tarefa = -1725881376627 - 40; update agenda_resposta_formulario a, agenda_tarefa b set a.tarefa = b.id where a.tarefa = b.idOriginal - 40; update agenda_resposta_desenvolvimento_equipe a, agenda_tarefa b set a.tarefa = b.id where a.tarefa = b.idOriginal - 40; insert into agenda_tarefa (idPrimario, assunto, vendedor, dataCriacao, dataInsercao, data, horario_inicial, horario_final, usuario, supervisor, idOriginal, observacao, clientes, resumo, status) select date_format(now(),'%Y%m%d%H%i%s') * -1, 999, b.vendedor, curdate(), now(), a.prazo, '08:00:00', '08:00:00', b.supervisor, b.supervisor, date_format(now(),'%Y%m%d%H%i%s') * -1, a.acao, '', '', 'Pendente' FROM agenda_resposta_desenvolvimento_equipe a, agenda_tarefa b where a.tarefaAgendada is null and a.tarefa = b.id ; - 40; update agenda_tarefa set idPrimario = id where idPrimario = idOriginal; - 40; update agenda_resposta_desenvolvimento_equipe aa set aa.tarefaAgendada = 1 where aa.tarefaAgendada is null; - 40; statusNaoFinalizado - 40;