List<Object> params = new ArrayList<>();
String selectdata="";
if (StringUtils.isNotEmpty(zhiwei)) {}
selectdata += " AND SEI.POSITION = ? ";
params.add(zhiwei);
}
//选择处室跳转到站段页面时,方法一:
if (officeid != null) {
String officeName = departmentManager.getDeptNameById(officeid);
selectdata += "AND SEI.OFFICE_NAME = ? ";
params.add(officeName);
}
String sqlA = "select * from table" + selectData;
SQLQuery sqA = dao.getSession().createSQLQuery(sqlA);
sqA.setParameter(0, findDepotName(depotid));
for (int i = 0; i < params.size(); ++i) {
sqA.setParameter(i+1, params.get(i));
}