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.FsHealthLifeParam;
import com.fs.his.param.FsHealthLifeUParam;
import com.fs.his.vo.FsHealthLifeListUVO;
import com.fs.his.vo.FsHealthLifeListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.his.mapper.FsHealthLifeMapper;
import com.fs.his.domain.FsHealthLife;
import com.fs.his.service.IFsHealthLifeService;

/**
 * 健康生活Service业务层处理
 *
 * @author fs
 * @date 2024-09-02
 */
@Service
public class FsHealthLifeServiceImpl implements IFsHealthLifeService
{
    @Autowired
    private FsHealthLifeMapper fsHealthLifeMapper;

    /**
     * 查询健康生活
     *
     * @param id 健康生活主键
     * @return 健康生活
     */
    @Override
    public FsHealthLife selectFsHealthLifeById(Long id)
    {
        return fsHealthLifeMapper.selectFsHealthLifeById(id);
    }

    /**
     * 查询健康生活列表
     *
     * @param fsHealthLife 健康生活
     * @return 健康生活
     */
    @Override
    public List<FsHealthLife> selectFsHealthLifeList(FsHealthLife fsHealthLife)
    {
        return fsHealthLifeMapper.selectFsHealthLifeList(fsHealthLife);
    }

    /**
     * 新增健康生活
     *
     * @param fsHealthLife 健康生活
     * @return 结果
     */
    @Override
    public int insertFsHealthLife(FsHealthLife fsHealthLife)
    {
        fsHealthLife.setCreateTime(DateUtils.getNowDate());
        return fsHealthLifeMapper.insertFsHealthLife(fsHealthLife);
    }

    /**
     * 修改健康生活
     *
     * @param fsHealthLife 健康生活
     * @return 结果
     */
    @Override
    public int updateFsHealthLife(FsHealthLife fsHealthLife)
    {
        return fsHealthLifeMapper.updateFsHealthLife(fsHealthLife);
    }

    /**
     * 批量删除健康生活
     *
     * @param ids 需要删除的健康生活主键
     * @return 结果
     */
    @Override
    public int deleteFsHealthLifeByIds(Long[] ids)
    {
        return fsHealthLifeMapper.deleteFsHealthLifeByIds(ids);
    }

    /**
     * 删除健康生活信息
     *
     * @param id 健康生活主键
     * @return 结果
     */
    @Override
    public int deleteFsHealthLifeById(Long id)
    {
        return fsHealthLifeMapper.deleteFsHealthLifeById(id);
    }

    @Override
    public List<FsHealthLifeListUVO> selectFsHealthLifeListUVO(FsHealthLifeUParam param) {
        return fsHealthLifeMapper.selectFsHealthLifeListUVO(param);
    }

    @Override
    public List<FsHealthLifeListVO> selectFsHealthLifeListVO(FsHealthLifeParam fsHealthLife) {
        return fsHealthLifeMapper.selectFsHealthLifeListVO(fsHealthLife);
    }

    @Override
    public FsHealthLifeListUVO selectFsHealthLifeDayByUserId(FsHealthLifeUParam param) {
        return fsHealthLifeMapper.selectFsHealthLifeDayByUserId(param);
    }
}
