DockerMonitorClusterMapper.xml 1.16 KB
<?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.mysql.mapper.DockerMonitorClusterMapper" >
    <resultMap id="BaseResultMap" type="com.model.DockerMonitorClusterModel" >
        <id column="clusterid" property="clusterId" jdbcType="VARCHAR" />
        <result column="monitor_flag" property="monitorFlag" jdbcType="VARCHAR" />
        <result column="descr" property="descr" jdbcType="VARCHAR" />
    </resultMap>

    <sql id="Base_Column_List" >
        clusterid,monitor_flag,descr
    </sql>

    <select id="selectAll"   resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from docker_monitor_cluster
    </select>

    <select id="selectAllMonitor"   resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from docker_monitor_cluster
        where monitor_flag='1'
    </select>

    <update id="updateMonitorFlag" >
        update docker_monitor_cluster
        set  monitor_flag = #{monitorFlag}
        where clusterid = #{clusterId}
    </update>



</mapper>