linwe
2023-11-29 59e1a8ff7dfd9af5244ae5448d8af745a9720d13
src/main/java/org/springblade/modules/discuss/mapper/PublicDiscussMapper.xml
@@ -47,24 +47,22 @@
    <select id="selectPublicDiscussPage" resultMap="publicDiscussResultMap">
        select  id,
        title,
        open_flag,
        number_restrictions,
        vote_restrictions,
        user_restrictions,
        end_time,
        article_id,
        create_time,
        update_time,
        deleted_flag,
        repeat_vote,
        vote_number_public,
        appoint_user,
        user_ids,
        event_type,
        (SELECT count(1) FROM jczz_user_public_enroll where public_discuss_id = jpd.id) enrollCount,
        (SELECT count(1) from (SELECT * FROM jczz_user_topics WHERE public_discuss_id = jpd.id GROUP BY user_id ) a) topsCount
        select  jpd.id,
        jpd.title,
        jpd.open_flag,
        jpd.number_restrictions,
        jpd.vote_restrictions,
        jpd.user_restrictions,
        jpd.end_time,
        jpd.article_id,
        jpd.create_time,
        jpd.update_time,
        jpd.deleted_flag,
        jpd.repeat_vote,
        jpd.vote_number_public,
        jpd.appoint_user,
        jpd.user_ids,
        jpd.event_type
        from jczz_public_discuss jpd
        <where>
            <if test="publicDiscuss.id != null "> and id = #{publicDiscuss.id}</if>