package com.srs.comprehensive.service.impl;

import java.util.List;

import com.srs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.srs.comprehensive.mapper.CphTotalScoreMapper;
import com.srs.comprehensive.domain.CphTotalScore;
import com.srs.comprehensive.service.ICphTotalScoreService;

/**
 * 总分记录表Service业务层处理
 *
 * @author srs
 * @date 2024-01-08
 */
@Service
public class CphTotalScoreServiceImpl extends ServiceImpl<CphTotalScoreMapper,CphTotalScore> implements ICphTotalScoreService {
    @Autowired
    private CphTotalScoreMapper cphTotalScoreMapper;

    /**
     * 查询总分记录表
     *
     * @param id 总分记录表主键
     * @return 总分记录表
     */
    @Override
    public CphTotalScore selectCphTotalScoreById(Long id) {
        return cphTotalScoreMapper.selectCphTotalScoreById(id);
    }

    /**
     * 查询总分记录表列表
     *
     * @param cphTotalScore 总分记录表
     * @return 总分记录表
     */
    @Override
    public List<CphTotalScore> selectCphTotalScoreList(CphTotalScore cphTotalScore) {
        return cphTotalScoreMapper.selectCphTotalScoreList(cphTotalScore);
    }

    /**
     * 新增总分记录表
     *
     * @param cphTotalScore 总分记录表
     * @return 结果
     */
    @Override
    public int insertCphTotalScore(CphTotalScore cphTotalScore) {
                cphTotalScore.setCreateTime(DateUtils.getNowDate());
            return cphTotalScoreMapper.insertCphTotalScore(cphTotalScore);
    }

    /**
     * 修改总分记录表
     *
     * @param cphTotalScore 总分记录表
     * @return 结果
     */
    @Override
    public int updateCphTotalScore(CphTotalScore cphTotalScore) {
                cphTotalScore.setUpdateTime(DateUtils.getNowDate());
        return cphTotalScoreMapper.updateCphTotalScore(cphTotalScore);
    }

    /**
     * 批量删除总分记录表
     *
     * @param ids 需要删除的总分记录表主键
     * @return 结果
     */
    @Override
    public int deleteCphTotalScoreByIds(Long[] ids) {
        return cphTotalScoreMapper.deleteCphTotalScoreByIds(ids);
    }

    /**
     * 删除总分记录表信息
     *
     * @param id 总分记录表主键
     * @return 结果
     */
    @Override
    public int deleteCphTotalScoreById(Long id) {
        return cphTotalScoreMapper.deleteCphTotalScoreById(id);
    }
}
