mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 17:05:55 +08:00
设备删除优化
This commit is contained in:
@@ -447,11 +447,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select count(*) from iot_device where serial_number = #{deviceNum}
|
||||
</select>
|
||||
|
||||
<delete id="deleteDeviceGroupByDeviceId" parameterType="com.ruoyi.iot.model.UserIdAndDeviceIdModel">
|
||||
<delete id="deleteDeviceGroupByDeviceId" parameterType="com.ruoyi.iot.model.UserIdDeviceIdModel">
|
||||
delete from iot_device_group
|
||||
<where>
|
||||
<if test="1==1"> and device_id = #{deviceId}</if>
|
||||
<if test="userId != null">user_id = #{userId}</if>
|
||||
<if test="userId != null"> and group_id in(select group_id from iot_group where user_id = #{userId})</if>
|
||||
</where>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -104,11 +104,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where device_id = #{deviceId} and user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDeviceUserByDeviceId" parameterType="com.ruoyi.iot.model.UserIdAndDeviceIdModel">
|
||||
<delete id="deleteDeviceUserByDeviceId" parameterType="com.ruoyi.iot.model.UserIdDeviceIdModel">
|
||||
delete from iot_device_user
|
||||
<where>
|
||||
<if test="1==1"> and device_id = #{deviceId}</if>
|
||||
<if test="userId != null">user_id = #{userId}</if>
|
||||
<if test="userId != null"> and user_id = #{userId}</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user