<?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.inspect.exec.mapper.EqpBookMapper">
    <resultMap type="EqpBook" id="EqpBookResult">
        <result property="eqpBookId"    column="eqp_book_id"    />
        <result property="stationName"    column="station_name"    />
        <result property="stationCode"    column="station_code"    />
        <result property="areaId"    column="area_id"    />
        <result property="areaName"    column="area_name"    />
        <result property="patrolDeviceName"    column="patrol_device_name"    />
        <result property="patrolDeviceCode"    column="patrol_device_code"    />
        <result property="deviceModel"    column="device_model"    />
        <result property="manufacturer"    column="manufacturer"    />
        <result property="useUnit"    column="use_unit"    />
        <result property="deviceSource"    column="device_source"    />
        <result property="productionDate"    column="production_date"    />
        <result property="productionCode"    column="production_code"    />
        <result property="isTransport"    column="is_transport"    />
        <result property="useMode"    column="use_mode"    />
        <result property="videoMode"    column="video_mode"    />
        <result property="place"    column="place"    />
        <result property="positionX"    column="position_x"    />
        <result property="positionY"    column="position_y"    />
        <result property="positionZ"    column="position_z"    />
        <result property="type"    column="type"    />
        <result property="patrolDeviceInfo"    column="patrol_device_info"    />
        <result property="robotsCode"    column="robots_code"    />
        <result property="ipAddr"    column="ip_addr"    />
        <result property="port"    column="port"    />
        <result property="user"    column="user"    />
        <result property="password"    column="password"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="mainSystemCode"    column="main_system_code"    />
    </resultMap>

    <sql id="selectEqpBookVo">
        select eqp_book_id, station_name, station_code, area_id, area_name, patrol_device_name, patrol_device_code, device_model, manufacturer, use_unit, device_source, production_date, production_code, is_transport, use_mode, video_mode, place, position_x, position_y, position_z, type, patrol_device_info, robots_code, ip_addr, port, user, password, del_flag, create_by, create_time, update_by, update_time, main_system_code from basedata_eqpbook
    </sql>

    <select id="selectEqpBookList" parameterType="EqpBook" resultMap="EqpBookResult">
        <include refid="selectEqpBookVo"/>
        <where>  
            <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
            <if test="stationCode != null  and stationCode != ''"> and station_code = #{stationCode}</if>
            <if test="areaId != null "> and area_id = #{areaId}</if>
            <if test="areaName != null  and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
            <if test="patrolDeviceName != null  and patrolDeviceName != ''"> and patrol_device_name like concat('%', #{patrolDeviceName}, '%')</if>
            <if test="patrolDeviceCode != null  and patrolDeviceCode != ''"> and patrol_device_code = #{patrolDeviceCode}</if>
            <if test="deviceModel != null  and deviceModel != ''"> and device_model = #{deviceModel}</if>
            <if test="manufacturer != null  and manufacturer != ''"> and manufacturer = #{manufacturer}</if>
            <if test="useUnit != null  and useUnit != ''"> and use_unit = #{useUnit}</if>
            <if test="deviceSource != null  and deviceSource != ''"> and device_source = #{deviceSource}</if>
            <if test="productionDate != null  and productionDate != ''"> and production_date = #{productionDate}</if>
            <if test="productionCode != null  and productionCode != ''"> and production_code = #{productionCode}</if>
            <if test="isTransport != null  and isTransport != ''"> and is_transport = #{isTransport}</if>
            <if test="useMode != null  and useMode != ''"> and use_mode = #{useMode}</if>
            <if test="videoMode != null  and videoMode != ''"> and video_mode = #{videoMode}</if>
            <if test="place != null  and place != ''"> and place = #{place}</if>
            <if test="positionX != null  and positionX != ''"> and position_x = #{positionX}</if>
            <if test="positionY != null  and positionY != ''"> and position_y = #{positionY}</if>
            <if test="positionZ != null  and positionZ != ''"> and position_z = #{positionZ}</if>
            <if test="type != null  and type != ''"> and type = #{type}</if>
            <if test="patrolDeviceInfo != null  and patrolDeviceInfo != ''"> and patrol_device_info = #{patrolDeviceInfo}</if>
            <if test="robotsCode != null  and robotsCode != ''"> and robots_code = #{robotsCode}</if>
            <if test="ipAddr != null  and ipAddr != ''"> and ip_addr = #{ipAddr}</if>
            <if test="port != null  and port != ''"> and port = #{port}</if>
            <if test="user != null  and user != ''"> and user = #{user}</if>
            <if test="password != null  and password != ''"> and password = #{password}</if>
            <if test="mainSystemCode != null  and mainSystemCode != ''"> and main_system_code = #{mainSystemCode}</if>
        </where>
    </select>

</mapper>