0
0

设备所属分组

This commit is contained in:
2025-10-11 09:04:48 +08:00
parent 7b8c626cb6
commit 04a21567aa
3 changed files with 11 additions and 4 deletions

View File

@ -17,10 +17,7 @@ import org.springframework.stereotype.Component;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.time.Duration; import java.time.Duration;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.fuyuanshen.common.core.constant.GlobalConstants.FUNCTION_ACCESS_KEY; import static com.fuyuanshen.common.core.constant.GlobalConstants.FUNCTION_ACCESS_KEY;
import static com.fuyuanshen.common.core.constant.GlobalConstants.GLOBAL_REDIS_KEY; import static com.fuyuanshen.common.core.constant.GlobalConstants.GLOBAL_REDIS_KEY;
@ -42,6 +39,12 @@ public class XinghanSendMsgRule implements MqttMessageRule {
@Override @Override
public String getCommandType() { public String getCommandType() {
List<Integer> list = Arrays.asList(1, 2, 3, 4, 5);
// 三种等价的写法
Integer[] array1 = list.toArray(new Integer[0]);
Integer[] array2 = list.toArray(size -> new Integer[size]);
return XingHanCommandTypeConstants.XingHan_ESEND_MSG; return XingHanCommandTypeConstants.XingHan_ESEND_MSG;
} }

View File

@ -105,6 +105,7 @@ public class DeviceQueryCriteria extends BaseEntity {
/** /**
* 设备所属分组 * 设备所属分组
* group_id
*/ */
private Long groupId; private Long groupId;

View File

@ -140,6 +140,9 @@
<if test="criteria.deviceStatus != null"> <if test="criteria.deviceStatus != null">
and d.device_status = #{criteria.deviceStatus} and d.device_status = #{criteria.deviceStatus}
</if> </if>
<if test="criteria.groupId != null">
and d.group_id = #{criteria.groupId}
</if>
<if test="criteria.currentOwnerId != null"> <if test="criteria.currentOwnerId != null">
and d.current_owner_id = #{criteria.currentOwnerId} and d.current_owner_id = #{criteria.currentOwnerId}
</if> </if>