You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

95 lines
4.8 KiB

<?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.inspect.simulator.mapper.PatrolPresetPosMapper">
<resultMap type="com.inspect.simulator.domain.result.PatrolPresetPos" id="PatrolPresetPosResult">
<result property="presetPosId" column="preset_pos_id"/>
<result property="presetPosCode" column="preset_pos_code"/>
<result property="presetPosName" column="preset_pos_name"/>
<result property="patrolPointId" column="patrol_point_id"/>
<result property="channelId" column="channel_id"/>
<result property="coordinateType" column="coordinate_type"/>
<result property="stopTime" column="stop_time"/>
<result property="channelImg" column="channel_img"/>
<result property="description" column="description"/>
<result property="isEnable" column="is_enable"/>
<result property="createTime" column="create_time"/>
<result property="algSubtypeCode" column="alg_subtype_code"/>
<result property="eqpBookId" column="eqp_book_id"/>
<result property="channelCode" column="channel_code"/>
<result property="channelType" column="channel_type"/>
<result property="channelContent" column="channel_content"/>
<result property="patrolDeviceName" column="patrol_device_name"/>
<result property="patrolDeviceCode" column="patrol_device_code"/>
<result property="videoNvrCode" column="video_nvr_code"/>
</resultMap>
<sql id="selectPatrolPresetPosVo">
select preset_pos_id,
preset_pos_code,
preset_pos_name,
patrol_point_id,
channel_id,
coordinate_type,
stop_time,
channel_img,
description,
is_enable,
create_time,
alg_subtype_code,
eqp_book_id,
channel_code,
channel_type,
patrol_device_code,
video_nvr_code
from patrol_preset_pos
</sql>
<select id="selectPatrolPresetPosList" parameterType="com.inspect.simulator.domain.result.PatrolPresetPos" resultMap="PatrolPresetPosResult">
<include refid="selectPatrolPresetPosVo"/>
<where>
<if test="presetPosCode != null and presetPosCode != ''">and preset_pos_code = #{presetPosCode}</if>
<if test="presetPosName != null and presetPosName != ''">and preset_pos_name like concat('%',
#{presetPosName}, '%')
</if>
<if test="patrolPointId != null ">and patrol_point_id = #{patrolPointId}</if>
<if test="channelId != null and channelId != ''">and channel_id = #{channelId}</if>
<if test="coordinateType != null and coordinateType != ''">and coordinate_type = #{coordinateType}</if>
<if test="stopTime != null ">and stop_time = #{stopTime}</if>
<if test="channelImg != null and channelImg != ''">and channel_img = #{channelImg}</if>
<if test="description != null and description != ''">and description = #{description}</if>
<if test="isEnable != null and isEnable != ''">and is_enable = #{isEnable}</if>
<if test="patrolDeviceCode != null and patrolDeviceCode != ''">and patrol_device_code = #{patrolDeviceCode}</if>
<if test="channelCode != null and channelCode != ''">and channel_code = #{channelCode}</if>
<if test="videoNvrCode != null and videoNvrCode != ''">and video_nvr_code = #{videoNvrCode}</if>
</where>
</select>
<select id="selectPatrolPresetPosListByIds" parameterType="String" resultMap="PatrolPresetPosResult">
<include refid="selectPatrolPresetPosVo"/>
where preset_pos_id in
<foreach item="presetPosId" collection="array" open="(" separator="," close=")">
#{presetPosId}
</foreach>
</select>
<select id="selectPatrolPresetPosByPresetPosId" parameterType="String" resultMap="PatrolPresetPosResult">
<include refid="selectPatrolPresetPosVo"/>
where preset_pos_id = #{presetPosId}
</select>
<select id="selectPatrolPresetPosByPatrolPointId" parameterType="String" resultMap="PatrolPresetPosResult">
select a.preset_pos_id,
a.preset_pos_name,
a.alg_subtype_code,
a.eqp_book_id,
a.channel_code,
a.channel_type,
a.channel_img,
c.channel_name patrol_device_name,
c.channel_content channel_content
from patrol_preset_pos a
left join basedata_eqpbook_channel c on c.channel_id = a.channel_id
where a.patrol_point_id = #{patrolPointId}
</select>
</mapper>