| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- <?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.iots.device.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="selectIotCmdexecByCeBid" parameterType="String" resultMap="IotCmdexecResult">
- <include refid="selectIotCmdexecVo"/>
- where ceBid = #{ceBid}
- </select>
- <select id="selectIotCmdexecListByTaskIdAndSeq" resultType="com.yunfeiyun.agmp.iot.common.domain.IotCmdexec">
- <include refid="selectIotCmdexecVo"/>
- where ctBid = #{taskId} and ceSeq >= #{seq}
- order by ceSeq
- </select>
- <select id="selectFinallyIotCmdexecListByTaskIdAndSeq"
- resultType="com.yunfeiyun.agmp.iot.common.domain.IotCmdexec">
- <include refid="selectIotCmdexecVo"/>
- where ctBid = #{taskId} and ceSeq >= #{seq} and ceFinally = 1
- order by ceSeq
- </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>
- <insert id="insertIotCmdexecByBatch">
- insert into IotCmdexec
- <trim prefix="(" suffix=")" suffixOverrides=",">
- ceBid,
- tid,
- ctBid,
- devBid,
- ceGroupbid,
- ceType,
- ceGroupparentbid,
- ceSeq,
- ceInstruct,
- ceStatus,
- ceSendrecount,
- ceValidrecount,
- ceDelayddate,
- ceFinally,
- ceDesc,
- ceStartddate,
- ceCompletedate,
- ceModifieddate,
- ceCreateddate,
- ceDelstatus
- </trim>
- values
- <foreach collection="list" separator="," index="index" item="item">
- (
- #{item.ceBid},
- #{item.tid},
- #{item.ctBid},
- #{item.devBid},
- #{item.ceGroupbid},
- #{item.ceType},
- #{item.ceGroupparentbid},
- #{item.ceSeq},
- #{item.ceInstruct},
- #{item.ceStatus},
- #{item.ceSendrecount},
- #{item.ceValidrecount},
- #{item.ceDelayddate},
- #{item.ceFinally},
- #{item.ceDesc},
- #{item.ceStartddate},
- #{item.ceCompletedate},
- #{item.ceModifieddate},
- #{item.ceCreateddate},
- #{item.ceDelstatus}
- )
- </foreach>
- </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>
- <update id="updateIotCmdexecByCeBid" 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 ceBid = #{ceBid}
- </update>
- <update id="updateIotCmdexecCeStatusByCeBid">
- update IotCmdexec set ceStatus = #{ceStatus} where ceBid = #{ceBid}
- </update>
- <update id="startCmdExecLog" parameterType="String">
- update IotCmdexec set ceStartddate = #{ceStartddate} where ceBid = #{ceBid}
- </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>
|