MediatorAlarmRuleMapper.xml 1.1 KB

12345678910111213141516171819202122232425
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.xunmei.mediator.api.mapper.MediatorAlarmRuleMapper">
  4. <select id="findListByDeviceId" resultType="com.xunmei.common.core.domain.mediator.domain.MediatorAlarmRule">
  5. select r.*
  6. from mediator_alarm_rule r
  7. left join mediator_alarm_rule_source s on r.id = s.rule_id and s.value_type = 'Device'
  8. where r.isdeleted = 0
  9. and r.enabled = 1
  10. and s.value = #{deviceId}
  11. and s.org_id = #{orgId}
  12. and s.source_type = #{sourceType}
  13. and r.type = 'alarm'
  14. </select>
  15. <select id="findListByDeviceType" resultType="com.xunmei.common.core.domain.mediator.domain.MediatorAlarmRule">
  16. select r.*
  17. from mediator_alarm_rule r
  18. left join mediator_alarm_rule_source s on r.id = s.rule_id and s.value_type = 'AllDevice'
  19. where r.isdeleted = 0
  20. and r.enabled = 1
  21. and s.source_type = #{sourceType}
  22. and r.type = 'alarm'
  23. </select>
  24. </mapper>