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;
}
Aggregations