package com.gk.hotwork.Service.ServiceImpl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gk.hotwork.Domain.TaskLocationInfo; import com.gk.hotwork.Domain.Utils.StringUtils; import com.gk.hotwork.Mapper.TaskLocationInfoMapper; import com.gk.hotwork.Service.TaskLocationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service("TaskLocationService") public class TaskLocationServiceImpl extends ServiceImpl implements TaskLocationService { @Autowired TaskLocationInfoMapper taskLocationInfoMapper; @Override public TaskLocationInfo getLocationByTaskAndWorker(String code, String worker) { LambdaQueryWrapperwrapper = new LambdaQueryWrapper<>(); wrapper.eq(TaskLocationInfo::getTaskcode,code); if (StringUtils.isNotBlank(worker)) wrapper.eq(TaskLocationInfo::getTaskworker,worker); wrapper.orderByDesc(TaskLocationInfo::getUpdatetime); return baseMapper.selectOne(wrapper); } }