ZengTao
2024-09-24 7c7c8b1fb4dd63bbc25130b32d507aee5c130d90
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
package com.mes.rawglassstation.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.rawglassdetails.entity.RawGlassStorageDetails;
import com.mes.rawglassstation.entity.RawGlassStorageStation;
import com.mes.rawglassstation.mapper.RawGlassStorageStationMapper;
import com.mes.rawglassstation.service.RawGlassStorageStationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * @author system
 * @since 2024-07-09 14:51:27
 */
@Service
@Slf4j
public class RawGlassStorageStationServiceImpl extends ServiceImpl<RawGlassStorageStationMapper, RawGlassStorageStation> implements RawGlassStorageStationService {
    @Override
    public List<RawGlassStorageStation> selectStations() {
        return list();
    }
    @Override
    public boolean updateRawGlassStorageStation(String slot) {
        UpdateWrapper<RawGlassStorageStation> wrapper = new UpdateWrapper<>();  //这个类型定义错了,不应该是tasking
        wrapper.set("slot","105")
                .eq( "slot",slot);
        return update(wrapper);
    }
 
    @Override
    public boolean deleteRawGlassStorageStation(String device_id) {
        QueryWrapper<RawGlassStorageStation> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("device_id", device_id);
        return remove(queryWrapper);
    }
 
    @Override
    public boolean insertRawGlassStorageStation(RawGlassStorageStation rw) {
        return this.save(rw);
    }
 
  @Override
  public List<RawGlassStorageDetails> listRawGlassDetails() {
        return baseMapper.listRawGlassDetails();
    }
 
  @Override
  public boolean updateSlotState(Integer slot, Integer enableState) {
    return update(
        new LambdaUpdateWrapper<RawGlassStorageStation>()
            .set(RawGlassStorageStation::getEnableState, enableState)
            .eq(RawGlassStorageStation::getSlot, slot));
  }
}