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(); }
@Override public SHIPIN_INFO insert() { if (StringUtils.isBlank(id)) { this.setId(StringUtil.getUUID()); } dao.execute(getInsertSql(), BEAN_VALUES); return this; }
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; }