package com.tenwa.customer.cache; import com.amarsoft.awe.util.ASResultSet; import com.amarsoft.awe.util.SqlObject; import com.amarsoft.awe.util.Transaction; import com.amarsoft.dict.als.cache.CacheLoaderFactory; public class LoanCache { //根据contractid获取ContractNo public static String getContractNo(String contractid) throws Exception{ String ContractNo=""; Transaction Sqlca =null; String companySql = "select CONTRACT_NO from LOAN_CONTRACT_INFO where ID=:ID "; try { Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource()); SqlObject aSql = new SqlObject(companySql); aSql.setParameter("ID", contractid); ASResultSet rs = null; rs = Sqlca.getASResultSet(aSql); if(rs.next()){ ContractNo = rs.getStringValue("CONTRACT_NO"); } } catch (Exception e) { e.printStackTrace(); }finally{ if(Sqlca!=null){ Sqlca.disConnect(); Sqlca = null; } } return ContractNo; } //根据提款单id获取bill_id public static String getBillNo(String billid) throws Exception{ String BillNo=""; Transaction Sqlca =null; String companySql = "select BILL_ID from LOAN_BILL_INFO where ID=:ID "; try { Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource()); SqlObject aSql = new SqlObject(companySql); aSql.setParameter("ID", billid); ASResultSet rs = null; rs = Sqlca.getASResultSet(aSql); if(rs.next()){ BillNo = rs.getStringValue("BILL_ID"); } } catch (Exception e) { e.printStackTrace(); }finally{ if(Sqlca!=null){ Sqlca.disConnect(); Sqlca = null; } } return BillNo; } }