Pārlūkot izejas kodu

指令集 RabbitMq 初始化

liuyaowen 1 gadu atpakaļ
vecāks
revīzija
ff1ad17d62

+ 9 - 9
src/main/java/com/yunfeiyun/agmp/iotm/device/monitor/service/impl/IotEzvizMonitorServiceImpl.java

@@ -57,7 +57,7 @@ public class IotEzvizMonitorServiceImpl extends IotDeviceBaseServiceImpl impleme
             throw new IotBizException(ErrorCode.FAILURE.getCode(),"设备已离线");
         }
         CmdGroupModel cmdGroupModel = new CmdGroupModel();
-        cmdGroupModel.setCId(CustomerIdUtil.getCustomerId());
+        cmdGroupModel.setTid(CustomerIdUtil.getCustomerId());
         cmdGroupModel.setCmdModels(new LinkedList<>());
         CmdModel cmdModel = new CmdModel();
         cmdModel.setDeviceId(iotMonitorPtzReqVo.getDevBid());
@@ -81,7 +81,7 @@ public class IotEzvizMonitorServiceImpl extends IotDeviceBaseServiceImpl impleme
         cmdGroupModel.setCtBiztype("3");
         cmdGroupModel.setCtBiztitle(IotDeviceTypeLv1Enum.JKSB.getName() + ":" + iotDevice.getDevCode());
         cmdGroupModel.setCtDevtype(iotDevice.getDevtypeBid());
-        
+
         iIotCmdtaskService.handInternalCmd(cmdGroupModel);
         return cmdGroupModel.getTaskUuid();
     }
@@ -97,7 +97,7 @@ public class IotEzvizMonitorServiceImpl extends IotDeviceBaseServiceImpl impleme
         }
         String[] devCodeArray = iotDevice.getDevCode().split("-");
         CmdGroupModel cmdGroupModel = new CmdGroupModel();
-        cmdGroupModel.setCId(CustomerIdUtil.getCustomerId());
+        cmdGroupModel.setTid(CustomerIdUtil.getCustomerId());
         cmdGroupModel.setCmdModels(new LinkedList<>());
         CmdModel cmdModel = new CmdModel();
         cmdModel.setDeviceId(iotMonitorPtzReqVo.getDevBid());
@@ -134,7 +134,7 @@ public class IotEzvizMonitorServiceImpl extends IotDeviceBaseServiceImpl impleme
         }
         String[] devCodeArray = iotDevice.getDevCode().split("-");
         CmdGroupModel cmdGroupModel = new CmdGroupModel();
-        cmdGroupModel.setCId(CustomerIdUtil.getCustomerId());
+        cmdGroupModel.setTid(CustomerIdUtil.getCustomerId());
         cmdGroupModel.setCmdModels(new LinkedList<>());
         CmdModel cmdModel = new CmdModel();
         cmdModel.setDeviceId(iotMonitorCaptureReqVo.getDevBid());
@@ -171,7 +171,7 @@ public class IotEzvizMonitorServiceImpl extends IotDeviceBaseServiceImpl impleme
         }
         String[] devCodeArray = iotDevice.getDevCode().split("-");
         CmdGroupModel cmdGroupModel = new CmdGroupModel();
-        cmdGroupModel.setCId(CustomerIdUtil.getCustomerId());
+        cmdGroupModel.setTid(CustomerIdUtil.getCustomerId());
         cmdGroupModel.setCmdModels(new LinkedList<>());
         CmdModel cmdModel = new CmdModel();
         cmdModel.setDeviceId(iotMonitorVideoReqVo.getDevBid());
@@ -204,12 +204,12 @@ public class IotEzvizMonitorServiceImpl extends IotDeviceBaseServiceImpl impleme
         if(null == iotDevice){
             iotDevice = iotDeviceMapper.selectIotDeviceByDevBid(iotMonitorAddressGetReqVo.getDevBid());
         }
