
package com.tmerclub.cloud.delivery.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.common.order.vo.TransfeeVO;
import com.tmerclub.cloud.delivery.mapper.TransfeeMapper;
import com.tmerclub.cloud.delivery.model.Transfee;
import com.tmerclub.cloud.delivery.service.TransfeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 运费项
 *
 * @author tmerclub
 * @date 2020-12-07 15:10:01
 */
@Service
public class TransfeeServiceImpl implements TransfeeService {

    @Autowired
    private TransfeeMapper transfeeMapper;

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

    @Override
    public TransfeeVO getByTransfeeId(Long transfeeId) {
        return transfeeMapper.getByTransfeeId(transfeeId);
    }

    @Override
    public void save(Transfee transfee) {
        transfeeMapper.save(transfee);
    }

    @Override
    public void update(Transfee transfee) {
        transfeeMapper.update(transfee);
    }

    @Override
    public void deleteById(Long transfeeId) {
        transfeeMapper.deleteById(transfeeId);
    }
}
