package com.younike.system.service.impl;

import java.util.List;
import java.time.LocalDateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.younike.system.mapper.DimensionMapper;
import com.younike.system.domain.Dimension;
import com.younike.system.service.IDimensionService;

/**
 * 评价维度Service业务层处理
 * 
 * @author elev
 * @date 2022-01-04
 */
@Service
public class DimensionServiceImpl implements IDimensionService {
    @Autowired
    private DimensionMapper dimensionMapper;

    /**
     * 查询评价维度
     * 
     * @param dimensionId 评价维度主键
     * @return 评价维度
     */
    @Override
    public Dimension selectDimensionByDimensionId(Long dimensionId) {
        return dimensionMapper.selectDimensionByDimensionId(dimensionId);
    }

    /**
     * 查询评价维度列表
     * 
     * @param dimension 评价维度
     * @return 评价维度
     */
    @Override
    public List<Dimension> selectDimensionList(Dimension dimension) {
        return dimensionMapper.selectDimensionList(dimension);
    }

    /**
     * 新增评价维度
     * 
     * @param dimension 评价维度
     * @return 结果
     */
    @Override
    public int insertDimension(Dimension dimension) {
        dimension.setCreateTime(LocalDateTime.now());
        return dimensionMapper.insertDimension(dimension);
    }

    /**
     * 修改评价维度
     * 
     * @param dimension 评价维度
     * @return 结果
     */
    @Override
    public int updateDimension(Dimension dimension) {
        dimension.setUpdateTime(LocalDateTime.now());
        return dimensionMapper.updateDimension(dimension);
    }

    /**
     * 批量删除评价维度
     * 
     * @param dimensionIds 需要删除的评价维度主键
     * @return 结果
     */
    @Override
    public int deleteDimensionByDimensionIds(Long[] dimensionIds) {
        return dimensionMapper.deleteDimensionByDimensionIds(dimensionIds);
    }

    /**
     * 删除评价维度信息
     * 
     * @param dimensionId 评价维度主键
     * @return 结果
     */
    @Override
    public int deleteDimensionByDimensionId(Long dimensionId) {
        return dimensionMapper.deleteDimensionByDimensionId(dimensionId);
    }
}
