wujianwei
2026-01-13 95d3a42006beb2b9e0856f0899003e075d1988f8
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<?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.cwgl.mapper.BankAccountConfigMapper">
 
    <resultMap type="com.ruoyi.cwgl.domain.BankAccountConfig" id="BankAccountConfigResult">
        <result property="id"    column="id"    />
        <result property="customerId"    column="customer_id"    />
        <result property="customerName"    column="customer_name"    />
        <result property="accountNo"    column="account_no"    />
        <result property="accountName"    column="account_name"    />
        <result property="bankName"    column="bank_name"    />
        <result property="branchName"    column="branch_name"    />
        <result property="accountType"    column="account_type"    />
        <result property="currency"    column="currency"    />
        <result property="status"    column="status"    />
        <result property="accountNumber"    column="account_number"    />
        <result property="openingDate"    column="opening_date"    />
        <result property="bankCode"    column="bank_code"    />
        <result property="remark"    column="remark"    />
        <result property="isDefault"    column="is_default"    />
        <result property="createBy"    column="create_by"    />
        <result property="updateBy"    column="update_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="deleted"    column="deleted"    />
    </resultMap>
 
    <sql id="selectBankAccountConfigVo">
        select thisTab.id, thisTab.customer_id, thisTab.customer_name, thisTab.account_no, thisTab.account_name, thisTab.bank_name, thisTab.branch_name, thisTab.account_type, thisTab.currency, thisTab.status, thisTab.account_number, thisTab.opening_date, thisTab.bank_code, thisTab.remark, thisTab.is_default, thisTab.create_by, thisTab.update_by, thisTab.create_time, thisTab.update_time, thisTab.deleted from bank_account_config AS thisTab
    </sql>
    <sql id="selectBankAccountConfigVoCount">
        select count(0) from bank_account_config as thisTab
    </sql>
 
    <sql id="whereCondition">
        <if test="customerId != null "> and thisTab.customer_id = #{customerId}</if>
        <if test="customerName != null  and customerName != ''"> and  thisTab.customer_name like concat('%', #{customerName}, '%')</if>
        <if test="accountNo != null  and accountNo != ''"> and thisTab.account_no = #{accountNo}</if>
        <if test="accountName != null  and accountName != ''"> and  thisTab.account_name like concat('%', #{accountName}, '%')</if>
        <if test="bankName != null  and bankName != ''"> and  thisTab.bank_name like concat('%', #{bankName}, '%')</if>
        <if test="branchName != null  and branchName != ''"> and  thisTab.branch_name like concat('%', #{branchName}, '%')</if>
        <if test="accountType != null  and accountType != ''"> and thisTab.account_type = #{accountType}</if>
        <if test="currency != null  and currency != ''"> and thisTab.currency = #{currency}</if>
        <if test="status != null  and status != ''"> and thisTab.status = #{status}</if>
        <if test="accountNumber != null  and accountNumber != ''"> and thisTab.account_number = #{accountNumber}</if>
        <if test="openingDate != null "> and thisTab.opening_date = #{openingDate}</if>
        <if test="bankCode != null  and bankCode != ''"> and thisTab.bank_code = #{bankCode}</if>
        <if test="isDefault != null "> and thisTab.is_default = #{isDefault}</if>
        <if test="deleted != null "> and thisTab.deleted = #{deleted}</if>
    </sql>
 
    <!--查询-->
    <select id="selectBankAccountConfigById" parameterType="Integer" resultMap="BankAccountConfigResult">
        <include refid="selectBankAccountConfigVo"/>
        where id = #{id}
    </select>
 
    <select id="selectBankAccountConfigCount" parameterType="com.ruoyi.cwgl.domain.BankAccountConfig" resultType="int">
        <include refid="selectBankAccountConfigVoCount"/>
        <where>
            <include refid="whereCondition"/>
        </where>
    </select>
 
    <select id="selectBankAccountConfigList" parameterType="com.ruoyi.cwgl.domain.BankAccountConfig" resultMap="BankAccountConfigResult">
        <include refid="selectBankAccountConfigVo"/>
        <where>
            <include refid="whereCondition"/>
        </where>
        order by thisTab.id desc
    </select>
 
    <!-- 新增 -->
    <insert id="insertBankAccountConfig" parameterType="com.ruoyi.cwgl.domain.BankAccountConfig"  useGeneratedKeys="true" keyProperty="id">
        insert into bank_account_config
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="customerId != null">customer_id,</if>
            <if test="customerName != null and customerName != ''">customer_name,</if>
            <if test="accountNo != null and accountNo != ''">account_no,</if>
            <if test="accountName != null and accountName != ''">account_name,</if>
            <if test="bankName != null and bankName != ''">bank_name,</if>
            <if test="branchName != null">branch_name,</if>
            <if test="accountType != null">account_type,</if>
            <if test="currency != null">currency,</if>
            <if test="status != null">status,</if>
            <if test="accountNumber != null">account_number,</if>
            <if test="openingDate != null">opening_date,</if>
            <if test="bankCode != null">bank_code,</if>
            <if test="remark != null">remark,</if>
            <if test="isDefault != null">is_default,</if>
            <if test="createBy != null">create_by,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="deleted != null">deleted,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="customerId != null">#{customerId},</if>
            <if test="customerName != null and customerName != ''">#{customerName},</if>
            <if test="accountNo != null and accountNo != ''">#{accountNo},</if>
            <if test="accountName != null and accountName != ''">#{accountName},</if>
            <if test="bankName != null and bankName != ''">#{bankName},</if>
            <if test="branchName != null">#{branchName},</if>
            <if test="accountType != null">#{accountType},</if>
            <if test="currency != null">#{currency},</if>
            <if test="status != null">#{status},</if>
            <if test="accountNumber != null">#{accountNumber},</if>
            <if test="openingDate != null">#{openingDate},</if>
            <if test="bankCode != null">#{bankCode},</if>
            <if test="remark != null">#{remark},</if>
            <if test="isDefault != null">#{isDefault},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="deleted != null">#{deleted},</if>
         </trim>
    </insert>
 
    <insert id="insertBankAccountConfigBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into bank_account_config
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,customer_id,customer_name,account_no,account_name,bank_name,branch_name,account_type,currency,status,account_number,opening_date,bank_code,remark,is_default,create_by,update_by,create_time,update_time,deleted,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.customerId},#{item.customerName},#{item.accountNo},#{item.accountName},#{item.bankName},#{item.branchName},#{item.accountType},#{item.currency},#{item.status},#{item.accountNumber},#{item.openingDate},#{item.bankCode},#{item.remark},#{item.isDefault},#{item.createBy},#{item.updateBy},#{item.createTime},#{item.updateTime},#{item.deleted},
            </trim>
        </foreach>
    </insert>
 
    <!-- 修改 -->
    <update id="updateBankAccountConfig" parameterType="com.ruoyi.cwgl.domain.BankAccountConfig">
        update bank_account_config
        <trim prefix="SET" suffixOverrides=",">
            <if test="customerId != null">customer_id = #{customerId},</if>
            <if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
            <if test="accountNo != null and accountNo != ''">account_no = #{accountNo},</if>
            <if test="accountName != null and accountName != ''">account_name = #{accountName},</if>
            <if test="bankName != null and bankName != ''">bank_name = #{bankName},</if>
            <if test="branchName != null">branch_name = #{branchName},</if>
            <if test="accountType != null">account_type = #{accountType},</if>
            <if test="currency != null">currency = #{currency},</if>
            <if test="status != null">status = #{status},</if>
            <if test="accountNumber != null">account_number = #{accountNumber},</if>
            <if test="openingDate != null">opening_date = #{openingDate},</if>
            <if test="bankCode != null">bank_code = #{bankCode},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="isDefault != null">is_default = #{isDefault},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="deleted != null">deleted = #{deleted},</if>
        </trim>
        where id = #{id}
    </update>
    <!-- 修改 -->
    <update id="updateBankAccountConfigBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            update bank_account_config
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.customerId != null">customer_id = #{item.customerId},</if>
                <if test="item.customerName != null and item.customerName != ''">customer_name = #{item.customerName},</if>
                <if test="item.accountNo != null and item.accountNo != ''">account_no = #{item.accountNo},</if>
                <if test="item.accountName != null and item.accountName != ''">account_name = #{item.accountName},</if>
                <if test="item.bankName != null and item.bankName != ''">bank_name = #{item.bankName},</if>
                <if test="item.branchName != null">branch_name = #{item.branchName},</if>
                <if test="item.accountType != null">account_type = #{item.accountType},</if>
                <if test="item.currency != null">currency = #{item.currency},</if>
                <if test="item.status != null">status = #{item.status},</if>
                <if test="item.accountNumber != null">account_number = #{item.accountNumber},</if>
                <if test="item.openingDate != null">opening_date = #{item.openingDate},</if>
                <if test="item.bankCode != null">bank_code = #{item.bankCode},</if>
                <if test="item.remark != null">remark = #{item.remark},</if>
                <if test="item.isDefault != null">is_default = #{item.isDefault},</if>
                <if test="item.createBy != null">create_by = #{item.createBy},</if>
                <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
                <if test="item.createTime != null">create_time = #{item.createTime},</if>
                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
                <if test="item.deleted != null">deleted = #{item.deleted},</if>
            </trim>
        where id = #{item.id}
        </foreach>
    </update>
 
    <!--删除-->
    <delete id="deleteBankAccountConfigById" parameterType="Integer">
        delete from bank_account_config where id = #{id}
    </delete>
    <delete id="deleteBankAccountConfigByIds" parameterType="Integer">
        delete from bank_account_config where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
</mapper>