wuyouming666
2024-05-27 8d5dddd1cc1a9ff3859d6acd251c3488ca066b21
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package com.mes.glassinfo.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.toolkit.JoinWrappers;
import com.mes.engineering.entity.Engineering;
import com.mes.engineering.mapper.EngineeringMapper;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.mapper.GlassInfoMapper;
import com.mes.glassinfo.service.GlassInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
import java.util.Map;
 
/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author zhoush
 * @since 2024-03-27
 */
@Service
public class GlassInfoServiceImpl extends ServiceImpl<GlassInfoMapper, GlassInfo> implements GlassInfoService {
 
    private EngineeringMapper engineeringMapper;
    private GlassInfoMapper glassInfoMapper;
 
    @Autowired(required=false)
    public GlassInfoServiceImpl(GlassInfoMapper glassInfoMapper, EngineeringMapper engineeringMapper) {
        this.glassInfoMapper = glassInfoMapper;
        this.engineeringMapper = engineeringMapper;
    }
 
    @Override
    public int getGlassInfoCountByFlowCardId(String flowCardId) {
        return baseMapper.selectCount(new QueryWrapper<GlassInfo>().lambda()
                .eq(GlassInfo::getFlowCardId, flowCardId));
    }
 
 
 
    @Override
    public List<Map<String, Object>> getFlowCardId() {
 
        return glassInfoMapper.selectJoinMaps(JoinWrappers.lambda(GlassInfo.class)
                .select(GlassInfo::getFlowCardId) // 选择需要查询的字段
                .eq(GlassInfo::getEngineerId, Engineering::getEngineerId) // 设置关联条件
                .eq(Engineering::getState, 0)
                .distinct()
 
        );
    }
 
 
 
 
 
 
    @Override
    public GlassInfo selectGlassId(String id) {
        return baseMapper.selectOne(new QueryWrapper<GlassInfo>().lambda()
                .eq(GlassInfo::getGlassId, id));
    }
 
 
 
 
}