<?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.u8c.Invmandoc.dao.impl.BdInvmandocDaoImpl">

    <resultMap id="get-BdInvmandocEntity-result" type="com.hzya.frame.u8c.Invmandoc.entity.BdInvmandocEntity" >
       <result property="abctype" column="abctype" jdbcType="VARCHAR"/>

           <result property="pkInvbasdoc" column="pk_invbasdoc" jdbcType="VARCHAR"/>
           <result property="pkInvmandoc" column="pk_invmandoc" jdbcType="VARCHAR"/>

        </resultMap>
    <!-- 查询的字段-->
    <sql id = "BdInvmandocEntity_Base_Column_List">

        pk_invbasdoc
        ,pk_invmandoc 

     </sql>


    <select id="queryBdInvmandocByInvcode" parameterType="com.hzya.frame.u8c.Invmandoc.entity.BdInvmandocEntity" resultMap="get-BdInvmandocEntity-result">
        select  pk_invbasdoc
        ,pk_invmandoc
         from bd_invmandoc where pk_invbasdoc in (
            select pk_invbasdoc from bd_invbasdoc bib
            where bib.dr = 0
            <if test="invcode!=null and invcode!=''">
                and bib.invcode = #{invcode}
            </if>
            <if test="invmnecode!=null and invmnecode!=''">
                and bib.invmnecode = #{invmnecode}
            </if>
        ) and dr = 0 and pk_corp = #{pkCorp}
    </select>

</mapper>

