|
@@ -4,20 +4,73 @@
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.yunfeiyun.agmp.iots.warn.mapper.IotWarnBussinessMapper">
|
|
<mapper namespace="com.yunfeiyun.agmp.iots.warn.mapper.IotWarnBussinessMapper">
|
|
|
|
|
|
|
|
- <insert id="insertWarnRecord">
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <insert id="insertWarnRecord" parameterType="IotWarnlog" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
+ insert into IotWarnlog
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="wlBid != null">wlBid,</if>
|
|
|
|
|
+ <if test="wlName != null">wlName,</if>
|
|
|
|
|
+ <if test="wlType != null">wlType,</if>
|
|
|
|
|
+ <if test="wlContent != null">wlContent,</if>
|
|
|
|
|
+ <if test="wlLevel != null">wlLevel,</if>
|
|
|
|
|
+ <if test="devtypeBid != null">devtypeBid,</if>
|
|
|
|
|
+ <if test="devBid != null">devBid,</if>
|
|
|
|
|
+ <if test="status != null">status,</if>
|
|
|
|
|
+ <if test="wlDealuserid != null">wlDealuserid,</if>
|
|
|
|
|
+ <if test="wlDealresult != null">wlDealresult,</if>
|
|
|
|
|
+ <if test="wlDealtime != null">wlDealtime,</if>
|
|
|
|
|
+ <if test="wlCreateddate != null">wlCreateddate,</if>
|
|
|
|
|
+ <if test="wlData != null">wlData,</if>
|
|
|
|
|
+ <if test="tid != null and tid != ''">tid,</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="wlBid != null">#{wlBid},</if>
|
|
|
|
|
+ <if test="wlName != null">#{wlName},</if>
|
|
|
|
|
+ <if test="wlType != null">#{wlType},</if>
|
|
|
|
|
+ <if test="wlContent != null">#{wlContent},</if>
|
|
|
|
|
+ <if test="wlLevel != null">#{wlLevel},</if>
|
|
|
|
|
+ <if test="devtypeBid != null">#{devtypeBid},</if>
|
|
|
|
|
+ <if test="devBid != null">#{devBid},</if>
|
|
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
|
|
+ <if test="wlDealuserid != null">#{wlDealuserid},</if>
|
|
|
|
|
+ <if test="wlDealresult != null">#{wlDealresult},</if>
|
|
|
|
|
+ <if test="wlDealtime != null">#{wlDealtime},</if>
|
|
|
|
|
+ <if test="wlCreateddate != null">#{wlCreateddate},</if>
|
|
|
|
|
+ <if test="wlData != null">#{wlData},</if>
|
|
|
|
|
+ <if test="tid != null and tid != ''">#{tid},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+ <insert id="insertIncrementReCount" parameterType="IotWarncount" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
+ insert into IotWarncount
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="wctBid != null">wctBid,</if>
|
|
|
|
|
+ <if test="wcBid != null">wcBid,</if>
|
|
|
|
|
+ <if test="devBid != null">devBid,</if>
|
|
|
|
|
+ <if test="wctCount != null">wctCount,</if>
|
|
|
|
|
+ <if test="lastUpdateTime != null">lastUpdateTime,</if>
|
|
|
|
|
+ <if test="tid != null and tid != ''">tid,</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="wctBid != null">#{wctBid},</if>
|
|
|
|
|
+ <if test="wcBid != null">#{wcBid},</if>
|
|
|
|
|
+ <if test="devBid != null">#{devBid},</if>
|
|
|
|
|
+ <if test="wctCount != null">#{wctCount},</if>
|
|
|
|
|
+ <if test="lastUpdateTime != null">#{lastUpdateTime},</if>
|
|
|
|
|
+ <if test="tid != null and tid != ''">#{tid},</if>
|
|
|
|
|
+ </trim>
|
|
|
</insert>
|
|
</insert>
|
|
|
<update id="incrementReCount">
|
|
<update id="incrementReCount">
|
|
|
-
|
|
|
|
|
|
|
+ update IotWarncount set wctCount=wctCount+1 where devBid=#{devBid} and wcBid=#{wcBid};
|
|
|
</update>
|
|
</update>
|
|
|
|
|
|
|
|
<update id="resetReCount">
|
|
<update id="resetReCount">
|
|
|
-
|
|
|
|
|
|
|
+ update IotWarncount set wctCount=0;
|
|
|
|
|
+ </update>
|
|
|
|
|
+ <update id="updateIncrementReCount">
|
|
|
|
|
+ update IotWarncount set wctCount=wctCount+1 where devBid=#{devBid} and wcBid=#{wcBid};
|
|
|
</update>
|
|
</update>
|
|
|
-
|
|
|
|
|
|
|
|
|
|
<select id="selectIotWarnCountByDevAndConfig"
|
|
<select id="selectIotWarnCountByDevAndConfig"
|
|
|
resultType="com.yunfeiyun.agmp.iot.common.domain.IotWarncount">
|
|
resultType="com.yunfeiyun.agmp.iot.common.domain.IotWarncount">
|
|
|
-
|
|
|
|
|
|
|
+ select * from IotWarncount where devBid=#{devBid} and wcBid=#{wcBid};
|
|
|
</select>
|
|
</select>
|
|
|
</mapper>
|
|
</mapper>
|