zhuo
2025-03-29 e19c5c816f8abfbbdb197e698cae285ab434fddb
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
<?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.device.mapper.DataConfigMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.device.pojo.DataConfig">
        <id column="id" property="id" />
        <result column="formula" property="formula" />
        <result column="referx" property="referx" />
        <result column="refery" property="refery" />
        <result column="x" property="x" />
        <result column="y" property="y" />
    </resultMap>
 
    <select id="selectDataConfigList" resultType="com.ruoyi.device.dto.DeviceConfigDtoPage">
        SELECT ddc.*,
               d.device_name
        FROM device_data_config ddc
                 left join device d on ddc.device_id = d.id
        where d.id = #{deviceId}
    </select>
 
    <select id="deleteDataConfig" resultType="integer">
        SELECT ddc.id
        FROM device d
                 left join structure_item_parameter ip on not FIND_IN_SET(ip.id, d.ins_product_ids)
                 inner join device_data_config ddc on ddc.device_id = d.id and ddc.structure_item_parameter_id = ip.id
    </select>
    <select id="getNoConfigProduct" resultType="com.ruoyi.device.pojo.DataConfig">
        SELECT d.id device_id,
               ip.inspection_item,
               ip.inspection_item_class,
               ip.inspection_item_subclass                          ,
               ip.sample,
               ip.id                                                                          structureItemParameterId,
               ddc.id
        FROM structure_item_parameter ip
                 left join device d on FIND_IN_SET(d.id, ip.device_ids)
                 left join device_data_config ddc on ddc.device_id = d.id and ddc.structure_item_parameter_id = ip.id
        where d.id = #{deviceId}
          and ddc.id is null
    </select>
</mapper>