Browse Source

fix 修复应用的是精选,特色,玩转应用

杨兴卓 1 month ago
parent
commit
bcbd59063e

+ 5 - 0
xyzc-start/src/main/java/com/xyzc/start/domain/query/AppQuery.java

@@ -32,4 +32,9 @@ public class AppQuery {
      */
     @Range(min = 1, max = 3, message = "类型错误,请输入{min}到{max}之间的数")
     private Integer discoveryType;
+
+    /**
+     * 长度
+     */
+    private Integer length = 10;
 }

+ 3 - 1
xyzc-start/src/main/resources/mapper/WebStart/AppMapper.xml

@@ -34,14 +34,16 @@
                  LEFT JOIN sys_oss oss2 ON oss2.oss_id = am.ai_model_logo_oss_id
                  LEFT JOIN xy_base_user_collect buc ON app.id = buc.collect_id AND buc.type = 3
             AND buc.base_user_id = #{userId}
+                 LEFT JOIN xy_discover_app xda ON xda.app_id = app.id
         WHERE app.del_flag = '0'
+            AND xda.discover_app_type = #{appQuery.discoveryType}
         <if test="appQuery != null and appQuery.appName != null">
             AND app.app_name LIKE CONCAT('%',#{appQuery.appName},'%')
         </if>
         <if test="appQuery != null and appQuery.appId != null">
             AND app.id > #{appQuery.appId}
         </if>
-        LIMIT 10
+        LIMIT #{appQuery.length}
     </select>
 
 

+ 3 - 5
xyzc-start/src/main/resources/mapper/WebStart/DrawAssistantMapper.xml

@@ -17,11 +17,9 @@
         <if test="promptId != null">
             and xdp.id > #{promptId}
         </if>
-        <if test="keyword != null">
-            and xdp.prompt_name like concat('%',#{keyword},'%')
-        </if>
-        <if test="keyword != null">
-            OR xdp.prompt_name_en like concat('%',#{keyword},'%')
+        <if test="keyword != null and keyword != ''">
+            and  (xdp.prompt_name like concat('%',#{keyword},'%')
+            OR xdp.prompt_name_en like concat('%',#{keyword},'%'))
         </if>
         LIMIT #{length}
     </select>