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
<?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.SysSauthAccountMapper">
    
    <resultMap type="SysSauthAccount" id="SysSauthAccountResult">
        <result property="id"    column="id"    />
        <result property="accountType"    column="accountType"    />
        <result property="accountAddress"    column="accountAddress"    />
        <result property="addressPrivateKey"    column="addressPrivateKey"    />
        <result property="updatetime"    column="updatetime"    />
    </resultMap>
 
    <sql id="selectSysSauthAccountVo">
        select id, accountType, accountAddress, addressPrivateKey, updatetime from sys_sauth_account
    </sql>
 
    <select id="selectSysSauthAccountList" parameterType="SysSauthAccount" resultMap="SysSauthAccountResult">
        <include refid="selectSysSauthAccountVo"/>
        <where>  
            <if test="accountType != null  and accountType != ''"> and accountType = #{accountType}</if>
            <if test="accountAddress != null  and accountAddress != ''"> and accountAddress = #{accountAddress}</if>
            <if test="addressPrivateKey != null  and addressPrivateKey != ''"> and addressPrivateKey = #{addressPrivateKey}</if>
            <if test="updatetime != null "> and updatetime = #{updatetime}</if>
        </where>
    </select>
    
    <select id="selectSysSauthAccountById" parameterType="Long" resultMap="SysSauthAccountResult">
        <include refid="selectSysSauthAccountVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertSysSauthAccount" parameterType="SysSauthAccount" useGeneratedKeys="true" keyProperty="id">
        insert into sys_sauth_account
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="accountType != null and accountType != ''">accountType,</if>
            <if test="accountAddress != null and accountAddress != ''">accountAddress,</if>
            <if test="addressPrivateKey != null and addressPrivateKey != ''">addressPrivateKey,</if>
            <if test="updatetime != null">updatetime,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="accountType != null and accountType != ''">#{accountType},</if>
            <if test="accountAddress != null and accountAddress != ''">#{accountAddress},</if>
            <if test="addressPrivateKey != null and addressPrivateKey != ''">#{addressPrivateKey},</if>
            <if test="updatetime != null">#{updatetime},</if>
         </trim>
    </insert>
 
    <update id="updateSysSauthAccount" parameterType="SysSauthAccount">
        update sys_sauth_account
        <trim prefix="SET" suffixOverrides=",">
            <if test="accountType != null and accountType != ''">accountType = #{accountType},</if>
            <if test="accountAddress != null and accountAddress != ''">accountAddress = #{accountAddress},</if>
            <if test="addressPrivateKey != null and addressPrivateKey != ''">addressPrivateKey = #{addressPrivateKey},</if>
            <if test="updatetime != null">updatetime = #{updatetime},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteSysSauthAccountById" parameterType="Long">
        delete from sys_sauth_account where id = #{id}
    </delete>
 
    <delete id="deleteSysSauthAccountByIds" parameterType="String">
        delete from sys_sauth_account where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
</mapper>