guoyujie
2025-04-08 1e1c416c6aa6596feb333b75d882ffeede73d3c9
north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml
@@ -76,7 +76,8 @@
            f.technology_number ,
            g.glass_child ,
            g.icon,
            op.project_name
            op.project_name,
            d.processing_note
        FROM
            ((pp.flow_card AS f
                LEFT JOIN sd.order_detail AS d ON (((f.order_id = d.order_id) AND (f.order_number = d.order_number))))
@@ -126,7 +127,7 @@
        SELECT
            i.id AS id,
            i.producer AS producer,
            i.available_quantity AS available_quantity,
            i.available_quantity-i.plan_quantity AS available_quantity,
            JSON_EXTRACT(s.json, '$.width') AS width,
            JSON_EXTRACT(s.json, '$.height') AS height,
            JSON_EXTRACT(s.json, '$.thickness') AS thickness,
@@ -142,12 +143,29 @@
            (
                    (`s`.`type` = '原片')
                    AND (`i`.`optimize_state` = 1)
                    AND (`i`.`available_quantity` > 0)
                    AND (`i`.`available_quantity`-i.plan_quantity > 0)
                    AND JSON_EXTRACT(s.json, '$.thickness') = #{thickness}
                    AND JSON_EXTRACT(s.json, '$.model') = #{model}
                )
        ORDER BY
            `i`.`available_quantity` DESC ;
    </select>
    <select id="materialStoreOptimizeUse">
        select ms.id AS id,
               ou.use_count AS processingQuantity,
               ou.width,
               ou.height,
               ou.left_trim as leftTrim,
               ou.down_trim as downTrim,
               ou.up_trim as upTrim,
               ou.right_trim as rightTrim,
               JSON_EXTRACT(ms.json, '$.thickness') AS thickness,
               JSON_EXTRACT(ms.json, '$.name') AS name,
               JSON_EXTRACT(ms.json, '$.model') AS model
        from pp.optimize_use ou
            left join mm.material_store ms on ou.raw_stock_code=ms.id where project_no=#{projectNumber} and state=1
    </select>
    <select id="selectWordOrder" resultMap="wordOrderMap">
@@ -684,4 +702,30 @@
               JSON_EXTRACT( oc.config_detail, '$.y_space' ) as y_space
        from pp.optimize_admin oa left join pp.optimize_config oc on oa.h_id=oc.id where name='admin'
    </select>
    <select id="getEdgeTrimming">
        select JSON_EXTRACT( oc.config_detail, '$.left_trim' ) as leftTrim,
               JSON_EXTRACT( oc.config_detail, '$.up_trim' ) as upTrim,
               JSON_EXTRACT( oc.config_detail, '$.right_trim' ) as rightTrim,
               JSON_EXTRACT( oc.config_detail, '$.down_trim' ) as downTrim,
               JSON_EXTRACT( oc.config_detail, '$.auto_fill_trim' ) as autoFillTrim,
               JSON_EXTRACT( oc.config_detail, '$.quick_trim' ) as quickTrim
        from  pp.optimize_config oc where config_type=5
    </select>
    <select id="getGrindingTrimming">
        select JSON_EXTRACT( oc.config_detail, '$.left_edge' ) as leftEdge,
               JSON_EXTRACT( oc.config_detail, '$.up_edge' ) as upEdge,
               JSON_EXTRACT( oc.config_detail, '$.right_edge' ) as rightEdge,
               JSON_EXTRACT( oc.config_detail, '$.down_edge' ) as downEdge,
               JSON_EXTRACT( oc.config_detail, '$.auto_fill_edge' ) as autoFillEdge,
               JSON_EXTRACT( oc.config_detail, '$.quick_edge' ) as quickEdge,
                JSON_EXTRACT( oc.config_detail, '$.min_auto_lenght' ) as minAutoLenght
        from  pp.optimize_config oc where config_type=4
    </select>
    <update id="updateOptimizeConfig">
        UPDATE pp.optimize_config set config_detail=#{json},create_time=now()
        where config_type=#{type}
    </update>
</mapper>