Commit 67db8872 authored by zengtianlai3's avatar zengtianlai3

查询设备列表

parent a076db8b
<?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="iot.sixiang.license.mapper.DeviceTypeMapper">
<sql id="DeviceTypeVoColumn">
dt.type_id,dt.type_name,de.sn,us.user_id,us.user_name,us.password,us.company
</sql>
<select id="getAllList" resultType="iot.sixiang.license.model.vo.DeviceTypeVo">
SELECT <include refid="DeviceTypeVoColumn"/> FROM device_type AS dt
JOIN device AS de ON dt.type_id = de.type_id
JOIN USER AS us ON de.user_id = us.user_id
</select>
<select id="getDeviceTypeList" resultType="iot.sixiang.license.model.vo.DeviceTypeVo">
SELECT <include refid="DeviceTypeVoColumn"/> FROM device_type AS dt
JOIN device AS de ON dt.type_id = de.type_id
JOIN USER AS us ON de.user_id = us.user_id
where 1=1
<if test="null != typeName and '' != typeName">
and type_name = #{typeName}
</if>
<if test="null != userId and '' != userId">
and us.user_id = #{userId}
</if>
LIMIT #{pageNo},#{pageSize}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment