liusuyi
2026-05-14 9958bc1501d0daee954d9bba383475e55e24ebab
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
<?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.ard.zlm.mapper.ZlmCloudRecordMapper">
 
    <resultMap type="ZlmCloudRecord" id="ZlmCloudRecordResult">
        <result property="id" column="id"/>
        <result property="app" column="app"/>
        <result property="stream" column="stream"/>
        <result property="callId" column="call_id"/>
        <result property="startTime" column="start_time"/>
        <result property="endTime" column="end_time"/>
        <result property="mediaServerId" column="media_server_id"/>
        <result property="serverId" column="server_id"/>
        <result property="fileName" column="file_name"/>
        <result property="folder" column="folder"/>
        <result property="filePath" column="file_path"/>
        <result property="collect" column="collect"/>
        <result property="fileSize" column="file_size"/>
        <result property="timeLen" column="time_len"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
    </resultMap>
 
    <sql id="selectZlmCloudRecordVo">
        select id,
               app,
               stream,
               call_id,
               start_time,
               end_time,
               media_server_id,
               server_id,
               file_name,
               folder,
               file_path,
               collect,
               file_size,
               time_len,
               create_time,
               update_time
        from zlm_cloud_record
    </sql>
 
    <select id="selectZlmCloudRecordList" parameterType="ZlmCloudRecord" resultMap="ZlmCloudRecordResult">
        <include refid="selectZlmCloudRecordVo"/>
        <where>
            <if test="app != null  and app != ''">and app like concat('%', #{app}, '%')</if>
            <if test="stream != null  and stream != ''">and stream like concat('%', #{stream}, '%')</if>
            <if test="callId != null  and callId != ''">and call_id = #{callId}</if>
            <if test="startTime != null ">and start_time &gt;= #{startTime}</if>
            <if test="endTime != null ">and end_time &lt;= #{endTime}</if>
            <if test="mediaServerId != null  and mediaServerId != ''">and media_server_id = #{mediaServerId}</if>
        </where>
    </select>
 
    <select id="selectZlmCloudRecordById" parameterType="Long" resultMap="ZlmCloudRecordResult">
        <include refid="selectZlmCloudRecordVo"/>
        where id = #{id}
    </select>
 
    <select id="queryZlmCloudRecordByIds" resultMap="ZlmCloudRecordResult">
        <include refid="selectZlmCloudRecordVo"/>
        where id in
        <foreach collection="ids" item="id" open="(" separator="," close=")">
            #{id}
        </foreach>
    </select>
 
    <select id="queryCloudRecordListForDelete" resultMap="ZlmCloudRecordResult">
        <include refid="selectZlmCloudRecordVo"/>
        where collect = false and end_time &lt;= #{endTimeStamp} and media_server_id = #{mediaServerId}
    </select>
 
    <insert id="insertZlmCloudRecord" parameterType="ZlmCloudRecord" useGeneratedKeys="true" keyProperty="id">
        insert into zlm_cloud_record
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="app != null">app,</if>
            <if test="stream != null">stream,</if>
            <if test="callId != null">call_id,</if>
            <if test="startTime != null">start_time,</if>
            <if test="endTime != null">end_time,</if>
            <if test="mediaServerId != null">media_server_id,</if>
            <if test="serverId != null">server_id,</if>
            <if test="fileName != null">file_name,</if>
            <if test="folder != null">folder,</if>
            <if test="filePath != null">file_path,</if>
            <if test="collect != null">collect,</if>
            <if test="fileSize != null">file_size,</if>
            <if test="timeLen != null">time_len,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="app != null">#{app},</if>
            <if test="stream != null">#{stream},</if>
            <if test="callId != null">#{callId},</if>
            <if test="startTime != null">#{startTime},</if>
            <if test="endTime != null">#{endTime},</if>
            <if test="mediaServerId != null">#{mediaServerId},</if>
            <if test="serverId != null">#{serverId},</if>
            <if test="fileName != null">#{fileName},</if>
            <if test="folder != null">#{folder},</if>
            <if test="filePath != null">#{filePath},</if>
            <if test="collect != null">#{collect},</if>
            <if test="fileSize != null">#{fileSize},</if>
            <if test="timeLen != null">#{timeLen},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
        </trim>
    </insert>
 
    <update id="updateZlmCloudRecord" parameterType="ZlmCloudRecord">
        update zlm_cloud_record
        <trim prefix="SET" suffixOverrides=",">
            <if test="app != null">app = #{app},</if>
            <if test="stream != null">stream = #{stream},</if>
            <if test="callId != null">call_id = #{callId},</if>
            <if test="startTime != null">start_time = #{startTime},</if>
            <if test="endTime != null">end_time = #{endTime},</if>
            <if test="mediaServerId != null">media_server_id = #{mediaServerId},</if>
            <if test="serverId != null">server_id = #{serverId},</if>
            <if test="fileName != null">file_name = #{fileName},</if>
            <if test="folder != null">folder = #{folder},</if>
            <if test="filePath != null">file_path = #{filePath},</if>
            <if test="collect != null">collect = #{collect},</if>
            <if test="fileSize != null">file_size = #{fileSize},</if>
            <if test="timeLen != null">time_len = #{timeLen},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteZlmCloudRecordByIds" parameterType="String">
        delete from zlm_cloud_record where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>