洪城义警-正式版后台
zengh
2022-05-26 4c19ddd36bdfb43b5ef4e8df3c9a98cd4d356d6c
src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml
@@ -18,6 +18,36 @@
        <if test="article.endTime!=null and article.endTime!=''">
            and create_time&lt;=#{article.endTime}
        </if>
        <if test="article.publish!=null and article.publish!=''">
            and publish = #{article.publish}
        </if>
        <if test="article.articleType!=null and article.articleType!=''">
            and article_type like concat('%',#{article.articleType},'%')
        </if>
        <if test="article.keyword!=null and article.keyword!=''">
            AND CONCAT(title,source_name)
            LIKE CONCAT ('%', #{article.keyword},'%')
        </if>
        and iswords = "0"
        order by create_time desc
    </select>
    <!--查询资讯敏感词预警-->
    <select id="pageWords" resultType="org.springblade.modules.article.entity.Article">
        select * from sys_article
        where 1=1
        <if test="article.title!=null and article.title!=''">
            and title like concat('%',#{article.title},'%')
        </if>
        <if test="article.sourceName!=null and article.sourceName!=''">
            and source_name like concat('%',#{article.sourceName},'%')
        </if>
        <if test="article.startTime!=null and article.startTime!=''">
            and create_time&gt;=#{article.startTime}
        </if>
        <if test="article.endTime!=null and article.endTime!=''">
            and create_time&lt;=#{article.endTime}
        </if>
        <if test="article.articleType!=null and article.articleType!=''">
            and article_type = #{article.articleType}
        </if>
@@ -25,6 +55,7 @@
            AND CONCAT(title,source_name)
            LIKE CONCAT ('%', #{article.keyword},'%')
        </if>
        and iswords = "1"
        order by create_time desc
    </select>
@@ -42,6 +73,7 @@
        <if test="(article.rolename==null and article.rolename=='') or (article.rolename!='administrator' and article.rolename!='policeAdmin')">
            AND publish = 1
        </if>
        and iswords = "0"
        order by create_time desc
    </select>
@@ -64,6 +96,7 @@
        <if test="(article.rolename==null and article.rolename=='') or (article.rolename!='administrator' and article.rolename!='policeAdmin')">
            AND publish = 1
        </if>
        and iswords = "0"
        order by create_time desc
    </select>
@@ -127,6 +160,7 @@
        <if test="(article.rolename==null and article.rolename=='') or (article.rolename!='administrator' and article.rolename!='policeAdmin')">
            AND publish = 1
        </if>
        and iswords = "0"
        order by create_time desc
    </select>
@@ -191,6 +225,7 @@
        <if test="(article.rolename==null and article.rolename=='') or (article.rolename!='administrator' and article.rolename!='policeAdmin')">
            AND publish = 1
        </if>
        and iswords = "0"
        order by create_time desc
    </select>
@@ -198,4 +233,34 @@
        update sys_article set iscomment = #{type}
        where id in(${ids})
    </update>
    <!--个人资讯-->
    <select id="selectArticleG" resultType="org.springblade.modules.article.entity.Article">
        select * from sys_article
        where 1=1
        <if test="article.title!=null and article.title!=''">
            and title like concat('%',#{article.title},'%')
        </if>
        <if test="article.sourceName!=null and article.sourceName!=''">
            and source_name like concat('%',#{article.sourceName},'%')
        </if>
        <if test="article.startTime!=null and article.startTime!=''">
            and create_time&gt;=#{article.startTime}
        </if>
        <if test="article.endTime!=null and article.endTime!=''">
            and create_time&lt;=#{article.endTime}
        </if>
        <if test="article.articleType!=null and article.articleType!=''">
            and article_type = #{article.articleType}
        </if>
        <if test="article.keyword!=null and article.keyword!=''">
            AND CONCAT(title,source_name)
            LIKE CONCAT ('%', #{article.keyword},'%')
        </if>
        <if test="(article.rolename==null and article.rolename=='') or (article.rolename!='administrator' and article.rolename!='policeAdmin')">
            AND publish = 1
        </if>
        and iswords = "0" and type!=1
        order by create_time desc
    </select>
</mapper>