<?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.trs.ggzyexchange.mapper.ZrzyTdCedeNoticeMapper">
    <select id="queryZrzyTdCedeNoticeList" resultType="com.trs.ggzyexchange.entity.ZrzyTdCedeNoticeVo">
        select
             ztcn.SOURCE_DATA_KEY sourceDataKey,
             ztcn.ANNOUNCEMENT_CODE announcementCode,
             ztcn.ANNOUNCEMENT_TITLE announcementTitle,
             ztcn.LAND_DISTRICT landDistrict,
             ztcn.PUBLISHING_TIME publishingTime,
             ztcn.ANNOUNCEMENT_START_TIME announcementStartTime,
             ztcn.ANNOUNCEMENT_DEADLINE announcementDeadline
        from
        ZRZY_TD_CEDE_NOTICE ztcn
        <where>
            <if test="announcementCode != null and announcementCode != ''">
                and ztcn.ANNOUNCEMENT_CODE = #{announcementCode}
            </if>
            <if test="announcementTitle != null and announcementTitle != ''">
                <bind name="announcementTitle" value="'%'+announcementTitle+'%'"/>
                and ztcn.ANNOUNCEMENT_TITLE like #{announcementTitle}
            </if>
            <if test="landDistrict != null and landDistrict != ''">
                <bind name="landDistrict" value="landDistrict+'%'"/>
                and ztcn.LAND_DISTRICT like #{landDistrict}
            </if>
            <if test="publishingTimeStart != null and publishingTimeStart != ''">
                and ztcn.PUBLISHING_TIME  &gt;=  #{publishingTimeStart}
            </if>
            <if test="publishingTimeEnd != null and publishingTimeEnd != ''">
                and ztcn.PUBLISHING_TIME  &lt;=  #{publishingTimeEnd}
            </if>
        </where>
        order by ztcn.PUBLISHING_TIME desc
    </select>
    <select id="maxDataTimeStamp" resultType="java.lang.Long">
        select max(DATA_TIMESTAMP) from "ggzyexchange"."ZRZY_TD_CEDE_NOTICE";
    </select>


</mapper>
