<?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.ruoyi.monitoring.mapper.CmcChannelMapper">
    
    <resultMap type="com.ruoyi.monitoring.domain.CmcChannel" id="CmcChannelResult">
    	<id     property="Id"      column="ID"      />
        <result property="SensorNo"     column="Sensor_No"     />
        <result property="Info"   column="Info"   />
        <result property="Ver"    column="Ver"    />
        <result property="Sn"      column="Sn"      />
        <result property="Ca"    column="Ca"    />
        <result property="Cb"    column="Cb"    />
        <result property="Units"    column="Units"    />
        <result property="LastDT"    column="LastDT"    />
    </resultMap>

    <sql id="selectChannelVo">
        SELECT c.ID, c.Sensor_No, c.Info, c.Ver, c.Sn, c.Ca, c.Cb, c.Units, c.LastDT
        FROM Channel c
    </sql>

    <select id="listChannel" parameterType="com.ruoyi.monitoring.domain.CmcChannel" resultMap="CmcChannelResult">
        <include refid="selectChannelVo"/>
        <where>
            <if test="Id != null ">c.ID = #{Id}</if>
            <if test="SensorNo != null ">c.Sensor_No = #{SensorNo}</if>
            <if test="Info != null ">c.Info LIKE concat('%', #{Info}, '%')</if>
            <if test="Ver != null ">c.Ver = #{Ver}</if>
            <if test="Sn != null ">c.Sn = #{Sn}</if>
            <if test="Ca != null ">c.Ca = #{Ca}</if>
            <if test="Cb != null ">c.Cb = #{Cb}</if>
            <if test="Units != null ">c.Units = #{Units}</if>
            <if test="LastDT != null ">c.LastDT = #{LastDT}</if>
        </where>
    </select>

</mapper>