<?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.shanghaichengdi.ghjgitem.mapper.WaterTemporaryFlightsMapper">


    <select id="getPageList" resultType="com.shanghaichengdi.ghjgitem.vo.response.WaterTemporaryFlightsRes">
        select code,
               unit_name unitName,
               shipname shipName,
               b.码头名称 dockAtTheDock,
--                charter_date charterDate,
               to_char(charter_date,'yyyy-mm-dd') charterDate,
               departure_date_sta departureDateSta,
               departure_date_end departureDateEnd,
               number_treasure_ships numberTreasureShips,
               route_type routeType,
               chartered_nature charteredNature,
               nature_of_charter_units natureOfCharterUnits,
               name,
               cdate,
               udate,
               CODE_HISTORY codeHistory,
               decode(ADDITIONAL,0,'补录','新建') additional
        from GHJG_BUSSINESS.WATER_TEMPORARY_FLIGHTS wafw
                 left join NHGIS.浦江游览码头 b on b.码头编号 = wafw.DOCK_AT_THE_DOCK
        where wafw.info_state = 3
            <if test="startDate != null and startDate != '' and endDate != null and endDate !=  ''">
                and ((wafw.CDATE >= to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss') and wafw.CDATE &lt;= to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss'))
                or (wafw.UDATE >= to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss') and wafw.UDATE &lt;= to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss')))
            </if>
    </select>

</mapper>
