<?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.hzya.frame.bip.v3.v2207.dao.impl.BipOrgsDetailsDaoImpl">
	<resultMap id="get-BipOrgsDetailsEntity-result" type="com.hzya.frame.bip.v3.v2207.entity.BipOrgsDetailsEntity">
		<result property="bankCode" column="bankCode" />
		<result property="bankName" column="bankName" />
		<result property="accnum" column="accnum" />
		<result property="controlorg" column="controlorg" />
		<result property="cnapsCode" column="cnapsCode" />
	</resultMap>


	<sql id="BipOrgsDetailsEntity_Base_Column_List">
		bankdoc.code as bankCode,bankdoc.name as bankName,bankaccbas.accnum,bankaccbas.controlorg,bankaccbas.combinenum as cnapsCode
	</sql>

	<!--通过ID获取数据 -->
	<select id="entity_get" resultMap="get-BipOrgsDetailsEntity-result">
		select
		<include refid="BipOrgsDetailsEntity_Base_Column_List" />
		from bd_bankaccbas where pk_bankaccbas = #{pk_bankaccbas}
	</select>


	<!-- 查询 采用==查询 -->
	<select id="thirdInterfaceGetOrgsDetails" resultMap="get-BipOrgsDetailsEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipOrgsDetailsEntity">
		select
		<include refid="BipOrgsDetailsEntity_Base_Column_List" />
		from bd_bankaccbas bankaccbas
		left join bd_bankdoc bankdoc on bankdoc.pk_bankdoc=bankaccbas.pk_bankdoc
		<trim prefix="where" prefixOverrides="and">
			<if test="bankCode != null and bankCode !=''">bankdoc.code=#{bankCode}</if>
			<if test="bankName != null and bankName !='' "> and bankdoc.name = #{bankName}</if>
			<if test="accnum != null and accnum !='' "> and bankaccbas.accnum = #{accnum}</if>
			and bankaccbas.dr='0' and bankdoc.dr='0'  and bankaccbas.pk_banktype!='0001Z01000000000036S' and bankaccbas.controlorg = #{controlorg}
		</trim>
	</select>




</mapper>

