yaowanxin
3 天以前 b33e6f53dd537abaebad066de12474580fcc33b2
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.warehouse.mapper.DocumentationMapper">
 
    <select id="listPage" resultType="com.ruoyi.warehouse.dto.DocumentationDto">
        SELECT
        doc.*,
        dc.category,
        CONCAT(
            w.warehouse_name, '-',
            wgs.name, '-',
            wgsr.row, '层-',
            wgsr.col, '列'
        ) AS location_info  -- 合并后的字段名
        FROM documentation doc
        LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id
        LEFT JOIN warehouse_goods_shelves_rowcol wgsr ON wgsr.id = doc.warehouse_goods_shelves_rowcol_id
        LEFT JOIN warehouse_goods_shelves wgs ON wgs.id = wgsr.warehouse_goods_shelves_id
        LEFT JOIN warehouse w ON w.id = wgs.warehouse_id
        where 1=1
        <if test="documentation.documentClassificationId != null">
            and doc.document_classification_id = #{documentation.documentClassificationId}
        </if>
        <if test="documentation.docName != null">
            and doc.doc_name = #{documentation.docName}
        </if>
        <if test="documentation.docNumber != null">
            and doc.doc_number = #{documentation.docNumber}
        </if>
        <if test="documentation.id != null">
            and doc.id = #{documentation.id}
        </if>
    </select>
    <select id="listByDocumentClassificationId" resultType="com.ruoyi.warehouse.dto.DocumentationDto">
        SELECT
        doc.*,
        dc.category,
        CONCAT(
        w.warehouse_name, '-',
        wgs.name, '-',
        wgsr.row, '层-',
        wgsr.col, '列'
        ) AS location_info  -- 合并后的字段名
        FROM documentation doc
        LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id
        LEFT JOIN warehouse_goods_shelves_rowcol wgsr ON wgsr.id = doc.warehouse_goods_shelves_rowcol_id
        LEFT JOIN warehouse_goods_shelves wgs ON wgs.id = wgsr.warehouse_goods_shelves_id
        LEFT JOIN warehouse w ON w.id = wgs.warehouse_id
        where doc.document_classification_id = #{documentClassificationId}
    </select>
    <select id="list" resultType="com.ruoyi.warehouse.dto.DocumentationDto">
        SELECT
            doc.*,
            dc.category,
            CONCAT(
                    w.warehouse_name, '-',
                    wgs.name, '-',
                    wgsr.row, '层-',
                    wgsr.col, '列'
                ) AS location_info  -- 合并后的字段名
        FROM documentation doc
         LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id
         LEFT JOIN warehouse_goods_shelves_rowcol wgsr ON wgsr.id = doc.warehouse_goods_shelves_rowcol_id
         LEFT JOIN warehouse_goods_shelves wgs ON wgs.id = wgsr.warehouse_goods_shelves_id
         LEFT JOIN warehouse w ON w.id = wgs.warehouse_id
    </select>
    <select id="listBywarehouseGoodsShelvesRowcolId" resultType="com.ruoyi.warehouse.dto.DocumentationDto">
        SELECT
        doc.*,
        dc.category,
        CONCAT(
        w.warehouse_name, '-',
        wgs.name, '-',
        wgsr.row, '层-',
        wgsr.col, '列'
        ) AS location_info  -- 合并后的字段名
        FROM documentation doc
        LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id
        LEFT JOIN warehouse_goods_shelves_rowcol wgsr ON wgsr.id = doc.warehouse_goods_shelves_rowcol_id
        LEFT JOIN warehouse_goods_shelves wgs ON wgs.id = wgsr.warehouse_goods_shelves_id
        LEFT JOIN warehouse w ON w.id = wgs.warehouse_id
        where doc.warehouse_goods_shelves_rowcol_id = #{warehouseGoodsShelvesRowcolId}
    </select>
 
</mapper>