新RabbitMQ精讲 提升工程实践能力 培养架构思维
V:ititit111222333
` @Autowired private ItemsMapper itemsMapper;
@Autowired
private ItemsSpecMapper itemsSpecMapper;
@Autowired
private ItemsParamMapper itemsParamMapper;
@Autowired
private ItemsImgMapper itemsImgMapper;
@Autowired
private ItemsCommentsMapper itemsCommentsMapper;
@Autowired
private ItemsCustomMapper itemsCustomMapper;
@Transactional(propagation = Propagation.SUPPORTS, rollbackFor = Exception.class)
@Override
public Items getById(String itemId) {
return this.itemsMapper.selectByPrimaryKey(itemId);
}
@Transactional(propagation = Propagation.SUPPORTS, rollbackFor = Exception.class)
@Override
public ItemsParam getByItemId(String itemId) {
Example example = new Example(ItemsParam.class);
Example.Criteria criteria = example.createCriteria();
Example.Criteria andEqualTo = criteria.andEqualTo("itemId", itemId);
return itemsParamMapper.selectOneByExample(example);
}
@Transactional(propagation = Propagation.SUPPORTS, rollbackFor = Exception.class)
@Override
public List<ItemsSpec> getItemsSpecsByItemId(String itemId) {
Example example = new Example(ItemsSpec.class);
Example.Criteria criteria = example.createCriteria();
Example.Criteria andEqualTo = criteria.andEqualTo("itemId", itemId);
return itemsSpecMapper.selectByExample(example);
}
@Transactional(propagation = Propagation.SUPPORTS, rollbackFor = Exception.class)
@Override
public List<ItemsImg> getItemsImgListByItemId(String itemId) {
Example example = new Example(ItemsSpec.class);
Example.Criteria criteria = example.createCriteria();
Example.Criteria andEqualTo = criteria.andEqualTo("itemId", itemId);
return itemsImgMapper.selectByExample(example);
}
`