6
jinlin
2023-11-29 b21945e7dea2daa8b30bee3cdd4bca91277e3b5f
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
<?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 warehouse_config_item a
        <where>
            a.is_delete = 0
            <if test="warehouseId!=null">
                and warehouse_id = ${warehouseId}
            </if>
        </where>
        <if test="orderBySql!=null">
            ORDER BY ${orderBySql}
        </if>
    </select>
    <select id="itemList" resultType="com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem">
        SELECT p.secret_class,
               SUBSTRING(m.name, LOCATE('软件', m.name) , LENGTH(m.name)) AS itemName,
               m.identify AS version,
               m.name AS Item_identify
        FROM software_test_order s
                 JOIN software_test_order_measured m ON s.project_id = ${projectId}
                 JOIN project p ON p.id = ${projectId}
        WHERE s.is_delete = 0
          AND  s.id = m.order_id
        UNION
        SELECT NULL AS secretClass,
               '软件测试委托单' AS itemName,
               NULL AS version,
               s.code AS itemIdentify
        FROM software_test_order s
        WHERE s.is_delete = 0
          AND  s.project_id = ${projectId}
        UNION
        SELECT NULL AS secretClass,
               '物品流转单' AS itemName,
               NULL AS version,
               i.code AS itemIdentify
        FROM item_circulat_order i
        WHERE i.is_delete = 0
          AND  i.project_id = ${projectId}
    </select>
 
</mapper>