package com.fs.hospital.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.hospital.vo.HospitalMemberLevelHVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.hospital.mapper.HospitalMemberLevelMapper;
import com.fs.hospital.domain.HospitalMemberLevel;
import com.fs.hospital.service.IHospitalMemberLevelService;

/**
 * 会员等级Service业务层处理
 *
 * @author fs
 * @date 2024-03-04
 */
@Service
public class HospitalMemberLevelServiceImpl implements IHospitalMemberLevelService
{
    @Autowired
    private HospitalMemberLevelMapper hospitalMemberLevelMapper;

    /**
     * 查询会员等级
     *
     * @param levelId 会员等级主键
     * @return 会员等级
     */
    @Override
    public HospitalMemberLevel selectHospitalMemberLevelByLevelId(Long levelId)
    {
        return hospitalMemberLevelMapper.selectHospitalMemberLevelByLevelId(levelId);
    }

    /**
     * 查询会员等级列表
     *
     * @param hospitalMemberLevel 会员等级
     * @return 会员等级
     */
    @Override
    public List<HospitalMemberLevel> selectHospitalMemberLevelList(HospitalMemberLevel hospitalMemberLevel)
    {
        return hospitalMemberLevelMapper.selectHospitalMemberLevelList(hospitalMemberLevel);
    }

    /**
     * 新增会员等级
     *
     * @param hospitalMemberLevel 会员等级
     * @return 结果
     */
    @Override
    public int insertHospitalMemberLevel(HospitalMemberLevel hospitalMemberLevel)
    {
        hospitalMemberLevel.setCreateTime(DateUtils.getNowDate());
        return hospitalMemberLevelMapper.insertHospitalMemberLevel(hospitalMemberLevel);
    }

    /**
     * 修改会员等级
     *
     * @param hospitalMemberLevel 会员等级
     * @return 结果
     */
    @Override
    public int updateHospitalMemberLevel(HospitalMemberLevel hospitalMemberLevel)
    {
        hospitalMemberLevel.setUpdateTime(DateUtils.getNowDate());
        return hospitalMemberLevelMapper.updateHospitalMemberLevel(hospitalMemberLevel);
    }

    /**
     * 批量删除会员等级
     *
     * @param levelIds 需要删除的会员等级主键
     * @return 结果
     */
    @Override
    public int deleteHospitalMemberLevelByLevelIds(Long[] levelIds)
    {
        return hospitalMemberLevelMapper.deleteHospitalMemberLevelByLevelIds(levelIds);
    }

    /**
     * 删除会员等级信息
     *
     * @param levelId 会员等级主键
     * @return 结果
     */
    @Override
    public int deleteHospitalMemberLevelByLevelId(Long levelId)
    {
        return hospitalMemberLevelMapper.deleteHospitalMemberLevelByLevelId(levelId);
    }

    @Override
    public List<HospitalMemberLevel> selectAllLevel(Long hospitalId) {
        return hospitalMemberLevelMapper.selectAllLevel(hospitalId);
    }

    @Override
    public List<HospitalMemberLevelHVO> selectHospitalMemberLevelListPVO(HospitalMemberLevel hospitalMemberLevel) {
        return hospitalMemberLevelMapper.selectHospitalMemberLevelListPVO(hospitalMemberLevel);
    }
}
