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.SchemeInvestmentMapper;
import com.ruoyi.system.domain.SchemeInvestment;
import com.ruoyi.system.service.ISchemeInvestmentService;

/**
 * 方案投资表 服务实现
 *
 * @author ruoyi
 */
@Service
public class SchemeInvestmentServiceImpl implements ISchemeInvestmentService
{
    @Autowired
    private SchemeInvestmentMapper schemeInvestmentMapper;

    /**
     * 查询方案投资集合
     *
     * @param schemeInvestment 方案投资信息
     * @return 方案投资集合
     */
    @Override
    public List<SchemeInvestment> selectSchemeInvestmentList(SchemeInvestment schemeInvestment)
    {
        return schemeInvestmentMapper.selectSchemeInvestmentList(schemeInvestment);
    }

    /**
     * 分页查询方案投资集合
     *
     * @param schemeInvestment 方案投资信息
     * @return 分页数据
     */
//    @Override
//    public TableDataInfo selectSchemeInvestmentListByPage(SchemeInvestment schemeInvestment, Integer pageNum, Integer pageSize)
//    {
//        if (pageNum == null) pageNum = 1;
//        if (pageSize == null) pageSize = 10;
//        PageHelper.startPage(pageNum, pageSize);
//        List<SchemeInvestment> list = schemeInvestmentMapper.selectSchemeInvestmentList(schemeInvestment);
//        PageInfo<SchemeInvestment> pageInfo = new PageInfo<>(list);
//        return new TableDataInfo(list, pageInfo.getTotal());
//    }

    /**
     * 根据ID查询方案投资信息
     *
     * @param id 主键ID
     * @return 方案投资信息
     */
    @Override
    public SchemeInvestment selectSchemeInvestmentById(Long id)
    {
        return schemeInvestmentMapper.selectSchemeInvestmentById(id);
    }

    /**
     * 根据方案ID查询方案投资信息
     *
     * @param schemeId 方案ID
     * @return 方案投资信息
     */
    @Override
    public SchemeInvestment selectSchemeInvestmentBySchemeId(String schemeId)
    {
        return schemeInvestmentMapper.selectSchemeInvestmentBySchemeId(schemeId);
    }

    /**
     * 新增方案投资信息
     *
     * @param schemeInvestment 方案投资信息
     * @return 结果
     */
    @Override
    public int insertSchemeInvestment(SchemeInvestment schemeInvestment)
    {
        return schemeInvestmentMapper.insertSchemeInvestment(schemeInvestment);
    }

    /**
     * 修改方案投资信息
     *
     * @param schemeInvestment 方案投资信息
     * @return 结果
     */
    @Override
    public int updateSchemeInvestment(SchemeInvestment schemeInvestment)
    {
        return schemeInvestmentMapper.updateSchemeInvestment(schemeInvestment);
    }

    /**
     * 删除方案投资信息
     *
     * @param schemeId 方案ID
     * @return 结果
     */
    @Override
    public int deleteSchemeInvestmentById(String schemeId)
    {
        return schemeInvestmentMapper.deleteSchemeInvestmentById(schemeId);
    }

    /**
     * 批量删除方案投资信息
     *
     * @param ids 需要删除的主键ID数组
     * @return 结果
     */
    @Override
    public int deleteSchemeInvestmentByIds(Long[] ids)
    {
        return schemeInvestmentMapper.deleteSchemeInvestmentByIds(ids);
    }
}
