Search in sources :

Example 1 with TbItemCatExample

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

the class ItemCatServiceImpl method getItemCatList.

@Override
public List<ZTreeNode> getItemCatList(int parentId) {
    TbItemCatExample example = new TbItemCatExample();
    TbItemCatExample.Criteria criteria = example.createCriteria();
    // 排序
    example.setOrderByClause("sort_order");
    // 条件查询
    criteria.andParentIdEqualTo(new Long(parentId));
    List<TbItemCat> list = tbItemCatMapper.selectByExample(example);
    // 转换成ZtreeNode
    List<ZTreeNode> resultList = new ArrayList<>();
    for (TbItemCat tbItemCat : list) {
        ZTreeNode node = DtoUtil.TbItemCat2ZTreeNode(tbItemCat);
        resultList.add(node);
    }
    return resultList;
}
Also used : TbItemCat(cn.exrick.manager.pojo.TbItemCat) ArrayList(java.util.ArrayList) ZTreeNode(cn.exrick.common.pojo.ZTreeNode) TbItemCatExample(cn.exrick.manager.pojo.TbItemCatExample)

Aggregations

ZTreeNode (cn.exrick.common.pojo.ZTreeNode)1 TbItemCat (cn.exrick.manager.pojo.TbItemCat)1 TbItemCatExample (cn.exrick.manager.pojo.TbItemCatExample)1 ArrayList (java.util.ArrayList)1