|
@@ -23,28 +23,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="remark" column="remark" />
|
|
|
+ <collection property="algorithmSetList" javaType="java.util.List" resultMap="AlgorithmSetResult" />
|
|
|
+ </resultMap>
|
|
|
+ <resultMap type="AlgorithmSet" id="AlgorithmSetResult">
|
|
|
+ <result property="algorithmId" column="algorithm_id"/>
|
|
|
+ <result property="algorithmNum" column="algorithm_num"/>
|
|
|
+ <result property="algorithmName" column="algorithm_name"/>
|
|
|
</resultMap>
|
|
|
-
|
|
|
<sql id="selectChannelNumberVo">
|
|
|
select channel_id, channel_num,equipment_id, equipment_num, equipment_name, video_address,photo_address,port, account,password,protocol_type, channel_details, del_flag, create_by, create_time, update_by, update_time, remark from channel_number
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectChannelNumberList" parameterType="ChannelNumber" resultMap="ChannelNumberResult">
|
|
|
- <include refid="selectChannelNumberVo"/>
|
|
|
+ select c.channel_id, c.channel_num,c.equipment_id, c.equipment_num, c.equipment_name, c.video_address,c.photo_address,c.port, c.account,c.password,c.protocol_type,
|
|
|
+ c.channel_details, c.del_flag, c.create_by, c.create_time, c.update_by, c.update_time, c.remark,als.algorithm_name,als.algorithm_id
|
|
|
+ from channel_number c
|
|
|
+ left join algorithm_channel a on a.channel_id = c.channel_id
|
|
|
+ left join algorithm_set als on als.algorithm_id = a.algorithm_id
|
|
|
<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="videoAddress != null and videoAddress != ''"> and video_address = #{videoAddress}</if>
|
|
|
- <if test="protocolType != null and protocolType != ''"> and protocol_type = #{protocolType}</if>
|
|
|
- <if test="channelDetails != null and channelDetails != ''"> and channel_details = #{channelDetails}</if>
|
|
|
+ <if test="equipmentNum != null and equipmentNum != ''"> and c.equipment_num like concat('%', #{equipmentNum}, '%')</if>
|
|
|
+ <if test="equipmentName != null and equipmentName != ''"> and c.equipment_name like concat('%', #{equipmentName}, '%')</if>
|
|
|
+ <if test="channelNum != null and channelNum != ''"> and c.channel_num = #{channelNum}</if>
|
|
|
+ <if test="videoAddress != null and videoAddress != ''"> and c.video_address = #{videoAddress}</if>
|
|
|
+ <if test="protocolType != null and protocolType != ''"> and c.protocol_type = #{protocolType}</if>
|
|
|
+ <if test="channelDetails != null and channelDetails != ''"> and c.channel_details = #{channelDetails}</if>
|
|
|
</where>
|
|
|
order by create_time DESC
|
|
|
</select>
|
|
|
|
|
|
<select id="selectChannelNumberByChannelId" parameterType="ChannelNumber" resultMap="ChannelNumberResult">
|
|
|
- <include refid="selectChannelNumberVo"/>
|
|
|
- where channel_id = #{channelId}
|
|
|
+ select c.channel_id,
|
|
|
+ c.channel_num,
|
|
|
+ c.equipment_id,
|
|
|
+ c.equipment_num,
|
|
|
+ c.equipment_name,
|
|
|
+ c.video_address,
|
|
|
+ c.photo_address,
|
|
|
+ c.port,
|
|
|
+ c.account,
|
|
|
+ c.password,
|
|
|
+ c.protocol_type,
|
|
|
+ c.channel_details,
|
|
|
+ c.del_flag,
|
|
|
+ c.create_by,
|
|
|
+ c.create_time,
|
|
|
+ c.update_by,
|
|
|
+ c.update_time,
|
|
|
+ c.remark,
|
|
|
+ als.algorithm_name,
|
|
|
+ als.algorithm_id
|
|
|
+ from channel_number c
|
|
|
+ left join algorithm_channel a on a.channel_id = c.channel_id
|
|
|
+ left join algorithm_set als on als.algorithm_id = a.algorithm_id
|
|
|
+ where c.channel_id = #{channelId}
|
|
|
</select>
|
|
|
<select id="selectChannelNumberByChannelNum" parameterType="string" resultMap="ChannelNumberResult">
|
|
|
<include refid="selectChannelNumberVo"/>
|