|
|
@@ -47,15 +47,6 @@
|
|
|
where devtypeBid = #{devtypeBid} and firmBid = #{firmBid} and devCode = #{devCode} and devDelstatus = '0'
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectIotDeviceByTypeFirmCodeExt" parameterType="IotDevice" resultMap="IotDeviceResult">
|
|
|
- <include refid="selectIotDeviceVo"/>
|
|
|
- where devtypeBid = #{devtypeBid}
|
|
|
- and firmBid = #{firmBid}
|
|
|
- and devCode = #{devCode}
|
|
|
- and extInfo = #{extInfo}
|
|
|
- and devDelstatus = '0'
|
|
|
- </select>
|
|
|
-
|
|
|
<select id="selectIotDeviceByDevBid" resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
|
|
|
<include refid="selectIotDeviceVo"/>
|
|
|
<where>
|
|
|
@@ -72,62 +63,11 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectIotDeviceList" parameterType="IotDevice"
|
|
|
- resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
|
|
|
- <include refid="selectIotDeviceVo"/>
|
|
|
- <where>
|
|
|
- devDelstatus = '0'
|
|
|
- <if test="devCode != null and devCode != ''">and devCode = #{devCode}</if>
|
|
|
- <if test="firmBid != null and firmBid != ''">and firmBid = #{firmBid}</if>
|
|
|
- <if test="devtypeBid != null and devtypeBid != ''">and devtypeBid = #{devtypeBid}</if>
|
|
|
- <if test="devStatus != null and devStatus != ''">and devStatus = #{devStatus}</if>
|
|
|
- <if test="devModifieddate != null and devModifieddate != ''">
|
|
|
- and devModifieddate <![CDATA[ <= ]]> #{devModifieddate}
|
|
|
- </if>
|
|
|
- <if test="devUpdateddate != null and devUpdateddate != ''">and devUpdateddate <![CDATA[ <= ]]>
|
|
|
- #{devUpdateddate}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
-
|
|
|
<select id="getDeviceIdByFirmBizId" resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice"
|
|
|
parameterType="string">
|
|
|
select * from IotDevice where firmBid=#{firmBizId} and devtypeBid=#{deviceTypeBizId} and devDelstatus = '0';
|
|
|
</select>
|
|
|
|
|
|
-
|
|
|
- <select id="getXmznDeviceList" resultType="com.yunfeiyun.agmp.iot.common.domain.resvo.IotXmzndeviceResVo"
|
|
|
- parameterType="string">
|
|
|
- select IotDevice.*
|
|
|
- ,IotXmzndevice.xdName
|
|
|
- ,IotXmzndevice.xdCata
|
|
|
- ,IotXmzndevice.xdMac
|
|
|
- ,IotXmzndevice.xdAddr
|
|
|
- ,IotXmzndevice.xdDevclassid
|
|
|
- ,IotXmzndevice.xdDataclass
|
|
|
- ,IotXmzndevice.xdCtrltype
|
|
|
- ,IotXmzndevice.xdMonitortype
|
|
|
- ,IotXmzndevice.xdClassid
|
|
|
- from IotDevice
|
|
|
- left join IotXmzndevice on IotXmzndevice.devBid = IotDevice.devBid
|
|
|
- where IotDevice.firmBid=#{firmBizId} and IotDevice.devDelstatus = '0';
|
|
|
- </select>
|
|
|
- <select id="getDeviceByOriginalId" parameterType="java.lang.String"
|
|
|
- resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
|
|
|
- select * from IotDevice where devOriginalid=#{originalId} and IotDevice.devDelstatus = '0'
|
|
|
-
|
|
|
- </select>
|
|
|
- <select id="findDeviceByDevCodeAndDevTypeBid" resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
|
|
|
- select * from IotDevice where
|
|
|
- devCode = #{devCode}
|
|
|
- <if test="devtypeBid != null and devtypeBid != ''">
|
|
|
- and devtypeBid = #{devtypeBid}
|
|
|
- </if>
|
|
|
- <if test="firmBid != null and firmBid != ''">
|
|
|
- and firmBid = #{firmBid}
|
|
|
- </if>
|
|
|
- limit 1
|
|
|
- </select>
|
|
|
<select id="selectAllDeviceConfigStatus"
|
|
|
resultType="com.yunfeiyun.agmp.iot.common.model.device.IotDeviceStatusResVo" parameterType="map">
|
|
|
select * from IotDevice a left join IotDeviceconfig b on a.devBid=b.devBid where a.devDelstatus='0' and devtypeBid=#{type} ORDER BY devtypeBid asc
|
|
|
@@ -173,88 +113,9 @@
|
|
|
group by iotd.devBid
|
|
|
</select>
|
|
|
|
|
|
-
|
|
|
- <update id="updateIotDevice" parameterType="IotDevice">
|
|
|
- update IotDevice
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="tid != null">tid = #{tid},</if>
|
|
|
- <if test="devtypeBid != null and devtypeBid != ''">devtypeBid = #{devtypeBid},</if>
|
|
|
- <if test="firmBid != null">firmBid = #{firmBid},</if>
|
|
|
- <if test="devCode != null">devCode = #{devCode},</if>
|
|
|
- <if test="devName != null">devName = #{devName},</if>
|
|
|
- <if test="devVersion != null">devVersion = #{devVersion},</if>
|
|
|
- <if test="devStatus != null">devStatus = #{devStatus},</if>
|
|
|
- <if test="devProvince != null">devProvince = #{devProvince},</if>
|
|
|
- <if test="devCity != null">devCity = #{devCity},</if>
|
|
|
- <if test="devDistrict != null">devDistrict = #{devDistrict},</if>
|
|
|
- <if test="devLng != null">devLng = #{devLng},</if>
|
|
|
- <if test="devLat != null">devLat = #{devLat},</if>
|
|
|
- <if test="devPositionstatus != null">devPositionstatus = #{devPositionstatus},</if>
|
|
|
- <if test="devPositiontype != null">devPositiontype = #{devPositiontype},</if>
|
|
|
- <if test="devTag != null">devTag = #{devTag},</if>
|
|
|
- <if test="devRecogtype != null">devRecogtype = #{devRecogtype},</if>
|
|
|
- <if test="devNetworktype != null">devNetworktype = #{devNetworktype},</if>
|
|
|
- <if test="devOnlinedate != null">devOnlinedate = #{devOnlinedate},</if>
|
|
|
- <if test="devOfflinedate != null">devOfflinedate = #{devOfflinedate},</if>
|
|
|
- <if test="devSubtype != null">devSubtype = #{devSubtype},</if>
|
|
|
- <if test="devUpdateddate != null">devUpdateddate = #{devUpdateddate},</if>
|
|
|
- <if test="devCreator != null">devCreator = #{devCreator},</if>
|
|
|
- <if test="devModifier != null">devModifier = #{devModifier},</if>
|
|
|
- <if test="devModifieddate != null">devModifieddate = #{devModifieddate},</if>
|
|
|
- <if test="devCreateddate != null">devCreateddate = #{devCreateddate},</if>
|
|
|
- <if test="devDelstatus != null">devDelstatus = #{devDelstatus},</if>
|
|
|
- <if test="devOriginalid != null">devOriginalid = #{devOriginalid},</if>
|
|
|
- <if test="devHostingstatus != null">devHostingstatus = #{devHostingstatus},</if>
|
|
|
- <if test="extInfo != null">extInfo = #{extInfo},</if>
|
|
|
- </trim>
|
|
|
- where devBid = #{devBid} and devDelstatus = '0'
|
|
|
- </update>
|
|
|
<update id="updateIotDeviceExtInfo">
|
|
|
update IotDevice set extInfo=#{extInfo}, devStatus='1' ,devUpdateddate=#{updateDate} ,devModifieddate=#{updateDate} where devBid=#{devBid}
|
|
|
</update>
|
|
|
- <update id="updateIotDeviceByDevCodeAndFirmDev">
|
|
|
- update IotDevice
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="tid != null">tid = #{tid},</if>
|
|
|
- <if test="devtypeBid != null and devtypeBid != ''">devtypeBid = #{devtypeBid},</if>
|
|
|
- <if test="firmBid != null">firmBid = #{firmBid},</if>
|
|
|
- <if test="devCode != null">devCode = #{devCode},</if>
|
|
|
- <if test="devName != null">devName = #{devName},</if>
|
|
|
- <if test="devVersion != null">devVersion = #{devVersion},</if>
|
|
|
- <if test="devStatus != null">devStatus = #{devStatus},</if>
|
|
|
- <if test="devProvince != null">devProvince = #{devProvince},</if>
|
|
|
- <if test="devCity != null">devCity = #{devCity},</if>
|
|
|
- <if test="devDistrict != null">devDistrict = #{devDistrict},</if>
|
|
|
- <if test="devLng != null">devLng = #{devLng},</if>
|
|
|
- <if test="devLat != null">devLat = #{devLat},</if>
|
|
|
- <if test="devPositionstatus != null">devPositionstatus = #{devPositionstatus},</if>
|
|
|
- <if test="devPositiontype != null">devPositiontype = #{devPositiontype},</if>
|
|
|
- <if test="devTag != null">devTag = #{devTag},</if>
|
|
|
- <if test="devRecogtype != null">devRecogtype = #{devRecogtype},</if>
|
|
|
- <if test="devNetworktype != null">devNetworktype = #{devNetworktype},</if>
|
|
|
- <if test="devOnlinedate != null">devOnlinedate = #{devOnlinedate},</if>
|
|
|
- <if test="devOfflinedate != null">devOfflinedate = #{devOfflinedate},</if>
|
|
|
- <if test="devSubtype != null">devSubtype = #{devSubtype},</if>
|
|
|
- <if test="devUpdateddate != null">devUpdateddate = #{devUpdateddate},</if>
|
|
|
- <if test="devCreator != null">devCreator = #{devCreator},</if>
|
|
|
- <if test="devModifier != null">devModifier = #{devModifier},</if>
|
|
|
- <if test="devModifieddate != null">devModifieddate = #{devModifieddate},</if>
|
|
|
- <if test="devCreateddate != null">devCreateddate = #{devCreateddate},</if>
|
|
|
- <if test="devDelstatus != null">devDelstatus = #{devDelstatus},</if>
|
|
|
- <if test="devOriginalid != null">devOriginalid = #{devOriginalid},</if>
|
|
|
- <if test="devHostingstatus != null">devHostingstatus = #{devHostingstatus},</if>
|
|
|
- <if test="extInfo != null">extInfo = #{extInfo},</if>
|
|
|
- </trim>
|
|
|
- where devCode = #{devCode} and firmBid = #{firmBid} and devtypeBid = #{devtypeBid}
|
|
|
- </update>
|
|
|
- <update id="updateIotDeviceStatusByDevCodeList">
|
|
|
- update IotDevice set devStatus = #{devStatus} where devtypeBid = #{devtypeBid} and firmBid = #{firmBid} and
|
|
|
- devCode in
|
|
|
- <foreach item="item" collection="list" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </update>
|
|
|
-
|
|
|
|
|
|
<insert id="insertIotDevice" parameterType="IotDevice" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into IotDevice
|
|
|
@@ -338,27 +199,6 @@
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
- <delete id="deleteIotDeviceByDevBids" parameterType="String">
|
|
|
- update IotDevice set devDelstatus = 1 where devBid in
|
|
|
- <foreach item="devBid" collection="array" open="(" separator="," close=")">
|
|
|
- #{devBid}
|
|
|
- </foreach>
|
|
|
- </delete>
|
|
|
-
|
|
|
- <delete id="updateIotDeviceStatusByDevBidList" parameterType="java.util.List">
|
|
|
- update IotDevice set devStatus = '0' where devBid in
|
|
|
- <foreach item="devBid" collection="list" open="(" separator="," close=")">
|
|
|
- #{devBid}
|
|
|
- </foreach>
|
|
|
- </delete>
|
|
|
-
|
|
|
- <select id="getDeviceListByDevtypeBids" resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
|
|
|
- <include refid="selectIotDeviceVo"/>
|
|
|
- where devDelstatus = '0' and firmBid = #{firmBizId} and devtypeBid in
|
|
|
- <foreach item="devtypeBid" collection="devtypeBids" open="(" separator="," close=")">
|
|
|
- #{devtypeBid}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
<select id="selectDeviceByDeviceServiceNameAndDevCode"
|
|
|
resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
|
|
|
select
|
|
|
@@ -437,84 +277,7 @@
|
|
|
where devBid = #{item.devBid} and devDelstatus = '0'
|
|
|
</foreach>
|
|
|
</update>
|
|
|
- <update id="updateIotDeviceStatusByType">
|
|
|
- update IotDevice set devStatus = #{devStatus} where devtypeBid = #{devtypeBid} and firmBid = #{firmBid}
|
|
|
- </update>
|
|
|
|
|
|
- <select id="getDeviceListByDevtypeBidsAndDevCode" resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
|
|
|
- <include refid="selectIotDeviceVo"/>
|
|
|
- where devDelstatus = '0' and firmBid = #{firmBizId} and devCode = #{devCode} and devtypeBid in
|
|
|
- <foreach item="devtypeBid" collection="devtypeBids" open="(" separator="," close=")">
|
|
|
- #{devtypeBid}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
- <select id="selectIotDeviceByIotDeviceDTO" resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
|
|
|
- select
|
|
|
- d.id,
|
|
|
- d.devBid,
|
|
|
- d.tid,
|
|
|
- d.devtypeBid,
|
|
|
- d.firmBid,
|
|
|
- d.devCode,
|
|
|
- d.devName,
|
|
|
- d.devVersion,
|
|
|
- d.devStatus,
|
|
|
- d.devProvince,
|
|
|
- d.devCity,
|
|
|
- d.devDistrict,
|
|
|
- d.devLng,
|
|
|
- d.devLat,
|
|
|
- d.devPositionstatus,
|
|
|
- d.devPositiontype,
|
|
|
- d.devTag,
|
|
|
- d.devRecogtype,
|
|
|
- d.devNetworktype,
|
|
|
- d.devOnlinedate,
|
|
|
- d.devOfflinedate,
|
|
|
- d.devSubtype,
|
|
|
- d.devCreator,
|
|
|
- d.devModifier,
|
|
|
- d.devUpdateddate,
|
|
|
- d.devModifieddate,
|
|
|
- d.devCreateddate,
|
|
|
- d.devDelstatus,
|
|
|
- d.extInfo
|
|
|
- from IotDevice d
|
|
|
- LEFT JOIN IotDevicetype idt ON d.devtypeBid = idt.devtypeBid
|
|
|
- <where>
|
|
|
- devDelstatus = '0'
|
|
|
- <if test="devBid != null and devBid != ''">and d.devBid = #{devBid}</if>
|
|
|
- <if test="tid != null and tid != ''">and d.tid = #{tid}</if>
|
|
|
- <if test="devtypeBids != null and devtypeBids != ''">and e.devtypePid in (${devtypeBids})</if>
|
|
|
- <if test="devtypeBid != null and devtypeBid != ''">and e.devtypePid = #{devtypeBid}</if>
|
|
|
- <if test="firmBid != null and firmBid != ''">and d.firmBid = #{firmBid}</if>
|
|
|
- <if test="devSubtype != null and devSubtype != ''">and d.devSubtype = #{devSubtype}</if>
|
|
|
- <if test="devTel != null and devTel != ''">and d.devTel like concat('%', #{devTel}, '%')</if>
|
|
|
- <if test="devName != null and devName != ''">and d.devName like concat('%', #{devName}, '%')</if>
|
|
|
- <if test="devCode != null and devCode != ''">and d.devCode like concat('%', #{devCode}, '%')</if>
|
|
|
- <if test="devStatus != null and devStatus != ''">and d.devStatus = #{devStatus}</if>
|
|
|
- <if test="devHostingstatus != null and devHostingstatus != ''">and d.devHostingstatus =
|
|
|
- #{devHostingstatus}
|
|
|
- </if>
|
|
|
- <if test="devtypeBidList != null and devtypeBidList.size() != 0">
|
|
|
- and d.devtypeBid in
|
|
|
- <foreach collection="devtypeBidList" item="item" index="index" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="devBids != null and devBids.size() != 0">
|
|
|
- and d.devBid in
|
|
|
- <foreach collection="devBids" item="item" index="index" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="serviceName != null and serviceName !=''">
|
|
|
- and idt.devtypeServicename = #{serviceName}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- and d.devDelstatus='0'
|
|
|
- group by d.devBid
|
|
|
- </select>
|
|
|
<select id="getDeviceCodesByDevconnBid" resultType="java.lang.String">
|
|
|
select devCode from IotDevice where devconnBid=#{devconnBid} and devDelstatus='0'
|
|
|
</select>
|