×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Text
Posted by: Aftab Alam
Added: May 3, 2017 5:59 AM
Views: 16
  1.  column = " lt.loantypeid,lt.loantype, SUM(ld.LoanDr) as dr, SUM(ld.LoanCr) as cr,  SUM(ld.LoanDr-ld.LoanCr) as balance ";
  2.  
  3.                     $bQuery = "SELECT " + column + " from loandetail ld  inner join  loantype lt on( lt.loantypeid = ld.loantypeid)  "
  4.                             + " where ld.memberid = ? And ld.Centerid =? And ld.officeid= ? "
  5.                             + " group by lt.loantypeid,lt.loantype "
  6.                             + "  order by lt.loantypeid ";
  7.                     nparameters = new HashMap<Integer, Object>();
  8.                     nparameters.put(1, $memberid);
  9.                     nparameters.put(2, $centerid);
  10.                     nparameters.put(3, $branchid);
  11.  
  12.                     List<Object[]> loans = nqe.ExecuteNativeSelectQuery($bQuery, nparameters, em);
  13.                     columns = this.nqe.getColumnsArray(column);
  14.                     columnType = new Integer[]{Types.INTEGER, Types.VARCHAR, Types.DOUBLE, Types.DOUBLE, Types.DOUBLE};
  15.                     JsonArray LoanDetail = null;
  16.                     if (loans != null && loans.size() > 0) {
  17.                         LoanDetail = rg.getJsonArrayFromDatabase(loans, columns, columnType);
  18.                     }

1 comment

Aftab Alam 5 months ago
nqe = NativeQueryExecutor is a class that performs dml task
getJsonArrayFromDatabase is a function to convert resultset to JSON

If anyone require these classes and function, you can email me at aftabthedeveloper@gmail.com

Write a comment