Sku存储服务代码

master
王皓雯 6 years ago
parent 99cd87b917
commit c652408818

@ -0,0 +1,38 @@
package com.macro.mall.service.impl;
import com.macro.mall.dao.PmsSkuStockDao;
import com.macro.mall.mapper.PmsSkuStockMapper;
import com.macro.mall.model.PmsSkuStock;
import com.macro.mall.model.PmsSkuStockExample;
import com.macro.mall.service.PmsSkuStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.List;
/**
* ÉÌÆ·sku¿â´æ¹ÜÀíServiceʵÏÖÀà
*/
@Service
public class PmsSkuStockServiceImpl implements PmsSkuStockService {
@Autowired
private PmsSkuStockMapper skuStockMapper;
@Autowired
private PmsSkuStockDao skuStockDao;
@Override
public List<PmsSkuStock> getList(Long pid, String keyword) {
PmsSkuStockExample example = new PmsSkuStockExample();
PmsSkuStockExample.Criteria criteria = example.createCriteria().andProductIdEqualTo(pid);
if (!StringUtils.isEmpty(keyword)) {
criteria.andSkuCodeLike("%" + keyword + "%");
}
return skuStockMapper.selectByExample(example);
}
@Override
public int update(Long pid, List<PmsSkuStock> skuStockList) {
return skuStockDao.replaceList(skuStockList);
}
}
Loading…
Cancel
Save