Esempio n. 1
0
 public void logicDelete(String accountId) {
   AdminAccountExample example = new AdminAccountExample();
   Criteria criteria = example.createCriteria();
   criteria.andIdEqualTo(accountId);
   AdminAccount account = new AdminAccount();
   account.setStat(0);
   mapper.updateByExampleSelective(account, example);
 }
Esempio n. 2
0
 public List<AdminAccount> findAllByPage(PageQuery page) {
   AdminAccountExample example = new AdminAccountExample();
   Criteria criteria = example.createCriteria();
   criteria.andStatEqualTo(DataStatus.ENABLED);
   example.setOrderByClause(
       " create_time asc limit " + page.getStartNum() + ", " + page.getPageSize());
   return mapper.selectByExample(example);
 }
Esempio n. 3
0
  public AdminAccount findByUsername(String username) {
    AdminAccountExample example = new AdminAccountExample();
    Criteria criteria = example.createCriteria();
    criteria.andUserNameEqualTo(username);
    criteria.andStatEqualTo(DataStatus.ENABLED);

    List<AdminAccount> adminUsers = mapper.selectByExample(example);
    return CollectionUtils.isEmpty(adminUsers) ? null : adminUsers.get(0);
  }
Esempio n. 4
0
 public long count(AdminAccountQuery query) {
   AdminAccountExample example = new AdminAccountExample();
   Criteria criteria = example.createCriteria();
   criteria.andStatEqualTo(DataStatus.ENABLED);
   if (StringUtils.isNotEmpty(query.getAccountCode())) {
     criteria.andUserNameEqualTo(query.getAccountCode());
   }
   if (StringUtils.isNotEmpty(query.getRoleId())) {
     criteria.andRoleIdEqualTo(query.getRoleId());
   }
   return mapper.countByExample(example);
 }
Esempio n. 5
0
 public List<AdminAccount> find(AdminAccountQuery query, PageQuery page) {
   AdminAccountExample example = new AdminAccountExample();
   Criteria criteria = example.createCriteria();
   criteria.andStatEqualTo(DataStatus.ENABLED);
   if (StringUtils.isNotEmpty(query.getAccountCode())) {
     criteria.andUserNameEqualTo(query.getAccountCode());
   }
   if (StringUtils.isNotEmpty(query.getRoleId())) {
     criteria.andRoleIdEqualTo(query.getRoleId());
   }
   example.setOrderByClause(
       " create_time asc limit " + page.getStartNum() + ", " + page.getPageSize());
   return mapper.selectByExample(example);
 }
Esempio n. 6
0
 public long countAll() {
   AdminAccountExample example = new AdminAccountExample();
   Criteria criteria = example.createCriteria();
   criteria.andStatEqualTo(DataStatus.ENABLED);
   return mapper.countByExample(example);
 }