UserGroupDao extends BaseDao { public List<MemberView> getUserListByLikeUserName(String userName) throws SQLException { StringBuffer sql = new StringBuffer("SELECT id as user_id, user_no, user_name, user_real_name, user_email FROM login_users "); if (StringUtils.isNotBlank(userName)) { sql.append("WHERE (user_name like '" + userName + "%' or user_real_name like '" + userName + "%') and id != " + PermissionService.getSUPERID() + " limit 10"); } else { sql.append("WHERE id != " + PermissionService.getSUPERID() + " limit 10"); } System.out.println(sql.toString()); return this.queryBySql(sql.toString(), MemberView.class); }  Long insertUserGroup(UserGroup userGroup); Long insertUserGroup(Long user_id, Long group_id, Integer role, Integer opt_user); int deleteUserFromGroup(Long user_id, Long group_id); int updateUserPersimion(UserGroup userGroup); int updateUserPersimion(Long userId, Long groupId, Integer role, Integer opt_user); List<MemberView> getUserListByLikeUserName(String userName); List<UserGroup> getUserGroupByUserId(Long userId); List<UserGroup> getUserGroupByGroupId(Long groupId); List<UserGroup> getUserGroupByGroupIdAndUserId(Long groupId, Long userId); Long getMemberTotalCount(Paging<UserGroup> paging); List<MemberView> findMemberPageList(Paging<UserGroup> paging);  }
@Test public void getUserListByLikeUserName() throws Exception { List<MemberView> lsit = userGroupDao.getUserListByLikeUserName("yu"); System.out.println("getUserListByLikeUserName :-------> " + lsit); Assert.assertTrue(lsit.size() > 0); }