Example #1
0
  @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);
  }
Example #2
0
 @Override
 public List<Admin> getAll() {
   return adminMapper.selectByExample(null);
 }
Example #3
0
 @Override
 public Admin get(int id) {
   return adminMapper.selectByPrimaryKey(id);
 }