Browse Source

套系逻辑删除1.0

sjx 2 years ago
parent
commit
495ea530ef

+ 5 - 3
ruoyi-system/src/main/resources/mapper/system/PostCollectionsSystemMapper.xml

@@ -38,12 +38,13 @@
             <if test="giftExchange != null "> and gift_exchange = #{giftExchange}</if>
             <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
             <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
+        and del_flag = '0'
         </where>
     </select>
 
     <select id="selectPostCollectionsSystemById" parameterType="Long" resultMap="PostCollectionsSystemResult">
         <include refid="selectPostCollectionsSystemVo"/>
-        where id = #{id}
+        where id = #{id} and del_flag = '0'
     </select>
 
     <insert id="insertPostCollectionsSystem" parameterType="PostCollectionsSystem" useGeneratedKeys="true" keyProperty="id">
@@ -101,11 +102,11 @@
     </update>
 
     <delete id="deletePostCollectionsSystemById" parameterType="Long">
-        delete from post_collections_system where id = #{id}
+        UPDATE  post_collections_system SET del_flag = '1'  WHERE del_flag = '0' AND (id = #{id})
     </delete>
 
     <delete id="deletePostCollectionsSystemByIds" parameterType="String">
-        delete from post_collections_system where id in
+        UPDATE post_collections_system SET del_flag = '1'  WHERE del_flag = '0' AND id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
@@ -117,6 +118,7 @@
         <where>
             <if test="title != null  and title != ''"> and name LIKE '%${title}%'</if>
             <if test="timeLeft != null and timeRight != null "> and create_time between #{timeLeft} AND #{timeRight}</if>
+            and del_flag = '0'
         </where>
     </select>