@Override public boolean checkUsernamePassword(String username, String password) { UserCriteria userCriteria = new UserCriteria(); userCriteria.createCriteria().andUsernameEqualTo(username).andPasswordEqualTo(password); List<User> list = userMapper.selectByExample(userCriteria); return (null != list && list.size() > 0) ? true : false; }
@Override public User findByUsername(String username) { UserCriteria userCriteria = new UserCriteria(); userCriteria.createCriteria().andUsernameEqualTo(username); List<User> list = userMapper.selectByExample(userCriteria); return (null != list && list.size() > 0) ? list.get(0) : null; }
/* * (non-Javadoc) * * @see com.jcin.cms.service.system.IUserService#deleteBatch(List) */ @Override @Transactional(readOnly = false) public int deleteBatch(List<String> list) { UserCriteria userCriteria = new UserCriteria(); userCriteria.createCriteria().andIdIn(list); int result = userMapper.deleteByExample(userCriteria); super.deleteBatch(list); return result; }
/* * (non-Javadoc) * * @see * com.jcin.cms.service.system.IUserService#select(com.jcin.cms.utils.Page) */ @Override public Page select(Page page) { super.select(page); // setOrderByClause("SER_NO asc , ORG_ID desc"); UserCriteria userCriteria = new UserCriteria(); userCriteria.setOrderByClause("id desc"); userCriteria.setPage(page); @SuppressWarnings("rawtypes") List list = userMapper.selectByExample(userCriteria); page.setRows(list); int total = userMapper.countByExample(userCriteria); page.setTotal(total); return page; }
// @Override @Override public Page select(UserCriteria criteria) { Page page = new Page(); if (null != criteria) { if (null != criteria.getPage()) { page = criteria.getPage(); } } @SuppressWarnings("rawtypes") List list = userMapper.selectByExample(criteria); page.setRows(list); int total = userMapper.countByExample(criteria); page.setTotal(total); return page; }