<?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="org.jeecg.modules.stm.page.mapper.PageMetricconfigMapper">
    <select id="queryPageMetricconfig" resultType="org.jeecg.modules.stm.page.vo.PageMetricMoniVo">
       SELECT s.id,s.mtrc_name,s.mtrc_no,m.DOMAIN_NAME as domain_no,s.coll_freq AS collFreq,
            d1.item_text as collFreqname,
            s.coll_method AS mtrcClass,
            d2.item_text as mtrcClassname,
            if(p.page_status='1','是','否') as pageStatus
            FROM metric_monitor_set s
            left join st_domain m on m.DOMAIN_CODE=s.domain_no
            LEFT JOIN
            page_metricconfig p ON p.id=s.id
            left join (
            select i.item_text,i.item_value from sys_dict d ,sys_dict_item i where d.id=i.dict_id
            and d.dict_code ='colletrate'
            ) d1 on d1.item_value=s.coll_freq
            left join (
            select i.item_text,i.item_value from sys_dict d ,sys_dict_item i where d.id=i.dict_id
            and d.dict_code ='colletway'
            ) d2 on d2.item_value=s.coll_method
            where s.mtrc_ctp in ('1','2')
            ORDER BY s.mtrc_no asc
    </select>

</mapper>