<?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.unis.rotationPlan.info.modular.rpWarnBiweeklyReport.mapper.RpWarnBiweeklyReportMapper">

    <select id="selectMyMapsPage" resultType="java.util.Map">
        SELECT
        CAST(c.plan_year as char) as 'planYear',
        e.dwmc as "dwmc",
        d.org_name as "orgName",
        DATE_FORMAT(a.warning_time,'%Y-%m-%d %T') as "warningTime"
        FROM
        biz_rp_warn_biweekly_report a
        LEFT JOIN biz_rp_issuance b ON a.rp_issuance_id = b.id
        LEFT JOIN depot_qh.business_rp_report c ON c.id = b.rp_report_id
        LEFT JOIN depot_qh.org_info d on a.org_id = d.org_id
        LEFT JOIN biz_unit_info e on a.unit_info_id = e.id
        <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
            where ${ew.sqlSegment}
        </if>
        order by a.warning_time desc
    </select>
</mapper>