|
@@ -6,8 +6,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<resultMap type="ChannelNumber" id="ChannelNumberResult">
|
|
<resultMap type="ChannelNumber" id="ChannelNumberResult">
|
|
<result property="channelId" column="channel_id" />
|
|
<result property="channelId" column="channel_id" />
|
|
|
|
+ <result property="equipmentId" column="equipment_id" />
|
|
|
|
+ <result property="equipmentNum" column="equipment_num" />
|
|
|
|
+ <result property="equipmentName" column="equipment_name" />
|
|
<result property="channelNum" column="channel_num" />
|
|
<result property="channelNum" column="channel_num" />
|
|
|
|
+ <result property="port" column="port" />
|
|
<result property="videoAddress" column="video_address" />
|
|
<result property="videoAddress" column="video_address" />
|
|
|
|
+ <result property="account" column="account" />
|
|
|
|
+ <result property="password" column="password" />
|
|
<result property="protocolType" column="protocol_type" />
|
|
<result property="protocolType" column="protocol_type" />
|
|
<result property="channelDetails" column="channel_details" />
|
|
<result property="channelDetails" column="channel_details" />
|
|
<result property="delFlag" column="del_flag" />
|
|
<result property="delFlag" column="del_flag" />
|
|
@@ -19,12 +25,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectChannelNumberVo">
|
|
<sql id="selectChannelNumberVo">
|
|
- select channel_id, channel_num, video_address, protocol_type, channel_details, del_flag, create_by, create_time, update_by, update_time, remark from channel_number
|
|
|
|
|
|
+ select channel_id, channel_num,equipment_id, equipment_num, equipment_name, video_address,port, account,password,protocol_type, channel_details, del_flag, create_by, create_time, update_by, update_time, remark from channel_number
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectChannelNumberList" parameterType="ChannelNumber" resultMap="ChannelNumberResult">
|
|
<select id="selectChannelNumberList" parameterType="ChannelNumber" resultMap="ChannelNumberResult">
|
|
<include refid="selectChannelNumberVo"/>
|
|
<include refid="selectChannelNumberVo"/>
|
|
- <where>
|
|
|
|
|
|
+ <where>
|
|
|
|
+ <if test="equipmentNum != null and equipmentNum != ''"> and equipment_num like concat('%', #{equipmentNum}, '%')</if>
|
|
|
|
+ <if test="equipmentName != null and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if>
|
|
<if test="channelNum != null and channelNum != ''"> and channel_num = #{channelNum}</if>
|
|
<if test="channelNum != null and channelNum != ''"> and channel_num = #{channelNum}</if>
|
|
<if test="videoAddress != null and videoAddress != ''"> and video_address = #{videoAddress}</if>
|
|
<if test="videoAddress != null and videoAddress != ''"> and video_address = #{videoAddress}</if>
|
|
<if test="protocolType != null and protocolType != ''"> and protocol_type = #{protocolType}</if>
|
|
<if test="protocolType != null and protocolType != ''"> and protocol_type = #{protocolType}</if>
|
|
@@ -32,16 +40,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="selectChannelNumberByChannelId" parameterType="Long" resultMap="ChannelNumberResult">
|
|
|
|
|
|
+ <select id="selectChannelNumberByChannelId" parameterType="ChannelNumber" resultMap="ChannelNumberResult">
|
|
<include refid="selectChannelNumberVo"/>
|
|
<include refid="selectChannelNumberVo"/>
|
|
where channel_id = #{channelId}
|
|
where channel_id = #{channelId}
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+ <select id="selectChannelNumberByChannelNum" parameterType="string" resultMap="ChannelNumberResult">
|
|
|
|
+ <include refid="selectChannelNumberVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="equipmentId != null "> and equipment_id =#{equipmentId}</if>
|
|
|
|
+ <if test="channelNum != null and channelNum != ''"> and channel_num = #{channelNum}</if>
|
|
|
|
+ </where>
|
|
|
|
+ limit 1
|
|
|
|
+ </select>
|
|
<insert id="insertChannelNumber" parameterType="ChannelNumber" useGeneratedKeys="true" keyProperty="channelId">
|
|
<insert id="insertChannelNumber" parameterType="ChannelNumber" useGeneratedKeys="true" keyProperty="channelId">
|
|
insert into channel_number
|
|
insert into channel_number
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="equipmentId != null">equipment_id,</if>
|
|
|
|
+ <if test="equipmentNum != null">equipment_num,</if>
|
|
|
|
+ <if test="equipmentName != null">equipment_name,</if>
|
|
<if test="channelNum != null">channel_num,</if>
|
|
<if test="channelNum != null">channel_num,</if>
|
|
<if test="videoAddress != null">video_address,</if>
|
|
<if test="videoAddress != null">video_address,</if>
|
|
|
|
+ <if test="account != null">account,</if>
|
|
|
|
+ <if test="port != null">port,</if>
|
|
|
|
+ <if test="password != null">password,</if>
|
|
<if test="protocolType != null">protocol_type,</if>
|
|
<if test="protocolType != null">protocol_type,</if>
|
|
<if test="channelDetails != null">channel_details,</if>
|
|
<if test="channelDetails != null">channel_details,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
@@ -52,8 +73,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="remark != null">remark,</if>
|
|
<if test="remark != null">remark,</if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="equipmentId != null">#{equipmentId},</if>
|
|
|
|
+ <if test="equipmentNum != null">#{equipmentNum},</if>
|
|
|
|
+ <if test="equipmentName != null">#{equipmentName},</if>
|
|
<if test="channelNum != null">#{channelNum},</if>
|
|
<if test="channelNum != null">#{channelNum},</if>
|
|
<if test="videoAddress != null">#{videoAddress},</if>
|
|
<if test="videoAddress != null">#{videoAddress},</if>
|
|
|
|
+ <if test="account != null">#{account},</if>
|
|
|
|
+ <if test="port != null">#{port},</if>
|
|
|
|
+ <if test="password != null">#{password},</if>
|
|
<if test="protocolType != null">#{protocolType},</if>
|
|
<if test="protocolType != null">#{protocolType},</if>
|
|
<if test="channelDetails != null">#{channelDetails},</if>
|
|
<if test="channelDetails != null">#{channelDetails},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
@@ -68,8 +95,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<update id="updateChannelNumber" parameterType="ChannelNumber">
|
|
<update id="updateChannelNumber" parameterType="ChannelNumber">
|
|
update channel_number
|
|
update channel_number
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="equipmentId != null">equipment_id = #{equipmentId},</if>
|
|
|
|
+ <if test="equipmentNum != null">equipment_num = #{equipmentNum},</if>
|
|
|
|
+ <if test="equipmentName != null">equipment_name = #{equipmentName},</if>
|
|
<if test="channelNum != null">channel_num = #{channelNum},</if>
|
|
<if test="channelNum != null">channel_num = #{channelNum},</if>
|
|
<if test="videoAddress != null">video_address = #{videoAddress},</if>
|
|
<if test="videoAddress != null">video_address = #{videoAddress},</if>
|
|
|
|
+ <if test="account != null">account = #{account},</if>
|
|
|
|
+ <if test="port != null">port = #{port},</if>
|
|
|
|
+ <if test="password != null">password = #{password},</if>
|
|
<if test="protocolType != null">protocol_type = #{protocolType},</if>
|
|
<if test="protocolType != null">protocol_type = #{protocolType},</if>
|
|
<if test="channelDetails != null">channel_details = #{channelDetails},</if>
|
|
<if test="channelDetails != null">channel_details = #{channelDetails},</if>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|