yaowanxin
6 天以前 9d5128803ebebb5788f13924a5775ac16494dfef
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
<?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.goods_shelves_name, '-',
            wgsr.storey, '层-',
            wgsr.arrange, '列'
        ) 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.goods_shelves_name, '-',
        wgsr.storey, '层-',
        wgsr.arrange, '列'
        ) 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>
 
</mapper>