廖井涛
2024-02-20 149d60a12ef635c2b08e4ebedfc9afa7363a6562
north-glass-erp/target/classes/mapper/sd/OrderGlassDetailMapper.xml
@@ -38,4 +38,61 @@
    <select id="selectOrderGlassDetail">
        select * from order_glass_detail where order_id = #{orderId}
    </select>
    <resultMap id="orderGlassDetailMap" type="com.example.erp.entity.sd.OrderGlassDetail" >
        <id column="id" property="id"/>
        <result column="order_id" property="orderId"/>
        <result column="glass_address" property="glassAddress"/>
        <result column="technology_number" property="technologyNumber"/>
        <result column="glass_child" property="glassChild"/>
        <result column="child_width" property="childWidth"/>
        <result column="child_height" property="childHeight"/>
        <result column="process" property="process"/>
        <!--接收其他外键实体类数据-->
        <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail">
            <result column="order_number" property="orderNumber"/>
            <result column="building_number" property="buildingNumber"/>
            <result column="product_name" property="productName"/>
            <result column="width" property="width"/>
            <result column="height" property="height"/>
            <result column="shape" property="shape"/>
            <result column="gross_area" property="grossArea"/>
            <result column="edging_type" property="edgingType"/>
            <result column="area" property="area"/>
            <result column="quantity" property="quantity"/>
            <result column="processing_note"  property="processingNote"/>
            <result column="beizhu"  property="remarks"/>
        </association>
    </resultMap>
    <select id="selectOrderGlassDetailByOrderId"  resultMap="orderGlassDetailMap">
        select
            a.order_id,
            b.order_number,
            b.building_number,
            b.product_name,
            a.glass_address,
           a.technology_number,
           a.glass_child,
           b.width,
           b.height,
           b.shape,
           b.gross_area,
           b.edging_type,
           a.child_width,
           a.child_height,
           b.area,
           b.quantity,
           a.process,
           b.remarks as 'beizhu',
           b.processing_note
        from order_glass_detail as a
        left join order_detail as b
        on a.order_id = b.order_id and a.order_number = b.order_number
        where a.order_id = #{orderId}
        order by a.order_number,a.technology_number
    </select>
</mapper>