徐州低空平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.9 KiB

8 months ago
<?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"/>
<result column="pro_name" property="proName"/>
<result column="bind_code" property="bindCode"/>
<result column="bind_type" property="bindType"/>
<result column="nick_name" property="nickName"/>
<result column="create_time" property="createTime"/>
8 months ago
<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"/>
8 months ago
<result column="user_id" property="userId"/>
<result column="user_name" property="userName"/>
8 months ago
</collection>
<collection property="deviceEntityList" ofType="org.dromara.sample.manage.model.entity.DeviceEntity">
<result column="device_id" property="id"/>
8 months ago
<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"/>
8 months ago
</collection>
</resultMap>
<select id="listDeviceProEntityMap" resultMap="listDeviceProEntityMap">
SELECT
dp.id pro_id,
dp.pro_name,
dp.bind_code,
dp.bind_type,
dp.nick_name,
dp.create_time,
dpu.id pro_user_id,
dpu.device_pro_id,
dpu.user_id,
dpu.user_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
8 months ago
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
8 months ago
<where>
<if test="condition.bind_code != null and condition.bind_code != ''">
and dp.bind_code like concat(concat('%',#{condition.bind_code}),'%')
8 months ago
</if>
<if test="condition.pro_name != null and condition.pro_name != ''">
and dp.pro_name like concat(concat('%',#{condition.pro_name}),'%')
</if>
</where>
8 months ago
</select>
</mapper>