郑永安
2023-09-19 69185134fcfaf913ea45f1255677225a2cc311a4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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<TaskLocationInfoMapper, TaskLocationInfo> implements TaskLocationService {
    @Autowired
    TaskLocationInfoMapper taskLocationInfoMapper;
 
    @Override
    public TaskLocationInfo getLocationByTaskAndWorker(String code, String worker) {
        LambdaQueryWrapper<TaskLocationInfo>wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(TaskLocationInfo::getTaskcode,code);
        if (StringUtils.isNotBlank(worker))
            wrapper.eq(TaskLocationInfo::getTaskworker,worker);
        wrapper.orderByDesc(TaskLocationInfo::getUpdatetime);
        return baseMapper.selectOne(wrapper);
    }
}