| | |
| | | </if> |
| | | ) |
| | | </select> |
| | | <select id="getDeviceStatesByAccount" resultType="map"> |
| | | <select id="getDeviceStatesByAccount" resultType="java.util.Map"> |
| | | SELECT |
| | | COUNT( d.state ) count, |
| | | d.state |
| | |
| | | </if> |
| | | GROUP BY d.state |
| | | </select> |
| | | |
| | | <select id="getSensorsByDevice" resultType="map"> |
| | | <select id="selectByOrgIdAndDevName" resultMap="BaseResultMap"> |
| | | SELECT * from device dev |
| | | left join monitor_point mpt on dev.monitor_point_id = mpt.id |
| | | where |
| | | mpt.organization_id = #{orgId} |
| | | <if test="devName!=null and ''!=devName"> |
| | | and dev.name like #{devName} |
| | | </if> |
| | | </select> |
| | | <select id="getSensorsByDevice" resultType="java.util.Map"> |
| | | SELECT |
| | | s.`key`, |
| | | s.`name` |
| | |
| | | ORDER BY |
| | | s.id |
| | | </select> |
| | | <select id="getDeviceVersionIdByMonitorPoint" resultType="map"> |
| | | SELECT |
| | | device_version_id deviceVersionId |
| | | FROM |
| | | device |
| | | WHERE |
| | | monitor_point_id = #{monitorPoint} |
| | | GROUP BY |
| | | device_version_id |
| | | </select> |
| | | <select id="getDeviceMacByMonitorPointAndDeviceVersion" resultType="string"> |
| | | SELECT |
| | | mac |
| | | FROM |
| | | device |
| | | WHERE |
| | | monitor_point_id = #{monitorPointId} |
| | | AND device_version_id = #{deviceVersionId} |
| | | </select> |
| | | </mapper> |