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.FsHealthDataParam;
import com.fs.his.param.FsHealthDataUParam;
import com.fs.his.vo.FsHealthDataListUVO;
import com.fs.his.vo.FsHealthDataListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.his.mapper.FsHealthDataMapper;
import com.fs.his.domain.FsHealthData;
import com.fs.his.service.IFsHealthDataService;

/**
 * 健康数据Service业务层处理
 *
 * @author fs
 * @date 2024-09-02
 */
@Service
public class FsHealthDataServiceImpl implements IFsHealthDataService
{
    @Autowired
    private FsHealthDataMapper fsHealthDataMapper;

    /**
     * 查询健康数据
     *
     * @param id 健康数据主键
     * @return 健康数据
     */
    @Override
    public FsHealthData selectFsHealthDataById(Long id)
    {
        return fsHealthDataMapper.selectFsHealthDataById(id);
    }

    /**
     * 查询健康数据列表
     *
     * @param fsHealthData 健康数据
     * @return 健康数据
     */
    @Override
    public List<FsHealthData> selectFsHealthDataList(FsHealthData fsHealthData)
    {
        return fsHealthDataMapper.selectFsHealthDataList(fsHealthData);
    }

    /**
     * 新增健康数据
     *
     * @param fsHealthData 健康数据
     * @return 结果
     */
    @Override
    public int insertFsHealthData(FsHealthData fsHealthData)
    {
        fsHealthData.setCreateTime(DateUtils.getNowDate());
        return fsHealthDataMapper.insertFsHealthData(fsHealthData);
    }

    /**
     * 修改健康数据
     *
     * @param fsHealthData 健康数据
     * @return 结果
     */
    @Override
    public int updateFsHealthData(FsHealthData fsHealthData)
    {
        return fsHealthDataMapper.updateFsHealthData(fsHealthData);
    }

    /**
     * 批量删除健康数据
     *
     * @param ids 需要删除的健康数据主键
     * @return 结果
     */
    @Override
    public int deleteFsHealthDataByIds(Long[] ids)
    {
        return fsHealthDataMapper.deleteFsHealthDataByIds(ids);
    }

    /**
     * 删除健康数据信息
     *
     * @param id 健康数据主键
     * @return 结果
     */
    @Override
    public int deleteFsHealthDataById(Long id)
    {
        return fsHealthDataMapper.deleteFsHealthDataById(id);
    }

    @Override
    public List<FsHealthDataListUVO> selectFsHealthDataListUVO(FsHealthDataUParam param) {
        return fsHealthDataMapper.selectFsHealthDataListUVO(param);
    }

    @Override
    public List<FsHealthDataListVO> selectFsHealthDataListVO(FsHealthDataParam fsHealthData) {
        return fsHealthDataMapper.selectFsHealthDataListVO(fsHealthData);
    }
}
