package com.srs.comprehensive.service.impl;

import java.util.List;

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

/**
 * 个人评优评先类别Service业务层处理
 *
 * @author srs
 * @date 2023-09-11
 */
@Service
public class CphOwnGoodTypeServiceImpl extends ServiceImpl<CphOwnGoodTypeMapper,CphOwnGoodType> implements ICphOwnGoodTypeService {
    @Autowired
    private CphOwnGoodTypeMapper cphOwnGoodTypeMapper;

    /**
     * 查询个人评优评先类别
     *
     * @param id 个人评优评先类别主键
     * @return 个人评优评先类别
     */
    @Override
    public CphOwnGoodType selectCphOwnGoodTypeById(Long id) {
        return cphOwnGoodTypeMapper.selectCphOwnGoodTypeById(id);
    }

    /**
     * 查询个人评优评先类别列表
     *
     * @param cphOwnGoodType 个人评优评先类别
     * @return 个人评优评先类别
     */
    @Override
    public List<CphOwnGoodType> selectCphOwnGoodTypeList(CphOwnGoodType cphOwnGoodType) {
        return cphOwnGoodTypeMapper.selectCphOwnGoodTypeList(cphOwnGoodType);
    }

    /**
     * 新增个人评优评先类别
     *
     * @param cphOwnGoodType 个人评优评先类别
     * @return 结果
     */
    @Override
    public int insertCphOwnGoodType(CphOwnGoodType cphOwnGoodType) {
                cphOwnGoodType.setCreateTime(DateUtils.getNowDate());
            return cphOwnGoodTypeMapper.insertCphOwnGoodType(cphOwnGoodType);
    }

    /**
     * 修改个人评优评先类别
     *
     * @param cphOwnGoodType 个人评优评先类别
     * @return 结果
     */
    @Override
    public int updateCphOwnGoodType(CphOwnGoodType cphOwnGoodType) {
                cphOwnGoodType.setUpdateTime(DateUtils.getNowDate());
        return cphOwnGoodTypeMapper.updateCphOwnGoodType(cphOwnGoodType);
    }

    /**
     * 批量删除个人评优评先类别
     *
     * @param ids 需要删除的个人评优评先类别主键
     * @return 结果
     */
    @Override
    public int deleteCphOwnGoodTypeByIds(Long[] ids) {
        return cphOwnGoodTypeMapper.deleteCphOwnGoodTypeByIds(ids);
    }

    /**
     * 删除个人评优评先类别信息
     *
     * @param id 个人评优评先类别主键
     * @return 结果
     */
    @Override
    public int deleteCphOwnGoodTypeById(Long id) {
        return cphOwnGoodTypeMapper.deleteCphOwnGoodTypeById(id);
    }
}
