package com.fs.his.service.impl;

import java.util.Collections;
import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.his.vo.FsHealthHistoryTempListUVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.his.mapper.FsHealthHistoryTempMapper;
import com.fs.his.domain.FsHealthHistoryTemp;
import com.fs.his.service.IFsHealthHistoryTempService;

/**
 * 健康史模板Service业务层处理
 *
 * @author fs
 * @date 2024-08-29
 */
@Service
public class FsHealthHistoryTempServiceImpl implements IFsHealthHistoryTempService
{
    @Autowired
    private FsHealthHistoryTempMapper fsHealthHistoryTempMapper;

    /**
     * 查询健康史模板
     *
     * @param id 健康史模板主键
     * @return 健康史模板
     */
    @Override
    public FsHealthHistoryTemp selectFsHealthHistoryTempById(Long id)
    {
        return fsHealthHistoryTempMapper.selectFsHealthHistoryTempById(id);
    }

    /**
     * 查询健康史模板列表
     *
     * @param fsHealthHistoryTemp 健康史模板
     * @return 健康史模板
     */
    @Override
    public List<FsHealthHistoryTemp> selectFsHealthHistoryTempList(FsHealthHistoryTemp fsHealthHistoryTemp)
    {
        return fsHealthHistoryTempMapper.selectFsHealthHistoryTempList(fsHealthHistoryTemp);
    }

    /**
     * 新增健康史模板
     *
     * @param fsHealthHistoryTemp 健康史模板
     * @return 结果
     */
    @Override
    public int insertFsHealthHistoryTemp(FsHealthHistoryTemp fsHealthHistoryTemp)
    {
        fsHealthHistoryTemp.setCreateTime(DateUtils.getNowDate());
        return fsHealthHistoryTempMapper.insertFsHealthHistoryTemp(fsHealthHistoryTemp);
    }

    /**
     * 修改健康史模板
     *
     * @param fsHealthHistoryTemp 健康史模板
     * @return 结果
     */
    @Override
    public int updateFsHealthHistoryTemp(FsHealthHistoryTemp fsHealthHistoryTemp)
    {
        return fsHealthHistoryTempMapper.updateFsHealthHistoryTemp(fsHealthHistoryTemp);
    }

    /**
     * 批量删除健康史模板
     *
     * @param ids 需要删除的健康史模板主键
     * @return 结果
     */
    @Override
    public int deleteFsHealthHistoryTempByIds(Long[] ids)
    {
        return fsHealthHistoryTempMapper.deleteFsHealthHistoryTempByIds(ids);
    }

    /**
     * 删除健康史模板信息
     *
     * @param id 健康史模板主键
     * @return 结果
     */
    @Override
    public int deleteFsHealthHistoryTempById(Long id)
    {
        return fsHealthHistoryTempMapper.deleteFsHealthHistoryTempById(id);
    }

    @Override
    public List<FsHealthHistoryTempListUVO> selectFsHealthHistoryTempListUVO() {
        return fsHealthHistoryTempMapper.selectFsHealthHistoryTempListUVO();
    }
}
