Search in sources :

Example 6 with SysUser

use of com.zyd.blog.persistence.beans.SysUser in project OneBlog by zhangyd-c.

the class SysUserServiceImpl method getByUserName.

/**
 * 根据用户名查找
 *
 * @param userName
 * @return
 */
@Override
public User getByUserName(String userName) {
    User user = new User(userName, null);
    SysUser sysUser = this.sysUserMapper.selectOne(user.getSysUser());
    return null == sysUser ? null : new User(sysUser);
}
Also used : SysUser(com.zyd.blog.persistence.beans.SysUser) User(com.zyd.blog.business.entity.User) SysUser(com.zyd.blog.persistence.beans.SysUser)

Example 7 with SysUser

use of com.zyd.blog.persistence.beans.SysUser in project OneBlog by zhangyd-c.

the class SysUserServiceImpl method findPageBreakByCondition.

@Override
public PageInfo<User> findPageBreakByCondition(UserConditionVO vo) {
    PageHelper.startPage(vo.getPageNumber(), vo.getPageSize());
    List<SysUser> sysUsers = sysUserMapper.findPageBreakByCondition(vo);
    if (CollectionUtils.isEmpty(sysUsers)) {
        return null;
    }
    List<User> users = new ArrayList<>();
    for (SysUser su : sysUsers) {
        users.add(new User(su));
    }
    PageInfo bean = new PageInfo<SysUser>(sysUsers);
    bean.setList(users);
    return bean;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) SysUser(com.zyd.blog.persistence.beans.SysUser) User(com.zyd.blog.business.entity.User) SysUser(com.zyd.blog.persistence.beans.SysUser) ArrayList(java.util.ArrayList)

Aggregations

User (com.zyd.blog.business.entity.User)7 SysUser (com.zyd.blog.persistence.beans.SysUser)7 ArrayList (java.util.ArrayList)4 PageInfo (com.github.pagehelper.PageInfo)1 Date (java.util.Date)1 Transactional (org.springframework.transaction.annotation.Transactional)1