ZabbixItemMapper.xml 1016 Bytes
<?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.monitor.zabbix.mapper.ZabbixItemMapper">
    <resultMap id="itemResultMapper" type="com.monitor.zabbix.model.ZabbixItemInfo">
        <id column="itemid" property="itemId" jdbcType="INTEGER"/>
        <result column="hostid" property="hostId" jdbcType="INTEGER"/>
        <result column="value_type" property="valueType" jdbcType="VARCHAR"/>
        <result column="key_" property="keyName" jdbcType="VARCHAR"/>
    </resultMap>

    <select id="queryItemInfo" resultMap="itemResultMapper">
        select
        itemid,hostid,key_,value_type
        from items
        where hostid IN
        <foreach collection="list" index="index" item="item" close=")" open="(" separator=",">
            #{item}
        </foreach>
        AND
        (key_ LIKE 'system.cpu.util%' OR key_ LIKE 'vm.memory%' OR key_ like 'net.if%')
    </select>
</mapper>