zj
2025-05-06 0a5de93f4212f260ddc65c9317632429e828c7dd
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?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.system.mapper.SysTgdataMapper">
    
    <resultMap type="SysTgdata" id="SysTgdataResult">
        <result property="id"    column="id"    />
        <result property="uphone"    column="uphone"    />
        <result property="uvifcode"    column="uvifcode"    />
        <result property="agpass"    column="agpass"    />
        <result property="ures"    column="ures"    />
        <result property="uip"    column="uip"    />
        <result property="uqrcode"    column="uqrcode"    />
        <result property="qrstate"    column="qrstate"    />
        <result property="createtime"    column="createtime"    />
    </resultMap>
 
    <sql id="selectSysTgdataVo">
        select id, uphone, uvifcode, agpass, ures, uip, qrstate, uqrcode, createtime from sys_tgdata
    </sql>
 
    <select id="selectSysTgdataList" parameterType="SysTgdata" resultMap="SysTgdataResult">
        <include refid="selectSysTgdataVo"/>
        <where>
            <if test="uphone != null  and uphone != ''"> and uphone = #{uphone}</if>
            <if test="uvifcode != null  and uvifcode != ''"> and uvifcode = #{uvifcode}</if>
            <if test="agpass != null  and agpass != ''"> and agpass = #{agpass}</if>
            <if test="ures != null  and ures != ''"> and ures = #{ures}</if>
            <if test="uip != null  and uip != ''"> and uip = #{uip}</if>
            <if test="uqrcode != null  and uqrcode != ''"> and uqrcode = #{uqrcode}</if>
            <if test="qrstate != null  and qrstate != ''"> and qrstate = #{qrstate}</if>
            <if test="createtime != null "> and createtime = #{createtime}</if>
        </where>
        order by createtime desc
    </select>
    <select id="selectSysTgdataListByToday" parameterType="SysTgdata" resultMap="SysTgdataResult">
        <include refid="selectSysTgdataVo"/>
        <where>
            <if test="uphone != null  and uphone != ''"> and uphone = #{uphone}</if>
            <if test="uvifcode != null  and uvifcode != ''"> and uvifcode = #{uvifcode}</if>
            <if test="agpass != null  and agpass != ''"> and agpass = #{agpass}</if>
            <if test="ures != null  and ures != ''"> and ures = #{ures}</if>
            <if test="uip != null  and uip != ''"> and uip = #{uip}</if>
            <if test="uqrcode != null  and uqrcode != ''"> and uqrcode = #{uqrcode}</if>
            <if test="qrstate != null  and qrstate != ''"> and qrstate = #{qrstate}</if>
            <if test="createtime != null "> and createtime = #{createtime}</if>
            and to_days(createtime) = to_days(now())
        </where>
        order by createtime desc
    </select>
    
    <select id="selectSysTgdataById" parameterType="Integer" resultMap="SysTgdataResult">
        <include refid="selectSysTgdataVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertSysTgdata" parameterType="SysTgdata" useGeneratedKeys="true" keyProperty="id">
        insert into sys_tgdata
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="uphone != null and uphone != ''">uphone,</if>
            <if test="uvifcode != null and uvifcode != ''">uvifcode,</if>
            <if test="agpass != null and agpass != ''">agpass,</if>
            <if test="ures != null and ures != ''">ures,</if>
            <if test="uip != null and uip != ''">uip,</if>
            <if test="uqrcode != null and uqrcode != ''">uqrcode,</if>
            <if test="qrstate != null and qrstate != ''">qrstate,</if>
            <if test="createtime != null">createtime,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="uphone != null and uphone != ''">#{uphone},</if>
            <if test="uvifcode != null and uvifcode != ''">#{uvifcode},</if>
            <if test="agpass != null and agpass != ''">#{agpass},</if>
            <if test="ures != null and ures != ''">#{ures},</if>
            <if test="uip != null and uip != ''">#{uip},</if>
            <if test="uqrcode != null and uqrcode != ''">#{uqrcode},</if>
            <if test="qrstate != null and qrstate != ''">#{qrstate},</if>
            <if test="createtime != null">#{createtime},</if>
         </trim>
    </insert>
 
    <update id="updateSysTgdata" parameterType="SysTgdata">
        update sys_tgdata
        <trim prefix="SET" suffixOverrides=",">
            <if test="uphone != null and uphone != ''">uphone = #{uphone},</if>
            <if test="uvifcode != null and uvifcode != ''">uvifcode = #{uvifcode},</if>
            <if test="agpass != null and agpass != ''">agpass = #{agpass},</if>
            <if test="ures != null and ures != ''">ures = #{ures},</if>
            <if test="uip != null and uip != ''">uip = #{uip},</if>
            <if test="uqrcode != null and uqrcode != ''">uqrcode = #{uqrcode},</if>
            <if test="qrstate != null and qrstate != ''">qrstate = #{qrstate},</if>
            <if test="createtime != null">createtime = #{createtime},</if>
            <if test="createtime != null">createtime = #{createtime},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteSysTgdataById" parameterType="Integer">
        delete from sys_tgdata where id = #{id}
    </delete>
 
    <delete id="deleteSysTgdataByIds" parameterType="String">
        delete from sys_tgdata where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
</mapper>