|
|
|
@ -52,8 +52,7 @@ public class IotVisualGroupServiceImpl extends BaseServiceImpl<IotVisualGroupMap |
|
|
|
public QueryWrapper getWrapper(Map<String, Object> params){ |
|
|
|
Long tenantCode = UserContext.getTenantCode(); |
|
|
|
QueryWrapper wrapper = new QueryWrapper(); |
|
|
|
String name = MapUtils.getString(params,"name"); |
|
|
|
String names = MapUtils.getString(params,"names"); |
|
|
|
String names = MapUtils.getString(params,"name"); |
|
|
|
List<String> nameList = null; |
|
|
|
if(StringUtils.isNotEmpty(names)){ |
|
|
|
nameList = Arrays.asList(names.split(",")); |
|
|
|
@ -61,9 +60,12 @@ public class IotVisualGroupServiceImpl extends BaseServiceImpl<IotVisualGroupMap |
|
|
|
String businessName = MapUtils.getString(params,"businessName"); |
|
|
|
wrapper.eq(IotVisualGroupEntity::getType,MapUtils.getString(params,"type")); |
|
|
|
wrapper.and(IOT_VISUAL_GROUP_ENTITY.TENANT_CODE.eq(tenantCode).or(IOT_VISUAL_GROUP_ENTITY.IS_DEFAULT.eq("1"))); |
|
|
|
wrapper.like(IotVisualGroupEntity::getName,name, StringUtils.isNotEmpty(name)); |
|
|
|
wrapper.like(IotVisualGroupEntity::getBusinessName,businessName, StringUtils.isNotEmpty(businessName)); |
|
|
|
wrapper.in(IotVisualGroupEntity::getName,nameList,ObjectUtils.isNotEmpty(nameList)); |
|
|
|
if(null!=nameList&&nameList.size()!=1){ |
|
|
|
wrapper.in(IotVisualGroupEntity::getName,nameList,ObjectUtils.isNotEmpty(nameList)); |
|
|
|
}else if(null != nameList) { |
|
|
|
wrapper.like(IotVisualGroupEntity::getName,nameList.get(0), StringUtils.isNotEmpty(nameList.get(0))); |
|
|
|
} |
|
|
|
wrapper.orderBy(IotVisualGroupEntity::getSort,true); |
|
|
|
wrapper.orderBy(IotVisualGroupEntity::getBsSort,true); |
|
|
|
return wrapper; |
|
|
|
|