查询
常用的查询接口:
private IUAPQueryBS bs = NCLocator.getInstance().lookup(IUAPQueryBS.class);前后端都适用
或
private BaseDAO bs = new BaseDAO();只能用于后端
查询单个字段:
String name=ValueUtils.getInstance().getString(bs.executeQuery(sql,new ColumnProcessor()));
查询多个字段:
List
Map objbill_status1 = new HashMap();
Map obj = custslist.get(i);
List<Map<String,String>> maplist = new ArrayList<Map<String,String>>();
maplist=(List<Map<String,String>>)bs.executeQuery(sql, new MapListProcessor());
maplist.get(0).get(“depid”)
查询VO实体:
<通过VO实体所对应的表查询>
ArrayList DeptVOlist = (ArrayList) bs.executeQuery(DeptVO sql.toString(),new BeanListProcessor(DeptVO .class));
<通过VO实体的主键查询>
DeptVO = (DeptVO ) bs .retrieveByPK(DeptVO .class, pk_dept);
<通过AggVO类型实体的主键查询>
BillQuery query = new BillQuery(AggVO.class);
AggVO[] aggVos= (AggVO[])query.query(pks);
或
List pks = new ArrayList<>();
pks.add(pk_agg);
AggVO[] aggVos= (AggVO[])query.query((String[])pks.toArray(new String[0]));