linwe
2023-12-23 55d677758efadb6d42e6d4e595cecc2c50c20d5a
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>
@@ -127,9 +125,9 @@
        jpd.appoint_user,
        jpd.user_ids,
        jpd.event_type,
        jupe.user_id userId
        (SELECT user_id from jczz_user_public_enroll where user_id = #{userId} and public_discuss_id = jpd.id)userId
        from
        jczz_public_discuss jpd LEFT JOIN jczz_user_public_enroll jupe on  jupe.public_discuss_id = jpd.id
        jczz_public_discuss jpd
        <where>
            <if test="id != null "> and jpd.id = #{id}</if>
        </where>