<?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.ycl.mapper.video.VideoPointMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ycl.entity.video.VideoPoint">
|
<id column="id" property="id" jdbcType="INTEGER"/>
|
<result column="name" property="name" jdbcType="VARCHAR"/>
|
<result column="longitude" property="longitude" jdbcType="FLOAT"/>
|
<result column="latitude" property="latitude" jdbcType="FLOAT"/>
|
<result column="street_id" property="streetId" jdbcType="INTEGER"/>
|
<result column="community_id" property="communityId" jdbcType="INTEGER"/>
|
<result column="address" property="address" jdbcType="VARCHAR"/>
|
<result column="plat_resource_id" property="platResourceId" jdbcType="VARCHAR"/>
|
<result column="equipment_brand" property="equipmentBrand" jdbcType="VARCHAR"/>
|
<result column="equipment_model" property="equipmentModel" jdbcType="VARCHAR"/>
|
<result column="equipment_ip" property="equipmentIp" jdbcType="VARCHAR"/>
|
<result column="url_address" property="urlAddress" jdbcType="VARCHAR"/>
|
</resultMap>
|
|
<resultMap id="VoMap" type="com.ycl.vo.equipment.VideoPointVo" extends="BaseResultMap">
|
<result column="community_name" property="community" jdbcType="VARCHAR"/>
|
<result column="street_name" property="street" jdbcType="VARCHAR"/>
|
|
</resultMap>
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id
|
,name,longitude,latitude,street_id,community_id,address,plat_resource_id,equipment_brand,equipment_model,equipment_ip,url_address
|
</sql>
|
<select id="search" resultMap="VoMap">
|
SELECT vp.*,s.region_name street_name,c.region_name community_name FROM ums_video_point vp
|
LEFT JOIN ums_sccg_region s on vp.street_id = s.id
|
LEFT JOIN ums_sccg_region c on vp.community_id = c.id
|
<where>
|
<if test="streetId!=null">
|
and vp.street_id = #{streetId}
|
</if>
|
<if test="communityId!=null">
|
and vp.community_id = #{communityId}
|
</if>
|
</where>
|
ORDER BY vp.code DESC
|
</select>
|
|
</mapper>
|