
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.mapper.StockChangeReasonStatusMapper;
import com.tmerclub.cloud.product.model.StockChangeReasonStatus;
import com.tmerclub.cloud.product.service.StockChangeReasonStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 出入库原因状态
 *
 * @author lhd
 * @date 2022-06-22 16:57:27
 */
@Service
public class StockChangeReasonStatusServiceImpl implements StockChangeReasonStatusService {

    @Autowired
    private StockChangeReasonStatusMapper stockChangeReasonStatusMapper;

    @Override
    public PageVO<StockChangeReasonStatus> page(PageDTO pageDTO) {
        return PageUtil.doPage(pageDTO, () -> stockChangeReasonStatusMapper.list());
    }

    @Override
    public StockChangeReasonStatus getByStockChangeReasonStatusId(Long stockChangeReasonStatusId) {
        return stockChangeReasonStatusMapper.getByStockChangeReasonStatusId(stockChangeReasonStatusId);
    }

    @Override
    public void save(StockChangeReasonStatus stockChangeReasonStatus) {
        stockChangeReasonStatusMapper.save(stockChangeReasonStatus);
    }

    @Override
    public void update(StockChangeReasonStatus stockChangeReasonStatus) {
        stockChangeReasonStatusMapper.update(stockChangeReasonStatus);
    }

    @Override
    public void deleteById(Long stockChangeReasonStatusId) {
        stockChangeReasonStatusMapper.deleteById(stockChangeReasonStatusId);
    }

    @Override
    public StockChangeReasonStatus getStatusByShopIdAndReasonId(Long shopId, Long reasonId) {
        return stockChangeReasonStatusMapper.getStatusByShopIdAndReasonId(shopId, reasonId);
    }
}
