Эх сурвалжийг харах

藏品以及套系的逻辑删除和查询的修改

zhangxin 2 жил өмнө
parent
commit
fcf71b782e

+ 9 - 8
ruoyi-post/src/main/resources/mapper/PostCollectionMapper.xml

@@ -44,7 +44,7 @@
     <select id="selectPostCollectionList" parameterType="PostCollection" resultMap="PostCollectionResult">
         <include refid="selectPostCollectionVo"/>
         <where>
-            and del_flag = 0
+            and del_flag = '0'
             <if test="collectionName != null  and collectionName != ''">and collection_name like concat('%',
                 #{collectionName}, '%')
             </if>
@@ -123,16 +123,17 @@
         where collection_id = #{collectionId}
     </update>
     <!--ID删除藏品-->
-    <delete id="deletePostCollectionByCollectionId" parameterType="Long">
-        delete
-        from post_collection
+    <update id="deletePostCollectionByCollectionId" parameterType="Long">
+        update
+        post_collection
+        set del_flag = '1'
         where collection_id = #{collectionId}
-    </delete>
+    </update>
     <!--批量删除-->
-    <delete id="deletePostCollectionByCollectionIds" parameterType="String">
-        delete from post_collection where collection_id in
+    <update id="deletePostCollectionByCollectionIds" parameterType="String">
+        update  post_collection  set del_flag = '1'  where collection_id in
         <foreach item="collectionId" collection="array" open="(" separator="," close=")">
             #{collectionId}
         </foreach>
-    </delete>
+    </update>
 </mapper>

+ 8 - 8
ruoyi-post/src/main/resources/mapper/PostSeriesMapper.xml

@@ -40,7 +40,7 @@
     <select id="selectPostSeriesList" parameterType="PostSeries" resultMap="PostSeriesResult">
         <include refid="selectPostSeriesVo"/>
         <where>
-            and del_flag = 0
+            and del_flag = '0'
             <if test="seriesName != null  and seriesName != ''">and series_name like concat('%', #{seriesName}, '%')
             </if>
             <if test="collectionCounts != null ">and collection_counts = #{collectionCounts}</if>
@@ -107,16 +107,16 @@
         where series_id = #{seriesId}
     </update>
     <!--删除套系ID-->
-    <delete id="deletePostSeriesBySeriesId" parameterType="Long">
-        delete
-        from post_series
+    <update id="deletePostSeriesBySeriesId" parameterType="Long">
+        update post_series
+        set del_flag = '1'
         where series_id = #{seriesId}
-    </delete>
+    </update>
     <!--批量删除-->
-    <delete id="deletePostSeriesBySeriesIds" parameterType="String">
-        delete from post_series where series_id in
+    <update id="deletePostSeriesBySeriesIds" parameterType="String">
+        update  post_series  set del_flag = '1'  where series_id in
         <foreach item="seriesId" collection="array" open="(" separator="," close=")">
             #{seriesId}
         </foreach>
-    </delete>
+    </update>
 </mapper>