无关风月
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
48
49
50
51
52
53
54
55
56
57
58
<?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.TUserMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.study.domain.TUser">
        <id column="id" property="id" />
        <result column="name" property="name" />
        <result column="account" property="account" />
        <result column="phone" property="phone" />
        <result column="password" property="password" />
        <result column="openId" property="openId" />
        <result column="birthday" property="birthday" />
        <result column="gender" property="gender" />
        <result column="headImg" property="headImg" />
        <result column="integral" property="integral" />
        <result column="state" property="state" />
        <result column="insertTime" property="insertTime" />
        <result column="vipEndTime" property="vipEndTime" />
        <result column="vipPayTime" property="vipPayTime" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, name, account, phone, password, openId, birthday, gender, headImg, integral, state, insertTime, vipEndTime, vipPayTime, isBack, backTime
    </sql>
    <update id="updateOne">
        update t_user
        <set>
            vipEndTime = #{vipEndTime},
            vipPayTime = #{vipPayTime}
        </set>
        where id = #{id}
    </update>
    <select id="listAll" resultType="com.ruoyi.study.vo.AppUserVO">
        select *
        from t_user
        where 1=1
        <if test="req.name !=null and req.name!=''">
            AND name LIKE concat('%',#{req.name},'%')
        </if>
        <if test="req.phone !=null and req.phone!=''">
            AND phone LIKE concat('%',#{req.phone},'%')
        </if>
        <if test="req.state !=null ">
            AND state = #{req.state}
        </if>
        <if test="req.isVip !=null and req.isVip == 0 ">
            AND (isNull(vipEndTime) or vipEndTime &lt;= NOW())
        </if>
        <if test="req.isVip !=null and req.isVip == 1 ">
            AND (vipEndTime IS NOT NULL and vipEndTime &gt;= NOW())
        </if>
        and state!=3
        order by insertTime desc
    </select>
 
</mapper>