/** * 更新大拿 * * @param user * @return */ @Transactional public void updateGreater(User user, Greater greater) { updateUser(user); StringBuilder sql = new StringBuilder(); sql.append("update USER_GREATER set "); ParamInfo paramInfo = new ParamInfo(); if (!Utils.isEmpty(greater.getCompany())) { sql.append("company=?,"); paramInfo.setTypeAndData(Types.VARCHAR, greater.getCompany()); } if (!Utils.isEmpty(greater.getPost())) { sql.append("post=?,"); paramInfo.setTypeAndData(Types.VARCHAR, greater.getPost()); } if (!Utils.isEmpty(greater.getTags())) { sql.append("tags=?,"); paramInfo.setTypeAndData(Types.VARCHAR, greater.getTags()); } if (!Utils.isEmpty(greater.getExperience())) { sql.append("experience=?,"); paramInfo.setTypeAndData(Types.VARCHAR, greater.getExperience()); } if (!Utils.isEmpty(greater.getSpecialty())) { sql.append("specialty=?,"); paramInfo.setTypeAndData(Types.CHAR, greater.getSpecialty()); } if (!Utils.isEmpty(greater.getJob())) { sql.append("job=?,"); paramInfo.setTypeAndData(Types.VARCHAR, greater.getJob()); } if (!Utils.isEmpty(greater.getAnswerTimes())) { sql.append("answerTimes=?,"); paramInfo.setTypeAndData(Types.BIGINT, greater.getAnswerTimes()); } if (!Utils.isEmpty(greater.getIsshow())) { sql.append("isshow=?,"); paramInfo.setTypeAndData(Types.CHAR, greater.getIsshow()); } if (!Utils.isEmpty(greater.getOrderNo())) { sql.append("orderNo=?,"); paramInfo.setTypeAndData(Types.INTEGER, greater.getOrderNo()); } if (sql.toString().endsWith(",")) { sql.replace(sql.length() - 1, sql.length(), ""); sql.append(" where id=?"); paramInfo.setTypeAndData(Types.BIGINT, greater.getId()); userDao.updateRecord(sql.toString(), paramInfo); } }
/** * 新增大拿 * * @param greater */ @Transactional public void insertGreater(User user, Greater greater) { long id = userDao.insertRecord(user, "USER_INFO"); greater.setId(String.valueOf(id)); greaterDao.insertRecord(greater, "USER_GREATER"); }