<?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="Ywvideotaskbean" type="cn.vp.XXX.model.YwvideotaskBean"/> -->
    <typeAlias alias="Ywvideotask" type="cn.im.ywvideotask.YwvideotaskBean"/>

    <sql id="condition_Ywvideotask">
        where 1=1
        <isNotEmpty prepend='AND ' property='LIKEtaskid'>
            (taskid like '%$LIKEtaskid$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='taskid'>
            (taskid = #taskid# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEtaskname'>
            (taskname like '%$LIKEtaskname$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='taskname'>
            (taskname = #taskname# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEtasktype'>
            (tasktype like '%$LIKEtasktype$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='tasktype'>
            (tasktype = #tasktype# )
        </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='LIKEdaystarttime'>
            (daystarttime like '%$LIKEdaystarttime$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='daystarttime'>
            (daystarttime = #daystarttime# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEdaystarttimebyhour'>
            (daystarttimebyhour like '%$LIKEdaystarttimebyhour$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='daystarttimebyhour'>
            (daystarttimebyhour = #daystarttimebyhour# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEchanneltotals'>
            (channeltotals like '%$LIKEchanneltotals$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='channeltotals'>
            (channeltotals = #channeltotals# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEmondayruntime'>
            (mondayruntime like '%$LIKEmondayruntime$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='mondayruntime'>
            (mondayruntime = #mondayruntime# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEmondayrunbyhour'>
            (mondayrunbyhour like '%$LIKEmondayrunbyhour$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='mondayrunbyhour'>
            (mondayrunbyhour = #mondayrunbyhour# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEtuesdayruntime'>
            (tuesdayruntime like '%$LIKEtuesdayruntime$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='tuesdayruntime'>
            (tuesdayruntime = #tuesdayruntime# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEtuesdayrunbyhour'>
            (tuesdayrunbyhour like '%$LIKEtuesdayrunbyhour$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='tuesdayrunbyhour'>
            (tuesdayrunbyhour = #tuesdayrunbyhour# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEwednesdayuntime'>
            (wednesdayuntime like '%$LIKEwednesdayuntime$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='wednesdayuntime'>
            (wednesdayuntime = #wednesdayuntime# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEwednesdayunbyhour'>
            (wednesdayunbyhour like '%$LIKEwednesdayunbyhour$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='wednesdayunbyhour'>
            (wednesdayunbyhour = #wednesdayunbyhour# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEthursdayruntime'>
            (thursdayruntime like '%$LIKEthursdayruntime$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='thursdayruntime'>
            (thursdayruntime = #thursdayruntime# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEthursdayrunbyhour'>
            (thursdayrunbyhour like '%$LIKEthursdayrunbyhour$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='thursdayrunbyhour'>
            (thursdayrunbyhour = #thursdayrunbyhour# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEfridayruntime'>
            (fridayruntime like '%$LIKEfridayruntime$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='fridayruntime'>
            (fridayruntime = #fridayruntime# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEfridayrunbyhour'>
            (fridayrunbyhour like '%$LIKEfridayrunbyhour$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='fridayrunbyhour'>
            (fridayrunbyhour = #fridayrunbyhour# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEsaturdatruntime'>
            (saturdatruntime like '%$LIKEsaturdatruntime$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='saturdatruntime'>
            (saturdatruntime = #saturdatruntime# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEsaturdatrunbyhour'>
            (saturdatrunbyhour like '%$LIKEsaturdatrunbyhour$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='saturdatrunbyhour'>
            (saturdatrunbyhour = #saturdatrunbyhour# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEsundayruntime'>
            (sundayruntime like '%$LIKEsundayruntime$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='sundayruntime'>
            (sundayruntime = #sundayruntime# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEsundayrunbyhour'>
            (sundayrunbyhour like '%$LIKEsundayrunbyhour$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='sundayrunbyhour'>
            (sundayrunbyhour = #sundayrunbyhour# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEmondayswitch'>
            (mondayswitch like '%$LIKEmondayswitch$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='mondayswitch'>
            (mondayswitch = #mondayswitch# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEtuesdayswitch'>
            (tuesdayswitch like '%$LIKEtuesdayswitch$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='tuesdayswitch'>
            (tuesdayswitch = #tuesdayswitch# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEwednesdayswitch'>
            (wednesdayswitch like '%$LIKEwednesdayswitch$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='wednesdayswitch'>
            (wednesdayswitch = #wednesdayswitch# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEthursdayswitch'>
            (thursdayswitch like '%$LIKEthursdayswitch$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='thursdayswitch'>
            (thursdayswitch = #thursdayswitch# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEfridayswitch'>
            (fridayswitch like '%$LIKEfridayswitch$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='fridayswitch'>
            (fridayswitch = #fridayswitch# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEsaturdayswitch'>
            (saturdayswitch like '%$LIKEsaturdayswitch$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='saturdayswitch'>
            (saturdayswitch = #saturdayswitch# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEsundayswitch'>
            (sundayswitch like '%$LIKEsundayswitch$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='sundayswitch'>
            (sundayswitch = #sundayswitch# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEdetectionswitch'>
            (detectionswitch like '%$LIKEdetectionswitch$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='detectionswitch'>
            (detectionswitch = #detectionswitch# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEdetectionstarttime'>
            (detectionstarttime like '%$LIKEdetectionstarttime$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='detectionstarttime'>
            (detectionstarttime = #detectionstarttime# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEcreateaccount'>
            (createaccount like '%$LIKEcreateaccount$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='createaccount'>
            (createaccount = #createaccount# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEcreatetime'>
            (createtime like '%$LIKEcreatetime$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='createtime'>
            (createtime = #createtime# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEmodifyaccount'>
            (modifyaccount like '%$LIKEmodifyaccount$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='modifyaccount'>
            (modifyaccount = #modifyaccount# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEmodifytime'>
            (modifytime like '%$LIKEmodifytime$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='modifytime'>
            (modifytime = #modifytime# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEremarks'>
            (remarks like '%$LIKEremarks$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='remarks'>
            (remarks = #remarks# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEextend1'>
            (extend1 like '%$LIKEextend1$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='extend1'>
            (extend1 = #extend1# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEextend2'>
            (extend2 like '%$LIKEextend2$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='extend2'>
            (extend2 = #extend2# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEextend3'>
            (extend3 like '%$LIKEextend3$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='extend3'>
            (extend3 = #extend3# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='LIKEextend4'>
            (extend4 like '%$LIKEextend4$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='extend4'>
            (extend4 = #extend4# )
        </isNotEmpty>
        <isNotEmpty property='tableparam'>
            $tableparam$
        </isNotEmpty>
        <isNotEmpty property='order'>
            $order$
        </isNotEmpty>
    </sql>

    <!-- add object -->
    <insert id="insert_Ywvideotask" parameterClass="java.util.Map">
        insert into
        ywvideotask(
        <dynamic prepend=" ">
            <isNotEmpty prepend=',' property='catalogid'>catalogid</isNotEmpty>
            <isNotEmpty prepend=',' property='catalogname'>catalogname</isNotEmpty>
            <isNotEmpty prepend=',' property='taskid'>taskid</isNotEmpty>
            <isNotEmpty prepend=',' property='taskname'>taskname</isNotEmpty>
            <isNotEmpty prepend=',' property='tasktype'>tasktype</isNotEmpty>
            <isNotEmpty prepend=',' property='tsaklevel'>tsaklevel</isNotEmpty>
            <isNotEmpty prepend=',' property='taskdescribe'>taskdescribe</isNotEmpty>
            <isNotEmpty prepend=',' property='taskmodel'>taskmodel</isNotEmpty>
            <isNotEmpty prepend=',' property='daystarttime'>daystarttime</isNotEmpty>
            <isNotEmpty prepend=',' property='daystarttimebyhour'>daystarttimebyhour</isNotEmpty>
            <isNotEmpty prepend=',' property='channeltotals'>channeltotals</isNotEmpty>
            <isNotEmpty prepend=',' property='mondayruntime'>mondayruntime</isNotEmpty>
            <isNotEmpty prepend=',' property='mondayrunbyhour'>mondayrunbyhour</isNotEmpty>
            <isNotEmpty prepend=',' property='tuesdayruntime'>tuesdayruntime</isNotEmpty>
            <isNotEmpty prepend=',' property='tuesdayrunbyhour'>tuesdayrunbyhour</isNotEmpty>
            <isNotEmpty prepend=',' property='wednesdayuntime'>wednesdayuntime</isNotEmpty>
            <isNotEmpty prepend=',' property='wednesdayunbyhour'>wednesdayunbyhour</isNotEmpty>
            <isNotEmpty prepend=',' property='thursdayruntime'>thursdayruntime</isNotEmpty>
            <isNotEmpty prepend=',' property='thursdayrunbyhour'>thursdayrunbyhour</isNotEmpty>
            <isNotEmpty prepend=',' property='fridayruntime'>fridayruntime</isNotEmpty>
            <isNotEmpty prepend=',' property='fridayrunbyhour'>fridayrunbyhour</isNotEmpty>
            <isNotEmpty prepend=',' property='saturdatruntime'>saturdatruntime</isNotEmpty>
            <isNotEmpty prepend=',' property='saturdatrunbyhour'>saturdatrunbyhour</isNotEmpty>
            <isNotEmpty prepend=',' property='sundayruntime'>sundayruntime</isNotEmpty>
            <isNotEmpty prepend=',' property='sundayrunbyhour'>sundayrunbyhour</isNotEmpty>
            <isNotEmpty prepend=',' property='mondayswitch'>mondayswitch</isNotEmpty>
            <isNotEmpty prepend=',' property='tuesdayswitch'>tuesdayswitch</isNotEmpty>
            <isNotEmpty prepend=',' property='wednesdayswitch'>wednesdayswitch</isNotEmpty>
            <isNotEmpty prepend=',' property='thursdayswitch'>thursdayswitch</isNotEmpty>
            <isNotEmpty prepend=',' property='fridayswitch'>fridayswitch</isNotEmpty>
            <isNotEmpty prepend=',' property='saturdayswitch'>saturdayswitch</isNotEmpty>
            <isNotEmpty prepend=',' property='sundayswitch'>sundayswitch</isNotEmpty>
            <isNotEmpty prepend=',' property='detectionswitch'>detectionswitch</isNotEmpty>
            <isNotEmpty prepend=',' property='detectionstarttime'>detectionstarttime</isNotEmpty>
            <isNotEmpty prepend=',' property='createaccount'>createaccount</isNotEmpty>
            <isNotEmpty prepend=',' property='createtime'>createtime</isNotEmpty>
            <isNotEmpty prepend=',' property='modifyaccount'>modifyaccount</isNotEmpty>
            <isNotEmpty prepend=',' property='modifytime'>modifytime</isNotEmpty>
            <isNotEmpty prepend=',' property='remarks'>remarks</isNotEmpty>
            <isNotEmpty prepend=',' property='extend1'>extend1</isNotEmpty>
            <isNotEmpty prepend=',' property='extend2'>extend2</isNotEmpty>
            <isNotEmpty prepend=',' property='extend3'>extend3</isNotEmpty>
            <isNotEmpty prepend=',' property='extend4'>extend4</isNotEmpty>

        </dynamic>
        <![CDATA[
	        ) values ( 
	    ]]>
        <dynamic prepend=" ">
            <isNotEmpty prepend=',' property='catalogid'>#catalogid#</isNotEmpty>
            <isNotEmpty prepend=',' property='catalogname'>#catalogname#</isNotEmpty>
            <isNotEmpty prepend=',' property='taskid'>#taskid#</isNotEmpty>
            <isNotEmpty prepend=',' property='taskname'>#taskname#</isNotEmpty>
            <isNotEmpty prepend=',' property='tasktype'>#tasktype#</isNotEmpty>
            <isNotEmpty prepend=',' property='tsaklevel'>#tsaklevel#</isNotEmpty>
            <isNotEmpty prepend=',' property='taskdescribe'>#taskdescribe#</isNotEmpty>
            <isNotEmpty prepend=',' property='taskmodel'>#taskmodel#</isNotEmpty>
            <isNotEmpty prepend=',' property='daystarttime'>#daystarttime#</isNotEmpty>
            <isNotEmpty prepend=',' property='daystarttimebyhour'>#daystarttimebyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='channeltotals'>#channeltotals#</isNotEmpty>
            <isNotEmpty prepend=',' property='mondayruntime'>#mondayruntime#</isNotEmpty>
            <isNotEmpty prepend=',' property='mondayrunbyhour'>#mondayrunbyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='tuesdayruntime'>#tuesdayruntime#</isNotEmpty>
            <isNotEmpty prepend=',' property='tuesdayrunbyhour'>#tuesdayrunbyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='wednesdayuntime'>#wednesdayuntime#</isNotEmpty>
            <isNotEmpty prepend=',' property='wednesdayunbyhour'>#wednesdayunbyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='thursdayruntime'>#thursdayruntime#</isNotEmpty>
            <isNotEmpty prepend=',' property='thursdayrunbyhour'>#thursdayrunbyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='fridayruntime'>#fridayruntime#</isNotEmpty>
            <isNotEmpty prepend=',' property='fridayrunbyhour'>#fridayrunbyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='saturdatruntime'>#saturdatruntime#</isNotEmpty>
            <isNotEmpty prepend=',' property='saturdatrunbyhour'>#saturdatrunbyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='sundayruntime'>#sundayruntime#</isNotEmpty>
            <isNotEmpty prepend=',' property='sundayrunbyhour'>#sundayrunbyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='mondayswitch'>#mondayswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='tuesdayswitch'>#tuesdayswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='wednesdayswitch'>#wednesdayswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='thursdayswitch'>#thursdayswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='fridayswitch'>#fridayswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='saturdayswitch'>#saturdayswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='sundayswitch'>#sundayswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='detectionswitch'>#detectionswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='detectionstarttime'>#detectionstarttime#</isNotEmpty>
            <isNotEmpty prepend=',' property='createaccount'>#createaccount#</isNotEmpty>
            <isNotEmpty prepend=',' property='createtime'>#createtime#</isNotEmpty>
            <isNotEmpty prepend=',' property='modifyaccount'>#modifyaccount#</isNotEmpty>
            <isNotEmpty prepend=',' property='modifytime'>#modifytime#</isNotEmpty>
            <isNotEmpty prepend=',' property='remarks'>#remarks#</isNotEmpty>
            <isNotEmpty prepend=',' property='extend1'>#extend1#</isNotEmpty>
            <isNotEmpty prepend=',' property='extend2'>#extend2#</isNotEmpty>
            <isNotEmpty prepend=',' property='extend3'>#extend3#</isNotEmpty>
            <isNotEmpty prepend=',' property='extend4'>#extend4#</isNotEmpty>

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

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

            <isNotEmpty prepend=',' property='taskname'>taskname=#taskname#</isNotEmpty>
            <isNotEmpty prepend=',' property='tasktype'>tasktype=#tasktype#</isNotEmpty>
            <isNotEmpty prepend=',' property='tsaklevel'>tsaklevel=#tsaklevel#</isNotEmpty>
            <isNotEmpty prepend=',' property='taskdescribe'>taskdescribe=#taskdescribe#</isNotEmpty>
            <isNotEmpty prepend=',' property='taskmodel'>taskmodel=#taskmodel#</isNotEmpty>
            <isNotEmpty prepend=',' property='daystarttime'>daystarttime=#daystarttime#</isNotEmpty>
            <isNotEmpty prepend=',' property='daystarttimebyhour'>daystarttimebyhour=#daystarttimebyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='channeltotals'>channeltotals=#channeltotals#</isNotEmpty>
            <isNotEmpty prepend=',' property='mondayruntime'>mondayruntime=#mondayruntime#</isNotEmpty>
            <isNotEmpty prepend=',' property='mondayrunbyhour'>mondayrunbyhour=#mondayrunbyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='tuesdayruntime'>tuesdayruntime=#tuesdayruntime#</isNotEmpty>
            <isNotEmpty prepend=',' property='tuesdayrunbyhour'>tuesdayrunbyhour=#tuesdayrunbyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='wednesdayuntime'>wednesdayuntime=#wednesdayuntime#</isNotEmpty>
            <isNotEmpty prepend=',' property='wednesdayunbyhour'>wednesdayunbyhour=#wednesdayunbyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='thursdayruntime'>thursdayruntime=#thursdayruntime#</isNotEmpty>
            <isNotEmpty prepend=',' property='thursdayrunbyhour'>thursdayrunbyhour=#thursdayrunbyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='fridayruntime'>fridayruntime=#fridayruntime#</isNotEmpty>
            <isNotEmpty prepend=',' property='fridayrunbyhour'>fridayrunbyhour=#fridayrunbyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='saturdatruntime'>saturdatruntime=#saturdatruntime#</isNotEmpty>
            <isNotEmpty prepend=',' property='saturdatrunbyhour'>saturdatrunbyhour=#saturdatrunbyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='sundayruntime'>sundayruntime=#sundayruntime#</isNotEmpty>
            <isNotEmpty prepend=',' property='sundayrunbyhour'>sundayrunbyhour=#sundayrunbyhour#</isNotEmpty>
            <isNotEmpty prepend=',' property='mondayswitch'>mondayswitch=#mondayswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='tuesdayswitch'>tuesdayswitch=#tuesdayswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='wednesdayswitch'>wednesdayswitch=#wednesdayswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='thursdayswitch'>thursdayswitch=#thursdayswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='fridayswitch'>fridayswitch=#fridayswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='saturdayswitch'>saturdayswitch=#saturdayswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='sundayswitch'>sundayswitch=#sundayswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='detectionswitch'>detectionswitch=#detectionswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='detectionstarttime'>detectionstarttime=#detectionstarttime#</isNotEmpty>
            <isNotEmpty prepend=',' property='createaccount'>createaccount=#createaccount#</isNotEmpty>
            <isNotEmpty prepend=',' property='createtime'>createtime=#createtime#</isNotEmpty>
            <isNotEmpty prepend=',' property='modifyaccount'>modifyaccount=#modifyaccount#</isNotEmpty>
            <isNotEmpty prepend=',' property='modifytime'>modifytime=#modifytime#</isNotEmpty>
            <isNotEmpty prepend=',' property='remarks'>remarks=#remarks#</isNotEmpty>
            <isNotEmpty prepend=',' property='extend1'>extend1=#extend1#</isNotEmpty>
            <isNotEmpty prepend=',' property='extend2'>extend2=#extend2#</isNotEmpty>
            <isNotEmpty prepend=',' property='extend3'>extend3=#extend3#</isNotEmpty>
            <isNotEmpty prepend=',' property='extend4'>extend4=#extend4#</isNotEmpty>
            <isNotEmpty prepend=',' property='channelsetid'>channelsetid=#channelsetid#</isNotEmpty>
            <isNotEmpty prepend=',' property='channelsetname'>channelsetname=#channelsetname#</isNotEmpty>

        </dynamic>
        where 1=1
        <isNotEmpty prepend='AND ' property='XGTJcatalogid'>catalogid = #XGTJcatalogid#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJtaskid'>taskid = #XGTJtaskid#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJtaskname'>taskname = #XGTJtaskname#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJtasktype'>tasktype = #XGTJtasktype#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJtsaklevel'>tsaklevel = #XGTJtsaklevel#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJtaskdescribe'>taskdescribe = #XGTJtaskdescribe#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJtaskmodel'>taskmodel = #XGTJtaskmodel#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJdaystarttime'>daystarttime = #XGTJdaystarttime#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJdaystarttimebyhour'>daystarttimebyhour = #XGTJdaystarttimebyhour#
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJchanneltotals'>channeltotals = #XGTJchanneltotals#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJmondayruntime'>mondayruntime = #XGTJmondayruntime#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJmondayrunbyhour'>mondayrunbyhour = #XGTJmondayrunbyhour#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJtuesdayruntime'>tuesdayruntime = #XGTJtuesdayruntime#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJtuesdayrunbyhour'>tuesdayrunbyhour = #XGTJtuesdayrunbyhour#
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJwednesdayuntime'>wednesdayuntime = #XGTJwednesdayuntime#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJwednesdayunbyhour'>wednesdayunbyhour = #XGTJwednesdayunbyhour#
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJthursdayruntime'>thursdayruntime = #XGTJthursdayruntime#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJthursdayrunbyhour'>thursdayrunbyhour = #XGTJthursdayrunbyhour#
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJfridayruntime'>fridayruntime = #XGTJfridayruntime#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJfridayrunbyhour'>fridayrunbyhour = #XGTJfridayrunbyhour#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJsaturdatruntime'>saturdatruntime = #XGTJsaturdatruntime#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJsaturdatrunbyhour'>saturdatrunbyhour = #XGTJsaturdatrunbyhour#
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJsundayruntime'>sundayruntime = #XGTJsundayruntime#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJsundayrunbyhour'>sundayrunbyhour = #XGTJsundayrunbyhour#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJmondayswitch'>mondayswitch = #XGTJmondayswitch#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJtuesdayswitch'>tuesdayswitch = #XGTJtuesdayswitch#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJwednesdayswitch'>wednesdayswitch = #XGTJwednesdayswitch#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJthursdayswitch'>thursdayswitch = #XGTJthursdayswitch#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJfridayswitch'>fridayswitch = #XGTJfridayswitch#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJsaturdayswitch'>saturdayswitch = #XGTJsaturdayswitch#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJsundayswitch'>sundayswitch = #XGTJsundayswitch#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJdetectionswitch'>detectionswitch = #XGTJdetectionswitch#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJdetectionstarttime'>detectionstarttime = #XGTJdetectionstarttime#
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJcreateaccount'>createaccount = #XGTJcreateaccount#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJcreatetime'>createtime = #XGTJcreatetime#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJmodifyaccount'>modifyaccount = #XGTJmodifyaccount#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJmodifytime'>modifytime = #XGTJmodifytime#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJremarks'>remarks = #XGTJremarks#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJextend1'>extend1 = #XGTJextend1#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJextend2'>extend2 = #XGTJextend2#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJextend3'>extend3 = #XGTJextend3#</isNotEmpty>
        <isNotEmpty prepend='AND ' property='XGTJextend4'>extend4 = #XGTJextend4#</isNotEmpty>

    </update>

    <!-- delete object -->
    <delete id="delete_Ywvideotask" parameterClass="java.util.Map">
        delete from ywvideotask where   (taskid = #taskid# )
    </delete>

    <!-- batch delete object -->
    <delete id="batch_delete_Ywvideotask_bak" parameterClass="java.util.Map">
        delete from ywvideotask
        where  key in (#keyword#)
    </delete>
    <delete id="batch_delete_Ywvideotask" parameterClass="java.util.List">
        delete from ywvideotask    where taskid in
        <iterate open="(" close=")" conjunction=" ,">
            #list[]#
        </iterate>
    </delete>
    <update id="batch_update_Ywvideotask" parameterClass="java.util.Map">
        update ywvideotask
        <dynamic prepend="set ">
            <isNotEmpty prepend=',' property='detectionstarttime'>detectionstarttime=#detectionstarttime#</isNotEmpty>
            <isNotEmpty prepend=',' property='detectionswitch'>detectionswitch=#detectionswitch#</isNotEmpty>
            <isNotEmpty prepend=',' property='modifyaccount'>modifyaccount=#modifyaccount#</isNotEmpty>
            <isNotEmpty prepend=',' property='modifytime'>modifytime=#modifytime#</isNotEmpty>
            <isNotEmpty prepend=',' property='extend1'>extend1=#extend1#</isNotEmpty>
            <isNotEmpty prepend=',' property='extend3'>extend3=#extend3#</isNotEmpty>
            <isNotEmpty prepend=',' property='extend4'>extend4=#extend4#</isNotEmpty>

        </dynamic>
        where 1=1
        <isNotEmpty prepend='AND ' property='keyword'>
            taskid in
            <iterate open="(" close=")" conjunction="," property="keyword">

                #keyword[]#
            </iterate>

        </isNotEmpty>
    </update>
    <update id="delete_channelset_Ywvideotask" parameterClass="java.util.Map">
        update ywvideotask set channelsetid='',channelsetname=''
        <isNotEmpty prepend=',' property='modifyaccount'>modifyaccount=#modifyaccount#</isNotEmpty>
        <isNotEmpty prepend=',' property='modifytime'>modifytime=#modifytime#</isNotEmpty>
        where 1=1
        <isNotEmpty prepend='AND ' property='taskid'>
            taskid = #taskid#
        </isNotEmpty>
    </update>
    <!-- query objects by page-->
    <select id="query_Ywvideotask_children" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        select
        b.catalogid,b.catalogname,b.taskid,b.taskname,b.tasktype,b.tsaklevel,b.taskdescribe,b.taskmodel,
        b.daystarttime,b.daystarttimebyhour,b.channeltotals,b.mondayruntime,
        b.mondayrunbyhour,b.tuesdayruntime,b.tuesdayrunbyhour,b.wednesdayuntime,
        b.wednesdayunbyhour,b.thursdayruntime,b.thursdayrunbyhour,b.fridayruntime,
        b.fridayrunbyhour,b.saturdatruntime,b.saturdatrunbyhour,b.sundayruntime,b.sundayrunbyhour,
        b.mondayswitch,b.tuesdayswitch,b.wednesdayswitch,b.thursdayswitch,b.fridayswitch,b.saturdayswitch,
        b.sundayswitch,b.detectionswitch,b.detectionstarttime,b.createaccount,b.createtime,b.modifyaccount,
        b.modifytime,b.remarks,b.extend1,b.extend2,b.extend3,b.extend4,
        (select csmc from xtcl where csdl='ywTaskEnable' and csdm=detectionswitch) as detectionswitchname
        from ywvideotask b
        where 1=1
        <isNotEmpty prepend='AND ' property='catalogid'>
            (b.catalogid = #catalogid# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='taskname'>
            (b.taskname like '%$taskname$%' )
        </isNotEmpty>
        order by createtime desc
    </select>
    <select id="query_Ywvideotask" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        select
        b.catalogid,b.catalogname,b.taskid,b.taskname,
        b.tasktype,(select csmc from xtcl a where a.csdl='ywVideoTaskType' and a.csdm=b.tasktype) as tasktypename,
        b.tsaklevel,(select csmc from xtcl a where a.csdl='ywVideoTaskLevel' and a.csdm=b.tsaklevel) as tsaklevelname,
        b.taskmodel,(select csmc from xtcl a where a.csdl='ywVideoTaskModel' and a.csdm=b.taskmodel) as taskmodelname,
        b.taskdescribe, b.daystarttime,b.daystarttimebyhour,b.channeltotals,b.mondayruntime,
        b.mondayrunbyhour,b.tuesdayruntime,b.tuesdayrunbyhour,b.wednesdayuntime,
        b.wednesdayunbyhour,b.thursdayruntime,b.thursdayrunbyhour,b.fridayruntime,
        b.fridayrunbyhour,b.saturdatruntime,b.saturdatrunbyhour,b.sundayruntime,b.sundayrunbyhour,
        b.mondayswitch,b.tuesdayswitch,b.wednesdayswitch,b.thursdayswitch,b.fridayswitch,b.saturdayswitch,
        b.sundayswitch,b.detectionswitch,b.detectionstarttime,b.createaccount,b.createtime,b.modifyaccount,
        b.modifytime,b.remarks,
        b.extend1,(select csmc from xtcl a where a.csdl='nhywVideotaskApproveStatus' and a.csdm=b.extend1) as
        extend1name,
        b.extend2,b.extend3,b.extend4,
        (select csmc from xtcl where csdl='ywTaskEnable' and csdm=detectionswitch) as detectionswitchname,
        b.channelsetid,b.channelsetname,
        c.ruleid
        from ywvideotask b left join ywvideotaskrule c on c.taskid=b.taskid
        where 1=1

        <isNotEmpty prepend='AND ' property='taskname'>
            (b.taskname like '%$taskname$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='tasktype'>
            (b.tasktype = $tasktype$ )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='tsaklevel'>
            (b.tsaklevel = $tsaklevel$ )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='taskmodel'>
            (b.taskmodel = $taskmodel$ )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='detectionswitch'>
            (b.detectionswitch = $detectionswitch$ )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='createaccount'>
            (b.createaccount = #createaccount# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='extend2'>
            (b.extend2 = #extend2# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='extend1'>
            (b.extend1 = #extend1# )
        </isNotEmpty>
        <isNotEmpty property='order'>
            $order$
        </isNotEmpty>
        <!-- <isNotEmpty prepend=' ' property='start'>
            limit #start# ,#limit#
        </isNotEmpty> -->
    </select>
    <!-- query objects totalcount -->
    <select id="count_Ywvideotask" resultClass="java.lang.Integer" parameterClass="java.util.Map">
        select count(*)
        from ywvideotask b
        where 1=1

        <isNotEmpty prepend='AND ' property='taskname'>
            (b.taskname like '%$taskname$%' )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='tasktype'>
            (b.tasktype = $tasktype$ )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='tsaklevel'>
            (b.tsaklevel = $tsaklevel$ )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='taskmodel'>
            (b.taskmodel = $taskmodel$ )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='detectionswitch'>
            (b.detectionswitch = $detectionswitch$ )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='extend2'>
            (b.extend2 = #extend2# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='extend1'>
            (b.extend1 = #extend1# )
        </isNotEmpty>
    </select>

    <select id="getApproveUser" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		 select a.yhbh,a.sjhm,a.yhmc,a.yhzh from ptyh a,ywuserrolerelation b 
		where a.yhbh = b.usernum and b.isapprovalauthory=1
	</select>

    <!-- batch add objects -->
    <insert id="batch_insert_Ywvideotask" parameterClass="java.util.List">
        <![CDATA[
          INSERT
      	]]>
        <iterate conjunction=" ">
            into ywvideotask(
            <![CDATA[
				taskid,taskname,tasktype,tsaklevel,taskdescribe,taskmodel,daystarttime,daystarttimebyhour,channeltotals,mondayruntime,mondayrunbyhour,tuesdayruntime,tuesdayrunbyhour,wednesdayuntime,wednesdayunbyhour,thursdayruntime,thursdayrunbyhour,fridayruntime,fridayrunbyhour,saturdatruntime,saturdatrunbyhour,sundayruntime,sundayrunbyhour,mondayswitch,tuesdayswitch,wednesdayswitch,thursdayswitch,fridayswitch,saturdayswitch,sundayswitch,detectionswitch,detectionstarttime,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4
			)values
			 ]]>
            <![CDATA[  1
				(
				#list[].taskid#,#list[].taskname#,#list[].tasktype#,#list[].tsaklevel#,#list[].taskdescribe#,#list[].taskmodel#,#list[].daystarttime#,#list[].daystarttimebyhour#,#list[].channeltotals#,#list[].mondayruntime#,#list[].mondayrunbyhour#,#list[].tuesdayruntime#,#list[].tuesdayrunbyhour#,#list[].wednesdayuntime#,#list[].wednesdayunbyhour#,#list[].thursdayruntime#,#list[].thursdayrunbyhour#,#list[].fridayruntime#,#list[].fridayrunbyhour#,#list[].saturdatruntime#,#list[].saturdatrunbyhour#,#list[].sundayruntime#,#list[].sundayrunbyhour#,#list[].mondayswitch#,#list[].tuesdayswitch#,#list[].wednesdayswitch#,#list[].thursdayswitch#,#list[].fridayswitch#,#list[].saturdayswitch#,#list[].sundayswitch#,#list[].detectionswitch#,#list[].detectionstarttime#,#list[].createaccount#,#list[].createtime#,#list[].modifyaccount#,#list[].modifytime#,#list[].remarks#,#list[].extend1#,#list[].extend2#,#list[].extend3#,#list[].extend4#
				)
			]]>
        </iterate>
    </insert>
    <select id="query_YwjtqueryTimeParam" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        SELECT daystarttime||':00' daystarttime,'23:59:59' nexttime,taskid
        FROM ywvideotask b   LEFT JOIN ywvideochannelset c ON b.channelsetid = c.channelsetid where  devicetype =#devicetype#
        union all
        SELECT decode(daystarttimebyhour,0,null,to_char(to_date(daystarttime,'hh24:mi:ss')+ daystarttimebyhour/24,'hh24:mi:ss'))  daystarttime,'23:59:59' nexttime, taskid
        FROM ywvideotask b   LEFT JOIN ywvideochannelset c ON b.channelsetid = c.channelsetid where  daystarttimebyhour>0
        and devicetype =#devicetype#
    </select>

    <select id="query_Ywjtxjtask" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        select taskid,#startTime# starttime ,#endTime# endTime,devicetype,taskname,tasktypename ,
        count(*)sbzs ,sum(decode(state,'1',1))onlinestotal
        from
        (
        SELECT m.create_time, concat(concat(concat(m.create_time, ' '), daystarttime), ':00') AS starttime
        , taskmodel, daystarttime, daystarttimebyhour, taskname, tasktype
        , ( SELECT csmc FROM xtcl WHERE csdl = 'ywVideoTaskType' AND csdm = tasktype ) AS tasktypename,
        b.channelsetid, b.channelsetname, c.devicetype, taskid,state
        FROM ywvideotask b
        LEFT JOIN ywvideochannelset c ON b.channelsetid = c.channelsetid
        LEFT JOIN ywvideochannelsetlist t ON t.channelsetid = b.channelsetid
        LEFT JOIN (
        select * from (
        <isEqual compareValue="1" property="devicetype">
            SELECT videonum xh , channelnum , to_char(m.isonline) state, '1' AS devicetype,
            to_char(to_date(currentstatetime , 'yyyy-MM-dd hh24:mi:ss'), 'yyyy-MM-dd') AS
            create_time, to_date(currentstatetime,'yyyy-MM-dd hh24:mi:ss') xjsj
            FROM ywvideohistorystate m
        </isEqual>
        <isEqual compareValue="3" property="devicetype">
            SELECT xh, 0 channelnum, m.state,'3' AS devicetype, to_char(to_date(create_time, 'yyyy-MM-dd hh24:mi:ss'),
            'yyyy-MM-dd') AS
            create_time, to_date(create_time,'yyyy-MM-dd hh24:mi:ss') xjsj
            FROM nhywjtxhdstate_history m  left join  nhywjtxhdgl b on b.qybh=m.noarea and b.lkh=m.nojunc
        </isEqual>
        <isEqual compareValue="4" property="devicetype">
            SELECT sbid AS xh,0 channelnum, sbzt state, '4' AS devicetype, to_char(to_date(xjsj, 'yyyy-MM-dd
            hh24:mi:ss'), 'yyyy-MM-dd') AS
            create_time,to_date(xjsj,'yyyy-MM-dd hh24:mi:ss')xjsj
            FROM nhywjtledydpzt
        </isEqual>
        <isEqual compareValue="10" property="devicetype">
            SELECT id AS xh, 0 channelnum,state, '10' AS devicetype, to_char(create_time, 'yyyy-MM-dd') AS
            create_time,create_time xjsj
            FROM its.ksh_detector_history
            WHERE detectortype = 'GVD'
        </isEqual>
        <isEqual compareValue="11" property="devicetype">
            SELECT id AS xh,0 channelnum, state, '11' AS devicetype, to_char(create_time, 'yyyy-MM-dd') AS
            create_time,create_time xjsj
            FROM its.ksh_detector_history
            WHERE detectortype = 'SMARTSENSOR'
        </isEqual>
        <isEqual compareValue="12" property="devicetype">
            SELECT xh, 0 channelnum,state, '12' AS devicetype, to_char(create_time, 'yyyy-MM-dd') AS
            create_time,create_time xjsj
            FROM its.ksh_zxldstate_history
        </isEqual>
        ) where 1=1
        <isNotEmpty prepend='AND ' property='startTime'>
            (xjsj >=to_date(#startTime#,'yyyy-MM-dd hh24:mi:ss'))
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='endTime'>
            <![CDATA[ (xjsj <=to_date(#endTime#,'yyyy-MM-dd  hh24:mi:ss'))]]>
        </isNotEmpty>
        ) m ON t.videonum = m.xh and t.channelnum=m.channelnum and c.devicetype=m.devicetype where c.devicetype != 2
        <isNotEmpty prepend='AND ' property='devicetype'>
            (c.devicetype =#devicetype# )
        </isNotEmpty>
        )
        group by taskid,starttime ,devicetype,taskname,tasktypename
    </select>

    <select id="count_Ywjtxjtask" resultClass="java.lang.Integer" parameterClass="java.util.Map">
        select count(count(*))
        from
        (
        SELECT m.create_time, concat(concat(concat(m.create_time, ' '), daystarttime), ':00') AS starttime
        , taskmodel, daystarttime, daystarttimebyhour, taskname, tasktype
        , ( SELECT csmc FROM xtcl WHERE csdl = 'ywVideoTaskType' AND csdm = tasktype ) AS tasktypename,
        b.channelsetid, b.channelsetname, m.devicetype, taskid,state
        FROM ywvideotask b
        LEFT JOIN ywvideochannelset c ON b.channelsetid = c.channelsetid
        LEFT JOIN ywvideochannelsetlist t ON t.channelsetid = b.channelsetid
        LEFT JOIN (
        select * from (
        <isEqual compareValue="1" property="devicetype">
            SELECT xh, to_char(m.isonline) state, '1' AS devicetype, to_char(to_date(currentstatetime , 'yyyy-MM-dd
            hh24:mi:ss'), 'yyyy-MM-dd') AS
            create_time,currentstatetime xjsj
            FROM ywvideohistorystate m
        </isEqual>
        <isEqual compareValue="3" property="devicetype">
            SELECT xh, m.state, '3' AS devicetype, to_char(to_date(create_time, 'yyyy-MM-dd hh24:mi:ss'), 'yyyy-MM-dd')
            AS
            create_time,create_time xjsj
            FROM nhywjtxhdstate_history m left join  nhywjtxhdgl b on b.qybh=m.noarea and b.lkh=m.nojunc
        </isEqual>
        <isEqual compareValue="4" property="devicetype">
            SELECT sbid AS xh, sbzt state, '4' AS devicetype, to_char(to_date(xjsj, 'yyyy-MM-dd hh24:mi:ss'),
            'yyyy-MM-dd') AS
            create_time,xjsj
            FROM nhywjtledydpzt
        </isEqual>
        <isEqual compareValue="10" property="devicetype">
            SELECT id AS xh, state, '10' AS devicetype, to_char(create_time, 'yyyy-MM-dd') AS
            create_time,to_char(create_time, 'yyyy-MM-dd hh24:mi:ss') xjsj
            FROM its.ksh_detector_history
            WHERE detectortype = 'GVD'
        </isEqual>
        <isEqual compareValue="11" property="devicetype">
            SELECT id AS xh, state, '11' AS devicetype, to_char(create_time, 'yyyy-MM-dd') AS
            create_time,to_char(create_time, 'yyyy-MM-dd hh24:mi:ss') xjsj
            FROM its.ksh_detector_history
            WHERE detectortype = 'SMARTSENSOR'
        </isEqual>
        <isEqual compareValue="12" property="devicetype">
            SELECT xh, state, '12' AS devicetype, to_char(create_time, 'yyyy-MM-dd') AS create_time,to_char(create_time,
            'yyyy-MM-dd hh24:mi:ss') xjsj
            FROM its.ksh_zxldstate_history
        </isEqual>
        ) where 1=1
        <isNotEmpty prepend='AND ' property='startTime'>
            (xjsj >=#startTime# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='endTime'>
            <![CDATA[ (xjsj <=#endTime# )]]>
        </isNotEmpty>
        ) m ON t.videonum = m.xh and c.devicetype=m.devicetype where c.devicetype != 2
        <isNotEmpty prepend='AND ' property='devicetype'>
            (c.devicetype =#devicetype# )
        </isNotEmpty>
        )
        group by taskid,starttime ,devicetype,taskname,tasktypename

    </select>

    <select id="query_Ywtaskrunresulthistory" resultClass="java.util.HashMap" parameterClass="java.util.Map" remapResults="true">
        SELECT to_char(xjsj,'yyyy-MM-dd hh24:mi:ss')xjsj , taskname ,t.videonum,t.channelnum,taskid,state,ip,name
        FROM ywvideotask b
        LEFT JOIN ywvideochannelset c ON b.channelsetid = c.channelsetid
        LEFT JOIN ywvideochannelsetlist t ON t.channelsetid = b.channelsetid
        left join(
        select * from (
        <isEqual compareValue="1" property="devicetype">
            select m.videonum xh ,m.channelnum, isonline state ,sbip ip ,n.tdmc name, to_date(createtime,'yyyy-MM-dd
            hh24:mi:ss') xjsj
            from ywvideohistorystate m
            left join sbtdspsr n on n.sbbh = m.videonum and n.tdbh = m.channelnum
            left join sbxx l on l.sbbh=m.videonum
            where  n.kz3 is not null  and n.kz3 != '1'
        </isEqual>
        <isEqual compareValue="3" property="devicetype">
            SELECT xh,0 channelnum , m.state,ip ,xhdmc name, to_date(create_time,'yyyy-MM-dd hh24:mi:ss')xjsj
            FROM nhywjtxhdstate_history m LEFT JOIN nhywjtxhdgl n ON n.qybh = m.noarea AND n.lkh = m.nojunc
        </isEqual>
        <isEqual compareValue="4" property="devicetype">
            SELECT sbid AS xh, 0 channelnum ,sbzt state,ip, ledmc name,to_date(xjsj,'yyyy-MM-dd hh24:mi:ss')xjsj
            FROM nhywjtledydpzt m LEFT JOIN nhywjtledydpgl n ON n.xh = m.sbid
        </isEqual>
        <isEqual compareValue="10" property="devicetype">
            SELECT n.id AS xh, 0 channelnum ,m.state,ip,name ,create_time xjsj
            FROM its.ksh_detector_history m left join its.ksh_detector n on m.id=n.id
            WHERE n.detectortype = 'GVD'
        </isEqual>
        <isEqual compareValue="11" property="devicetype">
            SELECT n.id AS xh, 0 channelnum ,m.state,ip,name ,create_time xjsj
            FROM its.ksh_detector_history m left join its.ksh_detector n on m.id=n.id
            WHERE n.detectortype = 'SMARTSENSOR'
        </isEqual>
        <isEqual compareValue="12" property="devicetype">
            SELECT n.xh,0 channelnum ,m.state,ip,ldmc name,create_time xjsj
            FROM its.ksh_zxldstate_history m left join its.ksh_zxld n on m.xh=n.xh
        </isEqual>
        ) where 1=1
        <isNotEmpty prepend='AND ' property='startTime'>
            (xjsj >=to_date(#startTime#,'yyyy-MM-dd hh24:mi:ss') )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='endTime'>
            <![CDATA[ (xjsj <=to_date(#endTime#,'yyyy-MM-dd  hh24:mi:ss') )]]>
        </isNotEmpty>
        ) m ON t.videonum = m.xh and t.channelnum = m.channelnum where c.devicetype != 2
        <isNotEmpty prepend='AND ' property='devicetype'>
            (c.devicetype =#devicetype# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='taskid'>
            (b.taskid =#taskid# )
        </isNotEmpty>
    </select>

    <!-- query objects totalcount -->
    <select id="count_Ywtaskrunresulthistory" resultClass="java.lang.Integer" parameterClass="java.util.Map" remapResults="true">
        SELECT count(*)
        FROM ywvideotask b
        LEFT JOIN ywvideochannelset c ON b.channelsetid = c.channelsetid
        LEFT JOIN ywvideochannelsetlist t ON t.channelsetid = b.channelsetid
        left join(
        select * from (
        <isEqual compareValue="1" property="devicetype">
            select m.videonum xh ,m.channelnum, isonline state ,sbip ip ,tdmc name, to_date(createtime,'yyyy-MM-dd
            hh24:mi:ss') xjsj
            from ywvideohistorystate m
            left join sbtdspsr n on n.sbbh = m.videonum and n.tdbh = m.channelnum
            left join sbxx l on l.sbbh=m.videonum
            where   n.kz3 is not null  and n.kz3 != '1'
        </isEqual>
        <isEqual compareValue="3" property="devicetype">
            SELECT xh,0 channelnum , m.state,ip ,xhdmc name, to_date(create_time,'yyyy-MM-dd hh24:mi:ss')xjsj
            FROM nhywjtxhdstate_history m LEFT JOIN nhywjtxhdgl n ON n.qybh = m.noarea AND n.lkh = m.nojunc
        </isEqual>
        <isEqual compareValue="4" property="devicetype">
            SELECT sbid AS xh, 0 channelnum ,sbzt state,ip, ledmc name,to_date(xjsj,'yyyy-MM-dd hh24:mi:ss')xjsj
            FROM nhywjtledydpzt m LEFT JOIN nhywjtledydpgl n ON n.xh = m.sbid
        </isEqual>
        <isEqual compareValue="10" property="devicetype">
            SELECT n.id AS xh, 0 channelnum ,m.state,ip,name ,create_time xjsj
            FROM its.ksh_detector_history m left join its.ksh_detector n on m.id=n.id
            WHERE n.detectortype = 'GVD'
        </isEqual>
        <isEqual compareValue="11" property="devicetype">
            SELECT n.id AS xh, 0 channelnum ,m.state,ip,name ,create_time xjsj
            FROM its.ksh_detector_history m left join its.ksh_detector n on m.id=n.id
            WHERE n.detectortype = 'SMARTSENSOR'
        </isEqual>
        <isEqual compareValue="12" property="devicetype">
            SELECT n.xh,0 channelnum ,m.state,ip,ldmc name,create_time xjsj
            FROM its.ksh_zxldstate_history m left join its.ksh_zxld n on m.xh=n.xh
        </isEqual>
        ) where 1=1
        <isNotEmpty prepend='AND ' property='startTime'>
            (xjsj >=to_date(#startTime#,'yyyy-MM-dd hh24:mi:ss') )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='endTime'>
            <![CDATA[ (xjsj <=to_date(#endTime#,'yyyy-MM-dd  hh24:mi:ss') )]]>
        </isNotEmpty>
        ) m ON t.videonum = m.xh and t.channelnum = m.channelnum where c.devicetype != 2
        <isNotEmpty prepend='AND ' property='devicetype'>
            (c.devicetype =#devicetype# )
        </isNotEmpty>
        <isNotEmpty prepend='AND ' property='taskid'>
            (b.taskid =#taskid# )
        </isNotEmpty>
    </select>


    <select id="query_YwDevicetaskNoTask" resultClass="java.util.HashMap" parameterClass="java.util.Map">
        <isEqual compareValue="1" property="devicetype">
            select sptd.* , ff.sbip ip
            from (select
            xh,sbbh,tdbh,tdmc,xzbh,(select xzmc from ptxzs p where p.xzbh = sptd.xzbh )xzmc
            from sbtdspsr sptd where not exists (
            select b.videonum
            FROM ywvideochannelsetlist b
            LEFT JOIN ywvideotask t ON b.channelsetid = t.channelsetid
            where b.videonum=sbbh and b.channelnum=tdbh
            <isNotEmpty prepend='AND ' property='taskid'>
                (taskid = #taskid# )
            </isNotEmpty>
            ) and   sptd.kz3 is not null  and sptd.kz3 != '1') sptd left join sbxx ff on sptd.sbbh = ff.sbbh
            <!--select  sptd.* , ff.sbip-->
            <!--from  (select-->
            <!--xh,sbbh,tdbh,tdmc,xzbh,(select xzmc from ptxzs p where p.xzbh = sptd.xzbh )xzmc-->
            <!--from sbtdspsr sptd   where not exists (select videonum from-->
            <!--ywvideotaskrunresulthistory a where a.videonum=sbbh-->
            <!--<isNotEmpty prepend='AND ' property='runsetid'>-->
            <!--(runsetid = #runsetid# )-->
            <!--</isNotEmpty>-->
            <!--<isNotEmpty prepend='AND ' property='taskid'>-->
            <!--(taskid = #taskid# )-->
            <!--</isNotEmpty>-->
            <!--) )sptd-->
            <!--left join sbxx ff on sptd.sbbh = ff.sbbh-->
        </isEqual>
        <isEqual compareValue="3" property="devicetype">
            select xh , ledbh sbbh,'' tdbh,ledmc tdmc,qybh xzbh ,(select xzmc from ptxzs p where p.xzbh = n.qybh)xzmc,ip
            from nhywjtledydpgl n where not exists (select videonum
            FROM ywvideochannelsetlist b
            LEFT JOIN ywvideotask t ON b.channelsetid = t.channelsetid
            where b.videonum=xh
            <isNotEmpty prepend='AND ' property='taskid'>
                (taskid = #taskid# )
            </isNotEmpty>
            )
        </isEqual>
        <isEqual compareValue="4" property="devicetype">
            select xh , xhdbh sbbh,'' tdbh,xhdmc tdmc,qybh xzbh ,(select xzmc from ptxzs p where p.xzbh = n.qybh )xzmc,ip
            from nhywjtxhdgl n
            where not exists (select videonum
            FROM ywvideochannelsetlist b
            LEFT JOIN ywvideotask t ON b.channelsetid = t.channelsetid
            where b.videonum=xh
            <isNotEmpty prepend='AND ' property='taskid'>
                (taskid = #taskid# )
            </isNotEmpty>
            )
        </isEqual>
        <isEqual compareValue="10" property="devicetype">
            select id xh ,id sbbh,'' tdbh,name tdmc,regionid xzbh ,(select xzmc from ptxzs p where p.xzbh = n.regionid)xzmc,ip
            from its.ksh_detector n
            where n.detectortype = 'GVD' and not exists (select videonum
            FROM ywvideochannelsetlist b
            LEFT JOIN ywvideotask t ON b.channelsetid = t.channelsetid
            where b.videonum=id
            <isNotEmpty prepend='AND ' property='taskid'>
                (taskid = #taskid# )
            </isNotEmpty>
            )
        </isEqual>
        <isEqual compareValue="11" property="devicetype">
            select id xh ,id sbbh,'' tdbh,name tdmc,regionid xzbh ,(select xzmc from ptxzs p where p.xzbh = n.regionid)xzmc,ip
            from its.ksh_detector n
            where n.detectortype = 'SMARTSENSOR' and not exists (select videonum
            FROM ywvideochannelsetlist b
            LEFT JOIN ywvideotask t ON b.channelsetid = t.channelsetid
            where b.videonum=id
            <isNotEmpty prepend='AND ' property='taskid'>
                (taskid = #taskid# )
            </isNotEmpty>
            )
        </isEqual>
        <isEqual compareValue="12" property="devicetype">
            select xh , ldbh sbbh,'' tdbh,ldmc tdmc,gxdwbh xzbh ,(select xzmc from ptxzs p where p.xzbh = n.gxdwbh )xzmc,ip
            from its.ksh_zxld n
            where not exists (select videonum
            FROM ywvideochannelsetlist b
            LEFT JOIN ywvideotask t ON b.channelsetid = t.channelsetid
            where b.videonum=xh
            <isNotEmpty prepend='AND ' property='taskid'>
                (taskid = #taskid# )
            </isNotEmpty>
            )
        </isEqual>
    </select>

    <!-- query objects totalcount -->
    <select id="count_YwDevicetaskNoTask" resultClass="java.lang.Integer" parameterClass="java.util.Map">
        <isEqual compareValue="1" property="devicetype">
            select count(*)
            from sbtdspsr sptd where not exists (
            select b.videonum
            FROM ywvideochannelsetlist b
            LEFT JOIN ywvideotask t ON b.channelsetid = t.channelsetid
            where b.videonum=sbbh and b.channelnum=tdbh
            <isNotEmpty prepend='AND ' property='taskid'>
                (taskid = #taskid# )
            </isNotEmpty>
            ) and sptd.kz3 is not null
            and sptd.kz3 != '1'
            <!--select  sptd.* , ff.sbip-->
            <!--from  (select-->
            <!--xh,sbbh,tdbh,tdmc,xzbh,(select xzmc from ptxzs p where p.xzbh = sptd.xzbh)xzmc-->
            <!--from sbtdspsr sptd   where not exists (select videonum from-->
            <!--ywvideotaskrunresulthistory a where a.videonum=sbbh-->
            <!--<isNotEmpty prepend='AND ' property='runsetid'>-->
            <!--(runsetid = #runsetid# )-->
            <!--</isNotEmpty>-->
            <!--<isNotEmpty prepend='AND ' property='taskid'>-->
            <!--(taskid = #taskid# )-->
            <!--</isNotEmpty>-->
            <!--) )sptd-->
            <!--left join sbxx ff on sptd.sbbh = ff.sbbh-->
        </isEqual>
        <isEqual compareValue="3" property="devicetype">
            select count(*)
            from nhywjtledydpgl n where not exists (select videonum
            FROM ywvideochannelsetlist b
            LEFT JOIN ywvideotask t ON b.channelsetid = t.channelsetid
            where b.videonum=xh
            <isNotEmpty prepend='AND ' property='taskid'>
                (taskid = #taskid# )
            </isNotEmpty>
            )
        </isEqual>
        <isEqual compareValue="4" property="devicetype">
            select count(*)
            from nhywjtxhdgl n
            where not exists (select videonum
            FROM ywvideochannelsetlist b
            LEFT JOIN ywvideotask t ON b.channelsetid = t.channelsetid
            where b.videonum=xh
            <isNotEmpty prepend='AND ' property='taskid'>
                (taskid = #taskid# )
            </isNotEmpty>
            )
        </isEqual>
        <isEqual compareValue="10" property="devicetype">
            select count(*)
            from its.ksh_detector n
            where n.detectortype = 'GVD' and not exists (select videonum
            FROM ywvideochannelsetlist b
            LEFT JOIN ywvideotask t ON b.channelsetid = t.channelsetid
            where b.videonum=id
            <isNotEmpty prepend='AND ' property='taskid'>
                (taskid = #taskid# )
            </isNotEmpty>
            )
        </isEqual>
        <isEqual compareValue="11" property="devicetype">
            select count(*)
            from its.ksh_detector n
            where n.detectortype = 'SMARTSENSOR' and not exists (select videonum
            FROM ywvideochannelsetlist b
            LEFT JOIN ywvideotask t ON b.channelsetid = t.channelsetid
            where b.videonum=id
            <isNotEmpty prepend='AND ' property='taskid'>
                (taskid = #taskid# )
            </isNotEmpty>
            )
        </isEqual>
        <isEqual compareValue="12" property="devicetype">
            select count(*)
            from its.ksh_zxld n
            where not exists (select videonum
            FROM ywvideochannelsetlist b
            LEFT JOIN ywvideotask t ON b.channelsetid = t.channelsetid
            where b.videonum=xh
            <isNotEmpty prepend='AND ' property='taskid'>
                (taskid = #taskid# )
            </isNotEmpty>
            )
        </isEqual>


    </select>


</sqlMap>











