public List<Wqwqxkzxq1Form> findWqwqxkzxq1ListWithPage( int pagesize, int pageno, Wqwqxkzxq1Form wqwqxkzxq1Form) { String hqlWhere = ""; Object[] params = null; List<String> paramsList = new ArrayList<String>(); LinkedHashMap<String, String> orderby = new LinkedHashMap<String, String>(); if (wqwqxkzxq1Form != null && StringUtils.isNotBlank(wqwqxkzxq1Form.getXh())) { hqlWhere += " and o.xh like ?"; paramsList.add("%" + wqwqxkzxq1Form.getXh() + "%"); } if (wqwqxkzxq1Form != null && StringUtils.isNotBlank(wqwqxkzxq1Form.getZymc())) { hqlWhere += " and o.zymc like ?"; paramsList.add("%" + wqwqxkzxq1Form.getZymc() + "%"); } orderby.put(" o.xh", "desc"); params = paramsList.toArray(); List<Wqwqxkzxq1> list = wqwqxkzxq1Dao.findCollectionByConditionWithPage( hqlWhere, params, orderby, pagesize, pageno); List<Wqwqxkzxq1Form> formlist = this.Wqwqxkzxq1POListToVOList(list); if (pageno == 1) { formListTemp = Wqwqxkzxq1POListToVOList( wqwqxkzxq1Dao.findCollectionByConditionNoPage(hqlWhere, params, orderby)); } return formlist; }
public void saveObject(Wqwqxkzxq1Form wqwqxkzxq1Form, String username) { Wqwqxkzxq1 wqwqxkzxq1 = new Wqwqxkzxq1(); wqwqxkzxq1.setXh(wqwqxkzxq1Form.getXh()); wqwqxkzxq1.setZymc(wqwqxkzxq1Form.getZymc()); wqwqxkzxq1.setBz(wqwqxkzxq1Form.getBz()); wqwqxkzxq1.setJlnf(String.valueOf(Calendar.getInstance().get(Calendar.YEAR))); wqwqxkzxq1.setUsername(username); wqwqxkzxq1.setGxsj(new Date().toString()); wqwqxkzxq1.setSubmit(0); wqwqxkzxq1Dao.save(wqwqxkzxq1); }
private List<Wqwqxkzxq1Form> Wqwqxkzxq1POListToVOList(List<Wqwqxkzxq1> list) { // TODO Auto-generated method stub List<Wqwqxkzxq1Form> formlist = new ArrayList<Wqwqxkzxq1Form>(); for (int i = 0; i < list.size(); i++) { Wqwqxkzxq1 wqwqxkzxq1 = list.get(i); Wqwqxkzxq1Form wqwqxkzxq1Form = new Wqwqxkzxq1Form(); wqwqxkzxq1Form.setXh(wqwqxkzxq1.getXh()); wqwqxkzxq1Form.setZymc(wqwqxkzxq1.getZymc()); wqwqxkzxq1Form.setId(String.valueOf(wqwqxkzxq1.getId())); wqwqxkzxq1Form.setBz(wqwqxkzxq1.getBz()); wqwqxkzxq1Form.setJlnf(wqwqxkzxq1.getJlnf()); wqwqxkzxq1Form.setUsername(wqwqxkzxq1.getUsername()); wqwqxkzxq1Form.setGxsj(wqwqxkzxq1.getGxsj()); wqwqxkzxq1Form.setSubmit(String.valueOf(wqwqxkzxq1.getSubmit())); formlist.add(wqwqxkzxq1Form); } return formlist; }