<?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="Nhywjtxhdglbean" type="cn.vp.XXX.model.NhywjtxhdglBean"/> -->
    <typeAlias alias="Nhywjtxhdgl" type="cn.im.nhywjtxhdgl.NhywjtxhdglBean"/>

    <sql id="condition_Nhywjtxhdgl">
        where 1=1
        <isNotEmpty prepend='AND ' property='LIKExh'>
            (xh like '%$LIKExh$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='xh'>
            (xh = #xh# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKExhdbh'>
            (xhdbh like '%$LIKExhdbh$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='xhdbh'>
            (xhdbh = #xhdbh# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKExhdmc'>
            (xhdmc like '%$LIKExhdmc$%' )
        </isNotEmpty>

        <isNotEmpty prepend='AND ' property='LIKEmc'>
            (xhdmc like '%$LIKEmc$%' )
        </isNotEmpty>

        <isNotEmpty prepend='AND ' property='xhdmc'>
            (xhdmc = #xhdmc# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEsccs'>
            (sccs like '%$LIKEsccs$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='sccs'>
            (sccs = #sccs# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEpp'>
            (pp like '%$LIKEpp$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='pp'>
            (pp = #pp# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEggxh'>
            (ggxh like '%$LIKEggxh$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='ggxh'>
            (ggxh = #ggxh# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEqybh'>
            (qybh like '%$LIKEqybh$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='qybh'>
            (qybh = #qybh# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEqymc'>
            (qymc like '%$LIKEqymc$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='qymc'>
            (qymc = #qymc# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKElkh'>
            (lkh like '%$LIKElkh$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='lkh'>
            (lkh = #lkh# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKElkmc'>
            (lkmc like '%$LIKElkmc$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='lkmc'>
            (lkmc = #lkmc# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKElkxw'>
            (lkxw like '%$LIKElkxw$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='lkxw'>
            (lkxw = #lkxw# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEazsj'>
            (azsj like '%$LIKEazsj$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='azsj'>
            (azsj = #azsj# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEazdw'>
            (azdw like '%$LIKEazdw$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='azdw'>
            (azdw = #azdw# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEqdfs'>
            (qdfs like '%$LIKEqdfs$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='qdfs'>
            (qdfs = #qdfs# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEsszbx'>
            (sszbx like '%$LIKEsszbx$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='sszbx'>
            (sszbx = #sszbx# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEjd'>
            (jd like '%$LIKEjd$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='jd'>
            (jd = #jd# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEwd'>
            (wd like '%$LIKEwd$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='wd'>
            (wd = #wd# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKExhdjj'>
            (xhdjj like '%$LIKExhdjj$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='xhdjj'>
            (xhdjj = #xhdjj# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEcjry'>
            (cjry like '%$LIKEcjry$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='cjry'>
            (cjry = #cjry# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEcjrq'>
            (cjrq like '%$LIKEcjrq$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='cjrq'>
            (cjrq = #cjrq# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKExgry'>
            (xgry like '%$LIKExgry$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='xgry'>
            (xgry = #xgry# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKExgrq'>
            (xgrq like '%$LIKExgrq$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='xgrq'>
            (xgrq = #xgrq# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEbz'>
            (bz like '%$LIKEbz$%' )
        </isNotEmpty>
        <isNotEmpty property='emptyremarks'>
            <isEqual prepend='AND ' property='emptyremarks' compareValue="0">
                (bz is null or bz =' ' )
            </isEqual>
            <isEqual prepend='AND ' property='emptyremarks' compareValue="1">
                (bz is not null  and bz!=' ' )
            </isEqual>
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='bz'>
            (bz = #bz# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEkz1'>
            (kz1 like '%$LIKEkz1$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='kz1'>
            (kz1 = #kz1# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEkz2'>
            (kz2 like '%$LIKEkz2$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='kz2'>
            (kz2 = #kz2# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEkz3'>
            (kz3 like '%$LIKEkz3$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='kz3'>
            (kz3 = #kz3# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEkz4'>
            (kz4 like '%$LIKEkz4$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='kz4'>
            (kz4 = #kz4# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEsjzp'>
            (sjzp like '%$LIKEsjzp$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='sjzp'>
            (sjzp = #sjzp# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEgxdwbm'>
            (gxdwbm like '%$LIKEgxdwbm$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='gxdwbm'>
            (gxdwbm = #gxdwbm# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEgxdwmc'>
            (gxdwmc like '%$LIKEgxdwmc$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='gxdwmc'>
            (gxdwmc = #gxdwmc# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKElxr'>
            (lxr like '%$LIKElxr$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='lxr'>
            (lxr = #lxr# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKElxdh'>
            (lxdh like '%$LIKElxdh$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='lxdh'>
            (lxdh = #lxdh# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKElifetime'>
            (lifetime like '%LIKElifetime%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='lifetime'>
            (lifetime = #lifetime# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='statusupbatch'>
            (statusupbatch = #statusupbatch# )
        </isNotEmpty>
        <isNotEmpty prepend="and " property='state'>
            state =#state#
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='ip'>
            (ip =#ip#)
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEip'>
            (ip like '%LIKEip%' )
        </isNotEmpty>

        <isNotEmpty property='tableparam'>
            $tableparam$
        </isNotEmpty>
        <isNotEmpty property='order'>
            $order$
        </isNotEmpty>
    </sql>
    <sql id="condition_xhdstate">
        where 1=1
        <isNotEmpty prepend='AND ' property='xhdmc'>
            (xhdmc like '%$xhdmc$%')
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='qybh'>
            (noarea = #qybh# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='lkh'>
            (nojunc = #lkh# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='Likemc'>
            (xhdmc like '%Likemc%')
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='currentstate'>
            (a.STATE = #currentstate# )
        </isNotEmpty>
        <isNotEmpty property='tableparam'>
            $tableparam$
        </isNotEmpty>

    </sql>
    <!-- add object -->
    <insert id="insert_Nhywjtxhdgl" parameterClass="java.util.Map">
        insert into
        nhywjtxhdgl(
        <dynamic prepend=" ">
            <isNotEmpty prepend=',' property='xh'>xh</isNotEmpty>
            <isNotEmpty prepend=',' property='xhdbh'>xhdbh</isNotEmpty>
            <isNotEmpty prepend=',' property='xhdmc'>xhdmc</isNotEmpty>
            <isNotEmpty prepend=',' property='sccs'>sccs</isNotEmpty>
            <isNotEmpty prepend=',' property='pp'>pp</isNotEmpty>
            <isNotEmpty prepend=',' property='ggxh'>ggxh</isNotEmpty>
            <isNotEmpty prepend=',' property='qybh'>qybh</isNotEmpty>
            <isNotEmpty prepend=',' property='qymc'>qymc</isNotEmpty>
            <isNotEmpty prepend=',' property='lkh'>lkh</isNotEmpty>
            <isNotEmpty prepend=',' property='lkmc'>lkmc</isNotEmpty>
            <isNotEmpty prepend=',' property='lkxw'>lkxw</isNotEmpty>
            <isNotEmpty prepend=',' property='azsj'>azsj</isNotEmpty>
            <isNotEmpty prepend=',' property='azdw'>azdw</isNotEmpty>
            <isNotEmpty prepend=',' property='qdfs'>qdfs</isNotEmpty>
            <isNotEmpty prepend=',' property='sszbx'>sszbx</isNotEmpty>
            <isNotEmpty prepend=',' property='jd'>jd</isNotEmpty>
            <isNotEmpty prepend=',' property='wd'>wd</isNotEmpty>
            <isNotEmpty prepend=',' property='xhdjj'>xhdjj</isNotEmpty>
            <isNotEmpty prepend=',' property='cjry'>cjry</isNotEmpty>
            <isNotEmpty prepend=',' property='cjrq'>cjrq</isNotEmpty>
            <isNotEmpty prepend=',' property='xgry'>xgry</isNotEmpty>
            <isNotEmpty prepend=',' property='xgrq'>xgrq</isNotEmpty>
            <isNotEmpty prepend=',' property='bz'>bz</isNotEmpty>
            <isNotEmpty prepend=',' property='kz1'>kz1</isNotEmpty>
            <isNotEmpty prepend=',' property='kz2'>kz2</isNotEmpty>
            <isNotEmpty prepend=',' property='kz3'>kz3</isNotEmpty>
            <isNotEmpty prepend=',' property='kz4'>kz4</isNotEmpty>
            <isNotEmpty prepend=',' property='sjzp'>sjzp</isNotEmpty>
            <isNotEmpty prepend=',' property='gxdwbm'>gxdwbm</isNotEmpty>
            <isNotEmpty prepend=',' property='gxdwmc'>gxdwmc</isNotEmpty>
            <isNotEmpty prepend=',' property='lxr'>lxr</isNotEmpty>
            <isNotEmpty prepend=',' property='lxdh'>lxdh</isNotEmpty>
            <isNotEmpty prepend=',' property='lifetime'>lifetime</isNotEmpty>
        </dynamic>
        <![CDATA[
	        ) values ( 
	    ]]>
        <dynamic prepend=" ">
            <isNotEmpty prepend=',' property='xh'>#xh#</isNotEmpty>
            <isNotEmpty prepend=',' property='xhdbh'>#xhdbh#</isNotEmpty>
            <isNotEmpty prepend=',' property='xhdmc'>#xhdmc#</isNotEmpty>
            <isNotEmpty prepend=',' property='sccs'>#sccs#</isNotEmpty>
            <isNotEmpty prepend=',' property='pp'>#pp#</isNotEmpty>
            <isNotEmpty prepend=',' property='ggxh'>#ggxh#</isNotEmpty>
            <isNotEmpty prepend=',' property='qybh'>#qybh#</isNotEmpty>
            <isNotEmpty prepend=',' property='qymc'>#qymc#</isNotEmpty>
            <isNotEmpty prepend=',' property='lkh'>#lkh#</isNotEmpty>
            <isNotEmpty prepend=',' property='lkmc'>#lkmc#</isNotEmpty>
            <isNotEmpty prepend=',' property='lkxw'>#lkxw#</isNotEmpty>
            <isNotEmpty prepend=',' property='azsj'>#azsj#</isNotEmpty>
            <isNotEmpty prepend=',' property='azdw'>#azdw#</isNotEmpty>
            <isNotEmpty prepend=',' property='qdfs'>#qdfs#</isNotEmpty>
            <isNotEmpty prepend=',' property='sszbx'>#sszbx#</isNotEmpty>
            <isNotEmpty prepend=',' property='jd'>#jd#</isNotEmpty>
            <isNotEmpty prepend=',' property='wd'>#wd#</isNotEmpty>
            <isNotEmpty prepend=',' property='xhdjj'>#xhdjj#</isNotEmpty>
            <isNotEmpty prepend=',' property='cjry'>#cjry#</isNotEmpty>
            <isNotEmpty prepend=',' property='cjrq'>#cjrq#</isNotEmpty>
            <isNotEmpty prepend=',' property='xgry'>#xgry#</isNotEmpty>
            <isNotEmpty prepend=',' property='xgrq'>#xgrq#</isNotEmpty>
            <isNotEmpty prepend=',' property='bz'>#bz#</isNotEmpty>
            <isNotEmpty prepend=',' property='kz1'>#kz1#</isNotEmpty>
            <isNotEmpty prepend=',' property='kz2'>#kz2#</isNotEmpty>
            <isNotEmpty prepend=',' property='kz3'>#kz3#</isNotEmpty>
            <isNotEmpty prepend=',' property='kz4'>#kz4#</isNotEmpty>
            <isNotEmpty prepend=',' property='sjzp'>#sjzp#</isNotEmpty>
            <isNotEmpty prepend=',' property='gxdwbm'>#gxdwbm#</isNotEmpty>
            <isNotEmpty prepend=',' property='gxdwmc'>#gxdwmc#</isNotEmpty>
            <isNotEmpty prepend=',' property='lxr'>#lxr#</isNotEmpty>
            <isNotEmpty prepend=',' property='lxdh'>#lxdh#</isNotEmpty>
            <isNotEmpty prepend=',' property='lifetime'>#lifetime#</isNotEmpty>
        </dynamic>
        <![CDATA[
	        ) 
	    ]]>
    </insert>

    <!-- edit object  -->
    <update id="update_Nhywjtxhdgl" parameterClass="java.util.Map">
        update nhywjtxhdgl
        <dynamic prepend="set ">

            <isNotEmpty prepend=',' property='xhdbh'>xhdbh=#xhdbh#</isNotEmpty>
            <isNotEmpty prepend=',' property='xhdmc'>xhdmc=#xhdmc#</isNotEmpty>
            <isNotEmpty prepend=',' property='sccs'>sccs=#sccs#</isNotEmpty>
            <isNotEmpty prepend=',' property='pp'>pp=#pp#</isNotEmpty>
            <isNotEmpty prepend=',' property='ggxh'>ggxh=#ggxh#</isNotEmpty>
            <isNotEmpty prepend=',' property='qybh'>qybh=#qybh#</isNotEmpty>
            <isNotEmpty prepend=',' property='qymc'>qymc=#qymc#</isNotEmpty>
            <isNotEmpty prepend=',' property='lkh'>lkh=#lkh#</isNotEmpty>
            <isNotEmpty prepend=',' property='lkmc'>lkmc=#lkmc#</isNotEmpty>
            <isNotEmpty prepend=',' property='lkxw'>lkxw=#lkxw#</isNotEmpty>
            <isNotEmpty prepend=',' property='azsj'>azsj=#azsj#</isNotEmpty>
            <isNotEmpty prepend=',' property='azdw'>azdw=#azdw#</isNotEmpty>
            <isNotEmpty prepend=',' property='qdfs'>qdfs=#qdfs#</isNotEmpty>
            <isNotEmpty prepend=',' property='sszbx'>sszbx=#sszbx#</isNotEmpty>
            <isNotEmpty prepend=',' property='jd'>jd=#jd#</isNotEmpty>
            <isNotEmpty prepend=',' property='wd'>wd=#wd#</isNotEmpty>
            <isNotEmpty prepend=',' property='xhdjj'>xhdjj=#xhdjj#</isNotEmpty>
            <isNotEmpty prepend=',' property='cjry'>cjry=#cjry#</isNotEmpty>
            <isNotEmpty prepend=',' property='cjrq'>cjrq=#cjrq#</isNotEmpty>
            <isNotEmpty prepend=',' property='xgry'>xgry=#xgry#</isNotEmpty>
            <isNotEmpty prepend=',' property='xgrq'>xgrq=#xgrq#</isNotEmpty>
            <isNotEmpty prepend=',' property='bz'>bz=#bz#</isNotEmpty>
            <isNotEmpty prepend=',' property='kz1'>kz1=#kz1#</isNotEmpty>
            <isNotEmpty prepend=',' property='kz2'>kz2=#kz2#</isNotEmpty>
            <isNotEmpty prepend=',' property='kz3'>kz3=#kz3#</isNotEmpty>
            <isNotEmpty prepend=',' property='kz4'>kz4=#kz4#</isNotEmpty>
            <isNotEmpty prepend=',' property='sjzp'>sjzp=#sjzp#</isNotEmpty>
            <isNotEmpty prepend=',' property='gxdwbm'>gxdwbm=#gxdwbm#</isNotEmpty>
            <isNotEmpty prepend=',' property='gxdwmc'>gxdwmc=#gxdwmc#</isNotEmpty>
            <isNotEmpty prepend=',' property='lxr'>lxr=#lxr#</isNotEmpty>
            <isNotEmpty prepend=',' property='lxdh'>lxdh=#lxdh#</isNotEmpty>
            <isNotEmpty prepend=',' property='lifetime'>lifetime=#lifetime#</isNotEmpty>
            <isNotEmpty prepend=',' property='detectionswitch'>detectionswitch=#detectionswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='detectionstarttime'>detectionstarttime=#detectionstarttime#</isNotEmpty>

        </dynamic>
        where xh = #XGTJxh#
        <isNotEmpty prepend='AND ' property='XGTJxhdbh'>xhdbh = #XGTJxhdbh#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJxhdmc'>xhdmc = #XGTJxhdmc#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJsccs'>sccs = #XGTJsccs#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJpp'>pp = #XGTJpp#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJggxh'>ggxh = #XGTJggxh#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJqybh'>qybh = #XGTJqybh#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJqymc'>qymc = #XGTJqymc#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJlkh'>lkh = #XGTJlkh#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJlkmc'>lkmc = #XGTJlkmc#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJlkxw'>lkxw = #XGTJlkxw#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJazsj'>azsj = #XGTJazsj#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJazdw'>azdw = #XGTJazdw#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJqdfs'>qdfs = #XGTJqdfs#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJsszbx'>sszbx = #XGTJsszbx#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJjd'>jd = #XGTJjd#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJwd'>wd = #XGTJwd#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJxhdjj'>xhdjj = #XGTJxhdjj#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJcjry'>cjry = #XGTJcjry#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJcjrq'>cjrq = #XGTJcjrq#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJxgry'>xgry = #XGTJxgry#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJxgrq'>xgrq = #XGTJxgrq#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJbz'>bz = #XGTJbz#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJkz1'>kz1 = #XGTJkz1#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJkz2'>kz2 = #XGTJkz2#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJkz3'>kz3 = #XGTJkz3#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJkz4'>kz4 = #XGTJkz4#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJsjzp'>sjzp = #XGTJsjzp#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJgxdwbm'>gxdwbm = #XGTJgxdwbm#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJgxdwmc'>gxdwmc = #XGTJgxdwmc#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJlxr'>lxr = #XGTJlxr#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJlxdh'>lxdh = #XGTJlxdh#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJlifetime'>lifetime=#XGTJlifetime#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJdetectionswitch'>detectionswitch=#XGTJdetectionswitch#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJdetectionstarttime'>detectionstarttime=#XGTJdetectionstarttime#
        </isNotEmpty>
    </update>

    <update id="updateJtxhdJdWdByXh" parameterClass="java.util.HashMap">
		update nhywjtxhdgl set  jd = #jd# , wd=#wd#, xgry=#xgry#,xgrq=#xgrq#  where xh = #xh#
	</update>
    <update id="update_NhywjtxhdglRepairstate" parameterClass="java.util.HashMap">
        update nhywjtxhdgl set xgry=#xgry#,xgrq=#xgrq#,bz=#bz#
        <isNotEmpty prepend="," property="repairstate">repairstate=#repairstate#</isNotEmpty>
        <isNotEmpty prepend="," property="state">state=#state#</isNotEmpty>
        where xh = #XGTJxh#
    </update>
    <!-- delete object -->
    <delete id="delete_Nhywjtxhdgl" parameterClass="java.util.Map">
        delete from nhywjtxhdgl  where  xh = #xh#
    </delete>

    <!-- batch delete object -->
    <delete id="batch_delete_Nhywjtxhdgl" parameterClass="java.util.Map">
        delete from nhywjtxhdgl      where         key in (#keyword#)
    </delete>

    <!-- query objects by page-->
    <select id="query_Nhywjtxhdgl" resultClass="java.util.HashMap" parameterClass="java.util.Map" remapResults="true">
        select a.*,b.csdm,b.csmc from (
        select * from nhywjtxhdgl
        <include refid="condition_Nhywjtxhdgl"/>
        )a left join xtcl b on b.csdm= detectionswitch and b.csdl = 'ywTaskEnable'
    </select>

    <select id="get_Nhywjtxhdgl" resultClass="java.util.HashMap" parameterClass="java.util.Map" remapResults="true">
        select a.*,b.csdm,b.csmc from (
        select * from nhywjtxhdgl
        <include refid="condition_Nhywjtxhdgl"/>
        )a left join xtcl b on b.csdm= detectionswitch and b.csdl = 'ywTaskEnable'
    </select>

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

    <!-- batch add objects -->
    <insert id="batch_insert_Nhywjtxhdgl" parameterClass="java.util.List">
        <![CDATA[
          INSERT
      	]]>
        <iterate conjunction=" ">
            into nhywjtxhdgl(
            <![CDATA[
				xh,xhdbh,xhdmc,sccs,pp,ggxh,qybh,qymc,lkh,lkmc,lkxw,azsj,azdw,qdfs,sszbx,jd,wd,xhdjj,cjry,cjrq,xgry,xgrq,bz,kz1,kz2,kz3,kz4,sjzp,gxdwbm,gxdwmc,lxr,lxdh,lifetime
			)values
			 ]]>
            <![CDATA[
				(
				#list[].xh#,#list[].xhdbh#,#list[].xhdmc#,#list[].sccs#,#list[].pp#,#list[].ggxh#,#list[].qybh#,#list[].qymc#,#list[].lkh#,#list[].lkmc#,#list[].lkxw#,#list[].azsj#,#list[].azdw#,#list[].qdfs#,#list[].sszbx#,#list[].jd#,#list[].wd#,#list[].xhdjj#,#list[].cjry#,#list[].cjrq#,#list[].xgry#,#list[].xgrq#,#list[].bz#,#list[].kz1#,#list[].kz2#,#list[].kz3#,#list[].kz4#,#list[].sjzp#,#list[].gxdwbm#,#list[].gxdwmc#,#list[].lxr#,#list[].lxdh#,#list[].lifetime#
				)
			]]>
        </iterate>
    </insert>

    <!-- query objects by page-->
    <select id="query_NhywjtxhdglState" resultClass="java.util.HashMap" parameterClass="java.util.Map"
            remapResults="true">
        select xh,xhdbh,xhdmc,sccs,pp,ggxh,qybh,qymc,lkh,lkmc,lkxw,azsj,azdw,
        qdfs,sszbx,jd,wd,xhdjj,cjry,cjrq,xgry,xgrq,bz,kz1,kz2,kz3,
        kz4, sjzp, gxdwbm, gxdwmc,lxr,lxdh, lifetime, detectionswitch, detectionstarttime,xhdmc name,state ,
        qybh xzbh,( select xzmc from Ptxzs where xzbh=qybh) xzmc,ip,repairstate,
        (select alarmname from ywalarmeventcode where alarmcode=repairstate)repairstatename,
        (select csmc from Xtcl where csdl='nhywjtxhdglCurrentState' and csdm=state)status from nhywjtxhdgl
        <include refid="condition_Nhywjtxhdgl"/>
        order by state desc
    </select>
    <select id="count_NhywjtxhdglState" resultClass="java.lang.Integer" parameterClass="java.util.Map"
            remapResults="true">
        select count(a.xh) from nhywjtxhdgl a
        <include refid="condition_Nhywjtxhdgl"/>
    </select>

    <select id="query_NhywjtxhdglHistoryState" resultClass="java.util.HashMap" parameterClass="java.util.Map"
            remapResults="true">
        select a.* ,b.state zt,b.create_time from
        (select * from nhywjtxhdgl a
        <include refid="condition_Nhywjtxhdgl"/>
        ) a
        left join nhywjtxhdstate_history b on a.lkh=b.nojunc and a.qybh=b.noarea
        <isNotEmpty prepend="and" property="startTime">
            <![CDATA[	b.create_time >= to_date(#startTime#,'yyyy-mm-dd hh24:mi:ss')]]>
        </isNotEmpty>
        <isNotEmpty prepend="and" property="endTime">
            <![CDATA[  b.create_time <=to_date(#endTime# ,'yyyy-mm-dd hh24:mi:ss') ]]>
        </isNotEmpty>

    </select>
    <select id="count_NhywjtxhdglHistoryState" resultClass="java.lang.Integer" parameterClass="java.util.Map"
            remapResults="true">
        select count(*) from
        (select * from nhywjtxhdgl a
        <include refid="condition_Nhywjtxhdgl"/>
        ) a
        left join nhywjtxhdstate_history b on a.lkh=b.nojunc and a.qybh=b.noarea
        <isNotEmpty prepend="and" property="startTime">
            <![CDATA[	b.create_time >= to_date(#startTime#,'yyyy-mm-dd hh24:mi:ss')	 ]]>
        </isNotEmpty>
        <isNotEmpty prepend="and" property="endTime">
            <![CDATA[  b.create_time <=to_date(#endTime# ,'yyyy-mm-dd hh24:mi:ss') ]]>
        </isNotEmpty>
    </select>
    <select id="query_NhywjtxhdglStateStatis" resultClass="java.util.HashMap" parameterClass="java.util.Map"
            remapResults="true">
        select count(*) total ,'正常' status from NHYWJTXHDGL
        <include refid="condition_Nhywjtxhdgl"/>
        and state=1
        union all
        select count(*) total ,'异常'status from NHYWJTXHDGL
        <include refid="condition_Nhywjtxhdgl"/>
        and (state=0 or state is null)
    </select>
    <select id="xhdOnline" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        select   count(*) as totalcount,
        SUM(case when a.state is not null and  a.state!=20 then 1 else 0 end) as xhdonline,
        SUM(case when  a.state =20 or a.state is null then 1 else 0 end) as xhdunonline
        from nhywjtxhdgl a

	</select>
    <select id="query_Ywxhdstatusinfo" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        select a.*,b.xhdbh,b.qybh,b.qymc,b.lkh,b.lkmc from (
        select
        statusupbatch,xh
        from ywxhdstatusinfo
        <include refid="condition_Nhywjtxhdgl"/>
        GROUP BY statusupbatch,xh
        ) a
        left join nhywjtxhdgl b on a.xh = b.xh
    </select>
    <select id="count_Ywxhdstatusinfo" resultClass="java.lang.Integer" parameterClass="java.util.Map">
        select count(*) from (
        select
        statusupbatch,xh
        from ywxhdstatusinfo
        <include refid="condition_Nhywjtxhdgl"/>
        GROUP BY statusupbatch,xh
        ) a
        left join nhywjtxhdgl b on a.xh = b.xh
    </select>


    <select id="query_YwNoTaskxhdstatusinfo" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        select a.*,b.csmc from (select xh,xhdmc,xhdbh,detectionswitch from nhywjtxhdgl
        where xh not in (select xh from ywxhdstatusinfo b
        <include refid="condition_Nhywjtxhdgl"/>
        and xh=b.xh
        )) a left join xtcl b on a.detectionswitch = b.csdm and b.csdl = 'ywTaskEnable'
    </select>

    <select id="count_YwNoTaskxhdstatusinfo" resultClass="java.lang.Integer" parameterClass="java.util.Map">
        select count(xh) from nhywjtxhdgl where xh not in (select xh from ywxhdstatusinfo b
        <include refid="condition_Nhywjtxhdgl"/>
        and xh=b.xh
        )
    </select>

    <!-- 根据 xh 批量更新启用状态 -->
    <update id="edit_Ywxhdinfo" parameterClass="java.util.Map">
        update nhywjtxhdgl
        <dynamic prepend="set ">
            <isNotEmpty prepend=',' property='detectionswitch'>detectionswitch=#detectionswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='modifyaccount'>xgry=#modifyaccount#</isNotEmpty>
            <isNotEmpty prepend=',' property='modifytime'>xgrq=#modifytime#</isNotEmpty>
        </dynamic>
        where xh in
        <iterate open="(" close=")" conjunction="," property="keys">
            #keys[]#
        </iterate>
    </update>

    <select id="query_AllNhywjtxhdglGroupByqybh" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        select qybh ,qymc,count(*) mcount from NHYWJTXHDGL a
        <isNotEmpty prepend='where' property='xzqh'>
            (a.qybh = #xzqh# or (a.qybh in (select xzbh from Ptxzs start with sjxzbh= #xzqh# connect by sjxzbh =prior
            xzbh)) )
        </isNotEmpty>
        GROUP BY a.qybh,a.qymc
    </select>
    <!-- 根据 xh g更新设备维修状态 -->
    <update id="update_NhyxhdCurrentState" parameterClass="java.util.Map">
        update NHYWJTXHDGL  set repairstate=#repairstate#       where xh=#XGTJxh#
    </update>

</sqlMap>











