<?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.thhy.engineering.modules.biz.device.mapper.TVideoMapper">
|
<resultMap id="BaseResultMap" type="com.thhy.engineering.modules.biz.device.entity.TVideo">
|
<!--
|
WARNING - @mbg.generated
|
This element is automatically generated by MyBatis Generator, do not modify.
|
This element was generated on Mon May 15 14:28:08 CST 2023.
|
-->
|
<id column="video_id" jdbcType="VARCHAR" property="videoId" />
|
<result column="video_name" jdbcType="VARCHAR" property="videoName" />
|
<result column="video_type" jdbcType="VARCHAR" property="videoType" />
|
<result column="video_path" jdbcType="VARCHAR" property="videoPath" />
|
<result column="longitude" jdbcType="VARCHAR" property="longitude" />
|
<result column="latitude" jdbcType="VARCHAR" property="latitude" />
|
<result column="company_id" jdbcType="VARCHAR" property="companyId" />
|
<result column="is_use" jdbcType="INTEGER" property="isUse" />
|
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
</resultMap>
|
|
<insert id="videoInsert" >
|
insert into t_video
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="videoId != null">
|
video_id,
|
</if>
|
<if test="videoName != null">
|
video_name,
|
</if>
|
<if test="videoType != null">
|
video_type,
|
</if>
|
<if test="videoPath != null">
|
video_path,
|
</if>
|
<if test="longitude != null">
|
longitude,
|
</if>
|
<if test="latitude != null">
|
latitude,
|
</if>
|
<if test="companyId != null">
|
company_id,
|
</if>
|
<if test="isUse != null">
|
is_use,
|
</if>
|
<if test="createUser != null">
|
create_user,
|
</if>
|
<if test="createTime != null">
|
create_time,
|
</if>
|
<if test="videoSn != null">
|
video_sn,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="videoId != null">
|
#{videoId,jdbcType=VARCHAR},
|
</if>
|
<if test="videoName != null">
|
#{videoName,jdbcType=VARCHAR},
|
</if>
|
<if test="videoType != null">
|
#{videoType,jdbcType=VARCHAR},
|
</if>
|
<if test="videoPath != null">
|
#{videoPath,jdbcType=VARCHAR},
|
</if>
|
<if test="longitude != null">
|
#{longitude,jdbcType=VARCHAR},
|
</if>
|
<if test="latitude != null">
|
#{latitude,jdbcType=VARCHAR},
|
</if>
|
<if test="companyId != null">
|
#{companyId,jdbcType=VARCHAR},
|
</if>
|
<if test="isUse != null">
|
#{isUse,jdbcType=INTEGER},
|
</if>
|
<if test="createUser != null">
|
#{createUser,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="videoSn != null">
|
#{videoSn,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
|
<select id="videoList" resultType="com.thhy.engineering.modules.biz.device.entity.TVideo">
|
SELECT
|
tv.video_id AS videoId,
|
tv.video_name AS videoName,
|
tv.video_path AS videoPath,
|
tv.video_type AS videoType,
|
tv.longitude AS longitude,
|
tv.latitude AS latitude,
|
tv.video_sn as videoSn,
|
sd.dict_name AS videoTypeName,
|
tv.create_time as createTime
|
FROM
|
t_video tv
|
LEFT JOIN sys_dict sd ON tv.video_type = sd.dict_id
|
WHERE
|
tv.is_use =1
|
<if test="videoName!=null and videoName!='' ">
|
and tv.video_name like concat('%',#{videoName},'%')
|
</if>
|
<if test="videoType!=null and videoType!='' ">
|
and tv.video_type=#{videoType}
|
</if>
|
<if test="companyId!=null and companyId!='' ">
|
and tv.company_id=#{companyId}
|
</if>
|
order by tv.create_time desc
|
</select>
|
<select id="videoInfo" parameterType="java.lang.String" resultType="com.thhy.engineering.modules.biz.device.entity.TVideo">
|
SELECT
|
tv.video_id AS videoId,
|
tv.video_name AS videoName,
|
tv.video_path AS videoPath,
|
tv.video_type AS videoType,
|
tv.longitude AS longitude,
|
tv.latitude AS latitude,
|
tv.video_sn as videoSn,
|
sd.dict_name AS videoTypeName
|
FROM
|
t_video tv
|
LEFT JOIN sys_dict sd ON tv.video_type = sd.dict_id
|
WHERE
|
tv.is_use =1 and tv.video_id=#{videoId}
|
</select>
|
|
<update id="videoDel" parameterType="java.lang.String">
|
update t_video set
|
is_use=2
|
where video_id=#{videoId}
|
</update>
|
|
<update id="videoUpdate" >
|
update t_video
|
<set>
|
<if test="videoName != null">
|
video_name = #{videoName,jdbcType=VARCHAR},
|
</if>
|
<if test="videoType != null">
|
video_type = #{videoType,jdbcType=VARCHAR},
|
</if>
|
<if test="videoPath != null">
|
video_path = #{videoPath,jdbcType=VARCHAR},
|
</if>
|
<if test="longitude != null">
|
longitude = #{longitude,jdbcType=VARCHAR},
|
</if>
|
<if test="latitude != null">
|
latitude = #{latitude,jdbcType=VARCHAR},
|
</if>
|
<if test="companyId != null">
|
company_id = #{companyId,jdbcType=VARCHAR},
|
</if>
|
<if test="isUse != null">
|
is_use = #{isUse,jdbcType=INTEGER},
|
</if>
|
<if test="createUser != null">
|
create_user = #{createUser,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="videoSn != null">
|
video_sn = #{videoSn,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where video_id = #{videoId,jdbcType=VARCHAR}
|
</update>
|
<select id="videoSnByOne" parameterType="java.lang.String" resultType="java.lang.String">
|
select video_id from t_video where video_sn=#{videoSn} and is_use=1
|
</select>
|
</mapper>
|