예제 #1
0
 public void add(SALEMAN user) {
   if (StringUtil.isBlank(user.getId())) {
     user.setCreate_time(new Date().getTime());
     String cardNo = baseDao.queryForString("SELECT nextval('sequence');");
     user.setCard_no(cardNo);
   }
   user.insertOrUpdate();
 }
예제 #2
0
 @Override
 public SHIPIN_INFO insert() {
   if (StringUtils.isBlank(id)) {
     this.setId(StringUtil.getUUID());
   }
   dao.execute(getInsertSql(), BEAN_VALUES);
   return this;
 }
예제 #3
0
 public Map find(SALEMAN zhuan, HttpServletRequest request) {
   StringBuffer buffer =
       new StringBuffer(
           "select *,FROM_UNIXTIME(left( create_time,10), '%Y-%m-%d' ) as createTime from saleman where 1=1 ");
   if (StringUtil.isNotBlank(zhuan.getName())) {
     buffer.append(" and name like '%" + zhuan.getName() + "%'");
   }
   if (StringUtil.isNotBlank(zhuan.getAddress())) {
     buffer.append(" and address like '%" + zhuan.getAddress() + "%'");
   }
   if (StringUtil.isNotBlank(zhuan.getCard_no())) {
     buffer.append(" and card_no like '%" + zhuan.getCard_no() + "%'");
   }
   if (StringUtil.isNotBlank(zhuan.getTel())) {
     buffer.append(" and tel like '%" + zhuan.getTel() + "%'");
   }
   buffer.append(" order by create_time desc");
   Map resultMap = baseDao.queryForDataGrid(request, buffer.toString(), new SqlParameter());
   return resultMap;
 }