无关风月
2024-07-03 f138375f15c072d10335c20ecec9b35f1da78ee4
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
<?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.study.mapper.TStoryMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.study.domain.TStory">
        <id column="id" property="id" />
        <result column="name" property="name" />
        <result column="english" property="english" />
        <result column="type" property="type" />
        <result column="state" property="state" />
        <result column="img" property="img" />
        <result column="right" property="right" />
        <result column="error" property="error" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, name, english, type, state, img, right, error
    </sql>
    <select id="listAll" resultType="com.ruoyi.study.vo.SubjectVO">
        select *
        from t_story
        where 1=1 and `state`!=3
        <if test="req.name != null and req.name != ''">
            and `name` like concat('%',#{req.name},'%')
        </if>
        <if test="req.english != null and req.english != ''">
            and english like concat('%',#{req.english},'%')
        </if>
        <if test="req.state != null">
            and `state` = #{req.state}
        </if>
        <if test="req.type != null and req.type != ''">
            and `type` like concat('%',#{req.type},'%')
        </if>
        order by createTime desc
    </select>
 
</mapper>