jinlin
2024-01-23 52a302b11c08cbc564ff3931038ae57a305a95d6
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
<?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.zt.life.modules.configItemWarehouse.dao.WarehouseConfigItemDao">
 
    <select id="getList" resultType="com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem">
        select a.*
        from config_item_warehouse_detail a
        <where>
            a.is_delete = 0
            <if test="warehouseId!=null">
                and warehouse_id = ${warehouseId}
            </if>
        </where>
        ORDER BY `no`
    </select>
    <select id="itemList" resultType="com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem">
        SET @row_number = 0;
        SELECT (@row_number := @row_number + 1) AS no,
        p.secret_class,
        SUBSTRING(t.name, LOCATE('软件', t.name), LENGTH(t.name)) AS itemName,
        t.identify AS version,
        t.name AS Item_identify,
        t.id as src_id
        FROM item_circulat_order_technical t
        JOIN item_circulat_order i ON i.project_id = ${projectId}
        JOIN project p ON p.id = ${projectId}
        WHERE t.is_delete = 0
        AND i.id = t.circulat_order_id
        <if test="ids!=null and ids!=''">
            AND t.id not in (${ids})
        </if>
        UNION
        SELECT (@row_number := @row_number + 1) AS no,
        p.secret_class,
        '软件测试委托单' AS itemName,
        NULL AS version,
        s.code AS itemIdentify,
        s.id as src_id
        FROM software_test_order s
        JOIN project p ON p.id = ${projectId}
        WHERE s.is_delete = 0
        AND s.project_id = ${projectId}
        <if test="ids!=null and ids!=''">
            AND s.id not in (${ids})
        </if>
        UNION
        SELECT (@row_number := @row_number + 1) AS no,
        p.secret_class,
        '物品流转单' AS itemName,
        NULL AS version,
        i.code AS itemIdentify,
        i.id as src_id
        FROM item_circulat_order i
        JOIN project p ON p.id = ${projectId}
        WHERE i.is_delete = 0
        AND i.project_id = ${projectId}
        <if test="ids!=null and ids!=''">
            AND i.id not in (${ids})
        </if>
    </select>
    <select id="selectList" resultType="com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem">
        SET @row_number = 0;
        SELECT (@row_number := @row_number + 1) AS no,
        a.item_name,a.item_identify,a.version as retrospect_version,a.secret_class,a.project_id,a.id as
        select_id,a.library_type
        from config_item_warehouse_detail a
        WHERE a.is_delete = 0
        and a.project_id = ${projectId}
        and a.select_id is NULL
        <if test="ids!=null and ids!=''">
            AND id not in (${ids})
            and a.id NOT IN (select select_id from config_item_warehouse_detail where select_id is not null)
        </if>
        <if test="type!=null and type!=''">
            and a.library_type=${type}
        </if>
    </select>
</mapper>