Explorar o código

配件分类,查询修改

xiewenjie %!s(int64=3) %!d(string=hai) anos
pai
achega
fdbe34b26f

+ 5 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/impl/CustomComponentServiceImpl.java

@@ -87,6 +87,11 @@ public class CustomComponentServiceImpl extends BaseServiceImpl<ICustomComponent
         if (ObjectUtil.isNotNull(param.getIsShow())) {
             wrapper.eq(CustomComponentEntity::getIsShow, param.getIsShow());
         }
+        List<Long> componentClassifyIds = componentClassifyService.list(
+                Wrappers.<CustomComponentClassifyEntity>lambdaQuery().eq(CustomComponentClassifyEntity::getIsShow, 1)).stream().map(CustomComponentClassifyEntity::getId).distinct().collect(Collectors.toList());
+        if (ObjectUtil.isNotNull(componentClassifyIds)) {
+            wrapper.in(CustomComponentEntity::getComponentTypeId, componentClassifyIds);
+        }
         param.setSortBy("desc");
         return super.listByPage(param, wrapper);
     }

+ 8 - 5
sxz-modules/src/main/java/com/fdkk/sxz/entity/custuom/CustomComponentClassifyEntity.java

@@ -1,13 +1,11 @@
 package com.fdkk.sxz.entity.custuom;
 
-import lombok.Data;
-import com.fdkk.sxz.entity.BaseEntity;
-import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fdkk.sxz.entity.BaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 
 /**
@@ -28,6 +26,11 @@ public class CustomComponentClassifyEntity extends BaseEntity {
     @TableField("name")
     @ApiModelProperty(value = "分类", name = "name")
     private String name;
-
+    /**
+     * 是否显示
+     */
+    @TableField("is_show")
+    @ApiModelProperty(value = "0不显示,1显示", name = "isShow")
+    private int isShow;
 
 }