소스 검색

藏品列表查询

chenzhengming 2 년 전
부모
커밋
2204db358b

+ 6 - 18
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PostCollectionsController.java

@@ -5,6 +5,7 @@ import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.system.domain.PcscId;
+import com.ruoyi.system.domain.PostCollectionsSystem;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -38,27 +39,14 @@ public class PostCollectionsController extends BaseController
      */
     @ApiOperation("查询藏品列表")
     @PreAuthorize("@ss.hasPermi('system:collections:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(PostCollections postCollections)
+    @GetMapping(value = "/list/{id}")
+    public TableDataInfo list(@PathVariable("id") Long id)
     {
         startPage();
-        List<PostCollections> list = postCollectionsService.selectPostCollectionsList(postCollections);
+        List<PostCollections> list = postCollectionsService.selectPostCollectionsList(id);
         return getDataTable(list);
     }
 
-    /**
-     * 导出藏品列表
-     */
-    @ApiOperation("导入藏品")
-    @PreAuthorize("@ss.hasPermi('system:collections:export')")
-    @Log(title = "藏品", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, PostCollections postCollections)
-    {
-        List<PostCollections> list = postCollectionsService.selectPostCollectionsList(postCollections);
-        ExcelUtil<PostCollections> util = new ExcelUtil<PostCollections>(PostCollections.class);
-        util.exportExcel(response, list, "藏品数据");
-    }
 
     /**
      * 获取藏品详细信息
@@ -78,9 +66,9 @@ public class PostCollectionsController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:collections:add')")
     @Log(title = "藏品", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody PcscId pcscId)
+    public AjaxResult add(@RequestBody PostCollections postCollections)
     {
-        return toAjax(postCollectionsService.insertPostCollections(pcscId));
+        return toAjax(postCollectionsService.insertPostCollections((PcscId) postCollections));
     }
 
     /**

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PostCollectionsMapper.java

@@ -24,10 +24,10 @@ public interface PostCollectionsMapper
     /**
      * 查询藏品列表
      *
-     * @param postCollections 藏品
+     * @param id 藏品
      * @return 藏品集合
      */
-    public List<PostCollections> selectPostCollectionsList(PostCollections postCollections);
+    public List<PostCollections> selectPostCollectionsList(Long id);
 
     /**
      * 新增藏品

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/IPostCollectionsService.java

@@ -25,10 +25,10 @@ public interface IPostCollectionsService
     /**
      * 查询藏品列表
      *
-     * @param postCollections 藏品
+     * @param id 藏品
      * @return 藏品集合
      */
-    public List<PostCollections> selectPostCollectionsList(PostCollections postCollections);
+    public List<PostCollections> selectPostCollectionsList(Long id);
 
     /**
      * 新增藏品

+ 6 - 3
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PostCollectionsServiceImpl.java

@@ -39,13 +39,16 @@ public class PostCollectionsServiceImpl implements IPostCollectionsService
     /**
      * 查询藏品列表
      *
-     * @param postCollections 藏品
+     * @param id 藏品
      * @return 藏品
      */
     @Override
-    public List<PostCollections> selectPostCollectionsList(PostCollections postCollections)
+    public List<PostCollections> selectPostCollectionsList(Long id)
     {
-        return postCollectionsMapper.selectPostCollectionsList(postCollections);
+        //这个id是套系里的主键id
+        PostCollections postCollections = new PostCollections();
+        postCollections.setSystemId(id);
+        return postCollectionsMapper.selectPostCollectionsList(id);
     }
 
     /**

+ 5 - 14
ruoyi-system/src/main/resources/mapper/system/PostCollectionsMapper.xml

@@ -29,23 +29,14 @@
     <select id="selectPostCollectionsList" parameterType="PostCollections" resultMap="PostCollectionsResult">
         <include refid="selectPostCollectionsVo"/>
         <where>
-            <if test="systemId != null "> and system_id = #{systemId}</if>
-            <if test="issuerId != null "> and issuer_id = #{issuerId}</if>
-            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
-            <if test="startTime != null "> and start_time = #{startTime}</if>
-            <if test="endTime != null "> and end_time = #{endTime}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
-            <if test="collectionsNumber != null "> and collections_number = #{collectionsNumber}</if>
-            <if test="collectionsStory != null  and collectionsStory != ''"> and collections_story = #{collectionsStory}</if>
-            <if test="image != null  and image != ''"> and image = #{image}</if>
-            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
-            <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
+            <if test="systemId != null "> and system_id = #{id}</if>
+            and del_flag = '0'
         </where>
     </select>
 
     <select id="selectPostCollectionsById" parameterType="Long" resultMap="PostCollectionsResult">
         <include refid="selectPostCollectionsVo"/>
-        where id = #{id}
+        where id = #{id} and del_flag = '0'
     </select>
 
     <insert id="insertPostCollections" parameterType="PostCollections" useGeneratedKeys="true" keyProperty="id">
@@ -106,11 +97,11 @@
     </update>
 
     <delete id="deletePostCollectionsById" parameterType="Long">
-        delete from post_collections where id = #{id}
+        UPDATE  post_collections SET del_flag = '1'  WHERE del_flag = '0' AND (id = #{id})
     </delete>
 
     <delete id="deletePostCollectionsByIds" parameterType="String">
-        delete from post_collections where id in
+        UPDATE post_collections SET del_flag = '1'  WHERE del_flag = '0' AND id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>