Search in sources :

Example 1 with TbContentCategoryExample

use of cn.exrick.manager.pojo.TbContentCategoryExample in project xmall by Exrick.

the class ContentCatServiceImpl method getContentCatList.

@Override
public List<ZTreeNode> getContentCatList(Long parentId) {
    TbContentCategoryExample example = new TbContentCategoryExample();
    TbContentCategoryExample.Criteria criteria = example.createCriteria();
    criteria.andParentIdEqualTo(parentId);
    example.setOrderByClause("sort_order");
    List<TbContentCategory> catList = tbContentCategoryMapper.selectByExample(example);
    List<ZTreeNode> list = new ArrayList<>();
    for (int i = 0; i < catList.size(); i++) {
        ZTreeNode zTreeNode = DtoUtil.TbContentCategory2ZTreeNode(catList.get(i));
        list.add(zTreeNode);
    }
    return list;
}
Also used : TbContentCategoryExample(cn.exrick.manager.pojo.TbContentCategoryExample) TbContentCategory(cn.exrick.manager.pojo.TbContentCategory) ArrayList(java.util.ArrayList) ZTreeNode(cn.exrick.common.pojo.ZTreeNode)

Aggregations

ZTreeNode (cn.exrick.common.pojo.ZTreeNode)1 TbContentCategory (cn.exrick.manager.pojo.TbContentCategory)1 TbContentCategoryExample (cn.exrick.manager.pojo.TbContentCategoryExample)1 ArrayList (java.util.ArrayList)1