<?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.purchaseAndSalesSupervision.modular.pssstorageemptyperiod.mapper.PssStorageEmptyPeriodMapper">

    <select id="selectMyMapsPage"
            resultType="com.unis.purchaseAndSalesSupervision.modular.pssstorageemptyperiod.entity.PssStorageEmptyPeriod">
        SELECT
            oi.org_name orgName,
            psep.plan_year,
            psep.plan_number,
            Bs.storehouse_name storehouseName,
            bw.warehouse_name warehouseName,
            psep.rotation_status,
            psep.rotation_deadline,
            psep.planned_quantity,
            psep.remaining_quantity,
            psep.date
        FROM
            province_all.biz_pss_storage_empty_period psep
                LEFT JOIN depot_qh.org_info oi ON psep.org_id = oi.org_id
                LEFT JOIN depot_qh.basic_storehouse Bs ON psep.basic_storehouse_id = Bs.storehouse_id
                LEFT JOIN  depot_qh.basic_warehouse bw on psep.warehouse_id = bw.warehouse_id
        <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
            where ${ew.sqlSegment}
        </if>

    </select>
</mapper>