Search in sources :

Example 1 with ItemDto

use of cn.exrick.manager.dto.ItemDto in project xmall by Exrick.

the class ItemServiceImpl method getItemById.

@Override
public ItemDto getItemById(Long id) {
    ItemDto itemDto = new ItemDto();
    TbItem tbItem = tbItemMapper.selectByPrimaryKey(id);
    itemDto = DtoUtil.TbItem2ItemDto(tbItem);
    TbItemCat tbItemCat = tbItemCatMapper.selectByPrimaryKey(itemDto.getCid());
    itemDto.setCname(tbItemCat.getName());
    TbItemDesc tbItemDesc = tbItemDescMapper.selectByPrimaryKey(id);
    itemDto.setDetail(tbItemDesc.getItemDesc());
    return itemDto;
}
Also used : ItemDto(cn.exrick.manager.dto.ItemDto) TbItemCat(cn.exrick.manager.pojo.TbItemCat) TbItemDesc(cn.exrick.manager.pojo.TbItemDesc) TbItem(cn.exrick.manager.pojo.TbItem)

Aggregations

ItemDto (cn.exrick.manager.dto.ItemDto)1 TbItem (cn.exrick.manager.pojo.TbItem)1 TbItemCat (cn.exrick.manager.pojo.TbItemCat)1 TbItemDesc (cn.exrick.manager.pojo.TbItemDesc)1