<?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="cn.cecep.talroad.mapper.PcStationBuildingEntranceGuMapper">

    <resultMap type="cn.cecep.talroad.domain.PcStationBuildingEntranceGu" id="PcStationBuildingEntranceGuResult">
        <result property="id"    column="id"    />
        <result property="stationBuildingId"    column="station_building_id"    />
        <result property="visitTime"    column="visit_time"    />
        <result property="entranceGuardCode"    column="entrance_guard_code"    />
        <result property="entranceGuardSignature"    column="entrance_guard_signature"    />
        <result property="entranceGuardType"    column="entrance_guard_type"    />
        <result property="entranceGuardImage"    column="entrance_guard_image"    />
    </resultMap>


    <sql id="selectPcStationBuildingEntranceGuVo">
        select id, station_building_id, visit_time, entrance_guard_code, entrance_guard_signature, entrance_guard_type, entrance_guard_image from pc_station_building_entrance_gu
    </sql>

    <select id="selectPcStationBuildingEntranceGuList" parameterType="cn.cecep.talroad.domain.PcStationBuildingEntranceGu" resultMap="PcStationBuildingEntranceGuResult">
        <include refid="selectPcStationBuildingEntranceGuVo"/>
        <where>
            <if test="stationBuildingId != null  and stationBuildingId != ''">
                and station_building_id = #{stationBuildingId}
            </if>
            <if test="visitTime != null  and visitTime != ''">
                and visit_time = #{visitTime}
            </if>
            <if test="entranceGuardCode != null  and entranceGuardCode != ''">
                and entrance_guard_code = #{entranceGuardCode}
            </if>
            <if test="entranceGuardSignature != null  and entranceGuardSignature != ''">
                and entrance_guard_signature = #{entranceGuardSignature}
            </if>
            <if test="entranceGuardType != null  and entranceGuardType != ''">
                and entrance_guard_type = #{entranceGuardType}
            </if>
            <if test="entranceGuardImage != null  and entranceGuardImage != ''">
                and entrance_guard_image = #{entranceGuardImage}
            </if>
        </where>
    </select>

    <select id="selectDayTask" resultMap="PcStationBuildingEntranceGuResult">
        <include refid="selectPcStationBuildingEntranceGuVo"/>
        where visit_time &gt;= #{startTime}
        and visit_time &lt;= #{endTime}
    </select>
</mapper>
