|
|
@@ -80,22 +80,23 @@
|
|
|
select * from IotWarncount where devBid=#{devBid} and wcBid=#{wcBid};
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectIotWarnConfigInfoList" parameterType="com.yunfeiyun.agmp.iots.warn.model.WarnConfigInfo" resultType="com.yunfeiyun.agmp.iots.warn.model.WarnConfigInfo">
|
|
|
+ <select id="selectIotWarnConfigInfoList" parameterType="com.yunfeiyun.agmp.iots.warn.model.WarnConfigInfo"
|
|
|
+ resultType="com.yunfeiyun.agmp.iots.warn.model.WarnConfigInfo">
|
|
|
SELECT wc.*, wi.wiBid, wi.wiAddress,
|
|
|
- wi.wiCode, wi.wiName, wi.wiUnit, wi.wiExpression, wi.wiValue, wi.wiStatus
|
|
|
+ wi.wiCode, wi.wiName, wi.wiUnit, wi.wiExpression, wi.wiValue, wi.wiStatus
|
|
|
FROM IotWarnconfig AS wc
|
|
|
- LEFT JOIN IotWarnindicator AS wi ON wi.wcBid = wc.wcBid
|
|
|
- <if test="devBid != null">
|
|
|
- LEFT JOIN IotWarnobject AS wo ON wo.wcBid = wc.wcBid
|
|
|
- </if>
|
|
|
+ LEFT JOIN IotWarnindicator AS wi ON wi.wcBid = wc.wcBid
|
|
|
+ <if test="devBid != null">
|
|
|
+ LEFT JOIN IotWarnobject AS wo ON wo.wcBid = wc.wcBid
|
|
|
+ </if>
|
|
|
|
|
|
WHERE wc.tid = #{tid} AND wi.wiBid IS NOT NULL
|
|
|
- <if test="devBid != null">
|
|
|
- AND wo.devBid = #{devBid} AND wo.woBid IS NOT NULL
|
|
|
- </if>
|
|
|
- <if test="devtypeBid!= null">
|
|
|
- AND wc.devtypeBid = #{devtypeBid}
|
|
|
- </if>
|
|
|
+ <if test="devBid != null">
|
|
|
+ AND wo.devBid = #{devBid} AND wo.woBid IS NOT NULL
|
|
|
+ </if>
|
|
|
+ <if test="devtypeBid!= null">
|
|
|
+ AND wc.devtypeBid = #{devtypeBid}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<select id="getAllReCount" resultType="com.yunfeiyun.agmp.iot.common.domain.IotWarncount">
|
|
|
select * from IotWarncount
|
|
|
@@ -106,6 +107,15 @@
|
|
|
<select id="selectAllTid" resultType="java.lang.String">
|
|
|
select tid from SysUser group by tid
|
|
|
</select>
|
|
|
+
|
|
|
+ <!-- 根据code查询虫害规则指标-->
|
|
|
+ <select id="selectIotWarnPestConfigInfoList"
|
|
|
+ resultType="com.yunfeiyun.agmp.iot.common.domain.IotWarnindicator">
|
|
|
+
|
|
|
+ SELECT * from (
|
|
|
+ select * from IotWarnindicator tb_wi2 where wiCode=#{code}
|
|
|
+ ) tb_wi LEFT JOIN IotWarnconfig tb_config on tb_wi.wcBid=tb_config.wcBid where tb_config.wcStatus='0'
|
|
|
+ </select>
|
|
|
<insert id="insertIotOfflineWarnconfig" parameterType="IotWarnconfig" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into IotWarnconfig
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|