package com.fs.company.service.impl;

import com.fs.common.utils.DateUtils;
import com.fs.company.domain.CompanyTcmSchedule;
import com.fs.company.mapper.CompanyTcmScheduleMapper;
import com.fs.company.service.ICompanyTcmScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 中医档期管理Service业务层处理
 *
 * @author fs
 * @date 2023-09-05
 */
@Service
public class CompanyTcmScheduleServiceImpl implements ICompanyTcmScheduleService
{
    @Autowired
    private CompanyTcmScheduleMapper companyTcmScheduleMapper;

    /**
     * 查询中医档期管理
     *
     * @param id 中医档期管理ID
     * @return 中医档期管理
     */
    @Override
    public CompanyTcmSchedule selectCompanyTcmScheduleById(Long id)
    {
        return companyTcmScheduleMapper.selectCompanyTcmScheduleById(id);
    }

    /**
     * 查询中医档期管理列表
     *
     * @param companyTcmSchedule 中医档期管理
     * @return 中医档期管理
     */
    @Override
    public List<CompanyTcmSchedule> selectCompanyTcmScheduleList(CompanyTcmSchedule companyTcmSchedule)
    {
        return companyTcmScheduleMapper.selectCompanyTcmScheduleList(companyTcmSchedule);
    }

    /**
     * 新增中医档期管理
     *
     * @param companyTcmSchedule 中医档期管理
     * @return 结果
     */
    @Override
    public int insertCompanyTcmSchedule(CompanyTcmSchedule companyTcmSchedule)
    {
        companyTcmSchedule.setCreateTime(DateUtils.getNowDate());
        return companyTcmScheduleMapper.insertCompanyTcmSchedule(companyTcmSchedule);
    }

    /**
     * 修改中医档期管理
     *
     * @param companyTcmSchedule 中医档期管理
     * @return 结果
     */
    @Override
    public int updateCompanyTcmSchedule(CompanyTcmSchedule companyTcmSchedule)
    {
        companyTcmSchedule.setUpdateTime(DateUtils.getNowDate());
        return companyTcmScheduleMapper.updateCompanyTcmSchedule(companyTcmSchedule);
    }

    /**
     * 批量删除中医档期管理
     *
     * @param ids 需要删除的中医档期管理ID
     * @return 结果
     */
    @Override
    public int deleteCompanyTcmScheduleByIds(Long[] ids)
    {
        return companyTcmScheduleMapper.deleteCompanyTcmScheduleByIds(ids);
    }

    /**
     * 删除中医档期管理信息
     *
     * @param id 中医档期管理ID
     * @return 结果
     */
    @Override
    public int deleteCompanyTcmScheduleById(Long id)
    {
        return companyTcmScheduleMapper.deleteCompanyTcmScheduleById(id);
    }

    @Override
    public List<CompanyTcmSchedule> selectUseableScheduleList() {
        return companyTcmScheduleMapper.selectUseableScheduleList();
    }
}
