package it.acxent.bank.consel; import it.acxent.db.ApplParmFull; import it.acxent.db.DBAdapter; import it.acxent.db.ResParm; import it.acxent.db.WcString; import it.acxent.util.Vectumerator; import java.io.Serializable; import java.sql.PreparedStatement; import java.sql.SQLException; public class ConselTabfin extends DBAdapter implements Serializable { public static final double MIN_FIN = 168.0D; public static final double MAX_FIN = 7500.0D; private long id_conselTabfin; private String flgTipo; private double valoreBene; private long durata; private double importoRata; private double tan; private double taeg; private double interessi; private double speseGestSingolaRata; private double speseGestTotaleRata; private double impostaBollo; private double importoTotaleDovuto; public ConselTabfin(ApplParmFull newApplParmFull) { super(newApplParmFull); } public ConselTabfin() {} public void setId_conselTabfin(long newId_conselTabfin) { this.id_conselTabfin = newId_conselTabfin; } public void setFlgTipo(String newFlgTipo) { this.flgTipo = newFlgTipo; } public void setValoreBene(double newValoreBene) { this.valoreBene = newValoreBene; } public void setDurata(long newDurata) { this.durata = newDurata; } public void setImportoRata(double newImportoRata) { this.importoRata = newImportoRata; } public void setTan(double newTan) { this.tan = newTan; } public void setTaeg(double newTaeg) { this.taeg = newTaeg; } public void setInteressi(double newInteressi) { this.interessi = newInteressi; } public void setSpeseGestSingolaRata(double newSpeseGestSingolaRata) { this.speseGestSingolaRata = newSpeseGestSingolaRata; } public void setSpeseGestTotaleRata(double newSpeseGestTotaleRata) { this.speseGestTotaleRata = newSpeseGestTotaleRata; } public void setImpostaBollo(double newImpostaBollo) { this.impostaBollo = newImpostaBollo; } public void setImportoTotaleDovuto(double newImportoTotaleDovuto) { this.importoTotaleDovuto = newImportoTotaleDovuto; } public long getId_conselTabfin() { return this.id_conselTabfin; } public String getFlgTipo() { return (this.flgTipo == null) ? "" : this.flgTipo.trim(); } public double getValoreBene() { return this.valoreBene; } public long getDurata() { return this.durata; } public double getImportoRata() { return this.importoRata; } public double getTan() { return this.tan; } public double getTaeg() { return this.taeg; } public double getInteressi() { return this.interessi; } public double getSpeseGestSingolaRata() { return this.speseGestSingolaRata; } public double getSpeseGestTotaleRata() { return this.speseGestTotaleRata; } public double getImpostaBollo() { return this.impostaBollo; } public double getImportoTotaleDovuto() { return this.importoTotaleDovuto; } protected ResParm checkDeleteCascade() { return new ResParm(true); } protected void deleteCascade() {} public Vectumerator findByCR(ConselTabfinCR CR, int pageNumber, int pageRows) { String s_Sql_Find = "select A.* from CONSEL_TABFIN AS A"; String s_Sql_Order = ""; WcString wc = new WcString(); if (CR.getValoreBene() > 0.0D) wc.addWc("A.valoreBene=" + CR.getValoreBene()); if (!CR.getFlgTipo().isEmpty()) wc.addWc("A.flgTipo='" + CR.getFlgTipo() + "'"); if (CR.getDurata() > 0L) wc.addWc("A.durata=" + CR.getDurata()); try { PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString()); return findRows(stmt, pageNumber, pageRows); } catch (SQLException e) { removeCPConnection(); handleDebug(e); return AB_EMPTY_VECTUMERATOR; } } public void findByTipoValoreDurata(String l_flgTipo, double l_valore, long l_durata) { String s_Sql_Find = "select A.* from CONSEL_TABFIN AS A"; String s_Sql_Order = ""; WcString wc = new WcString(); wc.addWc("A.valoreBene=" + Math.round(l_valore)); wc.addWc("A.flgTipo='" + l_flgTipo + "'"); wc.addWc("A.durata=" + l_durata); try { PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString()); findFirstRecord(stmt); } catch (SQLException e) { removeCPConnection(); handleDebug(e); } } }