2021与蓝度共同重构项目,服务端
liuhaonan
2022-10-21 0a30812acaa26ebe654340f7e749a6801b63b194
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?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.InterphoneHostMapper">
 
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.InterphoneHost">
        <id property="hostId" column="host_id" jdbcType="INTEGER"/>
        <result property="hostMac" column="host_mac" jdbcType="VARCHAR"/>
        <result property="hostIp" column="host_ip" jdbcType="VARCHAR"/>
        <result property="url" column="url" jdbcType="VARCHAR"/>
        <result property="hostAddress" column="host_address" jdbcType="VARCHAR"/>
        <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">
        host_id
        ,host_mac,host_ip,
        url,host_address,
        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="getInterphoneHostList" resultType="com.sandu.ximon.dao.bo.InterphoneHostBo">
        SELECT
        t1.*, t2.pole_id,
        t3.pole_name
        FROM
        interphone_host t1
        LEFT JOIN pole_binding t2 ON t1.host_mac = t2.device_code
        AND t2.device_type = 9
        LEFT JOIN pole t3 ON t3.id = t2.pole_id
 
        <where>
            1=1
            <if test="keyword != null and keyword != ''">
                AND(t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
                OR t3.id LIKE CONCAT(CONCAT('%', #{keyword}), '%')
                OR t1.host_mac LIKE CONCAT(CONCAT('%', #{keyword}), '%'))
            </if>
            <if test="clientId != null">
                AND (t3.user_id = #{clientId} OR t3.client_id = #{clientId})
            </if>
        </where>
 
    </select>
</mapper>