龚焕茏
2024-04-11 db0b87b36c44a5a9bc32a915769024f0c9db7c05
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?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.ycl.platform.mapper.TMonitorVideoMapper">
    
    <resultMap type="com.ycl.platform.domain.entity.TMonitorVideo" id="TMonitorVideoResult">
        <result property="id"    column="id"    />
        <result property="serialNumber"    column="serial_number"    />
        <result property="name"    column="name"    />
        <result property="macAddr"    column="mac_addr"    />
        <result property="ip"    column="ip"    />
        <result property="longitude"    column="longitude"    />
        <result property="latitude"    column="latitude"    />
        <result property="onState"    column="on_state"    />
        <result property="civilCode"    column="civil_code"    />
        <result property="address"    column="address"    />
        <result property="installedTime"    column="installed_time"    />
        <result property="managementUnit"    column="management_unit"    />
        <result property="muContactInfo"    column="mu_contact_info"    />
        <result property="storageDays"    column="storage_days"    />
        <result property="reason"    column="reason"    />
        <result property="defaultOrder"    column="default_order"    />
        <result property="recovery"    column="recovery"    />
        <result property="recoveryTime"    column="recovery_time"    />
        <result property="tag"    column="tag"    />
        <result property="region"    column="region"    />
        <result property="sipDelay"    column="sipDelay"    />
        <result property="videoDelay"    column="videoDelay"    />
        <result property="iframeDelay"    column="iframeDelay"    />
    </resultMap>
 
    <sql id="selectTMonitorVideoVo">
        select id, serial_number, name, mac_addr, ip, longitude, latitude, on_state, civil_code, address, installed_time, management_unit, mu_contact_info, storage_days, reason, default_order, recovery, recovery_time, tag, region, sipDelay, videoDelay, iframeDelay from t_monitor_video
    </sql>
 
    <select id="selectTMonitorVideoList"  resultMap="TMonitorVideoResult">
        <include refid="selectTMonitorVideoVo"/>
        <where>  
            <if test="serialNumber != null  and serialNumber != ''"> and serial_number = #{serialNumber}</if>
            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
            <if test="macAddr != null  and macAddr != ''"> and mac_addr = #{macAddr}</if>
            <if test="ip != null  and ip != ''"> and ip = #{ip}</if>
            <if test="longitude != null  and longitude != ''"> and longitude = #{longitude}</if>
            <if test="latitude != null  and latitude != ''"> and latitude = #{latitude}</if>
            <if test="onState != null "> and on_state = #{onState}</if>
            <if test="civilCode != null  and civilCode != ''"> and civil_code = #{civilCode}</if>
            <if test="address != null  and address != ''"> and address = #{address}</if>
            <if test="installedTime != null "> and installed_time = #{installedTime}</if>
            <if test="managementUnit != null  and managementUnit != ''"> and management_unit = #{managementUnit}</if>
            <if test="muContactInfo != null  and muContactInfo != ''"> and mu_contact_info = #{muContactInfo}</if>
            <if test="storageDays != null "> and storage_days = #{storageDays}</if>
            <if test="reason != null  and reason != ''"> and reason = #{reason}</if>
            <if test="defaultOrder != null "> and default_order = #{defaultOrder}</if>
            <if test="recovery != null "> and recovery = #{recovery}</if>
            <if test="recoveryTime != null "> and recovery_time = #{recoveryTime}</if>
            <if test="tag != null and tag !=''"> and tag = #{tag}</if>
            <if test="region != null  and region != ''"> and region = #{region}</if>
            <if test="sipDelay != null "> and sipDelay = #{sipDelay}</if>
            <if test="videoDelay != null "> and videoDelay = #{videoDelay}</if>
            <if test="iframeDelay != null "> and iframeDelay = #{iframeDelay}</if>
        </where>
    </select>
    
    <select id="selectTMonitorVideoById" parameterType="Long" resultMap="TMonitorVideoResult">
        <include refid="selectTMonitorVideoVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertTMonitorVideo" useGeneratedKeys="true" keyProperty="id">
        insert into t_monitor_video
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="serialNumber != null">serial_number,</if>
            <if test="name != null">name,</if>
            <if test="macAddr != null">mac_addr,</if>
            <if test="ip != null">ip,</if>
            <if test="longitude != null">longitude,</if>
            <if test="latitude != null">latitude,</if>
            <if test="onState != null">on_state,</if>
            <if test="civilCode != null">civil_code,</if>
            <if test="address != null">address,</if>
            <if test="installedTime != null">installed_time,</if>
            <if test="managementUnit != null">management_unit,</if>
            <if test="muContactInfo != null">mu_contact_info,</if>
            <if test="storageDays != null">storage_days,</if>
            <if test="reason != null">reason,</if>
            <if test="defaultOrder != null">default_order,</if>
            <if test="recovery != null">recovery,</if>
            <if test="recoveryTime != null">recovery_time,</if>
            <if test="tag != null and tag !=''">tag,</if>
            <if test="region != null">region,</if>
            <if test="sipDelay != null">sipDelay,</if>
            <if test="videoDelay != null">videoDelay,</if>
            <if test="iframeDelay != null">iframeDelay,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="serialNumber != null">#{serialNumber},</if>
            <if test="name != null">#{name},</if>
            <if test="macAddr != null">#{macAddr},</if>
            <if test="ip != null">#{ip},</if>
            <if test="longitude != null">#{longitude},</if>
            <if test="latitude != null">#{latitude},</if>
            <if test="onState != null">#{onState},</if>
            <if test="civilCode != null">#{civilCode},</if>
            <if test="address != null">#{address},</if>
            <if test="installedTime != null">#{installedTime},</if>
            <if test="managementUnit != null">#{managementUnit},</if>
            <if test="muContactInfo != null">#{muContactInfo},</if>
            <if test="storageDays != null">#{storageDays},</if>
            <if test="reason != null">#{reason},</if>
            <if test="defaultOrder != null">#{defaultOrder},</if>
            <if test="recovery != null">#{recovery},</if>
            <if test="recoveryTime != null">#{recoveryTime},</if>
            <if test="tag != null and tag !=''">#{tag},</if>
            <if test="region != null">#{region},</if>
            <if test="sipDelay != null">#{sipDelay},</if>
            <if test="videoDelay != null">#{videoDelay},</if>
            <if test="iframeDelay != null">#{iframeDelay},</if>
         </trim>
    </insert>
 
    <update id="updateTMonitorVideo" >
        update t_monitor_video
        <trim prefix="SET" suffixOverrides=",">
            <if test="serialNumber != null">serial_number = #{serialNumber},</if>
            <if test="name != null">name = #{name},</if>
            <if test="macAddr != null">mac_addr = #{macAddr},</if>
            <if test="ip != null">ip = #{ip},</if>
            <if test="longitude != null">longitude = #{longitude},</if>
            <if test="latitude != null">latitude = #{latitude},</if>
            <if test="onState != null">on_state = #{onState},</if>
            <if test="civilCode != null">civil_code = #{civilCode},</if>
            <if test="address != null">address = #{address},</if>
            <if test="installedTime != null">installed_time = #{installedTime},</if>
            <if test="managementUnit != null">management_unit = #{managementUnit},</if>
            <if test="muContactInfo != null">mu_contact_info = #{muContactInfo},</if>
            <if test="storageDays != null">storage_days = #{storageDays},</if>
            <if test="reason != null">reason = #{reason},</if>
            <if test="defaultOrder != null">default_order = #{defaultOrder},</if>
            <if test="recovery != null">recovery = #{recovery},</if>
            <if test="recoveryTime != null">recovery_time = #{recoveryTime},</if>
            <if test="tag != null and tag !=''">tag = #{tag},</if>
            <if test="region != null">region = #{region},</if>
            <if test="sipDelay != null">sipDelay = #{sipDelay},</if>
            <if test="videoDelay != null">videoDelay = #{videoDelay},</if>
            <if test="iframeDelay != null">iframeDelay = #{iframeDelay},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteTMonitorVideoById" parameterType="Long">
        delete from t_monitor_video where id = #{id}
    </delete>
 
    <delete id="deleteTMonitorVideoByIds" parameterType="String">
        delete from t_monitor_video where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>