XiaoRuby
2023-08-11 8936f5f9af4c6e0221b5a49f2c905efd4df58496
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
<?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.yuanchu.mom.mapper.RawInsProductMapper">
    <select id="selectInspectIdAndName" resultType="map">
        SELECT r.`id`, r.`name`
        FROM raw_ins_product r
                 LEFT JOIN device d
                           ON r.`device_id` = d.`id`
        WHERE r.`state` = 1
          AND ((r.`device_id` IS NULL
            OR (r.`device_id` IS NOT NULL AND r.`test_state` IS NOT NULL))
            OR (d.`state` = 0 AND r.`device_id` IS NOT NULL))
    </select>
 
    <select id="selectPageDevice" resultType="map">
 
    </select>
 
    <select id="inspectIdSelect" resultType="map">
        SELECT r.`name`, r.`specifications`, r.`user_name`
        FROM raw_inspect r, raw_ins_product p
        WHERE p.`id` = #{inspectId}
          AND p.`state` = 1
          AND r.`state` = 1
          AND r.`id` = p.`raw_inspect_id`
    </select>
 
    <select id="parentClassification" resultType="map">
        SELECT DISTINCT d.`father`
        FROM device d
        WHERE d.`state` = 1
          AND d.`father` IS NOT NULL
    </select>
</mapper>