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


import com.sooka.common.core.text.Convert;
import com.sooka.common.utils.DateUtils;
import com.sooka.system.medicine.plant.domain.TGuijiMedicinePlant;
import com.sooka.system.medicine.plant.mapper.TGuijiMedicinePlantMapper;
import com.sooka.system.medicine.plant.service.ITGuijiMedicinePlantService;
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 TGuijiMedicinePlantServiceImpl implements ITGuijiMedicinePlantService
{
    @Autowired
    private TGuijiMedicinePlantMapper tGuijiMedicinePlantMapper;

    /**
     * 查询种植采集数
     *
     * @param id 种植采集数ID
     * @return 种植采集数
     */
    @Override
    public TGuijiMedicinePlant selectTGuijiMedicinePlantById(String id)
    {
        return tGuijiMedicinePlantMapper.selectTGuijiMedicinePlantById(id);
    }

    /**
     * 查询种植采集数列表
     *
     * @param tGuijiMedicinePlant 种植采集数
     * @return 种植采集数
     */
    @Override
    public List<TGuijiMedicinePlant> selectTGuijiMedicinePlantList(TGuijiMedicinePlant tGuijiMedicinePlant)
    {
        return tGuijiMedicinePlantMapper.selectTGuijiMedicinePlantList(tGuijiMedicinePlant);
    }

    /**
     * 新增种植采集数
     *
     * @param tGuijiMedicinePlant 种植采集数
     * @return 结果
     */
    @Override
    public int insertTGuijiMedicinePlant(TGuijiMedicinePlant tGuijiMedicinePlant)
    {
        tGuijiMedicinePlant.setCreateTime(DateUtils.getNowDate());
        return tGuijiMedicinePlantMapper.insertTGuijiMedicinePlant(tGuijiMedicinePlant);
    }

    /**
     * 修改种植采集数
     *
     * @param tGuijiMedicinePlant 种植采集数
     * @return 结果
     */
    @Override
    public int updateTGuijiMedicinePlant(TGuijiMedicinePlant tGuijiMedicinePlant)
    {
        return tGuijiMedicinePlantMapper.updateTGuijiMedicinePlant(tGuijiMedicinePlant);
    }

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

    /**
     * 删除种植采集数信息
     *
     * @param id 种植采集数ID
     * @return 结果
     */
    @Override
    public int deleteTGuijiMedicinePlantById(String id)
    {
        return tGuijiMedicinePlantMapper.deleteTGuijiMedicinePlantById(id);
    }
}
