示例#1
0
 @Override
 public List<PersonBankBean> pagedQuery(PersonBankBean t) {
   List<Object> ls = new ArrayList<Object>();
   StringBuffer cond = new StringBuffer();
   PubFunc.personBeanToListAndWhere(t, ls, cond);
   String baseSql = PubDefine.personBaseSql + cond.toString();
   // 权限判断语句
   baseSql = PubFunc.authoritySQL(baseSql);
   String sqlStr =
       PubFunc.simpleTableQuery(
           baseSql,
           "t_psnBank",
           new String[] {
             "serNo", "bankNo", "bankBranch", "acctOwner", "acctNo", "startDate", "endDate"
           },
           new String[] {"pid"},
           new String[] {"pid"},
           new String[] {});
   t.setParams(ls);
   t.setSql(sqlStr);
   t.setFilter(true);
   return dao.queryPage(
       t, new POJORowMapper<PersonBankBean>(new String[] {}, PersonBankBean.class));
 }
示例#2
0
 public boolean insertPersonBank(PersonBankBean t) throws Exception {
   Long serNo = new Long(UUIDProxy.integerKey());
   t.setSerNo(serNo);
   SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
   if (t.getAcctNo() == null || t.getAcctNo().equals("")) {
     throw new RuntimeException("卡号不能为空!");
   }
   if (t.getStartDate() == null || t.getStartDate().equals("")) {
     throw new RuntimeException("起始日期不能为空!");
   } else {
     try {
       sf.parse(t.getStartDate());
     } catch (ParseException e) {
       throw new RuntimeException("起始日期格式不正确!");
     }
   }
   if (dao.isUnique(t)) {
     throw new RuntimeException("该银行账户已存在!");
   }
   return dao.insertPersonBank(t);
 }