package com.xinelu.manage.service.orderevaluatepictureinfo.impl;

import com.xinelu.manage.domain.orderevaluatepictureinfo.OrderEvaluatePictureInfo;
import com.xinelu.manage.mapper.orderevaluatepictureinfo.OrderEvaluatePictureInfoMapper;
import com.xinelu.manage.service.orderevaluatepictureinfo.IOrderEvaluatePictureInfoService;
import org.springframework.stereotype.Service;

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

/**
 * 订单评价图片信息Service业务层处理
 *
 * @author xinyilu
 * @date 2022-11-18
 */
@Service
public class OrderEvaluatePictureInfoServiceImpl implements IOrderEvaluatePictureInfoService {
    @Resource
    private OrderEvaluatePictureInfoMapper orderEvaluatePictureInfoMapper;

    /**
     * 查询订单评价图片信息
     *
     * @param id 订单评价图片信息主键
     * @return 订单评价图片信息
     */
    @Override
    public OrderEvaluatePictureInfo selectOrderEvaluatePictureInfoById(Long id) {
        return orderEvaluatePictureInfoMapper.selectOrderEvaluatePictureInfoById(id);
    }

    /**
     * 查询订单评价图片信息列表
     *
     * @param orderEvaluatePictureInfo 订单评价图片信息
     * @return 订单评价图片信息
     */
    @Override
    public List<OrderEvaluatePictureInfo> selectOrderEvaluatePictureInfoList(OrderEvaluatePictureInfo orderEvaluatePictureInfo) {
        return orderEvaluatePictureInfoMapper.selectOrderEvaluatePictureInfoList(orderEvaluatePictureInfo);
    }

    /**
     * 新增订单评价图片信息
     *
     * @param orderEvaluatePictureInfo 订单评价图片信息
     * @return 结果
     */
    @Override
    public int insertOrderEvaluatePictureInfo(OrderEvaluatePictureInfo orderEvaluatePictureInfo) {
        orderEvaluatePictureInfo.setCreateTime(LocalDateTime.now());
        return orderEvaluatePictureInfoMapper.insertOrderEvaluatePictureInfo(orderEvaluatePictureInfo);
    }

    /**
     * 修改订单评价图片信息
     *
     * @param orderEvaluatePictureInfo 订单评价图片信息
     * @return 结果
     */
    @Override
    public int updateOrderEvaluatePictureInfo(OrderEvaluatePictureInfo orderEvaluatePictureInfo) {
        orderEvaluatePictureInfo.setUpdateTime(LocalDateTime.now());
        return orderEvaluatePictureInfoMapper.updateOrderEvaluatePictureInfo(orderEvaluatePictureInfo);
    }

    /**
     * 批量删除订单评价图片信息
     *
     * @param ids 需要删除的订单评价图片信息主键
     * @return 结果
     */
    @Override
    public int deleteOrderEvaluatePictureInfoByIds(Long[] ids) {
        return orderEvaluatePictureInfoMapper.deleteOrderEvaluatePictureInfoByIds(ids);
    }
}