无关风月
2025-04-11 75942ecc2e438012c5ea876715966ace593565a0
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
44
45
46
47
<?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.TSubjectMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.study.domain.TSubject">
        <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_subject
        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>
        <if test="null != req.ids and req.ids.size()>0" >
            and firstCategory in
            <foreach collection="req.ids" close=")" open="(" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        and disabled=0
        order by createTime desc
    </select>
 
</mapper>