wuyouming666
2024-05-27 8d5dddd1cc1a9ff3859d6acd251c3488ca066b21
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
@@ -1,7 +1,11 @@
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;
@@ -22,11 +26,13 @@
@Service
public class GlassInfoServiceImpl extends ServiceImpl<GlassInfoMapper, GlassInfo> implements GlassInfoService {
    private EngineeringMapper engineeringMapper;
    private GlassInfoMapper glassInfoMapper;
    @Autowired(required=false)
    public GlassInfoServiceImpl(GlassInfoMapper glassInfoMapper) {
    public GlassInfoServiceImpl(GlassInfoMapper glassInfoMapper, EngineeringMapper engineeringMapper) {
        this.glassInfoMapper = glassInfoMapper;
        this.engineeringMapper = engineeringMapper;
    }
    @Override
@@ -36,15 +42,24 @@
    }
    @Override
    public List<Map<String, Object>> getFlowCardId() {
        return baseMapper.selectMaps(new QueryWrapper<GlassInfo>().lambda().select(GlassInfo::getFlowCardId).groupBy(GlassInfo::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()