@Override public Admin get(String username) { AdminExample example = new AdminExample(); AdminExample.Criteria criteria = example.createCriteria(); criteria.andUsernameEqualTo(username); List<Admin> list = adminMapper.selectByExample(example); return list.isEmpty() ? null : list.get(0); }
@Override public List<Admin> getAll() { return adminMapper.selectByExample(null); }
@Override public Admin get(int id) { return adminMapper.selectByPrimaryKey(id); }