Newer
Older
huludao / src / main / resources / mapper / monitoring / WarnConfigDao.xml
<?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.newfiber.api.pc.dao.monitoring.WarnConfigDao">

    <resultMap type="com.newfiber.api.pc.model.monitor.WarnConfig" id="baseResultMap">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="site_no" property="siteNo" jdbcType="VARCHAR"/>
        <result column="site_name" property="siteName" jdbcType="VARCHAR"/>
        <result column="factors_ascii" property="factorsAscii" jdbcType="VARCHAR"/>
        <result column="factors_name" property="factorsName" jdbcType="VARCHAR"/>
        <result column="warn_value" property="warnValue" jdbcType="DECIMAL"/>
        <result column="warn_type" property="warnType" jdbcType="INTEGER"/>
        <result column="warn_type_desc" property="warnTypeDesc" jdbcType="VARCHAR"/>
        <result column="compare_way" property="compareWay" jdbcType="VARCHAR"/>
        <result column="compare_way_desc" property="compareWayDesc" jdbcType="VARCHAR"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="plat_form" property="platForm" jdbcType="VARCHAR"/>
        <result column="condition_type" property="conditionType" jdbcType="INTEGER"/>
    </resultMap>

    <sql id="Base_Column_List" >
        wc.id, wc.site_no, wc.site_name, wc.factors_ascii, wc.factors_name, wc.warn_value, wc.warn_type, wc.warn_type_desc,
        wc.compare_way, wc.compare_way_desc, wc.create_time, wc.plat_form, wc.condition_type
    </sql>

    <select id="selectOnLineWarnConfigList" resultMap="baseResultMap">
        select <include refid="Base_Column_List" /> from warn_config wc inner join station_base sb on wc.site_no = sb.st_code where sb.status = 0
    </select>

    <select id="warnConfigByStCodes" resultType="com.newfiber.api.pc.model.monitor.WarnConfig">
        select <include refid="Base_Column_List"/> from warn_config wc
        where wc.site_no in
        <foreach item="item" index="index" collection="stCodeList" open="(" separator="," close=")">
            #{item,jdbcType=VARCHAR}
        </foreach>
    </select>

</mapper>