374 lines
12 KiB
XML
374 lines
12 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="cn.com.tenlion.operator.dao.accountbank.IAccountBankDao">
|
|
|
|
<resultMap id="accountBankDTO" type="cn.com.tenlion.operator.pojo.dtos.accountbank.AccountBankDTO">
|
|
<result column="account_bank_id" property="accountBankId"/>
|
|
<result column="bank_name" property="bankName"/>
|
|
<result column="bank_number" property="bankNumber"/>
|
|
<result column="bank_account_name" property="bankAccountName"/>
|
|
<result column="bank_unionpay_number" property="bankUnionpayNumber"/>
|
|
<result column="bank_remark" property="bankRemark"/>
|
|
<result column="bank_switch" property="bankSwitch"/>
|
|
<result column="gmt_create" property="gmtCreate"/>
|
|
<result column="creator" property="creator"/>
|
|
<result column="gmt_modified" property="gmtModified"/>
|
|
<result column="modifier" property="modifier"/>
|
|
<result column="is_delete" property="isDelete"/>
|
|
</resultMap>
|
|
|
|
<resultMap id="accountBankBO" type="cn.com.tenlion.operator.pojo.bos.accountbank.AccountBankBO">
|
|
<result column="account_bank_id" property="accountBankId"/>
|
|
<result column="bank_name" property="bankName"/>
|
|
<result column="bank_number" property="bankNumber"/>
|
|
<result column="bank_account_name" property="bankAccountName"/>
|
|
<result column="bank_unionpay_number" property="bankUnionpayNumber"/>
|
|
<result column="bank_remark" property="bankRemark"/>
|
|
<result column="bank_switch" property="bankSwitch"/>
|
|
<result column="gmt_create" property="gmtCreate"/>
|
|
<result column="creator" property="creator"/>
|
|
<result column="gmt_modified" property="gmtModified"/>
|
|
<result column="modifier" property="modifier"/>
|
|
<result column="is_delete" property="isDelete"/>
|
|
</resultMap>
|
|
|
|
<resultMap id="accountBankPO" type="cn.com.tenlion.operator.pojo.pos.accountbank.AccountBankPO">
|
|
<result column="account_bank_id" property="accountBankId"/>
|
|
<result column="bank_name" property="bankName"/>
|
|
<result column="bank_number" property="bankNumber"/>
|
|
<result column="bank_account_name" property="bankAccountName"/>
|
|
<result column="bank_unionpay_number" property="bankUnionpayNumber"/>
|
|
<result column="bank_remark" property="bankRemark"/>
|
|
<result column="bank_switch" property="bankSwitch"/>
|
|
<result column="gmt_create" property="gmtCreate"/>
|
|
<result column="creator" property="creator"/>
|
|
<result column="gmt_modified" property="gmtModified"/>
|
|
<result column="modifier" property="modifier"/>
|
|
<result column="is_delete" property="isDelete"/>
|
|
</resultMap>
|
|
|
|
<update id="updateSwitch" parameterType="map">
|
|
UPDATE
|
|
operator_account_bank
|
|
SET
|
|
bank_switch = #{bankSwitch}
|
|
WHERE
|
|
1 = 1
|
|
<if test="accountBankId != null and accountBankId != ''">
|
|
AND account_bank_id = #{accountBankId}
|
|
</if>
|
|
</update>
|
|
|
|
<select id="getOpen" parameterType="map" resultMap="accountBankDTO">
|
|
SELECT
|
|
t1.bank_name,
|
|
t1.bank_number,
|
|
t1.bank_account_name,
|
|
t1.bank_unionpay_number,
|
|
t1.bank_remark,
|
|
t1.bank_switch,
|
|
t1.account_bank_id
|
|
FROM
|
|
operator_account_bank t1
|
|
WHERE
|
|
t1.is_delete = 0 AND t1.bank_switch = 1
|
|
ORDER BY
|
|
t1.id
|
|
LIMIT 1
|
|
</select>
|
|
|
|
<!-- 新增平台账户表 -->
|
|
<insert id="save" parameterType="map">
|
|
INSERT INTO operator_account_bank(
|
|
account_bank_id,
|
|
bank_name,
|
|
bank_number,
|
|
bank_account_name,
|
|
bank_unionpay_number,
|
|
bank_remark,
|
|
bank_switch,
|
|
gmt_create,
|
|
creator,
|
|
gmt_modified,
|
|
modifier,
|
|
is_delete
|
|
) VALUES(
|
|
#{accountBankId},
|
|
#{bankName},
|
|
#{bankNumber},
|
|
#{bankAccountName},
|
|
#{bankUnionpayNumber},
|
|
#{bankRemark},
|
|
#{bankSwitch},
|
|
#{gmtCreate},
|
|
#{creator},
|
|
#{gmtModified},
|
|
#{modifier},
|
|
#{isDelete}
|
|
)
|
|
</insert>
|
|
|
|
<!-- 删除平台账户表 -->
|
|
<update id="remove" parameterType="map">
|
|
UPDATE
|
|
operator_account_bank
|
|
SET
|
|
gmt_modified = #{gmtModified},
|
|
modifier = #{modifier},
|
|
is_delete = 1
|
|
WHERE
|
|
account_bank_id IN
|
|
<foreach collection="accountBankIds" index="index" open="(" separator="," close=")">
|
|
#{accountBankIds[${index}]}
|
|
</foreach>
|
|
</update>
|
|
|
|
<!-- 删除平台账户表(物理) -->
|
|
<update id="delete" parameterType="map">
|
|
DELETE FROM
|
|
operator_account_bank
|
|
WHERE
|
|
account_bank_id IN
|
|
<foreach collection="accountBankIds" index="index" open="(" separator="," close=")">
|
|
#{accountBankIds[${index}]}
|
|
</foreach>
|
|
</update>
|
|
|
|
<!-- 修改平台账户表 -->
|
|
<update id="update" parameterType="map">
|
|
UPDATE
|
|
operator_account_bank
|
|
SET
|
|
<if test="bankName != null and bankName != ''">
|
|
bank_name = #{bankName},
|
|
</if>
|
|
<if test="bankNumber != null and bankNumber != ''">
|
|
bank_number = #{bankNumber},
|
|
</if>
|
|
<if test="bankAccountName != null and bankAccountName != ''">
|
|
bank_account_name = #{bankAccountName},
|
|
</if>
|
|
<if test="bankUnionpayNumber != null and bankUnionpayNumber != ''">
|
|
bank_unionpay_number = #{bankUnionpayNumber},
|
|
</if>
|
|
<if test="bankRemark != null and bankRemark != ''">
|
|
bank_remark = #{bankRemark},
|
|
</if>
|
|
<if test="bankSwitch != null and bankSwitch != ''">
|
|
bank_switch = #{bankSwitch},
|
|
</if>
|
|
gmt_modified = #{gmtModified},
|
|
modifier = #{modifier},
|
|
account_bank_id = account_bank_id
|
|
WHERE
|
|
account_bank_id = #{accountBankId}
|
|
</update>
|
|
|
|
<!-- 平台账户表详情 -->
|
|
<select id="get" parameterType="map" resultMap="accountBankDTO">
|
|
SELECT
|
|
t1.bank_name,
|
|
t1.bank_number,
|
|
t1.bank_account_name,
|
|
t1.bank_unionpay_number,
|
|
t1.bank_remark,
|
|
t1.bank_switch,
|
|
t1.account_bank_id
|
|
FROM
|
|
operator_account_bank t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
<if test="accountBankId != null and accountBankId != ''">
|
|
AND
|
|
t1.account_bank_id = #{accountBankId}
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 平台账户表详情 -->
|
|
<select id="getBO" parameterType="map" resultMap="accountBankBO">
|
|
SELECT
|
|
t1.account_bank_id,
|
|
t1.bank_name,
|
|
t1.bank_number,
|
|
t1.bank_account_name,
|
|
t1.bank_unionpay_number,
|
|
t1.bank_remark,
|
|
t1.bank_switch,
|
|
t1.gmt_create,
|
|
t1.creator,
|
|
t1.gmt_modified,
|
|
t1.modifier,
|
|
t1.is_delete
|
|
FROM
|
|
operator_account_bank t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
<if test="accountBankId != null and accountBankId != ''">
|
|
AND
|
|
t1.account_bank_id = #{accountBankId}
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 平台账户表详情 -->
|
|
<select id="getPO" parameterType="map" resultMap="accountBankPO">
|
|
SELECT
|
|
t1.account_bank_id,
|
|
t1.bank_name,
|
|
t1.bank_number,
|
|
t1.bank_account_name,
|
|
t1.bank_unionpay_number,
|
|
t1.bank_remark,
|
|
t1.bank_switch,
|
|
t1.gmt_create,
|
|
t1.creator,
|
|
t1.gmt_modified,
|
|
t1.modifier,
|
|
t1.is_delete
|
|
FROM
|
|
operator_account_bank t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
<if test="accountBankId != null and accountBankId != ''">
|
|
AND
|
|
t1.account_bank_id = #{accountBankId}
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 平台账户表列表 -->
|
|
<select id="list" parameterType="map" resultMap="accountBankDTO">
|
|
SELECT
|
|
t1.account_bank_id,
|
|
t1.bank_name,
|
|
t1.bank_number,
|
|
t1.bank_account_name,
|
|
t1.bank_unionpay_number,
|
|
t1.bank_remark,
|
|
t1.bank_switch,
|
|
t1.gmt_create,
|
|
t1.creator,
|
|
t1.gmt_modified,
|
|
t1.modifier,
|
|
t1.is_delete,
|
|
1
|
|
FROM
|
|
operator_account_bank t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
<if test="keywords != null and keywords != ''">
|
|
AND (
|
|
<!-- 这里添加其他条件 -->
|
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
|
)
|
|
</if>
|
|
<if test="startTime != null and startTime != ''">
|
|
AND
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|
</if>
|
|
<if test="endTime != null and endTime != ''">
|
|
AND
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|
</if>
|
|
<if test="accountBankIds != null and accountBankIds.size > 0">
|
|
AND
|
|
t1.account_bank_id IN
|
|
<foreach collection="accountBankIds" index="index" open="(" separator="," close=")">
|
|
#{accountBankIds[${index}]}
|
|
</foreach>
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 平台账户表列表 -->
|
|
<select id="listBO" parameterType="map" resultMap="accountBankBO">
|
|
SELECT
|
|
t1.account_bank_id,
|
|
t1.bank_name,
|
|
t1.bank_number,
|
|
t1.bank_account_name,
|
|
t1.bank_unionpay_number,
|
|
t1.bank_remark,
|
|
t1.bank_switch,
|
|
t1.gmt_create,
|
|
t1.creator,
|
|
t1.gmt_modified,
|
|
t1.modifier,
|
|
t1.is_delete
|
|
FROM
|
|
operator_account_bank t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
<if test="keywords != null and keywords != ''">
|
|
AND (
|
|
<!-- 这里添加其他条件 -->
|
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
|
)
|
|
</if>
|
|
<if test="startTime != null and startTime != ''">
|
|
AND
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|
</if>
|
|
<if test="endTime != null and endTime != ''">
|
|
AND
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|
</if>
|
|
<if test="accountBankIds != null and accountBankIds.size > 0">
|
|
AND
|
|
t1.account_bank_id IN
|
|
<foreach collection="accountBankIds" index="index" open="(" separator="," close=")">
|
|
#{accountBankIds[${index}]}
|
|
</foreach>
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 平台账户表列表 -->
|
|
<select id="listPO" parameterType="map" resultMap="accountBankPO">
|
|
SELECT
|
|
t1.account_bank_id,
|
|
t1.bank_name,
|
|
t1.bank_number,
|
|
t1.bank_account_name,
|
|
t1.bank_unionpay_number,
|
|
t1.bank_remark,
|
|
t1.bank_switch,
|
|
t1.gmt_create,
|
|
t1.creator,
|
|
t1.gmt_modified,
|
|
t1.modifier,
|
|
t1.is_delete
|
|
FROM
|
|
operator_account_bank t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
<if test="keywords != null and keywords != ''">
|
|
AND (
|
|
<!-- 这里添加其他条件 -->
|
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
|
)
|
|
</if>
|
|
<if test="startTime != null and startTime != ''">
|
|
AND
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|
</if>
|
|
<if test="endTime != null and endTime != ''">
|
|
AND
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|
</if>
|
|
<if test="accountBankIds != null and accountBankIds.size > 0">
|
|
AND
|
|
t1.account_bank_id IN
|
|
<foreach collection="accountBankIds" index="index" open="(" separator="," close=")">
|
|
#{accountBankIds[${index}]}
|
|
</foreach>
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 平台账户表统计 -->
|
|
<select id="count" parameterType="map" resultType="Integer">
|
|
SELECT
|
|
COUNT(*)
|
|
FROM
|
|
operator_account_bank t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
</select>
|
|
|
|
</mapper> |