hdy
2025-02-26 a2cd0f560c226d7830c79fa3c0a6cb3db72927b4
billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml
@@ -26,6 +26,61 @@
        select id, work_order_no, sales_order_code, product_code, line_code, plan_qty, plan_start_time, plan_end_time, order_status, create_time, update_time, create_by, update_by, remarks, del_flag from om_production_order_info
    </sql>
    <!-- 查询 order_status 为 1 且 plan_start_time 最早的一条记录 -->
    <select id="selectEarliestOrder" resultType="OmProductionOrderInfo">
            SELECT TOP 1 *
            FROM om_production_order_info
            WHERE order_status IN (1, 2)
            ORDER BY plan_start_time ASC
    </select>
    <select id="selectEarliestOrder2" resultType="OmProductionOrderInfo">
        SELECT TOP 1 *
        FROM om_production_order_info
        WHERE order_status IN (5)
        ORDER BY plan_start_time ASC
    </select>
    <select id="updateOrderStatus" resultType="OmProductionOrderInfo">
        UPDATE om_production_order_info
        SET order_status = 5
        WHERE id = (
            SELECT TOP 1 id
            FROM om_production_order_info
            WHERE order_status IN (1, 2)
            ORDER BY plan_start_time ASC
        );
    </select>
    <select id="updateOrderStatus2" resultType="OmProductionOrderInfo">
        UPDATE om_production_order_info
        SET order_status = 2
        WHERE id = (
            SELECT TOP 1 id
            FROM om_production_order_info
            WHERE order_status IN (1, 2)
            ORDER BY plan_start_time ASC
        );
    </select>
    <select id="getSerialNumber" resultType="OmProductionOrderInfo">
        SELECT  *
        FROM om_production_order_info
        WHERE id = 1
    </select>
    <select id="updateSerialNumber" resultType="OmProductionOrderInfo">
        UPDATE om_production_order_info
        SET plan_qty = plan_qty + 1
        WHERE id = 1;
    </select>
    <select id="updateYear" resultType="OmProductionOrderInfo">
        UPDATE om_production_order_info
        SET remarks = remarks + 1,
            qty = 1
        WHERE id = 1;
    </select>
    <select id="selectOmProductionOrderInfoList" parameterType="OmProductionOrderInfo" resultMap="OmProductionOrderInfoResult">
        <include refid="selectOmProductionOrderInfoVo"/>
        <where>