Browse Source

发行方逻辑删除以及查询的修改

huianan 2 years ago
parent
commit
501f728902
1 changed files with 21 additions and 15 deletions
  1. 21 15
      ruoyi-post/src/main/resources/mapper/PostPublisherMapper.xml

+ 21 - 15
ruoyi-post/src/main/resources/mapper/PostPublisherMapper.xml

@@ -30,13 +30,9 @@
                publisher_phonenumber,
                status,
                publisher_address,
-               del_flag,
-               create_by,
-               create_time,
-               update_by,
-               update_time,
-               remark
+               del_flag
         from post_publisher
+        where del_flag = '0'
     </sql>
     <!--查询发行方列表-->
     <select id="selectPostPublisherList" parameterType="PostPublisher" resultMap="PostPublisherResult">
@@ -60,7 +56,7 @@
     <!--查询单个用户-->
     <select id="selectPostPublisherByPublisherId" parameterType="Long" resultMap="PostPublisherResult">
         <include refid="selectPostPublisherVo"/>
-        where publisher_id = #{publisherId}
+        and publisher_id = #{publisherId}
     </select>
     <!--添加发行方信息-->
     <insert id="insertPostPublisher" parameterType="PostPublisher" useGeneratedKeys="true" keyProperty="publisherId">
@@ -118,23 +114,33 @@
     </update>
     <!--发行方ID删除-->
     <delete id="deletePostPublisherByPublisherId" parameterType="Long">
-        delete
-        from post_publisher
-        where publisher_id = #{publisherId}
+        --         delete
+--         from post_publisher
+--         where publisher_id = #{publisherId}
+        update post_publisher
+        set del_flag = '1'
+        where user_id = #{userId}
     </delete>
     <!--批量删除-->
     <delete id="deletePostPublisherByPublisherIds" parameterType="String">
-        delete from post_publisher where publisher_id in
+        -- delete from post_publisher where publisher_id in
+        update post_publisher
+        set del_flag = '1'
+        where publisher_id in
         <foreach item="publisherId" collection="array" open="(" separator="," close=")">
             #{publisherId}
         </foreach>
     </delete>
-<!--    账号是否重复-->
+    <!--    账号是否重复-->
     <select id="checkPublisherNameUnique" parameterType="String" resultMap="PostPublisherResult">
-        select publisher_id,publisher_name from post_publisher where publisher_name = #{publisherName} limit 1
+        select publisher_id, publisher_name
+        from post_publisher
+        where publisher_name = #{publisherName} limit 1
     </select>
-<!--    头像是否重复-->
+    <!--    头像是否重复-->
     <select id="checkImageUnique" parameterType="String" resultMap="PostPublisherResult">
-        select publisher_id, publisher_image from post_publisher where publisher_image = #{publisherImage} limit 1
+        select publisher_id, publisher_image
+        from post_publisher
+        where publisher_image = #{publisherImage} limit 1
     </select>
 </mapper>