Procházet zdrojové kódy

修改事项收藏和事项列表显示

conghelong před 1 rokem
rodič
revize
30e71a9e97

+ 3 - 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/matter/collectConller.java

@@ -44,13 +44,9 @@ public class collectConller extends BaseController {
     }
 
 
-    /**
-     * 获取事项详细信息
-     */
-    @GetMapping(value = "/lists/{id}")
-    public AjaxResult getInfo(@PathVariable("id") String id)
-    {
-        return success(collectService.selectcollect(id));
+    @GetMapping(value = "/lists")
+    public AjaxResult getInfo( Collect collect) {
+        return success(collectService.selectcollect(collect));
     }
 
     /**

+ 1 - 1
sooka-jnb/src/main/java/com/sooka/jnb/matter/mapper/CollectMapper.java

@@ -15,7 +15,7 @@ public interface CollectMapper {
     /**
      * 获取收藏事项详细信息
      */
-    Collect selectcollect(String id);
+    Collect selectcollect(Collect collect);
 
     /**
      * 获取事项详细信息

+ 1 - 1
sooka-jnb/src/main/java/com/sooka/jnb/matter/service/CollectService.java

@@ -16,7 +16,7 @@ public interface CollectService {
     /**
      * 获取收藏事项详细信息
      */
-    Collect selectcollect(String id);
+    Collect selectcollect(Collect collect);
 
 
     /**

+ 2 - 2
sooka-jnb/src/main/java/com/sooka/jnb/matter/service/impl/CollectServicempl.java

@@ -32,9 +32,9 @@ public class CollectServicempl  implements CollectService {
      * 获取收藏事项详细信息
      */
     @Override
-    public Collect selectcollect(String id)
+    public Collect selectcollect(Collect collect)
     {
-        return collectMapper.selectcollect(id);
+        return collectMapper.selectcollect(collect);
     }
 
 

+ 8 - 1
sooka-jnb/src/main/resources/mapper/matter/collectMapper.xml

@@ -19,7 +19,14 @@
 
     <select id="selectcollect"  resultMap="CollectResult">
        select  user_id, matter_id  from jnb_list_user_favorites
-        where user_id = #{id}
+        <where>
+            <if test="userId != null and userId !=''">
+                AND user_id = #{userId}
+            </if>
+            <if test="matterId != null and matterId !=''">
+                AND matter_id = #{matterId}
+            </if>
+        </where>
     </select>
 
     <select id="collectlist"  resultMap="CollectResult">

+ 9 - 4
sooka-jnb/src/main/resources/mapper/matter/matterMapper.xml

@@ -23,14 +23,17 @@
 
 
     <select id="selectSysMatterVo"  resultMap="MatterResult">
-        select  id,title, type, department,operation,address,phone,picture,examine ,content ,create_by,create_time,update_by,update_time from jnb_list_of_matters
+        SELECT
+        id, title, type, department, operation, address, phone, picture,
+        examine, content, create_by, create_time, update_by, update_time
+        FROM
+        jnb_list_of_matters
         <where>
-
             <if test="title != null and title !=''">
-                AND title LIKE   concat('%', #{title}, '%')
+                AND title LIKE CONCAT('%', #{title}, '%')
             </if>
             <if test="examine != null and examine !=''">
-                AND examine LIKE   concat('%', #{examine}, '%')
+                AND examine LIKE CONCAT('%', #{examine}, '%')
             </if>
             <if test="department != null and department !=''">
                 AND department = #{department}
@@ -39,6 +42,8 @@
                 AND type = #{type}
             </if>
         </where>
+        ORDER BY create_time DESC
+
     </select>
 
     <select id="selectSysrecommendVo"  resultMap="MatterResult">