<?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.example.ghjgpython.mapper.ShipRecognitionMapper">
    <select id="getPhotos" resultType="com.example.ghjgpython.dao.Photo">
        select o.column2 oldCogPicture, photoname p0Picture, v.name, to_char(v.time,'yyyy-MM-dd-HH24-mi-SS') time, a.type_class typeClass
        from "NHDT"."OFF_SITE_CASE" o left join "NHDT"."VIDEO_ANALYSIS" v on o.event_code = v.EVENTCODE
        left join nhdt.coverage_analysis a on a.event_code = v.eventcode
        where o.column2 is not null and o.type = 2 and PHOTONAME is not null
        <if test="toDate != null">
            and trunc(o.create_time) = #{toDate}
        </if>
        <if test="startDate != null">
            and trunc(o.create_time) >= #{startDate}
        </if>
        <if test="endDate != null">
            and trunc(o.create_time) &lt;= #{endDate}
        </if>
    </select>
    <select id="getTest" resultType="java.lang.String">
        select 1 from dual
    </select>
    <select id="getFlagPhoto" resultType="com.example.ghjgpython.dao.PhotoByType">
        select a.coverage_ratio coverageRatio, v.photoname photoName,to_char(v.time,'yyyy-MM-dd-HH24-mi-SS') time from "NHDT"."COVERAGE_ANALYSIS" a left join "NHDT"."VIDEO_ANALYSIS" v
            on a.EVENT_CODE = v.EVENTCODE
        where a.create_time >= #{startDate} and a.create_time &lt;= #{endDate}
        <if test="type != null">
            and a.type_class = #{type}
        </if>
    </select>
    <select id="getPhotoNew" resultType="com.example.ghjgpython.dao.PhotoByType">
        select a.coverage_ratio coverageRatio, v.photoname p0Picture,to_char(v.time,'yyyy-MM-dd-HH24-mi-SS') time, a.type_class typeClass
        from "NHDT"."COVERAGE_ANALYSIS" a left join "NHDT"."VIDEO_ANALYSIS" v
         on a.EVENT_CODE = v.EVENTCODE
        where v.photoname is not null and a.create_time >= #{startDate} and a.create_time &lt;= #{endDate}
    </select>
    <select id="getDayPhoto" resultType="com.example.ghjgpython.dao.PhotoByType">
        select a.coverage_ratio coverageRatio, v.photoname p0Picture,to_char(v.time,'yyyy-MM-dd-HH24-mi-SS') time, a.type_class typeClass
        from "NHDT"."COVERAGE_ANALYSIS" a left join "NHDT"."VIDEO_ANALYSIS" v
                                                    on a.EVENT_CODE = v.EVENTCODE
        where v.photoname is not null and a.create_time >= #{startDate} and a.create_time &lt;= #{endDate}
        and to_char(a.create_time ,'hh24:mi:ss') >= '08:00:00' and to_char(a.create_time,'hh24:mi:ss') &lt;= '16:00:00'
    </select>
    <select id="getNeedPhoto" resultType="com.example.ghjgpython.dao.PhotoByType">
        select v.photoname p0Picture, eventcode eventCode, to_char(time,'yyyy-MM-dd') time from "NHDT"."VIDEO_ANALYSIS" v
        where eventcode = #{eventCode}
    </select>
</mapper>