|
|
|
|
@ -481,7 +481,7 @@ public class CreatePlanosDataProvider {
|
|
|
|
|
{
|
|
|
|
|
Statement st = createStatement();
|
|
|
|
|
Integer newId = getMaxTableId("planos_actuacao");
|
|
|
|
|
String sql = "insert into planos_actuacao (id, estabelecimento_id, fase, data_visita, data_relatorio, nome_estabelecimento, empresa_id, nome_empresa, data_controlo, tecnico_hs_id, tecnico_hs_nome, tecnico_superior_hs_id, tecnico_superior_hs_nome, data_desactivacao) values (";
|
|
|
|
|
String sql = "insert into planos_actuacao (id, estabelecimento_id, fase, data_visita, data_relatorio, nome_estabelecimento, empresa_id, nome_empresa, data_controlo, tecnico_hs_id, tecnico_hs_nome, tecnico_superior_hs_id, tecnico_superior_hs_nome, concluido_por_desactivacao, data_desactivacao) values (";
|
|
|
|
|
sql += newId + ", ";
|
|
|
|
|
sql += p.getEstabelecimento_id() + ", ";
|
|
|
|
|
sql += p.getFase() + ", '";
|
|
|
|
|
@ -512,9 +512,23 @@ public class CreatePlanosDataProvider {
|
|
|
|
|
sql += p.getTecnico_superior_hs_id() + ", ";
|
|
|
|
|
sql += p.getTecnico_superior_hs_nome() == null ? null : "'" + p.getTecnico_superior_hs_nome() + "'";
|
|
|
|
|
|
|
|
|
|
//concluido_por_desactivacao
|
|
|
|
|
sql += ", ";
|
|
|
|
|
sql += p.getConcluidoPorDesactivacao() == null ? "false" : p.getConcluidoPorDesactivacao();
|
|
|
|
|
|
|
|
|
|
//data_desactivacao
|
|
|
|
|
sql += ", ";
|
|
|
|
|
sql += "null";
|
|
|
|
|
|
|
|
|
|
java.sql.Date deactiveDate = null;
|
|
|
|
|
if ( p.getDataDesactivacao() != null )
|
|
|
|
|
{
|
|
|
|
|
deactiveDate = new java.sql.Date( p.getDataDesactivacao().getTime() );
|
|
|
|
|
}
|
|
|
|
|
else if ( p.getConcluidoPorDesactivacao() != null && p.getConcluidoPorDesactivacao() )
|
|
|
|
|
{
|
|
|
|
|
deactiveDate = new java.sql.Date( new Date().getTime() );
|
|
|
|
|
}
|
|
|
|
|
sql += deactiveDate == null ? "null" : "'" + deactiveDate + "'";
|
|
|
|
|
|
|
|
|
|
sql += ")";
|
|
|
|
|
|
|
|
|
|
|