| | |
| | | @Resource
|
| | | private CommonGoodsMapper commonGoodsMapper;
|
| | |
|
| | | |
| | | @Override
|
| | | public CommonGoods selectByPrimaryKey(Long id) {
|
| | | return commonGoodsMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 验证数据正确性
|
| | | *
|
| | |
| | |
|
| | | @Override
|
| | | public CommonGoods addOrUpdateCommonGoods(CommonGoods commonGoods) throws CommonGoodsException {
|
| | | // 验证数据完整性
|
| | | filterCommonGoods(commonGoods);
|
| | | |
| | | CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(commonGoods.getGoodsId(),
|
| | | commonGoods.getGoodsType());
|
| | | if (goods != null) {
|
| | |
| | |
|
| | | @Override
|
| | | public CommonGoods addCommonGoods(CommonGoods commonGoods) throws CommonGoodsException {
|
| | | // 验证数据完整性
|
| | | filterCommonGoods(commonGoods);
|
| | | |
| | | CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(commonGoods.getGoodsId(),
|
| | | commonGoods.getGoodsType());
|
| | | if (goods != null) {
|
| | |
| | | public void updateCommonGoods(CommonGoods commonGoods) throws CommonGoodsException {
|
| | | // 判断信息是否完整
|
| | | filterCommonGoods(commonGoods);
|
| | | |
| | | CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(commonGoods.getGoodsId(),
|
| | | commonGoods.getGoodsType());
|
| | | if (goods == null) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void offlineCommonGoods(Long goodsId, int goodsType) {
|
| | | public void offlineCommonGoods(Long goodsId, Integer goodsType) {
|
| | | CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(goodsId, goodsType);
|
| | | if (goods == null)
|
| | | return;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public CommonGoods getCommonGoodsByGoodsIdAndGoodsType(Long goodsId, int goodsType) {
|
| | | public CommonGoods getCommonGoodsByGoodsIdAndGoodsType(Long goodsId, Integer goodsType) {
|
| | | return commonGoodsMapper.selectByGoodsIdAndGoodsType(goodsId, goodsType);
|
| | | }
|
| | |
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public List<CommonGoods> listBySellerId(Long sellerId) {
|
| | | return commonGoodsMapper.listBySellerId(sellerId);
|
| | | public List<CommonGoods> listBySellerId(Long sellerId, Integer goodsType) {
|
| | | return commonGoodsMapper.listBySellerId(sellerId, goodsType);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countBySellerIdAndHasCoupon(Long sellerId) {
|
| | | return commonGoodsMapper.countBySellerIdAndHasCoupon(sellerId);
|
| | | public long countBySellerIdAndHasCoupon(Long sellerId, Integer goodsType) {
|
| | | return commonGoodsMapper.countBySellerIdAndHasCoupon(sellerId, goodsType);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<CommonGoods> getByListGoodsId(List<Long> list) {
|
| | | return commonGoodsMapper.getByListGoodsId(list);
|
| | | public List<CommonGoods> getByListGoodsId(List<Long> list, Integer goodsType) {
|
| | | return commonGoodsMapper.getByListGoodsId(list, goodsType);
|
| | | }
|
| | |
|
| | | }
|