
package com.tmerclub.cloud.product.service.impl;

import com.tmerclub.cloud.common.database.dto.PageDTO;
import com.tmerclub.cloud.common.database.util.PageUtil;
import com.tmerclub.cloud.common.database.vo.PageVO;
import com.tmerclub.cloud.product.dto.SpuPriceLogDTO;
import com.tmerclub.cloud.product.mapper.SpuPriceLogMapper;
import com.tmerclub.cloud.product.model.SpuPriceLog;
import com.tmerclub.cloud.product.service.SpuPriceLogService;
import com.tmerclub.cloud.product.vo.SpuPriceLogVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 商品调价记录
 *
 * @author lhd
 * @date 2022-06-29 17:48:25
 */
@Service
public class SpuPriceLogServiceImpl implements SpuPriceLogService {

    @Autowired
    private SpuPriceLogMapper spuPriceLogMapper;

    @Override
    public PageVO<SpuPriceLogVO> page(PageDTO pageDTO, SpuPriceLogDTO spuPriceLogDTO) {
        return PageUtil.doPage(pageDTO, () -> spuPriceLogMapper.pageByParam(spuPriceLogDTO));
    }

    @Override
    public SpuPriceLog getById(Long id) {
        return spuPriceLogMapper.getById(id);
    }

    @Override
    public void save(SpuPriceLog spuPriceLog) {
        spuPriceLogMapper.save(spuPriceLog);
    }

    @Override
    public void update(SpuPriceLog spuPriceLog) {
        spuPriceLogMapper.update(spuPriceLog);
    }

    @Override
    public void deleteById(Long id) {
        spuPriceLogMapper.deleteById(id);
    }
}
