116 lines
6.0 KiB
XML
116 lines
6.0 KiB
XML
<?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.video.mapper.DeviceMapper">
|
|
|
|
<resultMap type="Device" id="DeviceResult">
|
|
<result property="deviceId" column="device_id" />
|
|
<result property="ip" column="ip" />
|
|
<result property="type" column="type" />
|
|
<result property="userName" column="user_name" />
|
|
<result property="password" column="password" />
|
|
<result property="url" column="url" />
|
|
<result property="mediaKey" column="mediaKey" />
|
|
<result property="enabledFlv" column="enabledFlv" />
|
|
<result property="enabledHls" column="enabledHls" />
|
|
<result property="mode" column="mode" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="remark" column="remark" />
|
|
</resultMap>
|
|
|
|
<sql id="selectDeviceVo">
|
|
select device_id, ip, type, user_name, password, url, mediaKey, enabledFlv, enabledHls, mode, create_by, create_time, update_by, update_time, remark from v_device
|
|
</sql>
|
|
|
|
<select id="selectDeviceList" parameterType="Device" resultMap="DeviceResult">
|
|
<include refid="selectDeviceVo"/>
|
|
<where>
|
|
<if test="ip != null and ip != ''"> and ip = #{ip}</if>
|
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
|
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
|
<if test="password != null and password != ''"> and password = #{password}</if>
|
|
<if test="url != null and url != ''"> and url = #{url}</if>
|
|
<if test="mediaKey != null and mediaKey != ''"> and mediaKey = #{mediaKey}</if>
|
|
<if test="enabledFlv != null and enabledFlv != ''"> and enabledFlv = #{enabledFlv}</if>
|
|
<if test="enabledHls != null and enabledHls != ''"> and enabledHls = #{enabledHls}</if>
|
|
<if test="mode != null and mode != ''"> and mode = #{mode}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectDeviceByDeviceId" parameterType="Long" resultMap="DeviceResult">
|
|
<include refid="selectDeviceVo"/>
|
|
where device_id = #{deviceId}
|
|
</select>
|
|
|
|
<insert id="insertDevice" parameterType="Device" useGeneratedKeys="true" keyProperty="deviceId">
|
|
insert into v_device
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="ip != null and ip != ''">ip,</if>
|
|
<if test="type != null and type != ''">type,</if>
|
|
<if test="userName != null and userName != ''">user_name,</if>
|
|
<if test="password != null and password != ''">password,</if>
|
|
<if test="url != null">url,</if>
|
|
<if test="mediaKey != null">mediaKey,</if>
|
|
<if test="enabledFlv != null">enabledFlv,</if>
|
|
<if test="enabledHls != null">enabledHls,</if>
|
|
<if test="mode != null">mode,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="remark != null">remark,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="ip != null and ip != ''">#{ip},</if>
|
|
<if test="type != null and type != ''">#{type},</if>
|
|
<if test="userName != null and userName != ''">#{userName},</if>
|
|
<if test="password != null and password != ''">#{password},</if>
|
|
<if test="url != null">#{url},</if>
|
|
<if test="mediaKey != null">#{mediaKey},</if>
|
|
<if test="enabledFlv != null">#{enabledFlv},</if>
|
|
<if test="enabledHls != null">#{enabledHls},</if>
|
|
<if test="mode != null">#{mode},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateDevice" parameterType="Device">
|
|
update v_device
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="ip != null and ip != ''">ip = #{ip},</if>
|
|
<if test="type != null and type != ''">type = #{type},</if>
|
|
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
|
<if test="password != null and password != ''">password = #{password},</if>
|
|
<if test="url != null">url = #{url},</if>
|
|
<if test="mediaKey != null">mediaKey = #{mediaKey},</if>
|
|
<if test="enabledFlv != null">enabledFlv = #{enabledFlv},</if>
|
|
<if test="enabledHls != null">enabledHls = #{enabledHls},</if>
|
|
<if test="mode != null">mode = #{mode},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
</trim>
|
|
where device_id = #{deviceId}
|
|
</update>
|
|
|
|
<delete id="deleteDeviceByDeviceId" parameterType="Long">
|
|
delete from v_device where device_id = #{deviceId}
|
|
</delete>
|
|
|
|
<delete id="deleteDeviceByDeviceIds" parameterType="String">
|
|
delete from v_device where device_id in
|
|
<foreach item="deviceId" collection="array" open="(" separator="," close=")">
|
|
#{deviceId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |