linwe
2023-11-10 6b14cf7b6b0b53cbfcdec105a9984fd5b1a6778a
src/main/java/org/springblade/modules/notice/mapper/NoticesMapper.xml
@@ -3,7 +3,7 @@
<mapper namespace="org.springblade.modules.notice.mapper.NoticesMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="noticeResultMap" type="org.springblade.modules.notice.entity.NoticeEntity">
    <resultMap id="noticeResultMap" type="org.springblade.modules.notice.vo.NoticeVO">
        <result column="id" property="id"/>
        <result column="title" property="title"/>
        <result column="type" property="type"/>
@@ -22,11 +22,56 @@
        <result column="update_user" property="updateUser"/>
        <result column="create_user" property="createUser"/>
        <result column="is_deleted" property="isDeleted"/>
        <!--        <collection property="lickFlag" javaType="int"-->
        <!--                    column="id" select="selectStlLick">-->
        <!--        </collection>-->
        <collection property="countNumber" column="id" javaType="int" select="selectStlCount">
        </collection>
    </resultMap>
    <!--    <select id="selectStlLick" parameterType="Long" resultType="int">-->
    <!--        select IFNULL(jnl.id, 0) lickFlag-->
    <!--        FROM jczz_notice jn-->
    <!--                 LEFT JOIN jczz_notice_like jnl ON jn.id = jnl.notice_id-->
    <!--        WHERE jnl.notice_user_id = #{notice.userId}-->
    <!--          and jn.is_deleted = 0-->
    <!--          and jn.id = #{id}-->
    <!--    </select>-->
    <select id="selectStlCount" resultType="int">
        select count(1) countNumber
        FROM jczz_notice jn
                 LEFT JOIN jczz_notice_like jnl ON jn.id = jnl.notice_id
        where jn.is_deleted = 0
          and jnl.delete_flag = 0
          and jn.id = #{id}
    </select>
    <select id="selectNoticePage" resultMap="noticeResultMap">
        select * from jczz_notice where is_deleted = 0
        select id,
               title,
               type,
               url,
               video_url,
               source_id,
               source_name,
               article_type,
               recommend,
               publish,
               iscomment,
               view_number,
               create_time,
               update_time,
               update_user,
               create_user,
               is_deleted
        from jczz_notice
        where is_deleted = 0
          and publish = 1
    </select>