<?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.plugin.lets.dao.impl.ToBillDaoImpl">

    <resultMap id="get-ToBillEntity-result" type="com.hzya.frame.plugin.lets.entity.ToBillEntity">
        <result property="baddplanflag" column="baddplanflag" jdbcType="VARCHAR"/>
        <result property="bdrictflag" column="bdrictflag" jdbcType="VARCHAR"/>
        <result property="blatest" column="blatest" jdbcType="VARCHAR"/>
        <result property="bpushbysoflag" column="bpushbysoflag" jdbcType="VARCHAR"/>
        <result property="cauditorid" column="cauditorid" jdbcType="VARCHAR"/>
        <result property="cbillid" column="cbillid" jdbcType="VARCHAR"/>
        <result property="cbilltype" column="cbilltype" jdbcType="VARCHAR"/>
        <result property="cbiztypeid" column="cbiztypeid" jdbcType="VARCHAR"/>
        <result property="ccorrectbillid" column="ccorrectbillid" jdbcType="VARCHAR"/>
        <result property="cemployeeid" column="cemployeeid" jdbcType="VARCHAR"/>
        <result property="cincbid" column="cincbid" jdbcType="VARCHAR"/>
        <result property="cincorpid" column="cincorpid" jdbcType="VARCHAR"/>
        <result property="cinwhid" column="cinwhid" jdbcType="VARCHAR"/>
        <result property="clastmodifierid" column="clastmodifierid" jdbcType="VARCHAR"/>
        <result property="coperatorid" column="coperatorid" jdbcType="VARCHAR"/>
        <result property="coutcbid" column="coutcbid" jdbcType="VARCHAR"/>
        <result property="coutcorpid" column="coutcorpid" jdbcType="VARCHAR"/>
        <result property="coutcurrtype" column="coutcurrtype" jdbcType="VARCHAR"/>
        <result property="coutwhid" column="coutwhid" jdbcType="VARCHAR"/>
        <result property="cprojectid" column="cprojectid" jdbcType="VARCHAR"/>
        <result property="creviser" column="creviser" jdbcType="VARCHAR"/>
        <result property="csettlepathid" column="csettlepathid" jdbcType="VARCHAR"/>
        <result property="csourcemodulename" column="csourcemodulename" jdbcType="VARCHAR"/>
        <result property="ctakeoutcbid" column="ctakeoutcbid" jdbcType="VARCHAR"/>
        <result property="ctakeoutcorpid" column="ctakeoutcorpid" jdbcType="VARCHAR"/>
        <result property="ctypecode" column="ctypecode" jdbcType="VARCHAR"/>
        <result property="dauditdate" column="dauditdate" jdbcType="VARCHAR"/>
        <result property="dbilldate" column="dbilldate" jdbcType="VARCHAR"/>
        <result property="dplanbindate" column="dplanbindate" jdbcType="VARCHAR"/>
        <result property="dplanenddate" column="dplanenddate" jdbcType="VARCHAR"/>
        <result property="dr" column="dr" jdbcType="INTEGER"/>
        <result property="drevisetime" column="drevisetime" jdbcType="VARCHAR"/>
        <result property="fallocflag" column="fallocflag" jdbcType="INTEGER"/>
        <result property="foiwastpartflag" column="foiwastpartflag" jdbcType="INTEGER"/>
        <result property="fotwastpartflag" column="fotwastpartflag" jdbcType="INTEGER"/>
        <result property="fstatusflag" column="fstatusflag" jdbcType="INTEGER"/>
        <result property="iprintcount" column="iprintcount" jdbcType="INTEGER"/>
        <result property="iversion" column="iversion" jdbcType="INTEGER"/>
        <result property="nexchangeotoarate" column="nexchangeotoarate" jdbcType="NUMERIC"/>
        <result property="nexchangeotobrate" column="nexchangeotobrate" jdbcType="NUMERIC"/>
        <result property="ntotalmny" column="ntotalmny" jdbcType="NUMERIC"/>
        <result property="ntotalnum" column="ntotalnum" jdbcType="NUMERIC"/>
        <result property="pkDefdoc1" column="pk_defdoc1" jdbcType="VARCHAR"/>
        <result property="pkDefdoc10" column="pk_defdoc10" jdbcType="VARCHAR"/>
        <result property="pkDefdoc11" column="pk_defdoc11" jdbcType="VARCHAR"/>
        <result property="pkDefdoc12" column="pk_defdoc12" jdbcType="VARCHAR"/>
        <result property="pkDefdoc13" column="pk_defdoc13" jdbcType="VARCHAR"/>
        <result property="pkDefdoc14" column="pk_defdoc14" jdbcType="VARCHAR"/>
        <result property="pkDefdoc15" column="pk_defdoc15" jdbcType="VARCHAR"/>
        <result property="pkDefdoc16" column="pk_defdoc16" jdbcType="VARCHAR"/>
        <result property="pkDefdoc17" column="pk_defdoc17" jdbcType="VARCHAR"/>
        <result property="pkDefdoc18" column="pk_defdoc18" jdbcType="VARCHAR"/>
        <result property="pkDefdoc19" column="pk_defdoc19" jdbcType="VARCHAR"/>
        <result property="pkDefdoc2" column="pk_defdoc2" jdbcType="VARCHAR"/>
        <result property="pkDefdoc20" column="pk_defdoc20" jdbcType="VARCHAR"/>
        <result property="pkDefdoc3" column="pk_defdoc3" jdbcType="VARCHAR"/>
        <result property="pkDefdoc4" column="pk_defdoc4" jdbcType="VARCHAR"/>
        <result property="pkDefdoc5" column="pk_defdoc5" jdbcType="VARCHAR"/>
        <result property="pkDefdoc6" column="pk_defdoc6" jdbcType="VARCHAR"/>
        <result property="pkDefdoc7" column="pk_defdoc7" jdbcType="VARCHAR"/>
        <result property="pkDefdoc8" column="pk_defdoc8" jdbcType="VARCHAR"/>
        <result property="pkDefdoc9" column="pk_defdoc9" jdbcType="VARCHAR"/>
        <result property="taudittime" column="taudittime" jdbcType="VARCHAR"/>
        <result property="tlastmodifytime" column="tlastmodifytime" jdbcType="VARCHAR"/>
        <result property="tmaketime" column="tmaketime" jdbcType="VARCHAR"/>
        <result property="ts" column="ts" jdbcType="VARCHAR"/>
        <result property="vcode" column="vcode" jdbcType="VARCHAR"/>
        <result property="vdef1" column="vdef1" jdbcType="VARCHAR"/>
        <result property="vdef10" column="vdef10" jdbcType="VARCHAR"/>
        <result property="vdef11" column="vdef11" jdbcType="VARCHAR"/>
        <result property="vdef12" column="vdef12" jdbcType="VARCHAR"/>
        <result property="vdef13" column="vdef13" jdbcType="VARCHAR"/>
        <result property="vdef14" column="vdef14" jdbcType="VARCHAR"/>
        <result property="vdef15" column="vdef15" jdbcType="VARCHAR"/>
        <result property="vdef16" column="vdef16" jdbcType="VARCHAR"/>
        <result property="vdef17" column="vdef17" jdbcType="VARCHAR"/>
        <result property="vdef18" column="vdef18" jdbcType="VARCHAR"/>
        <result property="vdef19" column="vdef19" jdbcType="VARCHAR"/>
        <result property="vdef2" column="vdef2" jdbcType="VARCHAR"/>
        <result property="vdef20" column="vdef20" jdbcType="VARCHAR"/>
        <result property="vdef3" column="vdef3" jdbcType="VARCHAR"/>
        <result property="vdef4" column="vdef4" jdbcType="VARCHAR"/>
        <result property="vdef5" column="vdef5" jdbcType="VARCHAR"/>
        <result property="vdef6" column="vdef6" jdbcType="VARCHAR"/>
        <result property="vdef7" column="vdef7" jdbcType="VARCHAR"/>
        <result property="vdef8" column="vdef8" jdbcType="VARCHAR"/>
        <result property="vdef9" column="vdef9" jdbcType="VARCHAR"/>
        <result property="vnote" column="vnote" jdbcType="VARCHAR"/>
        <result property="vrevisereasonH" column="vrevisereason_h" jdbcType="VARCHAR"/>
    </resultMap>
    <!-- 查询的字段-->
    <sql id="ToBillEntity_Base_Column_List">
        baddplanflag
        ,bdrictflag
        ,blatest 
        ,bpushbysoflag 
        ,cauditorid 
        ,cbillid 
        ,cbilltype 
        ,cbiztypeid 
        ,ccorrectbillid 
        ,cemployeeid 
        ,cincbid 
        ,cincorpid 
        ,cinwhid 
        ,clastmodifierid 
        ,coperatorid 
        ,coutcbid 
        ,coutcorpid 
        ,coutcurrtype 
        ,coutwhid 
        ,cprojectid 
        ,creviser 
        ,csettlepathid 
        ,csourcemodulename 
        ,ctakeoutcbid 
        ,ctakeoutcorpid 
        ,ctypecode 
        ,dauditdate 
        ,dbilldate 
        ,dplanbindate 
        ,dplanenddate 
        ,dr 
        ,drevisetime 
        ,fallocflag 
        ,foiwastpartflag 
        ,fotwastpartflag 
        ,fstatusflag 
        ,iprintcount 
        ,iversion 
        ,nexchangeotoarate 
        ,nexchangeotobrate 
        ,ntotalmny 
        ,ntotalnum 
        ,pk_defdoc1 
        ,pk_defdoc10 
        ,pk_defdoc11 
        ,pk_defdoc12 
        ,pk_defdoc13 
        ,pk_defdoc14 
        ,pk_defdoc15 
        ,pk_defdoc16 
        ,pk_defdoc17 
        ,pk_defdoc18 
        ,pk_defdoc19 
        ,pk_defdoc2 
        ,pk_defdoc20 
        ,pk_defdoc3 
        ,pk_defdoc4 
        ,pk_defdoc5 
        ,pk_defdoc6 
        ,pk_defdoc7 
        ,pk_defdoc8 
        ,pk_defdoc9 
        ,taudittime 
        ,tlastmodifytime 
        ,tmaketime 
        ,ts 
        ,vcode 
        ,vdef1 
        ,vdef10 
        ,vdef11 
        ,vdef12 
        ,vdef13 
        ,vdef14 
        ,vdef15 
        ,vdef16 
        ,vdef17 
        ,vdef18 
        ,vdef19 
        ,vdef2 
        ,vdef20 
        ,vdef3 
        ,vdef4 
        ,vdef5 
        ,vdef6 
        ,vdef7 
        ,vdef8 
        ,vdef9 
        ,vnote 
        ,vrevisereason_h
    </sql>
    <!-- 查询 采用==查询 -->
    <select id="entity_list_base" resultMap="get-ToBillEntity-result"
            parameterType="com.hzya.frame.plugin.lets.entity.ToBillEntity">
        select
        <include refid="ToBillEntity_Base_Column_List"/>
        from to_bill
        <trim prefix="where" prefixOverrides="and">
            <if test="baddplanflag != null and baddplanflag != ''">and baddplanflag = #{baddplanflag}</if>
            <if test="bdrictflag != null and bdrictflag != ''">and bdrictflag = #{bdrictflag}</if>
            <if test="blatest != null and blatest != ''">and blatest = #{blatest}</if>
            <if test="bpushbysoflag != null and bpushbysoflag != ''">and bpushbysoflag = #{bpushbysoflag}</if>
            <if test="cauditorid != null and cauditorid != ''">and cauditorid = #{cauditorid}</if>
            <if test="cbillid != null and cbillid != ''">and cbillid = #{cbillid}</if>
            <if test="cbilltype != null and cbilltype != ''">and cbilltype = #{cbilltype}</if>
            <if test="cbiztypeid != null and cbiztypeid != ''">and cbiztypeid = #{cbiztypeid}</if>
            <if test="ccorrectbillid != null and ccorrectbillid != ''">and ccorrectbillid = #{ccorrectbillid}</if>
            <if test="cemployeeid != null and cemployeeid != ''">and cemployeeid = #{cemployeeid}</if>
            <if test="cincbid != null and cincbid != ''">and cincbid = #{cincbid}</if>
            <if test="cincorpid != null and cincorpid != ''">and cincorpid = #{cincorpid}</if>
            <if test="cinwhid != null and cinwhid != ''">and cinwhid = #{cinwhid}</if>
            <if test="clastmodifierid != null and clastmodifierid != ''">and clastmodifierid = #{clastmodifierid}</if>
            <if test="coperatorid != null and coperatorid != ''">and coperatorid = #{coperatorid}</if>
            <if test="coutcbid != null and coutcbid != ''">and coutcbid = #{coutcbid}</if>
            <if test="coutcorpid != null and coutcorpid != ''">and coutcorpid = #{coutcorpid}</if>
            <if test="coutcurrtype != null and coutcurrtype != ''">and coutcurrtype = #{coutcurrtype}</if>
            <if test="coutwhid != null and coutwhid != ''">and coutwhid = #{coutwhid}</if>
            <if test="cprojectid != null and cprojectid != ''">and cprojectid = #{cprojectid}</if>
            <if test="creviser != null and creviser != ''">and creviser = #{creviser}</if>
            <if test="csettlepathid != null and csettlepathid != ''">and csettlepathid = #{csettlepathid}</if>
            <if test="csourcemodulename != null and csourcemodulename != ''">and csourcemodulename =
                #{csourcemodulename}
            </if>
            <if test="ctakeoutcbid != null and ctakeoutcbid != ''">and ctakeoutcbid = #{ctakeoutcbid}</if>
            <if test="ctakeoutcorpid != null and ctakeoutcorpid != ''">and ctakeoutcorpid = #{ctakeoutcorpid}</if>
            <if test="ctypecode != null and ctypecode != ''">and ctypecode = #{ctypecode}</if>
            <if test="dauditdate != null and dauditdate != ''">and dauditdate = #{dauditdate}</if>
            <if test="dbilldate != null and dbilldate != ''">and dbilldate = #{dbilldate}</if>
            <if test="dplanbindate != null and dplanbindate != ''">and dplanbindate = #{dplanbindate}</if>
            <if test="dplanenddate != null and dplanenddate != ''">and dplanenddate = #{dplanenddate}</if>
            <if test="drevisetime != null and drevisetime != ''">and drevisetime = #{drevisetime}</if>
            <if test="fallocflag != null">and fallocflag = #{fallocflag}</if>
            <if test="foiwastpartflag != null">and foiwastpartflag = #{foiwastpartflag}</if>
            <if test="fotwastpartflag != null">and fotwastpartflag = #{fotwastpartflag}</if>
            <if test="fstatusflag != null">and fstatusflag = #{fstatusflag}</if>
            <if test="iprintcount != null">and iprintcount = #{iprintcount}</if>
            <if test="iversion != null">and iversion = #{iversion}</if>
            <if test="nexchangeotoarate != null">and nexchangeotoarate = #{nexchangeotoarate}</if>
            <if test="nexchangeotobrate != null">and nexchangeotobrate = #{nexchangeotobrate}</if>
            <if test="ntotalmny != null">and ntotalmny = #{ntotalmny}</if>
            <if test="ntotalnum != null">and ntotalnum = #{ntotalnum}</if>
            <if test="pkDefdoc1 != null and pkDefdoc1 != ''">and pk_defdoc1 = #{pkDefdoc1}</if>
            <if test="pkDefdoc10 != null and pkDefdoc10 != ''">and pk_defdoc10 = #{pkDefdoc10}</if>
            <if test="pkDefdoc11 != null and pkDefdoc11 != ''">and pk_defdoc11 = #{pkDefdoc11}</if>
            <if test="pkDefdoc12 != null and pkDefdoc12 != ''">and pk_defdoc12 = #{pkDefdoc12}</if>
            <if test="pkDefdoc13 != null and pkDefdoc13 != ''">and pk_defdoc13 = #{pkDefdoc13}</if>
            <if test="pkDefdoc14 != null and pkDefdoc14 != ''">and pk_defdoc14 = #{pkDefdoc14}</if>
            <if test="pkDefdoc15 != null and pkDefdoc15 != ''">and pk_defdoc15 = #{pkDefdoc15}</if>
            <if test="pkDefdoc16 != null and pkDefdoc16 != ''">and pk_defdoc16 = #{pkDefdoc16}</if>
            <if test="pkDefdoc17 != null and pkDefdoc17 != ''">and pk_defdoc17 = #{pkDefdoc17}</if>
            <if test="pkDefdoc18 != null and pkDefdoc18 != ''">and pk_defdoc18 = #{pkDefdoc18}</if>
            <if test="pkDefdoc19 != null and pkDefdoc19 != ''">and pk_defdoc19 = #{pkDefdoc19}</if>
            <if test="pkDefdoc2 != null and pkDefdoc2 != ''">and pk_defdoc2 = #{pkDefdoc2}</if>
            <if test="pkDefdoc20 != null and pkDefdoc20 != ''">and pk_defdoc20 = #{pkDefdoc20}</if>
            <if test="pkDefdoc3 != null and pkDefdoc3 != ''">and pk_defdoc3 = #{pkDefdoc3}</if>
            <if test="pkDefdoc4 != null and pkDefdoc4 != ''">and pk_defdoc4 = #{pkDefdoc4}</if>
            <if test="pkDefdoc5 != null and pkDefdoc5 != ''">and pk_defdoc5 = #{pkDefdoc5}</if>
            <if test="pkDefdoc6 != null and pkDefdoc6 != ''">and pk_defdoc6 = #{pkDefdoc6}</if>
            <if test="pkDefdoc7 != null and pkDefdoc7 != ''">and pk_defdoc7 = #{pkDefdoc7}</if>
            <if test="pkDefdoc8 != null and pkDefdoc8 != ''">and pk_defdoc8 = #{pkDefdoc8}</if>
            <if test="pkDefdoc9 != null and pkDefdoc9 != ''">and pk_defdoc9 = #{pkDefdoc9}</if>
            <if test="taudittime != null and taudittime != ''">and taudittime = #{taudittime}</if>
            <if test="tlastmodifytime != null and tlastmodifytime != ''">and tlastmodifytime = #{tlastmodifytime}</if>
            <if test="tmaketime != null and tmaketime != ''">and tmaketime = #{tmaketime}</if>
            <if test="ts != null and ts != ''">and ts = #{ts}</if>
            <if test="vcode != null and vcode != ''">and vcode = #{vcode}</if>
            <if test="vdef1 != null and vdef1 != ''">and vdef1 = #{vdef1}</if>
            <if test="vdef10 != null and vdef10 != ''">and vdef10 = #{vdef10}</if>
            <if test="vdef11 != null and vdef11 != ''">and vdef11 = #{vdef11}</if>
            <if test="vdef12 != null and vdef12 != ''">and vdef12 = #{vdef12}</if>
            <if test="vdef13 != null and vdef13 != ''">and vdef13 = #{vdef13}</if>
            <if test="vdef14 != null and vdef14 != ''">and vdef14 = #{vdef14}</if>
            <if test="vdef15 != null and vdef15 != ''">and vdef15 = #{vdef15}</if>
            <if test="vdef16 != null and vdef16 != ''">and vdef16 = #{vdef16}</if>
            <if test="vdef17 != null and vdef17 != ''">and vdef17 = #{vdef17}</if>
            <if test="vdef18 != null and vdef18 != ''">and vdef18 = #{vdef18}</if>
            <if test="vdef19 != null and vdef19 != ''">and vdef19 = #{vdef19}</if>
            <if test="vdef2 != null and vdef2 != ''">and vdef2 = #{vdef2}</if>
            <if test="vdef20 != null and vdef20 != ''">and vdef20 = #{vdef20}</if>
            <if test="vdef3 != null and vdef3 != ''">and vdef3 = #{vdef3}</if>
            <if test="vdef4 != null and vdef4 != ''">and vdef4 = #{vdef4}</if>
            <if test="vdef5 != null and vdef5 != ''">and vdef5 = #{vdef5}</if>
            <if test="vdef6 != null and vdef6 != ''">and vdef6 = #{vdef6}</if>
            <if test="vdef7 != null and vdef7 != ''">and vdef7 = #{vdef7}</if>
            <if test="vdef8 != null and vdef8 != ''">and vdef8 = #{vdef8}</if>
            <if test="vdef9 != null and vdef9 != ''">and vdef9 = #{vdef9}</if>
            <if test="vnote != null and vnote != ''">and vnote = #{vnote}</if>
            <if test="vrevisereasonH != null and vrevisereasonH != ''">and vrevisereason_h = #{vrevisereasonH}</if>
            and dr='0'
        </trim>
    </select>

    <select id="queryToBillEntity" parameterType="com.hzya.frame.plugin.lets.entity.ToBillEntity"
            resultMap="get-ToBillEntity-result">
        select
        <include refid="ToBillEntity_Base_Column_List"/>
        from to_bill where dr=0
        <if test="vcode!=null and vcode!=''">
            and vcode = #{vcode}
        </if>
        <if test="ctypecode!=null and ctypecode!=''">
            and ctypecode = #{ctypecode}
        </if>
        <if test="fstatusflag!=null and fstatusflag!=''">
            and fstatusflag = #{fstatusflag}
        </if>
        <if test="start_time_dbilldate!=null and start_time_dbilldate!=''">
            and taudittime &gt;= #{start_time_dbilldate}
        </if>
        <if test="end_time_dbilldate!=null and end_time_dbilldate!=''">
            and taudittime &lt;= #{end_time_dbilldate}
        </if>
    </select>

</mapper>

