package cn.cecep.talroad.service.impl;

import cn.cecep.talroad.domain.AmProblemFiProcess;
import cn.cecep.talroad.mapper.AmProblemFiProcessMapper;
import cn.cecep.talroad.service.IAmProblemFiProcessService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liyongbing
 * @since 2023-06-17
 */
@Service
public class AmProblemFiProcessServiceImpl extends ServiceImpl<AmProblemFiProcessMapper, AmProblemFiProcess> implements IAmProblemFiProcessService {

    @Override
    public AmProblemFiProcess selectByProblemId(String problemId) {
        QueryWrapper<AmProblemFiProcess> query= Wrappers.query();
        query.eq("problem_id",problemId);
        query.orderByDesc("create_time");
        query.last("limit 1");
        return baseMapper.selectOne(query);
    }
}
