wu
2023-09-05 933d18d5d5486743fd4ef0bae77c2ef24c39362a
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
package com.example.springboot.mapper;
 
import com.example.springboot.entity.StorageRack;
 
import org.apache.ibatis.annotations.*;
 
import java.util.List;
 
@Mapper
public interface StorageRackMapper{
    @Select("SELECT cageno,round(round(1-sum(state)/42,2)*100) as cell,42-sum(state) as falg FROM storage_rack group by cageno")
    List<StorageRack> selectAll();
 
    @Select("SELECT state from storage_rack where cageno<=5 and cell=1")
    List<StorageRack> selectRack1();
 
    @Select("SELECT state from storage_rack where cageno>5 and cell=1")
    List<StorageRack> selectRack2();
 
    @Select("SELECT state from storage_rack where cageno<=5 and cell=2")
    List<StorageRack> selectRack3();
 
    @Select("SELECT state from storage_rack where cageno>5 and cell=2")
    List<StorageRack> selectRack4();
 
    void insert(StorageRack storageRack);
 
    void update(StorageRack storageRack);
}