<?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.bdCumandoc.dao.impl.BdCumandocDaoImpl">

    <resultMap id="get-BdCumandocEntity-result" type="com.hzya.frame.u8c.bdCumandoc.entity.BdCumandocEntity" >
       <result property="accawmny" column="accawmny" jdbcType="VARCHAR"/>
           <result property="acclimit" column="acclimit" jdbcType="VARCHAR"/>
           <result property="acclimitcontrol" column="acclimitcontrol" jdbcType="VARCHAR"/>
           <result property="acclmtbegindate" column="acclmtbegindate" jdbcType="VARCHAR"/>
           <result property="balancemny" column="balancemny" jdbcType="VARCHAR"/>
           <result property="bp" column="bp" jdbcType="VARCHAR"/>
           <result property="busawmny" column="busawmny" jdbcType="VARCHAR"/>
           <result property="cmnecode" column="cmnecode" jdbcType="VARCHAR"/>
           <result property="cooperateflag" column="cooperateflag" jdbcType="VARCHAR"/>
           <result property="cooperatingdayfrom" column="cooperatingdayfrom" jdbcType="VARCHAR"/>
           <result property="cooperatingdayto" column="cooperatingdayto" jdbcType="VARCHAR"/>
           <result property="correspsettleunit" column="correspsettleunit" jdbcType="VARCHAR"/>
           <result property="createtime" column="createtime" jdbcType="VARCHAR"/>
           <result property="creator" column="creator" jdbcType="VARCHAR"/>
           <result property="creditcontrol" column="creditcontrol" jdbcType="VARCHAR"/>
           <result property="creditlevel" column="creditlevel" jdbcType="VARCHAR"/>
           <result property="creditlimitnum" column="creditlimitnum" jdbcType="VARCHAR"/>
           <result property="creditmny" column="creditmny" jdbcType="VARCHAR"/>
           <result property="creditmoney" column="creditmoney" jdbcType="VARCHAR"/>
           <result property="credlimitflag" column="credlimitflag" jdbcType="INTEGER"/>
           <result property="custflag" column="custflag" jdbcType="VARCHAR"/>
           <result property="custstate" column="custstate" jdbcType="INTEGER"/>
           <result property="def1" column="def1" jdbcType="VARCHAR"/>
           <result property="def10" column="def10" jdbcType="VARCHAR"/>
           <result property="def11" column="def11" jdbcType="VARCHAR"/>
           <result property="def12" column="def12" jdbcType="VARCHAR"/>
           <result property="def13" column="def13" jdbcType="VARCHAR"/>
           <result property="def14" column="def14" jdbcType="VARCHAR"/>
           <result property="def15" column="def15" jdbcType="VARCHAR"/>
           <result property="def16" column="def16" jdbcType="VARCHAR"/>
           <result property="def17" column="def17" jdbcType="VARCHAR"/>
           <result property="def18" column="def18" jdbcType="VARCHAR"/>
           <result property="def19" column="def19" jdbcType="VARCHAR"/>
           <result property="def2" column="def2" jdbcType="VARCHAR"/>
           <result property="def20" column="def20" jdbcType="VARCHAR"/>
           <result property="def21" column="def21" jdbcType="VARCHAR"/>
           <result property="def22" column="def22" jdbcType="VARCHAR"/>
           <result property="def23" column="def23" jdbcType="VARCHAR"/>
           <result property="def24" column="def24" jdbcType="VARCHAR"/>
           <result property="def25" column="def25" jdbcType="VARCHAR"/>
           <result property="def26" column="def26" jdbcType="VARCHAR"/>
           <result property="def27" column="def27" jdbcType="VARCHAR"/>
           <result property="def28" column="def28" jdbcType="VARCHAR"/>
           <result property="def29" column="def29" jdbcType="VARCHAR"/>
           <result property="def3" column="def3" jdbcType="VARCHAR"/>
           <result property="def30" column="def30" jdbcType="VARCHAR"/>
           <result property="def4" column="def4" jdbcType="VARCHAR"/>
           <result property="def5" column="def5" jdbcType="VARCHAR"/>
           <result property="def6" column="def6" jdbcType="VARCHAR"/>
           <result property="def7" column="def7" jdbcType="VARCHAR"/>
           <result property="def8" column="def8" jdbcType="VARCHAR"/>
           <result property="def9" column="def9" jdbcType="VARCHAR"/>
           <result property="developdate" column="developdate" jdbcType="VARCHAR"/>
           <result property="diffcurrflag" column="diffcurrflag" jdbcType="VARCHAR"/>
           <result property="discountrate" column="discountrate" jdbcType="VARCHAR"/>
           <result property="dr" column="dr" jdbcType="INTEGER"/>
           <result property="freeofacclmtcheck" column="freeofacclmtcheck" jdbcType="VARCHAR"/>
           <result property="freeofcremnycheck" column="freeofcremnycheck" jdbcType="VARCHAR"/>
           <result property="frozendate" column="frozendate" jdbcType="VARCHAR"/>
           <result property="frozenflag" column="frozenflag" jdbcType="VARCHAR"/>
           <result property="grade" column="grade" jdbcType="INTEGER"/>
           <result property="innerctldays" column="innerctldays" jdbcType="INTEGER"/>
           <result property="iounit" column="iounit" jdbcType="VARCHAR"/>
           <result property="isagent" column="isagent" jdbcType="VARCHAR"/>
           <result property="ispromtesettlement" column="ispromtesettlement" jdbcType="VARCHAR"/>
           <result property="linkman" column="linkman" jdbcType="VARCHAR"/>
           <result property="memo" column="memo" jdbcType="VARCHAR"/>
           <result property="mobilephone" column="mobilephone" jdbcType="VARCHAR"/>
           <result property="modifier" column="modifier" jdbcType="VARCHAR"/>
           <result property="modifytime" column="modifytime" jdbcType="VARCHAR"/>
           <result property="ordawmny" column="ordawmny" jdbcType="VARCHAR"/>
           <result property="pkCalbody" column="pk_calbody" jdbcType="VARCHAR"/>
           <result property="pkCorp" column="pk_corp" jdbcType="VARCHAR"/>
           <result property="pkCubasdoc" column="pk_cubasdoc" jdbcType="VARCHAR"/>
           <result property="pkCumandoc" column="pk_cumandoc" jdbcType="VARCHAR"/>
           <result property="pkCurrtype1" column="pk_currtype1" jdbcType="VARCHAR"/>
           <result property="pkCusmandoc2" column="pk_cusmandoc2" jdbcType="VARCHAR"/>
           <result property="pkCusmandoc3" column="pk_cusmandoc3" jdbcType="VARCHAR"/>
           <result property="pkDefbusitype" column="pk_defbusitype" jdbcType="VARCHAR"/>
           <result property="pkPayterm" column="pk_payterm" jdbcType="VARCHAR"/>
           <result property="pkPricegroupcorp" column="pk_pricegroupcorp" jdbcType="VARCHAR"/>
           <result property="pkRespdept1" column="pk_respdept1" jdbcType="VARCHAR"/>
           <result property="pkResppsn1" column="pk_resppsn1" jdbcType="VARCHAR"/>
           <result property="pkSalestru" column="pk_salestru" jdbcType="VARCHAR"/>
           <result property="pkSendtype" column="pk_sendtype" jdbcType="VARCHAR"/>
           <result property="pkSettleunit" column="pk_settleunit" jdbcType="VARCHAR"/>
           <result property="pkStordoc2" column="pk_stordoc2" jdbcType="VARCHAR"/>
           <result property="prepaidratio" column="prepaidratio" jdbcType="INTEGER"/>
           <result property="ratifydate" column="ratifydate" jdbcType="VARCHAR"/>
           <result property="sealflag" column="sealflag" jdbcType="VARCHAR"/>
           <result property="stockpriceratio" column="stockpriceratio" jdbcType="INTEGER"/>
           <result property="testsalemoney" column="testsalemoney" jdbcType="VARCHAR"/>
           <result property="ts" column="ts" jdbcType="VARCHAR"/>
           <result property="custcode" column="custcode" jdbcType="VARCHAR"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "BdCumandocEntity_Base_Column_List">
        accawmny
       ,acclimit 
        ,acclimitcontrol 
        ,acclmtbegindate 
        ,balancemny 
        ,bp 
        ,busawmny 
        ,cmnecode 
        ,cooperateflag 
        ,cooperatingdayfrom 
        ,cooperatingdayto 
        ,correspsettleunit 
        ,createtime 
        ,creator 
        ,creditcontrol 
        ,creditlevel 
        ,creditlimitnum 
        ,creditmny 
        ,creditmoney 
        ,credlimitflag 
        ,custflag 
        ,custstate 
        ,def1 
        ,def10 
        ,def11 
        ,def12 
        ,def13 
        ,def14 
        ,def15 
        ,def16 
        ,def17 
        ,def18 
        ,def19 
        ,def2 
        ,def20 
        ,def21 
        ,def22 
        ,def23 
        ,def24 
        ,def25 
        ,def26 
        ,def27 
        ,def28 
        ,def29 
        ,def3 
        ,def30 
        ,def4 
        ,def5 
        ,def6 
        ,def7 
        ,def8 
        ,def9 
        ,developdate 
        ,diffcurrflag 
        ,discountrate 
        ,dr 
        ,freeofacclmtcheck 
        ,freeofcremnycheck 
        ,frozendate 
        ,frozenflag 
        ,grade 
        ,innerctldays 
        ,iounit 
        ,isagent 
        ,ispromtesettlement 
        ,linkman 
        ,memo 
        ,mobilephone 
        ,modifier 
        ,modifytime 
        ,ordawmny 
        ,pk_calbody 
        ,pk_corp 
        ,pk_cubasdoc 
        ,pk_cumandoc 
        ,pk_currtype1 
        ,pk_cusmandoc2 
        ,pk_cusmandoc3 
        ,pk_defbusitype 
        ,pk_payterm 
        ,pk_pricegroupcorp 
        ,pk_respdept1 
        ,pk_resppsn1 
        ,pk_salestru 
        ,pk_sendtype 
        ,pk_settleunit 
        ,pk_stordoc2 
        ,prepaidratio 
        ,ratifydate 
        ,sealflag 
        ,stockpriceratio 
        ,testsalemoney 
        ,ts 
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-BdCumandocEntity-result" parameterType = "com.hzya.frame.u8c.bdCumandoc.entity.BdCumandocEntity">
   select
    mand.pk_cumandoc ,
    mand.pk_cubasdoc ,
    basdoc.custcode,
    mand.pk_corp
    from bd_cumandoc mand
    left join bd_cubasdoc basdoc on mand.pk_cubasdoc = basdoc.pk_cubasdoc and basdoc.dr = '0'
    where mand.pk_corp = #{pkCorp} and basdoc.custcode = #{custcode}
    	and mand.dr='0'
	and custflag in ('0','2')
</select>

</mapper>

