Pu Zhibing
2025-04-01 8444084e6aa11efa23287e7f82474ac22378a5c4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.config.ArticleMapper">
 
    <update id="deleteArticleClass">
        UPDATE t_article SET class_id = null WHERE class_id = #{classId}
    </update>
 
    <select id="pageArticle" resultType="com.ruoyi.system.domain.vo.MgtArticlePageVo">
        SELECT
        ta.article_id articleId,
        tsc.class_name className,
        ta.article_sort articleSort,
        ta.article_introduce articleIntroduce,
        ta.article_title articleTitle,
        ta.article_cover articleCover,
        ta.create_time createTime
        FROM t_article ta
        LEFT JOIN t_sys_classification tsc ON tsc.class_id = ta.class_id
        WHERE ta.del_flag = 0
        <if test="param.articleTitle!=null and param.articleTitle!=''">
            AND ta.article_title LIKE CONCAT('%',#{param.articleTitle},'%')
        </if>
        <if test="param.createStartTime!=null and param.createStartTime!=''">
            AND Date(ta.create_time) &gt;= #{param.createStartTime}
        </if>
        <if test="param.createEndTime!=null and param.createEndTime!=''">
            AND Date(ta.create_time) &lt;= #{param.createEndTime}
        </if>
        ORDER BY ta.create_time DESC
    </select>
 
    <select id="listArticleByClass" resultType="com.ruoyi.system.domain.vo.AppArticlePageVo">
        SELECT
        ta.article_id articleId,
        ta.article_introduce articleIntroduce,
        ta.article_title articleTitle,
        ta.article_cover articleCover
        FROM t_article ta
        WHERE ta.del_flag = 0 AND ta.class_id = #{classId}
        ORDER BY ta.article_sort DESC
    </select>
</mapper>