liuxiaolong
2019-05-06 0bc4f4c791437b39b8c30624f5c21f8c855dc61d
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
59
60
61
<?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.cloud.retrieve.dao.CulOrDevDao" >
 
    <sql id="culTable" >
      cluster
    </sql>
    <sql id="nodeTable" >
      node
    </sql>
 
    <sql id="personTable" >
      bb_person_base
    </sql>
    <sql id="orgTable" >
      sys_organization
    </sql>
 
<!-- 查询集群 信息-->
    <select id="findById" resultType="java.util.Map">
    select  p.id,p.name
    from
    <include refid="culTable" /> p
        <if test="culId != null and culId != ''">
            where p.id = #{culId}
        </if>
        <if test="culId == null or culId == ''">
            where p.delFlag != '1'
            ORDER BY p.updateTime DESC
            LIMIT 1
        </if>
</select>
    <!-- 查询节点ip 信息  内网ip  和 外网 端口-->
    <select id="findByIndeviceId" resultType="java.util.Map">
        select nodeIp,videoPublicPort,publicIp
        from
        <include refid="nodeTable" />
            where devId = #{indeviceid}  order by createTime desc limit 1
    </select>
 
 
    <select id="selectPersonDetailById" resultType="java.util.Map">
        select b.name name,b.gender gender,b.cardId cardId,b.phone phone,b.`no` no,b.type type,o.name orgName
        from
      <include refid="personTable" /> b
        left join   <include refid="orgTable" /> o
        on b.officeId = o.id
        <if test="personId != null and personId != ''">
         where b.id = #{personId}
        </if>
        <if test="personId == null or personId == ''">
         where b.delFlag != '1'
            ORDER BY b.updateTime DESC
            LIMIT 1
        </if>
    </select>
 
</mapper>