wuyouming666
2024-04-29 6091a9cac0ef3236bd05137a5fae9a9cf1913ed4
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
package com.mes.temperingglass.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.query.MPJQueryWrapper;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.temperingglass.mapper.TemperingGlassInfoMapper;
import com.mes.temperingglass.mapper.TemperingMapper;
import com.mes.temperingglass.service.TemperingAgoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.yulichang.base.MPJBaseServiceImpl;
 
import java.util.Collections;
import java.util.List;
 
/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author zhoush
 * @since 2024-04-07
 */
@Service
public class TemperingAgoServiceImpl extends MPJBaseServiceImpl<TemperingGlassInfoMapper, TemperingGlassInfo> implements TemperingAgoService {
    @Autowired
    TemperingMapper temperingMapper;
 
    @Override
    public List<TemperingGlassInfo> selectWaitingGlass() {
        //获取等待进炉中的玻璃信息
        QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>();
        wrapper.inSql("flowcard_id", "select flowcard_id from tempering_glass_info GROUP BY flowcard_id,state having count(state) = 2");
        return temperingMapper.selectList(wrapper);
    }
 
    @Override
    public List<TemperingGlassInfo> selectIntoGlass() {
        //获取进炉中的玻璃信息
        QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>();
        wrapper.inSql("flowcard_id", "select flowcard_id from tempering_glass_info where state=1 GROUP BY flowcard_id,state having count(state) = 1");
 
        return temperingMapper.selectList(wrapper);
    }
 
    @Override
    public List<TemperingGlassInfo> SelectOutGlass() {
        //获取出炉中的玻璃信息
        QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>();
        wapper.eq("state", 3);
        return temperingMapper.selectList(wapper);
    }
}