zhanghl
2025-04-17 8bfafbd2e35e2cd0e370281c007fe98fe7fb91d3
aps-modules/aps-core/src/main/resources/mapper/core/ApsPlatePlanMapper.xml
@@ -54,9 +54,9 @@
            <if test="weekCycle != null  and weekCycle != ''"> and week_cycle like concat('%', #{weekCycle}, '%')</if>
            <if test="mainPartNumber != null  and mainPartNumber != ''"> and main_part_number like concat('%', #{mainPartNumber}, '%')</if>
            <if test="mainPartDrawingNumber != null  and mainPartDrawingNumber != ''"> and main_part_drawing_number like concat('%', #{mainPartDrawingNumber}, '%')</if>
            <if test="customer != null  and customer != ''"> and customer like concat('%', #{customer}, '%')</if>
            <if test="customer != null  and customer != ''"> and customer like  '%' || #{customer} || '%'</if>
            <if test="businessType != null  and businessType != ''"> and business_type = #{businessType}</if>
            <if test="documentNumber != null  and documentNumber != ''"> and document_number like concat('%', #{documentNumber}, '%')</if>
            <if test="documentNumber != null  and documentNumber != ''"> and document_number like '%'|| #{documentNumber}|| '%'</if>
            <if test="requirementType != null  and requirementType != ''"> and requirement_type like concat('%', #{requirementType}, '%')</if>
            <if test="documentStatus != null  and documentStatus != ''"> and document_status = #{documentStatus}</if>
            <if test="itemNumber != null  and itemNumber != ''"> and item_number like concat('%', #{itemNumber}, '%')</if>
@@ -83,6 +83,7 @@
            <if test="isStockComplete != null "> and is_stock_complete = #{isStockComplete}</if>
            <if test="hasTurnback != null "> and has_turnback = #{hasTurnback}</if>
            <if test="hasRisk != null "> and has_risk = #{hasRisk}</if>
             and del_flag='0'
        </where>
    </select>
    
@@ -129,6 +130,7 @@
            <if test="isStockComplete != null">is_stock_complete,</if>
            <if test="hasTurnback != null">has_turnback,</if>
            <if test="hasRisk != null">has_risk,</if>
            create_time,
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null and id != ''">#{id},</if>
@@ -166,6 +168,7 @@
            <if test="isStockComplete != null">#{isStockComplete},</if>
            <if test="hasTurnback != null">#{hasTurnback},</if>
            <if test="hasRisk != null">#{hasRisk},</if>
            #{createTime},
         </trim>
    </insert>
@@ -177,9 +180,9 @@
            <if test="weekCycle != null">week_cycle = #{weekCycle},</if>
            <if test="mainPartNumber != null">main_part_number = #{mainPartNumber},</if>
            <if test="mainPartDrawingNumber != null">main_part_drawing_number = #{mainPartDrawingNumber},</if>
            <if test="customer != null">customer = #{customer},</if>
            <if test="businessType != null">business_type = #{businessType},</if>
            <if test="documentNumber != null">document_number = #{documentNumber},</if>
            <if test="customer != null  and customer != ''">  and customer like  '%' || #{customer} || '%'  </if>
            <if test="businessType != null  and businessType != ''"> and business_type = #{businessType}</if>
            <if test="documentNumber != null  and documentNumber != ''"> and document_number  like  '%' || #{documentNumber} || '%'</if>
            <if test="requirementType != null">requirement_type = #{requirementType},</if>
            <if test="documentStatus != null">document_status = #{documentStatus},</if>
            <if test="itemNumber != null">item_number = #{itemNumber},</if>
@@ -220,4 +223,17 @@
            #{id}
        </foreach>
    </delete>
    <insert id="insertPlatePlanFromTempByBatchNumber" parameterType="String">
        insert into aps_plate_plan(
            id, master_planner, week_day, week_cycle, main_part_number, main_part_drawing_number, customer, business_type, document_number, requirement_type, document_status, item_number, drawing_no, version_number, production_quantity, good_products_quantity, process_number, work_center, department, plan_start_day, plan_end_day, standby_number, standby_name, standby_stock, next_process_deparment, is_suspended, is_outsourcing, account, advanced_materials, advanced_document_number, advanced_requirement_day, is_plan_complete, is_stock_complete, has_turnback, has_risk)
        SELECT
            id, master_planner, week_day, week_cycle, main_part_number, main_part_drawing_number, customer, business_type, document_number, requirement_type, document_status, item_number, drawing_no, version_number, production_quantity, good_products_quantity, process_number, work_center, department, plan_start_day, plan_end_day, standby_number, standby_name, standby_stock, next_process_deparment, is_suspended, is_outsourcing, account, advanced_materials, advanced_document_number, advanced_requirement_day, is_plan_complete, is_stock_complete, has_turnback, has_risk
        from aps_plate_plan_temp
        where batch_number = #{batch_number}
    </insert>
    <update id="removeAllPlatePlans" parameterType="String">
        update  aps_plate_plan  set del_flag='1' where del_flag ='0'
    </update>
</mapper>