Search in sources :

Example 1 with SysTemplate

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

the class SysTemplateServiceImpl method listAll.

@Override
public List<Template> listAll() {
    List<SysTemplate> entityList = sysTemplateMapper.selectAll();
    if (CollectionUtils.isEmpty(entityList)) {
        return null;
    }
    List<Template> list = new ArrayList<>();
    for (SysTemplate entity : entityList) {
        list.add(new Template(entity));
    }
    return list;
}
Also used : SysTemplate(com.zyd.blog.persistence.beans.SysTemplate) ArrayList(java.util.ArrayList) SysTemplate(com.zyd.blog.persistence.beans.SysTemplate) Template(com.zyd.blog.business.entity.Template)

Example 2 with SysTemplate

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

the class SysTemplateServiceImpl method findPageBreakByCondition.

/**
 * 分页查询
 *
 * @param vo
 * @return
 */
@Override
public PageInfo<Template> findPageBreakByCondition(TemplateConditionVO vo) {
    PageHelper.startPage(vo.getPageNumber(), vo.getPageSize());
    List<SysTemplate> list = sysTemplateMapper.findPageBreakByCondition(vo);
    if (CollectionUtils.isEmpty(list)) {
        return null;
    }
    List<Template> boList = new ArrayList<>();
    for (SysTemplate sysTemplate : list) {
        boList.add(new Template(sysTemplate));
    }
    PageInfo bean = new PageInfo<SysTemplate>(list);
    bean.setList(boList);
    return bean;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) SysTemplate(com.zyd.blog.persistence.beans.SysTemplate) ArrayList(java.util.ArrayList) SysTemplate(com.zyd.blog.persistence.beans.SysTemplate) Template(com.zyd.blog.business.entity.Template)

Example 3 with SysTemplate

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

the class SysTemplateServiceImpl method getTemplate.

@Override
public Template getTemplate(String key) {
    if (StringUtils.isEmpty(key)) {
        return null;
    }
    SysTemplate entity = new SysTemplate();
    entity.setRefKey(key);
    entity = this.sysTemplateMapper.selectOne(entity);
    return null == entity ? null : new Template(entity);
}
Also used : SysTemplate(com.zyd.blog.persistence.beans.SysTemplate) SysTemplate(com.zyd.blog.persistence.beans.SysTemplate) Template(com.zyd.blog.business.entity.Template)

Example 4 with SysTemplate

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

the class SysTemplateServiceImpl method getByPrimaryKey.

@Override
public Template getByPrimaryKey(Long primaryKey) {
    Assert.notNull(primaryKey, "PrimaryKey不可为空!");
    SysTemplate entity = sysTemplateMapper.selectByPrimaryKey(primaryKey);
    return null == entity ? null : new Template(entity);
}
Also used : SysTemplate(com.zyd.blog.persistence.beans.SysTemplate) SysTemplate(com.zyd.blog.persistence.beans.SysTemplate) Template(com.zyd.blog.business.entity.Template)

Aggregations

Template (com.zyd.blog.business.entity.Template)4 SysTemplate (com.zyd.blog.persistence.beans.SysTemplate)4 ArrayList (java.util.ArrayList)2 PageInfo (com.github.pagehelper.PageInfo)1