<?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.sandu.ximon.dao.mapper.InterphoneSubMapper">
|
|
<resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.InterphoneSub">
|
<id property="subId" column="sub_id" jdbcType="INTEGER"/>
|
<result property="subMac" column="sub_mac" jdbcType="VARCHAR"/>
|
<result property="subIp" column="sub_ip" jdbcType="VARCHAR"/>
|
<result property="subAddress" column="sub_address" jdbcType="VARCHAR"/>
|
<result property="createtime" column="createtime" jdbcType="TIMESTAMP"/>
|
<result property="updatetime" column="updatetime" jdbcType="TIMESTAMP"/>
|
<result property="sipAddress" column="sip_address" jdbcType="VARCHAR"/>
|
<result property="sipPort" column="sip_port" jdbcType="VARCHAR"/>
|
<result property="sipName" column="sip_name" jdbcType="VARCHAR"/>
|
<result property="sipAuth" column="sip_auth" jdbcType="VARCHAR"/>
|
<result property="sipPassword" column="sip_password" jdbcType="VARCHAR"/>
|
<result property="proxyAddress" column="proxy_address" jdbcType="VARCHAR"/>
|
<result property="proxyPort" column="proxy_port" jdbcType="VARCHAR"/>
|
<result property="proxyUser" column="proxy_user" jdbcType="VARCHAR"/>
|
<result property="proxyPassword" column="proxy_password" jdbcType="VARCHAR"/>
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
sub_id,sub_mac,sub_ip,
|
sub_address,createtime,updatetime,
|
sip_address,sip_port,sip_name,
|
sip_auth,sip_password,proxy_address,
|
proxy_port,proxy_user,proxy_password,
|
create_time,update_time
|
</sql>
|
<select id="getInterphoneSubList" resultType="com.sandu.ximon.dao.bo.InterphoneSubBo">
|
SELECT
|
t1.*, t2.pole_id,
|
t3.pole_name
|
FROM
|
interphone_sub t1
|
LEFT JOIN pole_binding t2 ON t1.sub_mac = t2.device_code
|
AND t2.device_type = 9
|
LEFT JOIN pole t3 ON t3.id = t2.pole_id
|
|
<where>
|
<if test="keyword != null and keyword != ''">
|
(t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
|
OR t3.id LIKE CONCAT(CONCAT('%', #{keyword}), '%')
|
OR t1.sub_mac LIKE CONCAT(CONCAT('%', #{keyword}), '%'))
|
</if>
|
<if test="clientId != null">
|
AND (t3.user_id = #{clientId} OR t3.client_id = #{clientId})
|
</if>
|
</where>
|
</select>
|
</mapper>
|