|
|
|
|
<?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="org.dromara.sample.manage.mapper.IDeviceProMapper">
|
|
|
|
|
<resultMap id="listDeviceProEntityMap" type="org.dromara.sample.manage.model.entity.DeviceProEntity">
|
|
|
|
|
<result column="pro_id" property="id" jdbcType="VARCHAR"/>
|
|
|
|
|
<result column="pro_name" property="proName" jdbcType="VARCHAR"/>
|
|
|
|
|
<result column="bind_code" property="bindCode" jdbcType="VARCHAR"/>
|
|
|
|
|
<result column="bind_type" property="bindType" jdbcType="VARCHAR"/>
|
|
|
|
|
<collection property="deviceProUserEntityList" ofType="org.dromara.sample.manage.model.entity.DeviceProUserEntity">
|
|
|
|
|
<result column="pro_user_id" property="id"/>
|
|
|
|
|
<result column="device_pro_id" property="deviceProId"/>
|
|
|
|
|
<result column="user_id" property="userId"/>
|
|
|
|
|
<result column="nick_name" property="nickName"/>
|
|
|
|
|
</collection>
|
|
|
|
|
<collection property="deviceEntityList" ofType="org.dromara.sample.manage.model.entity.DeviceEntity">
|
|
|
|
|
<result column="device_id" property="id"/>
|
|
|
|
|
<result column="device_sn" property="deviceSn"/>
|
|
|
|
|
<result column="device_name" property="deviceName"/>
|
|
|
|
|
<result column="device_type" property="deviceType"/>
|
|
|
|
|
<result column="sub_type" property="subType"/>
|
|
|
|
|
<result column="domain" property="domain"/>
|
|
|
|
|
<result column="child_sn" property="childSn"/>
|
|
|
|
|
<result column="workspace_id" property="workspaceId"/>
|
|
|
|
|
<result column="device_pro_number" property="proId"/>
|
|
|
|
|
<result column="device_nick_name" property="nickname"/>
|
|
|
|
|
</collection>
|
|
|
|
|
</resultMap>
|
|
|
|
|
<select id="listDeviceProEntityMap" resultMap="listDeviceProEntityMap">
|
|
|
|
|
SELECT
|
|
|
|
|
dp.id pro_id,
|
|
|
|
|
dp.pro_name,
|
|
|
|
|
dp.bind_code,
|
|
|
|
|
dp.bind_type,
|
|
|
|
|
dpu.user_id pro_user_id,
|
|
|
|
|
dpu.device_pro_id,
|
|
|
|
|
dpu.user_id,
|
|
|
|
|
dpu.nick_name,
|
|
|
|
|
d.id device_id,
|
|
|
|
|
d.device_sn,
|
|
|
|
|
d.device_name,
|
|
|
|
|
d.device_type,
|
|
|
|
|
d.sub_type,
|
|
|
|
|
d.domain,
|
|
|
|
|
d.child_sn,
|
|
|
|
|
d.workspace_id,
|
|
|
|
|
d.pro_id device_pro_number,
|
|
|
|
|
d.nickname device_nick_name
|
|
|
|
|
FROM
|
|
|
|
|
manage_device_pro dp
|
|
|
|
|
LEFT JOIN manage_device d ON dp.id = d.pro_id
|
|
|
|
|
LEFT JOIN manage_device_pro_user dpu ON dp.id = dpu.device_pro_id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="condition.deviceSn != null and condition.deviceSn != ''">
|
|
|
|
|
and d.device_sn like concat(concat('%',#{condition.deviceSn}),'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="condition.deviceName != null and condition.deviceName != ''">
|
|
|
|
|
and d.device_name like concat(concat('%',#{condition.deviceName}),'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="condition.nickname != null and condition.nickname != ''">
|
|
|
|
|
and dpu.nickname like concat(concat('%',#{condition.nickname}),'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="condition.userId != null and condition.userId != ''">
|
|
|
|
|
and dpu.user_id = #{condition.userId}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|