示例#1
0
 @Override
 public List<PersonJoinBrhBean> pagedQuery(PersonJoinBrhBean 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_joinbrh",
           new String[] {
             "rankID as \"joinRankID\"",
             "workDate",
             "postDate",
             "annuitytag",
             "workBegin",
             "insYears",
             "recruitFrom",
             "recruitType",
             "localAttr",
             "recommUID",
             "recommName"
           },
           new String[] {"pid"},
           new String[] {"pid"},
           new String[] {});
   t.setParams(ls);
   t.setSql(sqlStr);
   t.setFilter(true);
   return dao.queryPage(
       t, new POJORowMapper<PersonJoinBrhBean>(new String[] {}, PersonJoinBrhBean.class));
 }
示例#2
0
 public boolean updatePersonJoinBrh(PersonJoinBrhBean t) throws Exception {
   // 校验
   if ("".equals(t.getPid()) || null == t.getPid()) {
     throw new RuntimeException("主键不能为空!");
   }
   // 封装数据
   PersonJoinBrhBean obj = new PersonJoinBrhBean();
   obj.setPid(t.getPid());
   obj.setRecommUID(t.getRecommUID());
   obj.setRecommName(t.getRecommName());
   // 调用DAO方法
   return dao.updatePersonJoinBrh(obj);
 }
示例#3
0
 public boolean insertPersonJoinBrh(PersonJoinBrhBean t) throws Exception {
   SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
   if (t.getWorkBegin() == null || t.getWorkBegin().equals("")) {
     throw new RuntimeException("从业开始时间不能为空!");
   } else {
     try {
       sf.parse(t.getWorkBegin());
     } catch (ParseException e) {
       throw new RuntimeException("从业开始时间格式不正确!");
     }
   }
   if (t.getInsYears() == null || t.getInsYears().equals("")) {
     throw new RuntimeException("保险从业年限不能为空!");
   }
   if (t.getRecruitFrom() == null || t.getRecruitFrom().equals("")) {
     throw new RuntimeException("招募来源不能为空!");
   }
   if (t.getWorkDate() == null || t.getWorkDate().equals("")) {
     throw new RuntimeException("入司日期不能为空!");
   } else {
     try {
       sf.parse(t.getWorkDate());
     } catch (ParseException e) {
       throw new RuntimeException("入司日期格式不正确!");
     }
   }
   if (t.getRecruitType() == null || t.getRecruitType().equals("")) {
     throw new RuntimeException("招募类型不能为空!");
   }
   if (t.getLocalAttr() == null || t.getLocalAttr().equals("")) {
     throw new RuntimeException("地域属性不能为空!");
   }
   return dao.insertPersonJoinBrh(t);
 }