You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.6 KiB

9 months ago
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.techsor.datacenter.business.dao.ex.DeviceAlertTemplateBindMapperExt">
<select id="getAlarmTmplDeviceBindedPage" resultType="com.techsor.datacenter.business.dto.device.alert.DeviceAlertTemplateParams">
select
tmpl.id,
tmpl.tmpl_name,
tmpl.level,
tmpl.template_defs,
tmpl.forward_type alertNotificationMethod,
tmpl.alert_cancel_template_defs,
tmpl.alert_title,
tmpl.alert_cancel_title,
tmpl.alert_recipient_mail,
tmpl.alert_recipient_sms
from
device_alert_template tmpl
inner join device_alert_template_bind dtb on tmpl.id = dtb.device_alert_template_id
<where>
<foreach collection="companyIdList" item="companyId" open="and (" separator="or" close=")">
company_id = #{companyId}
</foreach>
and flag != 1 and dtb.device_info_id = #{deviceInfoId}
</where>
</select>
<select id="getAlarmTmplIdsByDeviceId" resultType="java.lang.String">
select
GROUP_CONCAT(tmpl.device_alert_template_id)
9 months ago
from
device_alert_template_bind tmpl
9 months ago
inner join device_info dinfo on dinfo.id = tmpl.device_info_id
inner join device_alert_template dtmpl on dtmpl.id = tmpl.device_alert_template_id
where dinfo.device_id = #{deviceId} and dinfo.flag != 1 and dtmpl.flag != 1
9 months ago
</select>
</mapper>