dengsixing 1 месяц назад
Родитель
Сommit
a241fda2b7

+ 2 - 2
src/main/java/com/project/hyb/biz/service/impl/MbArtArtworksServiceImpl.java

@@ -171,8 +171,8 @@ public class MbArtArtworksServiceImpl extends ServiceImpl<MbArtArtworksMapper, M
         Map<String, List<String>> result = new HashMap<>();
         result.put("category", this.getBaseMapper().listCategory().stream().filter(v->StrUtil.isNotEmpty(v)).collect(Collectors.toList()));
         result.put("grade", grades);
-        result.put("texture", this.getBaseMapper().listTexture());
-        result.put("agetype", this.getBaseMapper().listAgetype());
+        result.put("texture", this.getBaseMapper().listTexture().stream().filter(v->StrUtil.isNotEmpty(v)).collect(Collectors.toList()));
+        result.put("agetype", this.getBaseMapper().listAgetype().stream().filter(v->StrUtil.isNotEmpty(v)).collect(Collectors.toList()));
         return result;
     }
 }

+ 4 - 3
src/main/resources/mapper/biz/MbArtArtworksMapper.xml

@@ -34,15 +34,13 @@
         <if test="agetype != null and agetype != ''">
             and (
                 agetype1 = #{agetype}
-<!--                or agetype2 = #{agetype} -->
-<!--                or agetype3 = #{agetype} -->
-<!--                or agetype4 = #{agetype}-->
             )
         </if>
         <if test="searchText != null and searchText != ''">
             and name like concat('%', #{searchText}, '%')
         </if>
         <if test="orderBy != null and orderBy == 'grade'">
+            and grade is not null and grade != ''
             ORDER BY FIELD(grade,
             <foreach collection="orderbyList" item="item" separator=",">
                 #{item}
@@ -50,6 +48,7 @@
            )
         </if>
         <if test="orderBy != null and orderBy == 'category'">
+            and category is not null and category != ''
             ORDER BY FIELD(category,
             <foreach collection="orderbyList" item="item" separator=",">
                 #{item}
@@ -57,6 +56,7 @@
             )
         </if>
         <if test="orderBy != null and orderBy == 'texture'">
+            and texture is not null and texture != ''
             ORDER BY FIELD(texture,
             <foreach collection="orderbyList" item="item" separator=",">
                 #{item}
@@ -64,6 +64,7 @@
             )
         </if>
         <if test="orderBy != null and orderBy == 'agetype'">
+            and agetype is not null and agetype != ''
             ORDER BY FIELD(agetype,
             <foreach collection="orderbyList" item="item" separator=",">
                 #{item}