package com.fs.his.service.impl;

import java.util.Collections;
import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.his.param.FsHealthRecordListParam;
import com.fs.his.vo.FsHealthRecordListPVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.his.mapper.FsHealthRecordMapper;
import com.fs.his.domain.FsHealthRecord;
import com.fs.his.service.IFsHealthRecordService;

/**
 * 健康档案Service业务层处理
 *
 * @author fs
 * @date 2024-09-02
 */
@Service
public class FsHealthRecordServiceImpl implements IFsHealthRecordService
{
    @Autowired
    private FsHealthRecordMapper fsHealthRecordMapper;

    /**
     * 查询健康档案
     *
     * @param id 健康档案主键
     * @return 健康档案
     */
    @Override
    public FsHealthRecord selectFsHealthRecordById(Long id)
    {
        return fsHealthRecordMapper.selectFsHealthRecordById(id);
    }

    /**
     * 查询健康档案列表
     *
     * @param fsHealthRecord 健康档案
     * @return 健康档案
     */
    @Override
    public List<FsHealthRecord> selectFsHealthRecordList(FsHealthRecord fsHealthRecord)
    {
        return fsHealthRecordMapper.selectFsHealthRecordList(fsHealthRecord);
    }

    /**
     * 新增健康档案
     *
     * @param fsHealthRecord 健康档案
     * @return 结果
     */
    @Override
    public int insertFsHealthRecord(FsHealthRecord fsHealthRecord)
    {
        fsHealthRecord.setCreateTime(DateUtils.getNowDate());
        return fsHealthRecordMapper.insertFsHealthRecord(fsHealthRecord);
    }

    /**
     * 修改健康档案
     *
     * @param fsHealthRecord 健康档案
     * @return 结果
     */
    @Override
    public int updateFsHealthRecord(FsHealthRecord fsHealthRecord)
    {
        fsHealthRecord.setUpdateTime(DateUtils.getNowDate());
        return fsHealthRecordMapper.updateFsHealthRecord(fsHealthRecord);
    }

    /**
     * 批量删除健康档案
     *
     * @param ids 需要删除的健康档案主键
     * @return 结果
     */
    @Override
    public int deleteFsHealthRecordByIds(Long[] ids)
    {
        return fsHealthRecordMapper.deleteFsHealthRecordByIds(ids);
    }

    /**
     * 删除健康档案信息
     *
     * @param id 健康档案主键
     * @return 结果
     */
    @Override
    public int deleteFsHealthRecordById(Long id)
    {
        return fsHealthRecordMapper.deleteFsHealthRecordById(id);
    }

    @Override
    public FsHealthRecord selectFsHealthRecordByUserId(Long userId) {
        return fsHealthRecordMapper.selectFsHealthRecordByUserId(userId);
    }

    @Override
    public List<FsHealthRecordListPVO> selectFsHealthRecordListVO(FsHealthRecordListParam fsHealthRecord) {
        return fsHealthRecordMapper.selectFsHealthRecordListVO(fsHealthRecord);
    }

    @Override
    public List<FsHealthRecordListPVO> selectFsHealthRecordCompanyListVO(FsHealthRecordListParam fsHealthRecord) {
        return fsHealthRecordMapper.selectFsHealthRecordCompanyListVO(fsHealthRecord);
    }


}
