|
|
|
|
@ -2,6 +2,8 @@ package siprp.medicina.locais_analise;
|
|
|
|
|
|
|
|
|
|
import com.evolute.utils.Singleton;
|
|
|
|
|
import com.evolute.utils.arrays.Virtual2DArray;
|
|
|
|
|
import com.evolute.utils.data.IDObject;
|
|
|
|
|
import com.evolute.utils.data.MappableObject;
|
|
|
|
|
import com.evolute.utils.db.DBManager;
|
|
|
|
|
import com.evolute.utils.db.Executer;
|
|
|
|
|
import com.evolute.utils.sql.Expression;
|
|
|
|
|
@ -37,28 +39,34 @@ public class LocaisAnaliseDataProvider
|
|
|
|
|
return instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected Integer[] getGruposEcdsIdsByMarcacoes( Integer marcacoesIds[] )
|
|
|
|
|
protected IDObject[] getGruposEcdsIdsByMarcacoes( Integer marcacoesIds[] )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
Select select =
|
|
|
|
|
new Select2(
|
|
|
|
|
new String[]{ "trabalhadores_ecd", "prt_tipos_elementos_protocolo" },
|
|
|
|
|
new Integer[]{ Select2.JOIN_INNER },
|
|
|
|
|
new String[]{ "trabalhadores_ecd", "prt_tipos_elementos_protocolo",
|
|
|
|
|
"prt_grupos_protocolo"},
|
|
|
|
|
new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_INNER },
|
|
|
|
|
new Expression[]{
|
|
|
|
|
new Field( "trabalhadores_ecd.ecd_id" ).isEqual(
|
|
|
|
|
new Field( "prt_tipos_elementos_protocolo.id" ) )
|
|
|
|
|
new Field( "prt_tipos_elementos_protocolo.id" ) ),
|
|
|
|
|
new Field( "prt_tipos_elementos_protocolo.grupo_protocolo_id" ).isEqual(
|
|
|
|
|
new Field( "prt_grupos_protocolo.id" ) )
|
|
|
|
|
},
|
|
|
|
|
new String[]{ "DISTINCT prt_tipos_elementos_protocolo.grupo_protocolo_id" },
|
|
|
|
|
new String[]{ "DISTINCT prt_grupos_protocolo.id", "prt_grupos_protocolo.descricao",
|
|
|
|
|
"prt_grupos_protocolo.ordem" },
|
|
|
|
|
new Field( "trabalhadores_ecd.trabalhadores_ecds_datas_id" ).in( marcacoesIds ),
|
|
|
|
|
null,
|
|
|
|
|
new String[]{ "prt_grupos_protocolo.ordem" },
|
|
|
|
|
null,
|
|
|
|
|
null,
|
|
|
|
|
null );
|
|
|
|
|
Virtual2DArray array = EXECUTER.executeQuery( select );
|
|
|
|
|
Integer grupos[] = new Integer[ array.columnLength() ];
|
|
|
|
|
IDObject grupos[] = new IDObject[ array.columnLength() ];
|
|
|
|
|
for( int n = 0; n < grupos.length; n++ )
|
|
|
|
|
{
|
|
|
|
|
grupos[ n ] = ( Integer ) array.get( n, 0 );
|
|
|
|
|
Integer id = ( Integer ) array.get( n, 0 );
|
|
|
|
|
String descricao = ( String ) array.get( n, 1 );
|
|
|
|
|
grupos[ n ] = new MappableObject( id, descricao );
|
|
|
|
|
}
|
|
|
|
|
return grupos;
|
|
|
|
|
}
|
|
|
|
|
|