package com.fs.his.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.his.param.FsInquiryTempParam;
import com.fs.his.vo.FsInquiryTempListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.his.mapper.FsInquiryTempMapper;
import com.fs.his.domain.FsInquiryTemp;
import com.fs.his.service.IFsInquiryTempService;

/**
 * 模板Service业务层处理
 *
 * @author fs
 * @date 2023-09-04
 */
@Service
public class FsInquiryTempServiceImpl implements IFsInquiryTempService
{
    @Autowired
    private FsInquiryTempMapper fsInquiryTempMapper;

    /**
     * 查询模板
     *
     * @param tempId 模板主键
     * @return 模板
     */
    @Override
    public FsInquiryTemp selectFsInquiryTempByTempId(Long tempId)
    {
        return fsInquiryTempMapper.selectFsInquiryTempByTempId(tempId);
    }

    /**
     * 查询模板列表
     *
     * @param fsInquiryTemp 模板
     * @return 模板
     */
    @Override
    public List<FsInquiryTemp> selectFsInquiryTempList(FsInquiryTemp fsInquiryTemp)
    {
        return fsInquiryTempMapper.selectFsInquiryTempList(fsInquiryTemp);
    }

    /**
     * 新增模板
     *
     * @param fsInquiryTemp 模板
     * @return 结果
     */
    @Override
    public int insertFsInquiryTemp(FsInquiryTemp fsInquiryTemp)
    {
        fsInquiryTemp.setCreateTime(DateUtils.getNowDate());
        return fsInquiryTempMapper.insertFsInquiryTemp(fsInquiryTemp);
    }

    /**
     * 修改模板
     *
     * @param fsInquiryTemp 模板
     * @return 结果
     */
    @Override
    public int updateFsInquiryTemp(FsInquiryTemp fsInquiryTemp)
    {
        fsInquiryTemp.setUpdateTime(DateUtils.getNowDate());
        return fsInquiryTempMapper.updateFsInquiryTemp(fsInquiryTemp);
    }

    /**
     * 批量删除模板
     *
     * @param tempIds 需要删除的模板主键
     * @return 结果
     */
    @Override
    public int deleteFsInquiryTempByTempIds(Long[] tempIds)
    {
        return fsInquiryTempMapper.deleteFsInquiryTempByTempIds(tempIds);
    }

    /**
     * 删除模板信息
     *
     * @param tempId 模板主键
     * @return 结果
     */
    @Override
    public int deleteFsInquiryTempByTempId(Long tempId)
    {
        return fsInquiryTempMapper.deleteFsInquiryTempByTempId(tempId);
    }

    @Override
    public List<FsInquiryTempListVO> selectFsInquiryTempListVO(FsInquiryTempParam fsInquiryTemp) {
        return fsInquiryTempMapper.selectFsInquiryTempListVO(fsInquiryTemp);
    }
}
