自动化立体仓库 - WMS系统
zyx
2023-10-02 cda03cb23bc12f582029ac8d6df103d86e61fc8b
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
package com.zy.asrs.mapper;
 
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.zy.asrs.entity.AgvLocDetl;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
 
import java.util.List;
import java.util.Map;
 
@Mapper
@Repository
public interface AgvLocDetlMapper extends BaseMapper<AgvLocDetl> {
 
    @Update("update agv_loc_detl set loc_no = '${targetLoc}' where loc_no = '${sourceLoc}' ")
    void updateStock(@Param("sourceLoc")String sourceLoc, @Param("targetLoc")String targetLoc);
 
    @Select("select * from\n" +
            "(\n" +
            "\t\tselect\n" +
            "\t\tROW_NUMBER() over (order by sum(a.anfme) desc) as row\n" +
            "\t\t, a.matnr\n" +
            "\t\t, sum(a.anfme) as anfme\n" +
            "\t\tfrom agv_loc_detl a\n" +
            "\t\twhere 1=1\n" +
            "\t\tgroup by a.matnr\n" +
            " ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})")
    List<AgvLocDetl> getStockStatis(Map<String, Object> map);
 
    @Select("select count(1) as count from\n" +
            "        (\n" +
            "        select\n" +
            "        a.matnr\n" +
            "        from agv_loc_detl a\n" +
            "        where 1=1\n" +
            "        \n" +
            "        group by a.matnr\n" +
            "     ) b")
    Integer getStockStatisCount(Map<String, Object> map);
 
    @Select("SELECT SUM(anfme) FROM agv_loc_detl")
    Integer sum();
 
    @Select("select\n" +
            "        ROW_NUMBER() over (order by sum(a.anfme) desc) as row\n" +
            "        , a.matnr\n" +
            "        , sum(a.anfme) as anfme\n" +
            "        from agv_loc_detl a\n" +
            "        where 1=1\n" +
            "        group by a.matnr")
    List<AgvLocDetl> getStockStatisExcel();
 
}