<?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.BankSupplierConfigMapper">
|
|
<resultMap type="com.ruoyi.cwgl.domain.BankSupplierConfig" id="BankSupplierConfigResult">
|
<result property="id" column="id" />
|
<result property="supplierId" column="supplier_id" />
|
<result property="supplierName" column="supplier_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="selectBankSupplierConfigVo">
|
select thisTab.id, thisTab.supplier_id, thisTab.supplier_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_supplier_config AS thisTab
|
</sql>
|
<sql id="selectBankSupplierConfigVoCount">
|
select count(0) from bank_supplier_config as thisTab
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="supplierId != null "> and thisTab.supplier_id = #{supplierId}</if>
|
<if test="supplierName != null and supplierName != ''"> and thisTab.supplier_name like concat('%', #{supplierName}, '%')</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="selectBankSupplierConfigById" parameterType="Integer" resultMap="BankSupplierConfigResult">
|
<include refid="selectBankSupplierConfigVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectBankSupplierConfigCount" parameterType="com.ruoyi.cwgl.domain.BankSupplierConfig" resultType="int">
|
<include refid="selectBankSupplierConfigVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectBankSupplierConfigList" parameterType="com.ruoyi.cwgl.domain.BankSupplierConfig" resultMap="BankSupplierConfigResult">
|
<include refid="selectBankSupplierConfigVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertBankSupplierConfig" parameterType="com.ruoyi.cwgl.domain.BankSupplierConfig" useGeneratedKeys="true" keyProperty="id">
|
insert into bank_supplier_config
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="supplierId != null">supplier_id,</if>
|
<if test="supplierName != null and supplierName != ''">supplier_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="supplierId != null">#{supplierId},</if>
|
<if test="supplierName != null and supplierName != ''">#{supplierName},</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="insertBankSupplierConfigBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into bank_supplier_config
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
id,supplier_id,supplier_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.supplierId},#{item.supplierName},#{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="updateBankSupplierConfig" parameterType="com.ruoyi.cwgl.domain.BankSupplierConfig">
|
update bank_supplier_config
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="supplierId != null">supplier_id = #{supplierId},</if>
|
<if test="supplierName != null and supplierName != ''">supplier_name = #{supplierName},</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="updateBankSupplierConfigBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update bank_supplier_config
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.supplierId != null">supplier_id = #{item.supplierId},</if>
|
<if test="item.supplierName != null and item.supplierName != ''">supplier_name = #{item.supplierName},</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="deleteBankSupplierConfigById" parameterType="Integer">
|
delete from bank_supplier_config where id = #{id}
|
</delete>
|
<delete id="deleteBankSupplierConfigByIds" parameterType="Integer">
|
delete from bank_supplier_config where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|