<?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>
|