forked from Coded/SIPRP
git-svn-id: https://svn.coded.pt/svn/SIPRP@1125 bb69d46d-e84e-40c8-a05a-06db0d633741
parent
f69e32e6a6
commit
8687c2cd36
@ -0,0 +1,115 @@
|
||||
package com.evolute.siprp.server.logic.AnaliseAcidentesTrabalho.actual;
|
||||
|
||||
import com.evolute.siprp.server.db.InitDB;
|
||||
import com.evolute.utils.Singleton;
|
||||
import com.evolute.utils.arrays.Virtual2DArray;
|
||||
import com.evolute.utils.db.DBManager;
|
||||
import com.evolute.utils.db.Executer;
|
||||
import com.evolute.utils.jdo.JDOProvider;
|
||||
import com.evolute.utils.sql.Expression;
|
||||
import com.evolute.utils.sql.Select;
|
||||
import com.evolute.utils.sql.Select2;
|
||||
|
||||
public class ActualTableDataProvider
|
||||
{
|
||||
private static ActualTableDataProvider instance = null;
|
||||
|
||||
private final Executer EXECUTER;
|
||||
private final JDOProvider JDO_PROVIDER;
|
||||
|
||||
private ActualTableDataProvider() throws Exception
|
||||
{
|
||||
System.out.println( "-- InitDB.init()" );
|
||||
InitDB.init();
|
||||
|
||||
DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER );
|
||||
EXECUTER = dbm.getSharedExecuter( this );
|
||||
JDO_PROVIDER = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
|
||||
}
|
||||
|
||||
|
||||
public static ActualTableDataProvider getProvider() throws Exception
|
||||
{
|
||||
if ( instance == null )
|
||||
{
|
||||
instance = new ActualTableDataProvider();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
//TODO: ...
|
||||
public Virtual2DArray getAnalisesActuais() throws Exception
|
||||
{
|
||||
Virtual2DArray result = null;
|
||||
|
||||
Select query = new Select2(
|
||||
new String[] {},
|
||||
new Integer[] {},
|
||||
new Expression[] {},
|
||||
new String[] {},
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
);
|
||||
result = EXECUTER.executeQuery( query );
|
||||
|
||||
return result;
|
||||
}
|
||||
/* Seguranca */
|
||||
/*
|
||||
responsabel_loja = 'y'
|
||||
SELECT *
|
||||
FROM analises_acidentes
|
||||
WHERE
|
||||
( estado = Global.ESTADO_SEG OR (averiguacao_posterior = 'y' AND averiguacao_obs = '') OR estado = Global.ESTADO_ASSINATURA_SEG )
|
||||
AND estabelecimento_id = estabelecimento_id
|
||||
AND apagada = 'n'
|
||||
ORDER BY analise_nr
|
||||
|
||||
responsabel_loja = 'n'
|
||||
SELECT *
|
||||
FROM analises_acidentes
|
||||
WHERE
|
||||
( estado = Global.ESTADO_SEG OR (averiguacao_posterior = 'y' AND averiguacao_obs = '') )
|
||||
AND estabelecimento_id = estabelecimento_id
|
||||
AND apagada = 'n'
|
||||
ORDER BY analise_nr
|
||||
*/
|
||||
|
||||
|
||||
/* RH */
|
||||
/*
|
||||
responsabel_loja = 'y'
|
||||
SELECT *
|
||||
FROM analises_acidentes
|
||||
WHERE
|
||||
( estado = Global.ESTADO_RH1 OR estado = Global.ESTADO_RH2 OR estado = Global.ESTADO_ASSINATURA_RH )
|
||||
AND estabelecimento_id = estabelecimento_id
|
||||
AND apagada = 'n'
|
||||
ORDER BY analise_nr
|
||||
|
||||
responsavel_loja = 'n'
|
||||
SELECT *
|
||||
FROM analises_acidentes
|
||||
WHERE
|
||||
( estado = Global.ESTADO_RH1 OR estado = Global.ESTADO_RH2 )
|
||||
AND estabelecimento_id = estabelecimento_id
|
||||
AND apagada = 'n'
|
||||
ORDER BY analise_nr
|
||||
*/
|
||||
|
||||
|
||||
/* HS */
|
||||
/*
|
||||
SELECT *
|
||||
FROM analises_acidentes
|
||||
WHERE
|
||||
( estado = Global.ESTADO_HS OR estado = Global.ESTADO_FECHAR OR estado = Global.ESTADO_CONSOLIDACAO )
|
||||
AND apagada = 'n'
|
||||
ORDER BY analise_nr
|
||||
*/
|
||||
|
||||
}
|
||||
Loading…
Reference in new issue