czt
2025-06-12 930d29f39d115fe76c305af4320c2acbcb30c445
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?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.ld.igds.verb.mapper.AreationMapper">
 
    <!-- 基本返回信息 -->
    <sql id="DATA_COLUMN">
        ID_ AS id,
        COMPANY_ID_ AS companyId,
        DEPT_ID_ AS deptId,
        NAME_ AS name,
        EXE_MODE_ AS exeMode,
        MODE_TAG_ AS modeTag,
        DISABLED_TAG_ AS disabledTag,
        UPDATE_TIME_ AS updateTime,
        UPDATE_USER_ AS UPDATE_USER_,
        REMARK_ AS remark
    </sql>
 
    <sql id="DATA_COLUMN_CONF">
        a.ID_ AS id,
        a.COMPANY_ID_ AS companyId,
        a.DEPOT_ID_ AS depotId,
        a.NAME_ AS name,
        a.PASS_CODE_ as passCode,
        a.SER_ID_ as serId,
        a.TYPE_ as type,
        a.LOCATION_ as location,
        a.STATUS_ as status,
        a.LINK_ as link,
 
        b.AUTO_ID_  as autoId,
        b.TARGET_STATUS_ as targetStatus
    </sql>
 
 
    <!-- 获取通风模式配置 -->
    <select id="listAutoData" resultType="com.ld.igds.verb.dto.VerbAutoData" parameterType="com.ld.igds.verb.dto.VerbParam">
        select 
        <include refid="DATA_COLUMN"/>
        from
        d_areation_auto
 
        <where>
            <if test="param.companyId != null" >AND COMPANY_ID_ = #{param.companyId}</if>
            <if test="param.deptId != null">AND DEPT_ID_ = #{param.deptId}</if>
            <if test="param.autoId != null">AND ID_ = #{param.autoId}</if>
        </where>
            ORDER BY NAME_
    </select>
 
    <!-- 获取通风模式详细配置 -->
    <select id="listAutoDataConf" resultType="com.ld.igds.io.request.ExeDevice" parameterType="com.ld.igds.verb.dto.VerbParam">
        select
        <include refid="DATA_COLUMN_CONF"/>
        from
        d_device a
        left join d_areation_auto_conf b
        on a.ID_ = b.DEVICE_ID_
        AND b.AUTO_ID_ = #{param.autoId}
        <where>
            <if test="param.companyId != null" >AND a.COMPANY_ID_ = #{param.companyId}</if>
            <if test="param.depotId != null">AND a.DEPOT_ID_ = #{param.depotId}</if>
        </where>
        ORDER BY a.TYPE_,a.PASS_CODE_
    </select>
 
    <!-- 获取通风模式信息 -->
    <select id="queryAutoDataById" resultType="com.ld.igds.verb.dto.VerbAutoData" parameterType="com.ld.igds.verb.dto.VerbParam">
        select
        <include refid="DATA_COLUMN"/>
        from
        d_areation_auto
        <where>
            <if test="param.companyId != null" >AND COMPANY_ID_ = #{param.companyId}</if>
            <if test="param.autoId != null">AND ID_ = #{param.autoId}</if>
        </where>
    </select>
 
 
    <!-- 删除数据 -->
    <update id="delAuto"  parameterType="java.lang.String">
        delete from d_areation_auto where  id_ = #{id}
    </update>
 
    <!-- 新增通风模式 -->
    <insert id="addAuto" parameterType="com.ld.igds.verb.dto.VerbAutoData">
        insert into
        d_areation_auto(id_,company_id_,dept_id_,NAME_,EXE_MODE_,MODE_TAG_,DISABLED_TAG_,UPDATE_TIME_,UPDATE_USER_,REMARK_)
        values(
        #{data.id},
        #{data.companyId},
        #{data.deptId},
        #{data.name},
        #{data.exeMode},
        #{data.modeTag},
        #{data.disabledTag},
        #{data.updateTime},
        #{data.updateUser},
        #{data.remark}
        )
    </insert>
 
    <!-- 修改通风模式-->
    <update id="updateAuto" parameterType="com.ld.igds.verb.dto.VerbAutoData">
        update d_areation_auto set
        NAME_ = #{data.name},
        EXE_MODE_ =  #{data.exeMode},
        MODE_TAG_ = #{data.modeTag},
        DISABLED_TAG_ = #{data.disabledTag},
        UPDATE_TIME_ = #{data.updateTime},
        UPDATE_USER_ = #{data.updateUser},
        REMARK_ = #{data.remark}
        where id_ = #{data.id}
    </update>
 
 
    <!-- 删除配置数据 -->
    <update id="delAutoConfByAutoId"  parameterType="java.lang.String">
        delete from d_areation_auto_conf where  auto_id_ = #{autoId}
    </update>
 
    <!-- 新增模式配置-->
    <insert id="addAutoConf" parameterType="com.ld.igds.io.request.ExeDevice">
        insert into
        d_areation_auto_conf(id_,AUTO_ID_,DEVICE_ID_,TARGET_STATUS_,DEPOT_ID_,PASS_CODE_)
        values(
        uuid(),
        #{data.autoId},
        #{data.id},
        #{data.targetStatus},
        #{data.depotId},
        #{data.passCode}
        )
    </insert>
 
</mapper>