|
...
|
...
|
@@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<result property="create_time" column="create_time" />
|
|
|
|
<result property="sensor_number" column="sensor_number" />
|
|
|
|
<result property="sys_user_id" column="sys_user_id" />
|
|
|
|
<result property="order_by" column="order_by" />
|
|
|
|
<association property="userTerminalGroupRelation" column="id" javaType="UserTerminalGroupRelation" resultMap="userTerminalGroupRelationResult" />
|
|
|
|
<association property="iotDevice" column="device_id" javaType="IotDevice" resultMap="iotDeviceResult" />
|
|
|
|
</resultMap>
|
|
...
|
...
|
@@ -96,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
${params.dataScope}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
order by a.create_time desc
|
|
|
|
order by a.create_time desc,a.order_by asc
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectIotTerminalListByUserId" parameterType="IotTerminal" resultMap="IotTerminalResult">
|
|
...
|
...
|
@@ -139,6 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="mqtt_username != null">mqtt_username,</if>
|
|
|
|
<if test="data_update_time != null">data_update_time,</if>
|
|
|
|
<if test="sys_user_id != null and sys_user_id != ''">sys_user_id,</if>
|
|
|
|
<if test="order_by != null and order_by != ''">order_by,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="device_id != null">#{device_id},</if>
|
|
...
|
...
|
@@ -151,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="mqtt_username != null">#{mqtt_username},</if>
|
|
|
|
<if test="data_update_time != null">#{data_update_time},</if>
|
|
|
|
<if test="sys_user_id != null">#{sys_user_id},</if>
|
|
|
|
<if test="order_by != null">#{order_by},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
...
|
...
|
@@ -166,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="mqtt_username != null">mqtt_username = #{mqtt_username},</if>
|
|
|
|
<if test="data_update_time != null">data_update_time = #{data_update_time},</if>
|
|
|
|
<if test="sys_user_id != null">sys_user_id = #{sys_user_id},</if>
|
|
|
|
<if test="order_by != null">order_by = #{order_by},</if>
|
|
|
|
</trim>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
...
|
...
|
@@ -185,7 +189,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
<select id="selectNotUserIotTerminalListByImei" parameterType="String" resultMap="IotTerminalResult">
|
|
|
|
SELECT a.* FROM `iot_terminal` a LEFT JOIN `user_terminal_group_relation` b ON a.`id`=b.`iot_terminal_id` WHERE b.user_info_id is null AND a.`device_id`= #{device_id}
|
|
|
|
SELECT a.* FROM `iot_terminal` a LEFT JOIN `user_terminal_group_relation` b ON a.`id`=b.`iot_terminal_id` WHERE b.user_info_id is null AND a.`device_id`= #{device_id} ORDER BY `order_by` ASC
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|