liujie
2023-07-25 9b1188a004df6585d1836e85e22ee24a91b5fd62
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
<?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.course.mapper.TbUserExitMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.dsh.guns.modular.system.model.TbUserExit">
        <id column="id" property="id"/>
        <result column="insertTime" property="insertTime"/>
        <result column="userId" property="userId"/>
        <result column="balance" property="balance"/>
        <result column="remark" property="remark"/>
        <result column="state" property="state"/>
        <result column="userName" property="userName"/>
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
    id,
insertTime,
userId,
balance,
remark,
state
 
 
    </sql>
    <update id="updatestate">
        update t_user_exit set state =2 where id=#{id}
    </update>
    <select id="getList" resultType="com.dsh.guns.modular.system.model.TbUserExit">
        select * from t_user_exit where 1=1
        <if test="sTime !=null and sTime !=''">
            and insertTime between #{sTime} and #{eTime}
        </if>
        <if test="state !=null and state !=''">
            and state =#{state}
        </if>
        <if test="name !=null and name !=''">
            and userName like concat("%",#{name},"%")
        </if>
    </select>
    <select id="getList1" resultType="com.dsh.guns.modular.system.model.TbUserExit">
        select * from t_user_exit where 1=1
        <if test="sTime !=null and sTime !=''">
            and insertTime between #{sTime} and #{eTime}
        </if>
        <if test="state !=null and state !=''">
            and state =#{state}
        </if>
    </select>
    <select id="getSevenDay" resultType="com.dsh.guns.modular.system.model.TbUserExit">
        select * from t_user_exit where TIMESTAMPDIFF(DAY,insertTime,now()) >=7
    </select>
 
 
</mapper>