Files
BMS/bms-back/bms-system/src/main/resources/mapper/ar/ArBankAccountMapper.xml
T
2026-09-28 10:02:38 +08:00

70 lines
2.4 KiB
XML

<?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.bms.ar.mapper.ArBankAccountMapper">
<resultMap id="ArBankAccountResult" type="ArBankAccount">
<id property="bankAccountId" column="bank_account_id"/>
<result property="accountName" column="account_name"/>
<result property="accountNo" column="account_no"/>
<result property="bankName" column="bank_name"/>
<result property="currency" column="currency"/>
<result property="isDefault" column="is_default"/>
<result property="status" column="status"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="selectDefaultByCurrency" resultMap="ArBankAccountResult">
select bank_account_id,
account_name,
account_no,
bank_name,
currency,
is_default,
status,
remark,
create_by,
create_time,
update_by,
update_time
from ar_bank_account
where currency = #{currency}
and status = '0'
order by is_default desc, bank_account_id limit 1
</select>
<sql id="enabledColumns">
select bank_account_id,
account_name,
account_no,
bank_name,
currency,
is_default,
status,
remark,
create_by,
create_time,
update_by,
update_time
from ar_bank_account
where status = '0'
</sql>
<select id="selectEnabledById" resultMap="ArBankAccountResult">
<include refid="enabledColumns"/>
and bank_account_id = #{bankAccountId}
</select>
<select id="selectEnabledList" resultMap="ArBankAccountResult">
<include refid="enabledColumns"/>
<if test="currency != null and currency != ''">
and currency = #{currency}
</if>
order by is_default desc, currency asc, bank_account_id asc
</select>
</mapper>