sfd
2025-05-20 2786ed1fe266240fa6216c5dd6a9014481963d24
aps-modules/aps-core/src/main/resources/mapper/core/ApsPlate/ApsPlatePlanMapper.xml
@@ -277,15 +277,19 @@
    </update>
    <select id="selectPlatePlanByPlantMajor" parameterType="com.aps.core.domain.ApsPlate.ApsPlatePlan" resultMap="ApsPlatePlanResult">
        select  id,document_number,main_part_number,item_number,plant,professional_affiliation,production_quantity,require_id,
        unmatched_quantity,version, production_base,plan_end_day,order_create_time,low_order_code
        from aps_plate_plan
        <where>
            <if test="plant != null "> and plant = #{plant} </if>
            <if test="professionalAffiliation != null "> and professional_affiliation = 'main' </if>
              and del_flag='0'
        </where>
        order by document_number asc,id asc
        with rd as (
            select doc_no,require_date   from aps_plate_require_date where del_flag=0
        )
        select
            app.id,app.document_number,app.main_part_number,app.item_number,app.plant,app.professional_affiliation,app.production_quantity,app.require_id,
            app.unmatched_quantity,app.version, app.production_base,app.order_create_time,app.low_order_code,
            app.plan_end_day as orign_end_day,
            COALESCE(rd.require_date,app.plan_end_day) as plan_end_day
        from aps_plate_plan as  app
        left join rd  on app.document_number=rd.doc_no
        where app.del_flag='0'  and app.professional_affiliation = 'main'
        <if test="plant != null "> and plant = #{plant} </if>
        order by document_number ,id
    </select>
    <select id="selectUnMatchPlateSubPlan" parameterType="com.aps.core.domain.ApsPlate.ApsPlatePlan" resultMap="ApsPlatePlanResult">