package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.mapper.PosOrderRatingMapper;
import com.ruoyi.system.domain.PosOrderRating;
import com.ruoyi.system.service.IPosOrderRatingService;

/**
 * 订单评级Service业务层处理
 *
 * @author ruoyi
 * @date 2025-07-29
 */
@Service
public class PosOrderRatingServiceImpl extends ServiceImpl<BaseMapper<PosOrderRating>,PosOrderRating> implements IPosOrderRatingService
{
    @Autowired
    private PosOrderRatingMapper posOrderRatingMapper;

    /**
     * 查询订单评级
     *
     * @param id 订单评级主键
     * @return 订单评级
     */
    @Override
    public PosOrderRating selectPosOrderRatingById(Long id)
    {
        return posOrderRatingMapper.selectPosOrderRatingById(id);
    }

    /**
     * 查询订单评级列表
     *
     * @param posOrderRating 订单评级
     * @return 订单评级
     */
    @Override
    public List<PosOrderRating> selectPosOrderRatingList(PosOrderRating posOrderRating)
    {
        return posOrderRatingMapper.selectPosOrderRatingList(posOrderRating);
    }

    /**
     * 新增订单评级
     *
     * @param posOrderRating 订单评级
     * @return 结果
     */
    @Override
    public int insertPosOrderRating(PosOrderRating posOrderRating)
    {
        posOrderRating.setCreateTime(DateUtils.getNowDate());
        return posOrderRatingMapper.insertPosOrderRating(posOrderRating);
    }

    /**
     * 修改订单评级
     *
     * @param posOrderRating 订单评级
     * @return 结果
     */
    @Override
    public int updatePosOrderRating(PosOrderRating posOrderRating)
    {
        return posOrderRatingMapper.updatePosOrderRating(posOrderRating);
    }

    /**
     * 批量删除订单评级
     *
     * @param ids 需要删除的订单评级主键
     * @return 结果
     */
    @Override
    public int deletePosOrderRatingByIds(Long[] ids)
    {
        return posOrderRatingMapper.deletePosOrderRatingByIds(ids);
    }

    /**
     * 删除订单评级信息
     *
     * @param id 订单评级主键
     * @return 结果
     */
    @Override
    public int deletePosOrderRatingById(Long id)
    {
        return posOrderRatingMapper.deletePosOrderRatingById(id);
    }
}
