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.GoodsServerDimensionMapper;
import com.younike.system.domain.GoodsServerDimension;
import com.younike.system.service.IGoodsServerDimensionService;

/**
 * 商品服务评价统计Service业务层处理
 * 
 * @author elev
 * @date 2022-01-07
 */
@Service
public class GoodsServerDimensionServiceImpl implements IGoodsServerDimensionService {
    @Autowired
    private GoodsServerDimensionMapper goodsServerDimensionMapper;

    /**
     * 查询商品服务评价统计
     * 
     * @param id 商品服务评价统计主键
     * @return 商品服务评价统计
     */
    @Override
    public GoodsServerDimension selectGoodsServerDimensionById(Long id) {
        return goodsServerDimensionMapper.selectGoodsServerDimensionById(id);
    }

    /**
     * 查询商品服务评价统计列表
     * 
     * @param goodsServerDimension 商品服务评价统计
     * @return 商品服务评价统计
     */
    @Override
    public List<GoodsServerDimension> selectGoodsServerDimensionList(GoodsServerDimension goodsServerDimension) {
        return goodsServerDimensionMapper.selectGoodsServerDimensionList(goodsServerDimension);
    }

    /**
     * 新增商品服务评价统计
     * 
     * @param goodsServerDimension 商品服务评价统计
     * @return 结果
     */
    @Override
    public int insertGoodsServerDimension(GoodsServerDimension goodsServerDimension) {
        goodsServerDimension.setCreateTime(LocalDateTime.now());
        return goodsServerDimensionMapper.insertGoodsServerDimension(goodsServerDimension);
    }

    /**
     * 修改商品服务评价统计
     * 
     * @param goodsServerDimension 商品服务评价统计
     * @return 结果
     */
    @Override
    public int updateGoodsServerDimension(GoodsServerDimension goodsServerDimension) {
        goodsServerDimension.setUpdateTime(LocalDateTime.now());
        return goodsServerDimensionMapper.updateGoodsServerDimension(goodsServerDimension);
    }

    /**
     * 批量删除商品服务评价统计
     * 
     * @param ids 需要删除的商品服务评价统计主键
     * @return 结果
     */
    @Override
    public int deleteGoodsServerDimensionByIds(Long[] ids) {
        return goodsServerDimensionMapper.deleteGoodsServerDimensionByIds(ids);
    }

    /**
     * 删除商品服务评价统计信息
     * 
     * @param id 商品服务评价统计主键
     * @return 结果
     */
    @Override
    public int deleteGoodsServerDimensionById(Long id)
    {
        return goodsServerDimensionMapper.deleteGoodsServerDimensionById(id);
    }

    /**
     * @param serverId 服务人员ID
     * @param goodsId 商品服务ID
     */
    @Override
    public List<GoodsServerDimension>  selectGoodsServerDimensionByServerIdAndGoodsId(Long serverId, Long goodsId) {
        return goodsServerDimensionMapper.selectGoodsServerDimensionByServerIdAndGoodsId(serverId, goodsId);
    }

    @Override
    public void updateGoodsServerDimensions(List<GoodsServerDimension> goodsServerDimensions) {
        goodsServerDimensionMapper.updateGoodsServerDimensions(goodsServerDimensions);
    }

    @Override
    public void insertGoodsServerDimensions(List<GoodsServerDimension> goodsServerDimensions) {
        goodsServerDimensionMapper.insertGoodsServerDimensions(goodsServerDimensions);
    }
}
