liuxiaolong
2019-05-06 71af9c46c24b562acc00a71ec6c97c04eb048d9c
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
<?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.device.dao.OrgDeviceDao">
    <resultMap id="BaseResultMap" type="com.cloud.device.model.Device">
        <id column="id" jdbcType="VARCHAR" property="id" />
        <result column="orgId" jdbcType="INTEGER" property="orgId" />
        <result column="type" jdbcType="VARCHAR" property="type" />
        <result column="name" jdbcType="VARCHAR" property="name" />
        <result column="code" jdbcType="VARCHAR" property="code" />
        <result column="address" jdbcType="VARCHAR" property="address" />
        <result column="longitude" jdbcType="VARCHAR" property="longitude" />
        <result column="latitude" jdbcType="VARCHAR" property="latitude" />
        <result column="ip" jdbcType="VARCHAR" property="ip" />
        <result column="port" jdbcType="VARCHAR" property="port" />
        <result column="username" jdbcType="VARCHAR" property="username" />
        <result column="password" jdbcType="VARCHAR" property="password" />
        <result column="revJson" jdbcType="CHAR" property="revJson" />
        <result column="createBy" jdbcType="VARCHAR" property="createBy" />
        <result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
        <result column="updateBy" jdbcType="VARCHAR" property="updateBy" />
        <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
        <result column="remarks" jdbcType="VARCHAR" property="remarks" />
        <result column="delFlag" jdbcType="VARCHAR" property="delFlag" />
    </resultMap>
 
    <select id="getDeviceByOrgId" parameterType="java.lang.Long" resultMap="BaseResultMap">
      select d.* from device d join org_device od on d.id=od.deviceId
      where d.delFalg = '0'
      <if test="orgId !=null">
          and od.dicId = #{orgId,jdbcType=INTEGER} and delFal='0')
      </if>
    </select>
</mapper>