huanghongfa
2021-09-02 1a912819dfedad2ca9f2f31522db9b3f58a30716
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActNeighborCircleTopicDOMapper.xml
@@ -10,11 +10,13 @@
        <result column="status" property="status" />
        <result column="create_at" property="createAt" />
        <result column="create_by" property="createBy" />
        <result column="count" property="count" />
        <result column="hot_num" property="hotNum" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, community_id, name, status, create_at, create_by
        id, community_id, name, status, create_at, create_by, count, hot_num
    </sql>
    <select id="pageNeighborTopicByAdmin" parameterType="com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleTopicAdminDTO"
@@ -43,6 +45,18 @@
    </select>
    <select id="getNeighborTopicByApp" resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleTopicAppVO">
        select id,`name` from com_act_neighbor_circle_topic where `status` = 1 and community_id = #{communityId}
        select id,`name`,hot_num,`count` from com_act_neighbor_circle_topic where `status` = 1 and community_id = #{communityId}
        <if test="isZero != null and isZero == 1">
            and `count` > 0
        </if>
        order by hot_num desc
    </select>
    <update id="addHotNum">
        update com_act_neighbor_circle_topic set hot_num = hot_num + #{hotNum} where id = #{circleTopicId}
    </update>
    <update id="addCount">
        update com_act_neighbor_circle_topic set `count` = `count` + 1 where id = #{circleTopicId}
    </update>
</mapper>