Selaa lähdekoodia

修改应用&业务 收藏分页

yonghuifan 1 vuosi sitten
vanhempi
sitoutus
c83ffae027

+ 6 - 1
src/main/java/com/dragon/tj/portal/entity/AppInfo.java

@@ -1,6 +1,7 @@
 package com.dragon.tj.portal.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Getter;
@@ -102,5 +103,9 @@ public class AppInfo implements Serializable {
      */
     private Long star;
 
-
+    /*
+     * 排序
+     */
+    @TableField(exist = false)
+    private int seq;
 }

+ 6 - 0
src/main/java/com/dragon/tj/portal/entity/BusinessInfo.java

@@ -91,4 +91,10 @@ public class BusinessInfo {
      * 收藏数量
      */
     private Long star;
+
+    /*
+     * 排序
+     */
+    @TableField(exist = false)
+    private int seq;
 }

+ 12 - 13
src/main/resources/mapper/BusinessMapper.xml

@@ -5,20 +5,19 @@
 
     <select id="getInstalledApp" resultType="com.dragon.tj.portal.entity.BusinessInfo">
         select * from business_info t1
-        where t1.del_flag = 0
-        and t1.id in  (
-            select business_id from install_info t2
-            <where>
-                business_id != 0
-                <if test="map.idcard != null and map.idcard != ''">
-                    and t2.user_idcard = #{map.idcard}
-                </if>
-                <if test="map.delFlag != null">
-                    and t2.del_flag = #{map.delFlag}
-                </if>
-            </where>
+        right join install_info t2 on t1.id = t2.business_id
+        <where>
+            t1.del_flag = 0
+            and t2.business_id != 0
+            <if test="map.idcard != null and map.idcard != ''">
+                and t2.user_idcard = #{map.idcard}
+            </if>
+            <if test="map.delFlag != null">
+                and t2.del_flag = #{map.delFlag}
+            </if>
+        </where>
 
-        )
+        order by t2.seq desc
     </select>
 
 

+ 13 - 14
src/main/resources/mapper/app/AppInfoMapper.xml

@@ -30,20 +30,19 @@
 
     <select id="getInstalledApp" resultType="com.dragon.tj.portal.entity.AppInfo">
         select * from app_info t1
-        where t1.del_flag = 0
-        and t1.id in  (
-            select app_id from install_info t2
-            <where>
-                business_id = 0
-                <if test="map.idcard != null and map.idcard != ''">
-                    and t2.user_idcard = #{map.idcard}
-                </if>
-                <if test="map.delFlag != null">
-                    and t2.del_flag = #{map.delFlag}
-                </if>
-            </where>
-
-        )
+        right join install_info t2 on t1.id = t2.app_id
+        <where>
+            t2.business_id = 0
+            <if test="map.idcard != null and map.idcard != ''">
+                and t2.user_idcard = #{map.idcard}
+            </if>
+            <if test="map.delFlag != null">
+                and t2.del_flag = #{map.delFlag}
+            </if>
+        </where>
+
+        order by t2.seq desc
+
     </select>