<?xml version="1.0" encoding="gbk" standalone="no"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="">
    <!-- 	<typeAlias alias="Nhywjjzcxxbean" type="cn.vp.XXX.model.NhywjjzcxxBean"/> -->
    <typeAlias alias="Nhywjjzcxx" type="cn.im.nhywjjzcxx.NhywjjzcxxBean"/>

    <sql id="condition_Nhywjjzcxx">
        where 1=1
        <isNotEmpty prepend='AND ' property='LIKExh'>
            (xh like '%$LIKExh$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='xh'>
            (xh = #xh# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEzcmc'>
            (zcmc like '%$LIKEzcmc$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='zcmc'>
            (zcmc = #zcmc# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEzclb'>
            (zclb like '%$LIKEzclb$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='zclb'>
            (zclb = #zclb# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEzcdw'>
            (zcdw like '%$LIKEzcdw$%')
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='zcdw'>
            (zcdw = #zcdw# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEbdfs'>
            (bdfs like '%$LIKEbdfs$%' )
        </isNotEmpty>
        <isNotNull property='bdfs'>
            <isNotEmpty prepend='AND ' property='bdfs'>
                (bdfs is not null )
            </isNotEmpty>
            <isEmpty prepend='AND ' property='bdfs'>
                (bdfs is null )
            </isEmpty>
        </isNotNull>
        <isNotEmpty prepend='AND ' property='LIKEsyip'>
            syip like  '%$LIKEsyip$%'
        </isNotEmpty>

        <isNotEmpty prepend='AND ' property='lessyzyb'>
            <![CDATA[  (to_number(yzyb) > #lessyzyb# )]]>
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='moreyzyb'>
            <![CDATA[ (to_number(yzyb) < #moreyzyb# )]]>
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='zcstate'>
            zcstate = #zcstate#
        </isNotEmpty>
        <isNotEmpty property='tableparam'>
            $tableparam$
        </isNotEmpty>
        <isNotEmpty property='order'>
            $order$
        </isNotEmpty>
    </sql>


    <!-- query objects by page-->
    <select id="query_Nhywjjzcxx" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        select xh,zcmc,zclb,zcxh,zcdw,bdfs,syqk,syrq,cfdd,zcsl,yzyb,syip,bz,zcbm,
        case when zcstate='1' then '正常' when zcstate='2' then '停用' when zcstate='3'  then '报废' else '未知' end state,zcstate
        from nhywjjzcxx
        <include refid="condition_Nhywjjzcxx"/>
    </select>

    <!-- query objects totalcount -->
    <select id="count_Nhywjjzcxx" resultClass="java.lang.Integer" parameterClass="java.util.Map">
        select count(*) from nhywjjzcxx
        <include refid="condition_Nhywjjzcxx"/>
    </select>


    <!-- add object -->
    <insert id="insert_Nhywjjzcxx" parameterClass="java.util.Map">
        insert into
        nhywjjzcxx(
        <dynamic prepend=" ">
            <isNotEmpty prepend=',' property='xh'>xh</isNotEmpty>
            <isNotEmpty prepend=',' property='zcbm'>zcbm</isNotEmpty>
            <isNotEmpty prepend=',' property='zcmc'>zcmc</isNotEmpty>
            <isNotEmpty prepend=',' property='zclb'>zclb</isNotEmpty>
            <isNotEmpty prepend=',' property='zcxh'>zcxh</isNotEmpty>
            <isNotEmpty prepend=',' property='zcdw'>zcdw</isNotEmpty>
            <isNotEmpty prepend=',' property='bdfs'>bdfs</isNotEmpty>
            <isNotEmpty prepend=',' property='syqk'>syqk</isNotEmpty>
            <isNotEmpty prepend=',' property='syrq'>syrq</isNotEmpty>
            <isNotEmpty prepend=',' property='cfdd'>cfdd</isNotEmpty>
            <isNotEmpty prepend=',' property='zcsl'>zcsl</isNotEmpty>
            <isNotEmpty prepend=',' property='yzyb'>yzyb</isNotEmpty>
            <isNotEmpty prepend=',' property='syip'>syip</isNotEmpty>
            <isNotEmpty prepend=',' property='bz'>bz</isNotEmpty>
            <isNotEmpty prepend=',' property='zcstate'>zcstate</isNotEmpty>
        </dynamic>
        <![CDATA[
	        ) values (
	    ]]>
        <dynamic prepend=" ">
            <isNotEmpty prepend=',' property='xh'>#xh#</isNotEmpty>
            <isNotEmpty prepend=',' property='zcbm'>#zcbm#</isNotEmpty>
            <isNotEmpty prepend=',' property='zcmc'>#zcmc#</isNotEmpty>
            <isNotEmpty prepend=',' property='zclb'>#zclb#</isNotEmpty>
            <isNotEmpty prepend=',' property='zcxh'>#zcxh#</isNotEmpty>
            <isNotEmpty prepend=',' property='zcdw'>#zcdw#</isNotEmpty>
            <isNotEmpty prepend=',' property='bdfs'>#bdfs#</isNotEmpty>
            <isNotEmpty prepend=',' property='syqk'>#syqk#</isNotEmpty>
            <isNotEmpty prepend=',' property='syrq'>#syrq#</isNotEmpty>
            <isNotEmpty prepend=',' property='cfdd'>#cfdd#</isNotEmpty>
            <isNotEmpty prepend=',' property='zcsl'>#zcsl#</isNotEmpty>
            <isNotEmpty prepend=',' property='yzyb'>#yzyb#</isNotEmpty>
            <isNotEmpty prepend=',' property='syip'>#syip#</isNotEmpty>
            <isNotEmpty prepend=',' property='bz'>#bz#</isNotEmpty>
            <isNotEmpty prepend=',' property='zcstate'>#zcstate#</isNotEmpty>
        </dynamic>
        <![CDATA[
	        )
	    ]]>
    </insert>
    <update id="update_Nhywjjzcxx" parameterClass="java.util.Map">
        update nhywjjzcxx
        <dynamic prepend="set ">
            <isNotEmpty prepend=',' property='xh'>xh=#xh#</isNotEmpty>
            <isNotEmpty prepend=',' property='zcbm'>zcbm=#zcbm#</isNotEmpty>
            <isNotEmpty prepend=',' property='zcmc'>zcmc=#zcmc#</isNotEmpty>
            <isNotEmpty prepend=',' property='zclb'>zclb=#zclb#</isNotEmpty>
            <isNotEmpty prepend=',' property='zcxh'>zcxh=#zcxh#</isNotEmpty>
            <isNotEmpty prepend=',' property='zcdw'>zcdw=#zcdw#</isNotEmpty>
            <isNotEmpty prepend=',' property='bdfs'>bdfs=#bdfs#</isNotEmpty>
            <isNotEmpty prepend=',' property='syqk'>syqk=#syqk#</isNotEmpty>
            <isNotEmpty prepend=',' property='syrq'>syrq=#syrq#</isNotEmpty>
            <isNotEmpty prepend=',' property='cfdd'>cfdd=#cfdd#</isNotEmpty>
            <isNotEmpty prepend=',' property='zcsl'>zcsl=#zcsl#</isNotEmpty>
            <isNotEmpty prepend=',' property='yzyb'>yzyb=#yzyb#</isNotEmpty>
            <isNotEmpty prepend=',' property='syip'>syip=#syip#</isNotEmpty>
            <isNotEmpty prepend=',' property='bz'>bz=#bz#</isNotEmpty>
            <isNotEmpty prepend=',' property='zcstate'>zcstate=#zcstate#</isNotEmpty>
        </dynamic>
        where xh=#XGTJxh#
    </update>
    <delete id="delete_Nhywjjzcxx" parameterClass="java.util.Map">
        delete from nhywjjzcxx where   (xh = #xh# )
    </delete>
    <insert id="batch_insert_Nhywjjzcxx" parameterClass="java.util.List">
        <iterate open="begin" close="end;">
            insert into nhywjjzcxx(xh,zcmc,zclb,zcxh,zcdw,bdfs,syqk,syrq,
            cfdd,zcsl,yzyb,syip,bz,zcbm,zcstate) values
            (#list[].xh#,#list[].zcmc#,#list[].zclb#,#list[].zcxh#,#list[].zcdw#,
            #list[].bdfs#,#list[].syqk#,#list[].syrq#,#list[].cfdd#,#list[].zcsl#,
            #list[].yzyb#,#list[].syip#,#list[].bz#,#list[].zcbm#,#list[].zcstate#);
        </iterate>
    </insert>
</sqlMap>











