package com.ruoyi.model.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.ruoyi.model.mapper.AppMyEvaluateMapper;
import com.ruoyi.model.domain.AppMyEvaluate;
import com.ruoyi.model.service.IAppMyEvaluateService;

/**
 * 我的评价Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-08
 */
@Service
public class AppMyEvaluateServiceImpl implements IAppMyEvaluateService 
{
    @Autowired
    private AppMyEvaluateMapper appMyEvaluateMapper;

    /**
     * 查询我的评价
     * 
     * @param id 我的评价主键
     * @return 我的评价
     */
    @Override
    public AppMyEvaluate selectAppMyEvaluateById(Long id)
    {
        return appMyEvaluateMapper.selectAppMyEvaluateById(id);
    }

    /**
     * 查询我的评价列表
     * 
     * @param appMyEvaluate 我的评价
     * @return 我的评价
     */
    @Override
    public List<AppMyEvaluate> selectAppMyEvaluateList(AppMyEvaluate appMyEvaluate)
    {
        return appMyEvaluateMapper.selectAppMyEvaluateList(appMyEvaluate);
    }

    /**
     * 新增我的评价
     * 
     * @param appMyEvaluate 我的评价
     * @return 结果
     */
    @Override
    public int insertAppMyEvaluate(AppMyEvaluate appMyEvaluate)
    {
        appMyEvaluate.setCreateTime(DateUtils.getNowDate());
        return appMyEvaluateMapper.insertAppMyEvaluate(appMyEvaluate);
    }

    /**
     * 修改我的评价
     * 
     * @param appMyEvaluate 我的评价
     * @return 结果
     */
    @Override
    public int updateAppMyEvaluate(AppMyEvaluate appMyEvaluate)
    {
        appMyEvaluate.setUpdateTime(DateUtils.getNowDate());
        return appMyEvaluateMapper.updateAppMyEvaluate(appMyEvaluate);
    }

    /**
     * 批量删除我的评价
     * 
     * @param ids 需要删除的我的评价主键
     * @return 结果
     */
    @Override
    public int deleteAppMyEvaluateByIds(Long[] ids)
    {
        return appMyEvaluateMapper.deleteAppMyEvaluateByIds(ids);
    }

    /**
     * 删除我的评价信息
     * 
     * @param id 我的评价主键
     * @return 结果
     */
    @Override
    public int deleteAppMyEvaluateById(Long id)
    {
        return appMyEvaluateMapper.deleteAppMyEvaluateById(id);
    }

    @Override
    public List<AppMyEvaluate> getAppMyEvaluateByPetId(Long petId) {
        return appMyEvaluateMapper.getAppMyEvaluateByPetId(petId);
    }
}
