liujie
2023-09-20 d09828cdec78a160f4530a8ab245216ed8671c27
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
59
60
61
62
63
64
65
66
67
68
69
70
<?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.dsh.account.mapper.TAppUserMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.dsh.account.entity.TAppUser">
        <id column="id" property="id" />
        <result column="code" property="code" />
        <result column="name" property="name" />
        <result column="phone" property="phone" />
        <result column="password" property="password" />
        <result column="birthday" property="birthday" />
        <result column="gender" property="gender" />
        <result column="height" property="height" />
        <result column="weight" property="weight" />
        <result column="bmi" property="bmi" />
        <result column="idCard" property="idCard" />
        <result column="openid" property="openid" />
        <result column="province" property="province" />
        <result column="provinceCode" property="provinceCode" />
        <result column="city" property="city" />
        <result column="cityCode" property="cityCode" />
        <result column="isVip" property="isVip" />
        <result column="vipEndTime" property="vipEndTime" />
        <result column="viplevelId" property="viplevelId" />
        <result column="referralUserId" property="referralUserId" />
        <result column="salesmanUserId" property="salesmanUserId" />
        <result column="state" property="state" />
        <result column="integral" property="integral" />
        <result column="playPaiCoins" property="playPaiCoins" />
        <result column="headImg" property="headImg" />
    </resultMap>
 
 
 
    <update id="membershipEnd">
        update t_app_user set isVip = 0 where isVip = 1 and now() >= vipEndTime
    </update>
    <select id="listAll" resultType="com.dsh.account.model.vo.QueryAppUserVO">
        select t1.* from t_app_user t1
        <where>
            <if test="query.city!=null and query.city!= ''">
                and t1.city = #{query.city}
            </if>
            <if test="query.province!=null and query.province!= ''">
                and t1.province = #{query.province}
            </if>
            <if test="query.name!=null and query.name!= ''">
                AND t1.name LIKE concat('%',#{query.name},'%')
            </if>
            <if test="query.phone!=null and query.phone!= ''">
                and t1.phone LIKE concat('%',#{query.phone},'%')
            </if>
            <if test="query.isVip!=null and query.isVip!= ''">
                and t1.isVip = #{query.isVip}
            </if>
            and t1.state != 3
        </where>
    </select>
    <select id="getSelects" resultType="com.dsh.account.dto.SelectDto">
        SELECT ts.id ,ts.`name` as value
        FROM t_student ts
        <where>
            ts.id in
            <foreach collection="studentIds" item="id" index="index" open="(" close=")" separator=",">
                #{id}
            </foreach>
        </where>
    </select>
</mapper>