<?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.unis.crk.hardware.mapper.UnithardwareMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.unis.crk.hardware.entity.Unithardware">
        <id column="UnitHIID" property="UnitHIID" />
        <result column="UnitId" property="UnitId" />
        <result column="DCID" property="dcid" />
        <result column="IsUsed" property="IsUsed" />
        <result column="IPAddr" property="IPAddr" />
        <result column="Port" property="Port" />
        <result column="SeriesCode" property="SeriesCode" />
        <result column="ChannelCode" property="ChannelCode" />
        <result column="WinCode" property="WinCode" />
        <result column="Account" property="Account" />
        <result column="PWD" property="pwd" />
        <result column="UseType" property="UseType" />
        <result column="Filter_IP" property="filterIp" />
        <result column="Note" property="Note" />
        <result column="HIID" property="hiid" />
        <result column="Antenna" property="antenna" />
        <result column="Power" property="power" />
    </resultMap>
    <select id="getPageByUnitId" resultType="java.util.Map">

        SELECT
        u.*, d.DEVICECODE,
        h.Name
        FROM
        unithardware u
        LEFT JOIN devicecode d ON u.DCID = d.DCID
        LEFT JOIN hardware h ON h.HIID = u.HIID
        where 1=1
        <if test="ew.sqlSegment != null and  ew.sqlSegment != ''">
            and  ${ew.sqlSegment}
        </if>

    </select>
</mapper>
