package com.ningdatech.pmapi.expert.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.pmapi.expert.mapper.ExpertReviewMapper;
import com.ningdatech.pmapi.expert.model.entity.ExpertReview;
import com.ningdatech.pmapi.expert.service.IExpertReviewService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author WendyYang
 * @since 2023-02-15
 */
@Service
public class ExpertReviewServiceImpl extends ServiceImpl<ExpertReviewMapper, ExpertReview> implements IExpertReviewService {

    @Override
    public List<ExpertReview> listByProjectIdAndExpertId(Long projectId, Long expertId) {
        LambdaQueryWrapper<ExpertReview> query = Wrappers.lambdaQuery(ExpertReview.class);
        query.eq(ExpertReview::getProjectId, projectId);
        query.eq(ExpertReview::getCreateBy, expertId);
        query.orderByAsc(ExpertReview::getCreateOn);
        return list(query);
    }

}