-        if(ObjectUtil.isNull(redisCacheManager.getCacheObject(RedisCacheKey.IOT_DEVICE_STATUS,iotMonitorAddressGetReqVo.getDevBid()))){
+        /*if(ObjectUtil.isNull(redisCacheManager.getCacheObject(RedisCacheKey.IOT_DEVICE_STATUS,iotMonitorAddressGetReqVo.getDevBid()))){
             throw new IotBizException(ErrorCode.FAILURE.getCode(),"设备已离线");
-        }
+        }*/
         String[] devCodeArray = iotDevice.getDevCode().split("-");
         CmdGroupModel cmdGroupModel = new CmdGroupModel();
-        cmdGroupModel.setCId(CustomerIdUtil.getCustomerId());
+        cmdGroupModel.setTid(CustomerIdUtil.getCustomerId());
         cmdGroupModel.setCmdModels(new LinkedList<>());
         CmdModel cmdModel = new CmdModel();
         cmdModel.setDeviceId(iotMonitorAddressGetReqVo.getDevBid());
@@ -241,7 +241,7 @@ public class IotEzvizMonitorServiceImpl extends IotDeviceBaseServiceImpl impleme
     public String refreshStatus(IotDevice iotDevice) {
         String[] devCodeArray = iotDevice.getDevCode().split("-");
         CmdGroupModel cmdGroupModel = new CmdGroupModel();
-        cmdGroupModel.setCId(CustomerIdUtil.getCustomerId());
+        cmdGroupModel.setTid(CustomerIdUtil.getCustomerId());
         cmdGroupModel.setCmdModels(new LinkedList<>());
         CmdModel cmdModel = new CmdModel();
         cmdModel.setDeviceId(iotDevice.getDevBid());

+ 3 - 1
src/main/java/com/yunfeiyun/agmp/iotm/mq/provider/IotsMqProviderService.java

@@ -5,6 +5,7 @@ import com.yunfeiyun.agmp.common.framework.mq.rabbitmq.model.SynGlobalTenantInfo
 import com.yunfeiyun.agmp.common.utils.JSONUtils;
 import com.yunfeiyun.agmp.iot.common.constant.mq.IotActionEnums;
 import com.yunfeiyun.agmp.iot.common.constant.mq.IotMqExchange;
+import com.yunfeiyun.agmp.iot.common.constant.mq.IotMqQueue;
 import com.yunfeiyun.agmp.iot.common.model.cmd.CmdGroupModel;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.amqp.rabbit.core.RabbitTemplate;
@@ -32,7 +33,7 @@ public class IotsMqProviderService {
         synGlobalTenantInfoDto.setAction(iotActionEnums.getCode());
         synGlobalTenantInfoDto.setDesc(desc);
         synGlobalTenantInfoDto.setData(JSONObject.from(data));
-        iotRabbitTemplate.convertAndSend(IotMqExchange.IOTM_TO_IOTS_EXCHANGE, "", JSONUtils.toJSONString(synGlobalTenantInfoDto));
+        iotRabbitTemplate.convertAndSend(IotMqExchange.IOTM_TO_IOTS_EXCHANGE, IotMqQueue.IOTM_TO_IOTS_BASE_DATA_QUEUE, JSONUtils.toJSONString(synGlobalTenantInfoDto));
     }
     /**
      * 往Iots发送指令信息
@@ -42,5 +43,6 @@ public class IotsMqProviderService {
         synGlobalTenantInfoDto.setAction(IotActionEnums.CMD_TASK.getCode());
         synGlobalTenantInfoDto.setDesc(desc);
         synGlobalTenantInfoDto.setData(JSONObject.from(cmdGroupModel));
+        iotRabbitTemplate.convertAndSend(IotMqExchange.IOTM_TO_IOTS_EXCHANGE,IotMqQueue.IOTM_TO_IOTS_CMD_QUEUE,JSONUtils.toJSONString(synGlobalTenantInfoDto));
     }
 }

+ 160 - 0
src/main/resources/mapper/IotCmdexecMapper.xml

@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yunfeiyun.agmp.iotm.web.mapper.IotCmdexecMapper">
+
+    <resultMap type="IotCmdexec" id="IotCmdexecResult">
+        <result property="id" column="id"/>
+        <result property="ceBid" column="ceBid"/>
+        <result property="tid" column="tid"/>
+        <result property="ctBid" column="ctBid"/>
+        <result property="devBid" column="devBid"/>
+        <result property="ceGroupbid" column="ceGroupbid"/>
+        <result property="ceType" column="ceType"/>
+        <result property="ceGroupparentbid" column="ceGroupparentbid"/>
+        <result property="ceSeq" column="ceSeq"/>
+        <result property="ceInstruct" column="ceInstruct"/>
+        <result property="ceStatus" column="ceStatus"/>
+        <result property="ceSendrecount" column="ceSendrecount"/>
+        <result property="ceValidrecount" column="ceValidrecount"/>
+        <result property="ceDelayddate" column="ceDelayddate"/>
+        <result property="ceFinally" column="ceFinally"/>
+        <result property="ceDesc" column="ceDesc"/>
+        <result property="ceStartddate" column="ceStartddate"/>
+        <result property="ceCompletedate" column="ceCompletedate"/>
+        <result property="ceModifieddate" column="ceModifieddate"/>
+        <result property="ceCreateddate" column="ceCreateddate"/>
+        <result property="ceDelstatus" column="ceDelstatus"/>
+    </resultMap>
+
+    <sql id="selectIotCmdexecVo">
+        select id, ceBid, tid, ctBid, devBid, ceGroupbid, ceType, ceGroupparentbid, ceSeq, ceInstruct, ceStatus, ceSendrecount, ceValidrecount, ceDelayddate, ceFinally, ceDesc, ceStartddate, ceCompletedate, ceModifieddate, ceCreateddate, ceDelstatus from IotCmdexec
+    </sql>
+
+    <select id="selectIotCmdexecList" parameterType="IotCmdexec" resultMap="IotCmdexecResult">
+        <include refid="selectIotCmdexecVo"/>
+        <where>
+            <if test="ceBid != null  and ceBid != ''">and ceBid = #{ceBid}</if>
+            <if test="tid != null  and tid != ''">and tid = #{tid}</if>
+            <if test="ctBid != null  and ctBid != ''">and ctBid = #{ctBid}</if>
+            <if test="devBid != null  and devBid != ''">and devBid = #{devBid}</if>
+            <if test="ceGroupbid != null  and ceGroupbid != ''">and ceGroupbid = #{ceGroupbid}</if>
+            <if test="ceType != null  and ceType != ''">and ceType = #{ceType}</if>
+            <if test="ceGroupparentbid != null  and ceGroupparentbid != ''">and ceGroupparentbid = #{ceGroupparentbid}
+            </if>
+            <if test="ceSeq != null ">and ceSeq = #{ceSeq}</if>
+            <if test="ceInstruct != null  and ceInstruct != ''">and ceInstruct = #{ceInstruct}</if>
+            <if test="ceStatus != null  and ceStatus != ''">and ceStatus = #{ceStatus}</if>
+            <if test="ceSendrecount != null ">and ceSendrecount = #{ceSendrecount}</if>
+            <if test="ceValidrecount != null ">and ceValidrecount = #{ceValidrecount}</if>
+            <if test="ceDelayddate != null ">and ceDelayddate = #{ceDelayddate}</if>
+            <if test="ceFinally != null  and ceFinally != ''">and ceFinally = #{ceFinally}</if>
+            <if test="ceDesc != null  and ceDesc != ''">and ceDesc = #{ceDesc}</if>
+            <if test="ceStartddate != null  and ceStartddate != ''">and ceStartddate = #{ceStartddate}</if>
+            <if test="ceCompletedate != null  and ceCompletedate != ''">and ceCompletedate = #{ceCompletedate}</if>
+            <if test="ceModifieddate != null  and ceModifieddate != ''">and ceModifieddate = #{ceModifieddate}</if>
+            <if test="ceCreateddate != null  and ceCreateddate != ''">and ceCreateddate = #{ceCreateddate}</if>
+            <if test="ceDelstatus != null  and ceDelstatus != ''">and ceDelstatus = #{ceDelstatus}</if>
+        </where>
+    </select>
+
+    <select id="selectIotCmdexecById" parameterType="Long" resultMap="IotCmdexecResult">
+        <include refid="selectIotCmdexecVo"/>
+        where id = #{id}
+    </select>
+    <select id="selectCmdExeByCeBids" resultType="com.yunfeiyun.agmp.iot.common.domain.IotCmdexec">
+        select * from IotCmdexec where ceBid in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+
+    </select>
+
+
+    <insert id="insertIotCmdexec" parameterType="IotCmdexec" useGeneratedKeys="true" keyProperty="id">
+        insert into IotCmdexec
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="ceBid != null">ceBid,</if>
+            <if test="tid != null">tid,</if>
+            <if test="ctBid != null">ctBid,</if>
+            <if test="devBid != null">devBid,</if>
+            <if test="ceGroupbid != null">ceGroupbid,</if>
+            <if test="ceType != null">ceType,</if>
+            <if test="ceGroupparentbid != null">ceGroupparentbid,</if>
+            <if test="ceSeq != null">ceSeq,</if>
+            <if test="ceInstruct != null">ceInstruct,</if>
+            <if test="ceStatus != null">ceStatus,</if>
+            <if test="ceSendrecount != null">ceSendrecount,</if>
+            <if test="ceValidrecount != null">ceValidrecount,</if>
+            <if test="ceDelayddate != null">ceDelayddate,</if>
+            <if test="ceFinally != null">ceFinally,</if>
+            <if test="ceDesc != null">ceDesc,</if>
+            <if test="ceStartddate != null">ceStartddate,</if>
+            <if test="ceCompletedate != null">ceCompletedate,</if>
+            <if test="ceModifieddate != null">ceModifieddate,</if>
+            <if test="ceCreateddate != null">ceCreateddate,</if>
+            <if test="ceDelstatus != null">ceDelstatus,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="ceBid != null">#{ceBid},</if>
+            <if test="tid != null">#{tid},</if>
+            <if test="ctBid != null">#{ctBid},</if>
+            <if test="devBid != null">#{devBid},</if>
+            <if test="ceGroupbid != null">#{ceGroupbid},</if>
+            <if test="ceType != null">#{ceType},</if>
+            <if test="ceGroupparentbid != null">#{ceGroupparentbid},</if>
+            <if test="ceSeq != null">#{ceSeq},</if>
+            <if test="ceInstruct != null">#{ceInstruct},</if>
+            <if test="ceStatus != null">#{ceStatus},</if>
+            <if test="ceSendrecount != null">#{ceSendrecount},</if>
+            <if test="ceValidrecount != null">#{ceValidrecount},</if>
+            <if test="ceDelayddate != null">#{ceDelayddate},</if>
+            <if test="ceFinally != null">#{ceFinally},</if>
+            <if test="ceDesc != null">#{ceDesc},</if>
+            <if test="ceStartddate != null">#{ceStartddate},</if>
+            <if test="ceCompletedate != null">#{ceCompletedate},</if>
+            <if test="ceModifieddate != null">#{ceModifieddate},</if>
+            <if test="ceCreateddate != null">#{ceCreateddate},</if>
+            <if test="ceDelstatus != null">#{ceDelstatus},</if>
+        </trim>
+    </insert>
+
+    <update id="updateIotCmdexec" parameterType="IotCmdexec">
+        update IotCmdexec
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="ceBid != null">ceBid = #{ceBid},</if>
+            <if test="tid != null">tid = #{tid},</if>
+            <if test="ctBid != null">ctBid = #{ctBid},</if>
+            <if test="devBid != null">devBid = #{devBid},</if>
+            <if test="ceGroupbid != null">ceGroupbid = #{ceGroupbid},</if>
+            <if test="ceType != null">ceType = #{ceType},</if>
+            <if test="ceGroupparentbid != null">ceGroupparentbid = #{ceGroupparentbid},</if>
+            <if test="ceSeq != null">ceSeq = #{ceSeq},</if>
+            <if test="ceInstruct != null">ceInstruct = #{ceInstruct},</if>
+            <if test="ceStatus != null">ceStatus = #{ceStatus},</if>
+            <if test="ceSendrecount != null">ceSendrecount = #{ceSendrecount},</if>
+            <if test="ceValidrecount != null">ceValidrecount = #{ceValidrecount},</if>
+            <if test="ceDelayddate != null">ceDelayddate = #{ceDelayddate},</if>
+            <if test="ceFinally != null">ceFinally = #{ceFinally},</if>
+            <if test="ceDesc != null">ceDesc = #{ceDesc},</if>
+            <if test="ceStartddate != null">ceStartddate = #{ceStartddate},</if>
+            <if test="ceCompletedate != null">ceCompletedate = #{ceCompletedate},</if>
+            <if test="ceModifieddate != null">ceModifieddate = #{ceModifieddate},</if>
+            <if test="ceCreateddate != null">ceCreateddate = #{ceCreateddate},</if>
+            <if test="ceDelstatus != null">ceDelstatus = #{ceDelstatus},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteIotCmdexecById" parameterType="Long">
+        delete from IotCmdexec where id = #{id}
+    </delete>
+
+    <delete id="deleteIotCmdexecByIds" parameterType="String">
+        delete from IotCmdexec where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 182 - 0
src/main/resources/mapper/IotCmdtaskMapper.xml

@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yunfeiyun.agmp.iotm.web.mapper.IotCmdtaskMapper">
+
+    <resultMap type="IotCmdtask" id="IotCmdtaskResult">
+        <result property="id"    column="id"    />
+        <result property="tid"    column="tid"    />
+        <result property="ctBid"    column="ctBid"    />
+        <result property="ctStatus"    column="ctStatus"    />
+        <result property="ctDescribe"    column="ctDescribe"    />
+        <result property="ctStartddate"    column="ctStartddate"    />
+        <result property="ctCompletedate"    column="ctCompletedate"    />
+        <result property="ctRequestid"    column="ctRequestid"    />
+        <result property="ctRequestSource"    column="ctRequestSource"    />
+        <result property="ctRequestParam"    column="ctRequestParam"    />
+        <result property="ctReceiptstatus"    column="ctReceiptstatus"    />
+        <result property="ctReceiptddate"    column="ctReceiptddate"    />
+        <result property="ctReceiptaddr"    column="ctReceiptaddr"    />
+        <result property="ctCreator"    column="ctCreator"    />
+        <result property="ctModifier"    column="ctModifier"    />
+        <result property="ctModifieddate"    column="ctModifieddate"    />
+        <result property="ctCreateddate"    column="ctCreateddate"    />
+        <result property="ctDelstatus"    column="ctDelstatus"    />
+        <result property="ctCreatorname"    column="ctCreatorname"    />
+        <result property="ctBiztype"    column="ctBiztype"    />
+        <result property="ctBiztitle"    column="ctBiztitle"    />
+        <result property="ctParam"    column="ctParam"    />
+        <result property="ctCtime"    column="ctCtime"    />
+        <result property="ctDevcode"    column="ctDevcode"    />
+        <result property="ctDevtype"    column="ctDevtype"    />
+        <result property="ctLogtype"    column="ctLogtype"    />
+    </resultMap>
+
+    <sql id="selectIotCmdtaskVo">
+        select id, tid, ctBid, ctStatus, ctDescribe, ctStartddate, ctCompletedate, ctRequestid, ctRequestSource, ctRequestParam, ctReceiptstatus, ctReceiptddate, ctReceiptaddr, ctCreator, ctModifier, ctModifieddate, ctCreateddate, ctDelstatus, ctCreatorname, ctBiztype, ctBiztitle, ctParam, ctCtime, ctDevcode, ctDevtype,ctLogtype from IotCmdtask
+    </sql>
+
+    <select id="selectIotCmdtaskList" parameterType="IotCmdtask" resultMap="IotCmdtaskResult">
+        <include refid="selectIotCmdtaskVo"/>
+        <where>
+            <if test="tid != null  and tid != ''"> and tid = #{tid}</if>
+            <if test="ctBid != null  and ctBid != ''"> and ctBid = #{ctBid}</if>
+            <if test="ctStatus != null  and ctStatus != ''"> and ctStatus = #{ctStatus}</if>
+            <if test="ctDescribe != null  and ctDescribe != ''"> and ctDescribe = #{ctDescribe}</if>
+            <if test="ctStartddate != null  and ctStartddate != ''"> and ctStartddate = #{ctStartddate}</if>
+            <if test="ctCompletedate != null  and ctCompletedate != ''"> and ctCompletedate = #{ctCompletedate}</if>
+            <if test="ctRequestid != null  and ctRequestid != ''"> and ctRequestid = #{ctRequestid}</if>
+            <if test="ctRequestSource != null  and ctRequestSource != ''"> and ctRequestSource = #{ctRequestSource}</if>
+            <if test="ctRequestParam != null  and ctRequestParam != ''"> and ctRequestParam = #{ctRequestParam}</if>
+            <if test="ctReceiptstatus != null  and ctReceiptstatus != ''"> and ctReceiptstatus = #{ctReceiptstatus}</if>
+            <if test="ctReceiptddate != null  and ctReceiptddate != ''"> and ctReceiptddate = #{ctReceiptddate}</if>
+            <if test="ctReceiptaddr != null  and ctReceiptaddr != ''"> and ctReceiptaddr = #{ctReceiptaddr}</if>
+            <if test="ctCreator != null  and ctCreator != ''"> and ctCreator = #{ctCreator}</if>
+            <if test="ctModifier != null  and ctModifier != ''"> and ctModifier = #{ctModifier}</if>
+            <if test="ctModifieddate != null  and ctModifieddate != ''"> and ctModifieddate = #{ctModifieddate}</if>
+            <if test="ctCreateddate != null  and ctCreateddate != ''"> and ctCreateddate = #{ctCreateddate}</if>
+            <if test="ctDelstatus != null  and ctDelstatus != ''"> and ctDelstatus = #{ctDelstatus}</if>
+            <if test="ctCreatorname != null  and ctCreatorname != ''"> and ctCreatorname like concat('%', #{ctCreatorname}, '%')</if>
+            <if test="ctBiztype != null  and ctBiztype != ''"> and ctBiztype = #{ctBiztype}</if>
+            <if test="ctBiztitle != null  and ctBiztitle != ''"> and ctBiztitle = #{ctBiztitle}</if>
+            <if test="ctParam != null  and ctParam != ''"> and ctParam = #{ctParam}</if>
+            <if test="ctCtime != null "> and ctCtime = #{ctCtime}</if>
+            <if test="ctDevcode != null "> and ctDevcode = #{ctDevcode}</if>
+            <if test="ctDevtype != null "> and ctDevtype = #{ctDevtype}</if>
+            <if test="ctLogtype != null "> and ctLogtype = #{ctLogtype}</if>
+        </where>
+
+    </select>
+
+    <select id="selectIotCmdtaskById" parameterType="Long" resultMap="IotCmdtaskResult">
+        <include refid="selectIotCmdtaskVo"/>
+        where id = #{id}
+    </select>
+    <select id="selectIotCmdtaskByCtBid" resultType="com.yunfeiyun.agmp.iot.common.domain.IotCmdtask">
+        <include refid="selectIotCmdtaskVo"/>
+        where ctBid = #{ctBid}
+        limit 1
+    </select>
+
+    <insert id="insertIotCmdtask" parameterType="IotCmdtask" useGeneratedKeys="true" keyProperty="id">
+        insert into IotCmdtask
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="tid != null">tid,</if>
+            <if test="ctBid != null">ctBid,</if>
+            <if test="ctStatus != null">ctStatus,</if>
+            <if test="ctDescribe != null and ctDescribe != ''">ctDescribe,</if>
+            <if test="ctStartddate != null">ctStartddate,</if>
+            <if test="ctCompletedate != null">ctCompletedate,</if>
+            <if test="ctRequestid != null">ctRequestid,</if>
+            <if test="ctRequestSource != null and ctRequestSource != ''">ctRequestSource,</if>
+            <if test="ctRequestParam != null">ctRequestParam,</if>
+            <if test="ctReceiptstatus != null">ctReceiptstatus,</if>
+            <if test="ctReceiptddate != null">ctReceiptddate,</if>
+            <if test="ctReceiptaddr != null">ctReceiptaddr,</if>
+            <if test="ctCreator != null">ctCreator,</if>
+            <if test="ctModifier != null">ctModifier,</if>
+            <if test="ctModifieddate != null">ctModifieddate,</if>
+            <if test="ctCreateddate != null">ctCreateddate,</if>
+            <if test="ctDelstatus != null">ctDelstatus,</if>
+            <if test="ctCreatorname != null">ctCreatorname,</if>
+            <if test="ctBiztype != null">ctBiztype,</if>
+            <if test="ctBiztitle != null">ctBiztitle,</if>
+            <if test="ctParam != null">ctParam,</if>
+            <if test="ctCtime != null">ctCtime,</if>
+            <if test="ctDevcode != null">ctDevcode,</if>
+            <if test="ctDevtype != null">ctDevtype,</if>
+            <if test="ctLogtype != null">ctLogtype,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="tid != null">#{tid},</if>
+            <if test="ctBid != null">#{ctBid},</if>
+            <if test="ctStatus != null">#{ctStatus},</if>
+            <if test="ctDescribe != null and ctDescribe != ''">#{ctDescribe},</if>
+            <if test="ctStartddate != null">#{ctStartddate},</if>
+            <if test="ctCompletedate != null">#{ctCompletedate},</if>
+            <if test="ctRequestid != null">#{ctRequestid},</if>
+            <if test="ctRequestSource != null and ctRequestSource != ''">#{ctRequestSource},</if>
+            <if test="ctRequestParam != null">#{ctRequestParam},</if>
+            <if test="ctReceiptstatus != null">#{ctReceiptstatus},</if>
+            <if test="ctReceiptddate != null">#{ctReceiptddate},</if>
+            <if test="ctReceiptaddr != null">#{ctReceiptaddr},</if>
+            <if test="ctCreator != null">#{ctCreator},</if>
+            <if test="ctModifier != null">#{ctModifier},</if>
+            <if test="ctModifieddate != null">#{ctModifieddate},</if>
+            <if test="ctCreateddate != null">#{ctCreateddate},</if>
+            <if test="ctDelstatus != null">#{ctDelstatus},</if>
+            <if test="ctCreatorname != null">#{ctCreatorname},</if>
+            <if test="ctBiztype != null">#{ctBiztype},</if>
+            <if test="ctBiztitle != null">#{ctBiztitle},</if>
+            <if test="ctParam != null">#{ctParam},</if>
+            <if test="ctCtime != null">#{ctCtime},</if>
+            <if test="ctDevcode != null">#{ctDevcode},</if>
+            <if test="ctDevtype != null">#{ctDevtype},</if>
+            <if test="ctLogtype != null">#{ctLogtype},</if>
+         </trim>
+    </insert>
+
+    <update id="updateIotCmdtask" parameterType="IotCmdtask">
+        update IotCmdtask
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="tid != null">tid = #{tid},</if>
+            <if test="ctBid != null">ctBid = #{ctBid},</if>
+            <if test="ctStatus != null">ctStatus = #{ctStatus},</if>
+            <if test="ctDescribe != null and ctDescribe != ''">ctDescribe = #{ctDescribe},</if>
+            <if test="ctStartddate != null">ctStartddate = #{ctStartddate},</if>
+            <if test="ctCompletedate != null">ctCompletedate = #{ctCompletedate},</if>
+            <if test="ctRequestid != null">ctRequestid = #{ctRequestid},</if>
+            <if test="ctRequestSource != null and ctRequestSource != ''">ctRequestSource = #{ctRequestSource},</if>
+            <if test="ctRequestParam != null">ctRequestParam = #{ctRequestParam},</if>
+            <if test="ctReceiptstatus != null">ctReceiptstatus = #{ctReceiptstatus},</if>
+            <if test="ctReceiptddate != null">ctReceiptddate = #{ctReceiptddate},</if>
+            <if test="ctReceiptaddr != null">ctReceiptaddr = #{ctReceiptaddr},</if>
+            <if test="ctCreator != null">ctCreator = #{ctCreator},</if>
+            <if test="ctModifier != null">ctModifier = #{ctModifier},</if>
+            <if test="ctModifieddate != null">ctModifieddate = #{ctModifieddate},</if>
+            <if test="ctCreateddate != null">ctCreateddate = #{ctCreateddate},</if>
+            <if test="ctDelstatus != null">ctDelstatus = #{ctDelstatus},</if>
+            <if test="ctCreatorname != null">ctCreatorname = #{ctCreatorname},</if>
+            <if test="ctBiztype != null">ctBiztype = #{ctBiztype},</if>
+            <if test="ctBiztitle != null">ctBiztitle = #{ctBiztitle},</if>
+            <if test="ctParam != null">ctParam = #{ctParam},</if>
+            <if test="ctCtime != null">ctCtime = #{ctCtime},</if>
+            <if test="ctDevcode != null">ctDevcode = #{ctDevcode},</if>
+            <if test="ctDevtype != null">ctDevtype = #{ctDevtype},</if>
+            <if test="ctLogtype != null">ctLogtype = #{ctLogtype},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteIotCmdtaskById" parameterType="Long">
+        delete from IotCmdtask where id = #{id}
+    </delete>
+
+    <delete id="deleteIotCmdtaskByIds" parameterType="String">
+        delete from IotCmdtask where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>