package com.sooka.system.medicine.project.service.impl;


import com.sooka.common.core.text.Convert;
import com.sooka.common.utils.DateUtils;
import com.sooka.system.medicine.project.domain.TGuijiMedicineProject;
import com.sooka.system.medicine.project.mapper.TGuijiMedicineProjectMapper;
import com.sooka.system.medicine.project.service.ITGuijiMedicineProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 项目采集Service业务层处理
 *
 * @author lei
 * @date 2022-08-22
 */
@Service
public class TGuijiMedicineProjectServiceImpl implements ITGuijiMedicineProjectService
{
    @Autowired
    private TGuijiMedicineProjectMapper tGuijiMedicineProjectMapper;

    /**
     * 查询项目采集
     *
     * @param id 项目采集ID
     * @return 项目采集
     */
    @Override
    public TGuijiMedicineProject selectTGuijiMedicineProjectById(String id)
    {
        return tGuijiMedicineProjectMapper.selectTGuijiMedicineProjectById(id);
    }

    /**
     * 查询项目采集列表
     *
     * @param tGuijiMedicineProject 项目采集
     * @return 项目采集
     */
    @Override
    public List<TGuijiMedicineProject> selectTGuijiMedicineProjectList(TGuijiMedicineProject tGuijiMedicineProject)
    {
        return tGuijiMedicineProjectMapper.selectTGuijiMedicineProjectList(tGuijiMedicineProject);
    }

    /**
     * 新增项目采集
     *
     * @param tGuijiMedicineProject 项目采集
     * @return 结果
     */
    @Override
    public int insertTGuijiMedicineProject(TGuijiMedicineProject tGuijiMedicineProject)
    {
        tGuijiMedicineProject.setCreateTime(DateUtils.getNowDate());
        return tGuijiMedicineProjectMapper.insertTGuijiMedicineProject(tGuijiMedicineProject);
    }

    /**
     * 修改项目采集
     *
     * @param tGuijiMedicineProject 项目采集
     * @return 结果
     */
    @Override
    public int updateTGuijiMedicineProject(TGuijiMedicineProject tGuijiMedicineProject)
    {
        return tGuijiMedicineProjectMapper.updateTGuijiMedicineProject(tGuijiMedicineProject);
    }

    /**
     * 删除项目采集对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTGuijiMedicineProjectByIds(String ids)
    {
        return tGuijiMedicineProjectMapper.deleteTGuijiMedicineProjectByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除项目采集信息
     *
     * @param id 项目采集ID
     * @return 结果
     */
    @Override
    public int deleteTGuijiMedicineProjectById(String id)
    {
        return tGuijiMedicineProjectMapper.deleteTGuijiMedicineProjectById(id);
    }
}
