package com.ruoyi.system.service.impl;

import java.util.List;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ProductProductsemitrailerMapper;
import com.ruoyi.system.domain.ProductProductsemitrailer;
import com.ruoyi.system.service.IProductProductsemitrailerService;

/**
 * 半挂车表 服务实现
 *
 * @author ruoyi
 */
@Service
public class ProductProductsemitrailerServiceImpl implements IProductProductsemitrailerService
{
    @Autowired
    private ProductProductsemitrailerMapper productProductsemitrailerMapper;

    /**
     * 查询半挂车集合
     *
     * @param productProductsemitrailer 半挂车信息
     * @return 半挂车集合
     */
    @Override
    public List<ProductProductsemitrailer> selectProductProductsemitrailerList(ProductProductsemitrailer productProductsemitrailer)
    {
        return productProductsemitrailerMapper.selectProductProductsemitrailerList(productProductsemitrailer);
    }

    /**
     * 分页查询半挂车集合
     *
     * @param productProductsemitrailer 半挂车信息
     * @return 分页数据
     */
    @Override
    public TableDataInfo selectProductProductsemitrailerListByPage(ProductProductsemitrailer productProductsemitrailer, Integer pageNum, Integer pageSize)
    {
        if (pageNum == null) pageNum = 1;
        if (pageSize == null) pageSize = 10;
        PageHelper.startPage(pageNum, pageSize);
        List<ProductProductsemitrailer> list = productProductsemitrailerMapper.selectProductProductsemitrailerList(productProductsemitrailer);
        PageInfo<ProductProductsemitrailer> pageInfo = new PageInfo<>(list);
        return new TableDataInfo(list, pageInfo.getTotal());
    }

    /**
     * 根据ID查询半挂车信息
     *
     * @return 半挂车信息
     */
    @Override
    public ProductProductsemitrailer selectProductProductsemitrailerById(String productId)
    {
        return productProductsemitrailerMapper.selectProductProductsemitrailerById(productId);
    }

    /**
     * 新增半挂车信息
     *
     * @param productProductsemitrailer 半挂车信息
     * @return 结果
     */
    @Override
    public int insertProductProductsemitrailer(ProductProductsemitrailer productProductsemitrailer)
    {
        return productProductsemitrailerMapper.insertProductProductsemitrailer(productProductsemitrailer);
    }

    /**
     * 修改半挂车信息
     *
     * @param productProductsemitrailer 半挂车信息
     * @return 结果
     */
    @Override
    public int updateProductProductsemitrailer(ProductProductsemitrailer productProductsemitrailer)
    {
        return productProductsemitrailerMapper.updateProductProductsemitrailer(productProductsemitrailer);
    }

    /**
     * 删除半挂车信息
     *
     * @return 结果
     */
    @Override
    public int deleteProductProductsemitrailerById(String ProductId)
    {
        return productProductsemitrailerMapper.deleteProductProductsemitrailerById(ProductId);
    }

    /**
     * 批量删除半挂车信息
     *
     * @param ids 需要删除的主键ID数组
     * @return 结果
     */
    @Override
    public int deleteProductProductsemitrailerByIds(Long[] ids)
    {
        return productProductsemitrailerMapper.deleteProductProductsemitrailerByIds(ids);
    }
}