package com.xinyilu.system.service.heightWeightInfo.impl;

import com.xinyilu.common.utils.DateUtils;
import com.xinyilu.system.domain.heightWeightInfo.HeightWeightInfo;
import com.xinyilu.system.mapper.heightWeightInfo.HeightWeightInfoMapper;
import com.xinyilu.system.service.heightWeightInfo.IHeightWeightInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 身高体重比成绩区间Service业务层处理
 *
 * @author jihan
 * @date 2022-08-10
 */
@Service
public class HeightWeightInfoServiceImpl implements IHeightWeightInfoService {
    @Resource
    private HeightWeightInfoMapper heightWeightInfoMapper;

    /**
     * 查询身高体重比成绩区间
     *
     * @param id 身高体重比成绩区间主键
     * @return 身高体重比成绩区间
     */
    @Override
    public HeightWeightInfo selectHeightWeightInfoById(Long id) {
        return heightWeightInfoMapper.selectHeightWeightInfoById(id);
    }

    /**
     * 查询身高体重比成绩区间列表
     *
     * @param heightWeightInfo 身高体重比成绩区间
     * @return 身高体重比成绩区间
     */
    @Override
    public List<HeightWeightInfo> selectHeightWeightInfoList(HeightWeightInfo heightWeightInfo) {
        return heightWeightInfoMapper.selectHeightWeightInfoList(heightWeightInfo);
    }

    /**
     * 新增身高体重比成绩区间
     *
     * @param heightWeightInfo 身高体重比成绩区间
     * @return 结果
     */
    @Override
    public int insertHeightWeightInfo(HeightWeightInfo heightWeightInfo) {
        heightWeightInfo.setCreateTime(DateUtils.getNowDate());
        return heightWeightInfoMapper.insertHeightWeightInfo(heightWeightInfo);
    }

    /**
     * 修改身高体重比成绩区间
     *
     * @param heightWeightInfo 身高体重比成绩区间
     * @return 结果
     */
    @Override
    public int updateHeightWeightInfo(HeightWeightInfo heightWeightInfo) {
        heightWeightInfo.setUpdateTime(DateUtils.getNowDate());
        return heightWeightInfoMapper.updateHeightWeightInfo(heightWeightInfo);
    }

    /**
     * 批量删除身高体重比成绩区间
     *
     * @param ids 需要删除的身高体重比成绩区间主键
     * @return 结果
     */
    @Override
    public int deleteHeightWeightInfoByIds(Long[] ids) {
        return heightWeightInfoMapper.deleteHeightWeightInfoByIds(ids);
    }

    /**
     * 删除身高体重比成绩区间信息
     *
     * @param id 身高体重比成绩区间主键
     * @return 结果
     */
    @Override
    public int deleteHeightWeightInfoById(Long id) {
        return heightWeightInfoMapper.deleteHeightWeightInfoById(id);
    }
}
