INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','101','0','') ON DUPLICATE KEY UPDATE resposta = '0', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','302','0','') ON DUPLICATE KEY UPDATE resposta = '0', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','303','0','') ON DUPLICATE KEY UPDATE resposta = '0', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','106','1','') ON DUPLICATE KEY UPDATE resposta = '1', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','107','1','') ON DUPLICATE KEY UPDATE resposta = '1', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','206','1','') ON DUPLICATE KEY UPDATE resposta = '1', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','305','0','') ON DUPLICATE KEY UPDATE resposta = '0', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','207','0','') ON DUPLICATE KEY UPDATE resposta = '0', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','109','0','') ON DUPLICATE KEY UPDATE resposta = '0', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','110','0','') ON DUPLICATE KEY UPDATE resposta = '0', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','111','0','') ON DUPLICATE KEY UPDATE resposta = '0', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','112','0','') ON DUPLICATE KEY UPDATE resposta = '0', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','114','0','') ON DUPLICATE KEY UPDATE resposta = '0', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','208','0','') ON DUPLICATE KEY UPDATE resposta = '0', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','210','0','') ON DUPLICATE KEY UPDATE resposta = '0', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','115','0','') ON DUPLICATE KEY UPDATE resposta = '0', resposta_txt = '' - 110; INSERT INTO agenda_resposta_formulario (tarefa, item, resposta, resposta_txt) values ('30291','117','0','') ON DUPLICATE KEY UPDATE resposta = '0', resposta_txt = '' - 110; update agenda_resposta_formulario a, agenda_tarefa b set a.tarefa = b.id where a.tarefa = b.idOriginal - 110; update agenda_resposta_desenvolvimento_equipe a, agenda_tarefa b set a.tarefa = b.id where a.tarefa = b.idOriginal - 110; 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 ; - 110; update agenda_tarefa set idPrimario = id where idPrimario = idOriginal; - 110; update agenda_resposta_desenvolvimento_equipe aa set aa.tarefaAgendada = 1 where aa.tarefaAgendada is null; - 110;