<?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.usky.fire.mapper.PatrolInspectionPlanSonMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.usky.fire.domain.PatrolInspectionPlanSon">
        <id column="id" property="id" />
        <result column="plan_id" property="planId" />
        <result column="inspection_date" property="inspectionDate" />
        <result column="start_date" property="startDate" />
        <result column="end_date" property="endDate" />
        <result column="start_time" property="startTime" />
        <result column="end_time" property="endTime" />
        <result column="personnel_id" property="personnelId" />
        <result column="area_id" property="areaId" />
        <result column="plan_type" property="planType" />
        <result column="plan_cycle" property="planCycle" />
        <result column="plan_frequency" property="planFrequency" />
        <result column="lap_time" property="lapTime" />
        <result column="interval_time" property="intervalTime" />
        <result column="plan_describe" property="planDescribe" />
        <result column="completion" property="completion" />
        <result column="create_time" property="createTime" />
        <result column="creator" property="creator" />
        <result column="alternate_field" property="alternateField" />
        <result column="tenant_id" property="tenantId" />
        <result column="company_id" property="companyId" />
    </resultMap>

    <select id="selectInspectionPlanSonData" resultType="com.usky.fire.domain.PatrolInspectionPlanSon">
        select
        *
        from patrol_inspection_plan_son
        <where>
            and concat(inspection_date,' ',end_time) &lt; #{datetime1}
            and CONCAT(inspection_date,' ',end_time) > #{datetime2}
        </where>
    </select>

</mapper>
