<?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.BankConfigMapper">
|
|
<resultMap type="com.ruoyi.cwgl.domain.BankConfig" id="BankConfigResult">
|
<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="selectBankConfigVo">
|
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_config AS thisTab
|
</sql>
|
<sql id="selectBankConfigVoCount">
|
select count(0) from bank_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="selectBankConfigById" parameterType="Integer" resultMap="BankConfigResult">
|
<include refid="selectBankConfigVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectBankConfigCount" parameterType="com.ruoyi.cwgl.domain.BankConfig" resultType="int">
|
<include refid="selectBankConfigVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectBankConfigList" parameterType="com.ruoyi.cwgl.domain.BankConfig" resultMap="BankConfigResult">
|
<include refid="selectBankConfigVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertBankConfig" parameterType="com.ruoyi.cwgl.domain.BankConfig" useGeneratedKeys="true" keyProperty="id">
|
insert into bank_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="insertBankConfigBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into bank_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="updateBankConfig" parameterType="com.ruoyi.cwgl.domain.BankConfig">
|
update bank_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="updateBankConfigBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update bank_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="deleteBankConfigById" parameterType="Integer">
|
delete from bank_config where id = #{id}
|
</delete>
|
<delete id="deleteBankConfigByIds" parameterType="Integer">
|
delete from bank_config where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|