|
|
|
|
@ -35,7 +35,7 @@ public class PlanosDataProvider extends GenericDataProvider{
|
|
|
|
|
{
|
|
|
|
|
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, concluido_por_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, concluido_por_desactivacao, data_desactivacao, tecnico_superior_hs_id, tecnico_superior_hs_nome) values (";
|
|
|
|
|
sql += newId + ", ";
|
|
|
|
|
sql += p.getEstabelecimento_id() + ", ";
|
|
|
|
|
sql += p.getFase() + ", '";
|
|
|
|
|
@ -63,11 +63,21 @@ public class PlanosDataProvider extends GenericDataProvider{
|
|
|
|
|
if ( p.getConcluidoPorDesactivacao() == null )
|
|
|
|
|
{
|
|
|
|
|
sql += Boolean.FALSE;
|
|
|
|
|
sql += ", null";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
sql += p.getConcluidoPorDesactivacao();
|
|
|
|
|
if ( p.getConcluidoPorDesactivacao() )
|
|
|
|
|
{
|
|
|
|
|
sql += ", now()";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sql += ", ";
|
|
|
|
|
sql += p.getTecnico_superior_hs_id() + ", ";
|
|
|
|
|
sql += p.getTecnico_superior_hs_nome() == null ? null : "'" + p.getTecnico_superior_hs_nome() + "'";
|
|
|
|
|
|
|
|
|
|
sql += ")";
|
|
|
|
|
|
|
|
|
|
System.out.println("SQL CREATE PLANO : " + sql);
|
|
|
|
|
@ -130,6 +140,7 @@ public class PlanosDataProvider extends GenericDataProvider{
|
|
|
|
|
sql += "correcao = '" + p.getCorrecao() + "', ";
|
|
|
|
|
sql += "fase_antes_correcao = " + p.getFase_antes_correcao() + ", ";
|
|
|
|
|
sql += "concluido_por_desactivacao = " + p.getConcluidoPorDesactivacao() + ", ";
|
|
|
|
|
sql += "data_desactivacao = " + new java.sql.Date( p.getDataDesactivacao().getTime() ) + ", ";
|
|
|
|
|
|
|
|
|
|
if(p.getData_validacao_dir_loja() == null)
|
|
|
|
|
{
|
|
|
|
|
@ -444,7 +455,7 @@ public class PlanosDataProvider extends GenericDataProvider{
|
|
|
|
|
{
|
|
|
|
|
nome = StringPlainer.convertString( nome.trim() );
|
|
|
|
|
nome = nome.replaceAll( " ", "%" );
|
|
|
|
|
whereExpression += "AND plain_utf8( planos_actuacao.tecnico_hs_nome ) LIKE '%" + nome + "%' ";
|
|
|
|
|
whereExpression += "AND ( plain_utf8( planos_actuacao.tecnico_hs_nome ) LIKE '%" + nome + "%' OR plain_utf8( planos_actuacao.tecnico_superior_hs_nome ) LIKE '%" + nome + "%' ) ";
|
|
|
|
|
}
|
|
|
|
|
if ( estabelecimento != null )
|
|
|
|
|
{
|
|
|
|
|
@ -748,6 +759,9 @@ public class PlanosDataProvider extends GenericDataProvider{
|
|
|
|
|
pa.setTecnico_hs_id(new Integer(rs.getInt("tecnico_hs_id")));
|
|
|
|
|
pa.setTecnico_hs_nome(rs.getString("tecnico_hs_nome"));
|
|
|
|
|
pa.setConcluidoPorDesactivacao( new Boolean( rs.getBoolean( "concluido_por_desactivacao" ) ) );
|
|
|
|
|
pa.setDataDesactivacao( rs.getDate( "data_desactivacao" ) );
|
|
|
|
|
pa.setTecnico_superior_hs_id( new Integer( rs.getInt( "tecnico_superior_hs_id" ) ) );
|
|
|
|
|
pa.setTecnico_superior_hs_nome( rs.getString( "tecnico_superior_hs_nome" ) );
|
|
|
|
|
|
|
|
|
|
list.add(pa);
|
|
|
|
|
|
|
|
|
|
|