<?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="nhywledydpxjb" type="cn.im.nhywledydpxjb.nhywledydpxjbBean"/>

    <sql id="condition_Nhywledydpxjb">
        where 1=1
        <isNotEmpty prepend='AND ' property='LIKExh'>
            (xh like '%$LIKExh$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='xh'>
            (xh = #xh# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEledmc'>
            (ledmc like '%$LIKEledmc$%')
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEname'>
            (name like '%$LIKEname$%')
        </isNotEmpty>

        <isNotEmpty prepend='AND ' property='LIKEldmc'>
            (ldmc like '%$LIKEldmc$%')
        </isNotEmpty>

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

        <isNotEmpty prepend='AND ' property='LIKEid'>
            (id like '%$LIKEid$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='id'>
            (id = #id# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='xjid'>
            (xjid = #xjid# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKExjid'>
            (xjid like '%$LIKExjid%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKErw_name'>
            (rw_name like '%$LIKErw_name$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='rw_name'>
            (rw_name = #rw_name# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEtype'>
            (type like '%$LIKEtype$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='type'>
            (type = #type# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKErw_type'>
            (rw_type like '%$LIKErw_type$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='rw_type'>
            (rw_type = #rw_type# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEtsaklevel'>
            (tsaklevel like '%$LIKEtsaklevel$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='tsaklevel'>
            (tsaklevel = #tsaklevel# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEtaskdescribe'>
            (taskdescribe like '%$LIKEtaskdescribe$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='taskdescribe'>
            (taskdescribe = #taskdescribe# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEtaskmodel'>
            (taskmodel like '%$LIKEtaskmodel$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='taskmodel'>
            (taskmodel = #taskmodel# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEjgsj'>
            (jgsj like '%$LIKEjgsj$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='jgsj'>
            (jgsj = #jgsj# )
        </isNotEmpty>

        <isNotEmpty prepend='AND ' property='LIKEzxsj'>
            (zxsj like '%$LIKEzxsj$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='zxsj'>
            (zxsj = #zxsj# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKErw_state'>
            (rw_state like '%$LIKErw_state$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='rw_state'>
            (rw_state = #rw_state# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEcreatetime'>
            (createtime like '%$LIKEcreatetime$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='create_user'>
            (create_user = #create_user# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEcreate_user'>
            (create_user like '%$create_user$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='create_time'>
            (create_time = #create_time# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEcreate_time'>
            (create_time like '%$create_time$%' )
        </isNotEmpty>

        <isNotEmpty property='tableparam'>
            $tableparam$
        </isNotEmpty>
        <isNotEmpty property='order'>
            $order$
        </isNotEmpty>
    </sql>

    <!-- add object -->
    <insert id="insert_Nhywledydpxjb" parameterClass="java.util.Map">
        insert into
        NHYWLEDYDPXJB(
        <dynamic prepend=" ">

            <isNotEmpty prepend=',' property='id'>id</isNotEmpty>
            <isNotEmpty prepend=',' property='rw_name'>rw_name</isNotEmpty>
            <isNotEmpty prepend=',' property='rw_type'>rw_type</isNotEmpty>
            <isNotEmpty prepend=',' property='rwms'>rwms</isNotEmpty>
            <isNotEmpty prepend=',' property='zxsj'>zxsj</isNotEmpty>
            <isNotEmpty prepend=',' property='jgsj'>jgsj</isNotEmpty>
            <isNotEmpty prepend=',' property='rw_state'>rw_state</isNotEmpty>
            <isNotEmpty prepend=',' property='create_user'>create_user</isNotEmpty>
            <isNotEmpty prepend=',' property='create_time'>create_time</isNotEmpty>
            <isNotEmpty prepend=',' property='type'>type</isNotEmpty>
        </dynamic>
        <![CDATA[
	        ) values (
	    ]]>
        <dynamic prepend=" ">
            <isNotEmpty prepend=',' property='id'>#id#</isNotEmpty>
            <isNotEmpty prepend=',' property='rw_name'>#rw_name#</isNotEmpty>
            <isNotEmpty prepend=',' property='rw_type'>#rw_type#</isNotEmpty>
            <isNotEmpty prepend=',' property='rwms'>#rwms#</isNotEmpty>
            <isNotEmpty prepend=',' property='zxsj'>#zxsj#</isNotEmpty>
            <isNotEmpty prepend=',' property='jgsj'>#jgsj#</isNotEmpty>
            <isNotEmpty prepend=',' property='rw_state'>#rw_state#</isNotEmpty>
            <isNotEmpty prepend=',' property='create_user'>#create_user#</isNotEmpty>
            <isNotEmpty prepend=',' property='create_time'>#create_time#</isNotEmpty>
            <isNotEmpty prepend=',' property='type'>#type#</isNotEmpty>

        </dynamic>
        <![CDATA[
	        )
	    ]]>
    </insert>

    <!-- edit object  -->
    <update id="update_Nhywledydpxjb" parameterClass="java.util.Map">
        update nhywledydpxjb
        <dynamic prepend="set ">
            <isNotEmpty prepend=',' property='rw_name'>rw_name=#rw_name#</isNotEmpty>
            <isNotEmpty prepend=',' property='rwms'>rwms=#rwms#</isNotEmpty>
            <isNotEmpty prepend=',' property='rw_type'>rw_type=#rw_type#</isNotEmpty>
            <isNotEmpty prepend=',' property='zxsj'>zxsj=#zxsj#</isNotEmpty>
            <isNotEmpty prepend=',' property='rw_state'>rw_state=#rw_state#</isNotEmpty>
            <isNotEmpty prepend=',' property='create_user'>create_user=#create_user#</isNotEmpty>
            <isNotEmpty prepend=',' property='jgsj'>jgsj=#jgsj#</isNotEmpty>
            <isNotEmpty prepend=',' property='create_time'>create_time=#create_time#</isNotEmpty>
            <isNotEmpty prepend=',' property='type'>type=#type#</isNotEmpty>

        </dynamic>
        where id=#XGTJid#
        <isNotEmpty prepend='AND ' property='XGTJrw_name'>rw_name=#XGTJrw_name#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJrwms'>rwms=#XGTJrwms#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJrw_type'>rw_type=#XGTJrw_type#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJzxsj'>zxsj=#XGTJzxsj#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJrw_state'>rw_state=#XGTJrw_state#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJcreate_user'>create_user=#XGTJcreate_user#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJjgsj'>jgsj=#XGTJgsj#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJcreate_time'>create_time=#XGTJcreate_time#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJtype'>type=#XGTJtype#</isNotEmpty>

    </update>

    <!-- delete object -->
    <delete id="delete_Nhywledydpxjb" parameterClass="java.util.Map">
        delete from Nhywledydpxjb where    (xh = #xh# )
    </delete>

    <!-- batch delete object -->
    <delete id="batch_delete_Nhywledydpxjb_bak" parameterClass="java.util.Map">
        delete from Nhywledydpxjb        where  id in (#keyword#)

    </delete>
    <delete id="batch_delete_Nhywledydpxjb" parameterClass="java.util.List">
        delete from Nhywledydpxjb        where  id in
        <iterate open="(" close=")" conjunction=" ,">
            #list[]#
        </iterate>
    </delete>
    <update id="batch_update_Nhywledydpxjb" parameterClass="java.util.Map">
        update Nhywledydpxjb
        <dynamic prepend="set ">
            <isNotEmpty prepend=',' property='rw_name'>rw_name=#rw_name#</isNotEmpty>
            <isNotEmpty prepend=',' property='rwms'>rwms=#rwms#</isNotEmpty>
            <isNotEmpty prepend=',' property='rw_type'>rw_type=#rw_type#</isNotEmpty>
            <isNotEmpty prepend=',' property='zxsj'>zxsj=#zxsj#</isNotEmpty>
            <isNotEmpty prepend=',' property='rw_state'>rw_state=#rw_state#</isNotEmpty>
            <isNotEmpty prepend=',' property='jgsj'>jgsj=#jgsj#</isNotEmpty>
        </dynamic>
        where id in
            <iterate open="(" close=")" conjunction="," property="keyword">
                #keyword[]#
            </iterate>
    </update>
    <update id="delete_channelset_Nhywledydpxjb" parameterClass="java.util.Map">
        update Nhywledydpxjb set channelsetid='',channelsetname=''
        <isNotEmpty prepend=',' property='modifyaccount'>modifyaccount=#modifyaccount#</isNotEmpty>
        <isNotEmpty prepend=',' property='modifytime'>modifytime=#modifytime#</isNotEmpty>
        where id = #id#
    </update>

    <select id="query_Nhywledydpxjb" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        select *
        from Nhywledydpxjb b
        <include refid="condition_Nhywledydpxjb"/>

        <!-- <isNotEmpty prepend=' ' property='start'>
            limit #start# ,#limit#
        </isNotEmpty> -->
    </select>

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

    <select id="query_Nhywledydpxjbtask" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        select a.*,b.csdm,b.csmc from Nhywledydpxjb a left join xtcl b on rw_state = b.csdm and b.csdl = 'ywTaskEnable'
        <include refid="condition_Nhywledydpxjb"/>
    </select>
    <select id="query_NHywydptask" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        select c.* from NHYWXLYDP a ,nhywjtxhdgl c
        <include refid="condition_Nhywledydpxjb"/>
        and a.deviceid=c.xh

    </select>

    <select id="query_NhywledydpxjbNotask" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        <isEqual compareValue="1" property="type">
            select c.xh ,c.xhdbh id ,c.xhdmc mc ,c.qybh ,c.qymc from nhywjtxhdgl c
            where xh not in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (xhdbh like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (xhdbh = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (xhdmc like '%$LIKEmc$%' )
            </isNotEmpty>
        </isEqual>
        <isEqual compareValue="2" property="type">
            select c.xh ,c.ledbh id ,c.ledmc mc ,c.qybh ,c.qymc from nhywjtledydpgl c
            where xh not in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (ledbh like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (ledbh = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (ledmc like '%$LIKEmc$%' )
            </isNotEmpty>

        </isEqual>
        <isEqual compareValue="3" property="type">
            select c.id xh ,c.bianma id ,c.name mc ,regionid qybh,(
            select xzmc from Ptxzs where xzbh=regionid) qymc from its.ksh_detector c where detectortype='SMARTSENSOR'
            and id not in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (bianma like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (bianma = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (name like '%$LIKEmc$%' )
            </isNotEmpty>
        </isEqual>
        <isEqual compareValue="4" property="type">
            select c.id xh ,c.bianma id ,c.name mc ,regionid qybh,(
            select xzmc from Ptxzs where xzbh=regionid) qymc from its.ksh_detector c where detectortype='GVD'
            and id not in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (bianma like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (bianma = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (name like '%$LIKEmc$%' )
            </isNotEmpty>

        </isEqual>
        <isEqual compareValue="5" property="type">
            select c.xh ,c.ldbh id ,c.ldmc mc ,gxdwbh qybh,(
            select xzmc from Ptxzs where xzbh=gxdwbh) qymc from its.ksh_zxld c
            where xh not in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>)
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (ldbh like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (ldbh = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (ldmc like '%$LIKEmc$%' )
            </isNotEmpty>

        </isEqual>
    </select>
    <select id="count_NhywledydpxjbNotask" resultClass="java.lang.Integer" parameterClass="java.util.Map">
        <isEqual compareValue="1" property="type">
            select count(*) from nhywjtxhdgl c where
            xh not in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>)
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (xhdbh like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (xhdbh = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (xhdmc like '%$LIKEledmc$%' )
            </isNotEmpty>

        </isEqual>
        <isEqual compareValue="2" property="type">
            select count(*) from nhywjtledydpgl c
            where xh not in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>)
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (ledbh like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (ledbh = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (ledmc like '%$LIKEmc$%' )
            </isNotEmpty>
        </isEqual>
        <isEqual compareValue="3" property="type">
            select count(*) from its.ksh_detector c where detectortype='SMARTSENSOR'
            and id not in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (bianma like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (bianma = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (name like '%$LIKEmc$%' )
            </isNotEmpty>
        </isEqual>
        <isEqual compareValue="4" property="type">
            select count(*) from its.ksh_detector c where detectortype='GVD'
            and id not in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (bianma like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (bianma = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (name like '%$LIKEmc$%' )
            </isNotEmpty>
        </isEqual>
        <isEqual compareValue="5" property="type">
            select count(*) from its.ksh_zxld c
            where xh not in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (ldbh like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (ldbh = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (ldmc like '%$LIKEmc$%' )
            </isNotEmpty>
        </isEqual>
    </select>
    <select id="query_NhywxlydptaskByPage" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        <isEqual compareValue="1" property="type">
            select c.xh ,c.xhdbh id ,c.xhdmc mc ,c.qybh ,c.qymc from nhywjtxhdgl c where
            xh in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>)
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (xhdbh like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (xhdbh = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (xhdmc like '%$LIKEmc$%' )
            </isNotEmpty>
        </isEqual>
        <isEqual compareValue="2" property="type">
            select c.xh ,c.ledbh id ,c.ledmc mc ,c.qybh ,c.qymc from nhywjtledydpgl c
            where xh in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (ledbh like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (ledbh = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (ledmc like '%$LIKEmc$%' )
            </isNotEmpty>
        </isEqual>

        <isEqual compareValue="3" property="type">
            select c.id xh ,c.bianma id ,c.name mc ,regionid qybh,(
            select xzmc from Ptxzs where xzbh=regionid) qymc from its.ksh_detector c where detectortype='SMARTSENSOR'
            and id in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (bianma like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (bianma = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (name like '%$LIKEmc$%' )
            </isNotEmpty>
        </isEqual>
        <isEqual compareValue="4" property="type">
            select c.id xh ,c.bianma id ,c.name mc ,regionid qybh,(
            select xzmc from Ptxzs where xzbh=regionid) qymc from its.ksh_detector c where detectortype='GVD'
            and id in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (bianma like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (bianma = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (name like '%$LIKEmc$%' )
            </isNotEmpty>
        </isEqual>
        <isEqual compareValue="5" property="type">
            select c.xh ,c.ldbh id ,c.ldmc mc ,gxdwbh qybh,(
            select xzmc from Ptxzs where xzbh=gxdwbh) qymc from its.ksh_zxld c
            where xh in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (ldbh like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (ldbh = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (ldmc like '%$LIKEmc$%' )
            </isNotEmpty>
        </isEqual>
    </select>
    <select id="count_Nhywxlydptask" resultClass="java.lang.Integer" parameterClass="java.util.Map">
        <isEqual compareValue="1" property="type">
            select count(*) from nhywjtxhdgl c
             where xh in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (xhdbh like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (xhdbh = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEledmc'>
                (xhdmc like '%$LIKEledmc$%' )
            </isNotEmpty>
        </isEqual>
        <isEqual compareValue="2" property="type">
            select count(*) from nhywjtledydpgl c
            where xh in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (ledbh like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (ledbh = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEledmc'>
                (ledmc like '%$LIKEledmc$%' )
            </isNotEmpty>

        </isEqual>
        <isEqual compareValue="3" property="type">
            select count(*) from its.ksh_detector c where detectortype='SMARTSENSOR'
            and id in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (bianma like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (bianma = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (name like '%$LIKEmc$%' )
            </isNotEmpty>

        </isEqual>
        <isEqual compareValue="4" property="type">
            select count(*) from its.ksh_detector c where detectortype='GVD'
            and id in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (bianma like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (bianma = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (name like '%$LIKEmc$%' )
            </isNotEmpty>

        </isEqual>
        <isEqual compareValue="5" property="type">
            select count(*) from its.ksh_zxld c
            where xh in (select DEVICEID from NHYWXLYDP
            <isNotEmpty prepend='where ' property='xjid'>
                (xjid =#xjid# )
            </isNotEmpty>
            )
            <isNotEmpty prepend='AND ' property='LIKExh'>
                (ldbh like '%$LIKExh$%' )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='xh'>
                (ldbh = #xh# )
            </isNotEmpty>
            <isNotEmpty prepend='AND ' property='LIKEmc'>
                (ldmc like '%$LIKEmc$%' )
            </isNotEmpty>

        </isEqual>
    </select>
    <delete id="delete_Nhywxlydp" parameterClass="java.util.Map">
      delete from  NHYWXLYDP where xjid=#xjid#  and  deviceid=#deviceid# and  type =#type#
    </delete>
    <delete id="batchdelete_Nhywxlydp" parameterClass="java.util.Map">
        delete from NHYWXLYDP
        where xjid =#xjid# and type =#type# and id in
        <iterate open="(" close=")" conjunction=" ," property="ids">
            #ids[]#
        </iterate>
    </delete>
    <insert id="batchinsert_Nhywxlydp" parameterClass="java.util.List">
        <iterate open="begin" close="end;">
            insert into NHYWXLYDP(id,xjid,deviceid,type) values
            (#list[].id#, #list[].xjid#, #list[].deviceid#, #list[].type#);
        </iterate>

    </insert>

    <!-- 根据 xh 批量更新启用状态 -->
    <update id="edit_Nhywledydpxjb" parameterClass="java.util.Map">
        update Nhywledydpxjb
        <dynamic prepend="set ">
            <isNotEmpty prepend=',' property='rw_state'>rw_state=#rw_state#</isNotEmpty>
        </dynamic>
        where  id in
        <iterate open="(" close=")" conjunction="," property="keys">
            #keys[]#
        </iterate>
        <isNotEmpty prepend='AND ' property='type'>
            type=#type#
        </isNotEmpty>

    </update>

</sqlMap>











