chenlu
2025-03-10 c12e4a831b4210ec886b2537824a464d74b59ff5
north-glass-erp/src/main/resources/mapper/sd/OrderGlassDetailMapper.xml
@@ -92,6 +92,7 @@
        <result column="glass_child" property="glassChild"/>
        <result column="child_width" property="childWidth"/>
        <result column="child_height" property="childHeight"/>
        <result column="arc" property="arc"/>
        <result column="icon" property="icon"/>
        <result column="process" property="process"/>
        <result column="area" property="area"/>
@@ -130,7 +131,7 @@
           a.total_area,
           b.edging_type,
           a.child_width,
           a.child_height,
           a.child_height,a.arc,
           a.icon,
           a.area,
           b.quantity,
@@ -154,7 +155,8 @@
                a.area = #{item.area},
                a.total_area = #{item.area}*b.quantity,
                a.icon = #{item.icon},
                a.process = #{item.process}
                a.process = #{item.process},
                a.arc = #{item.arc}
            where
                a.order_id = b.order_id
                and a.order_id = #{item.orderId}
@@ -165,12 +167,39 @@
    </update>
    <select id="getDifferentSizeNumber">
       select if(count(id)>1,1,0) from (select
          id
       select if(count(id)>0,1,0) from (select
          a.id,a.child_width,b.width
        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}
          and a.order_number = #{orderNumber}
        group by child_width,child_height) as c
          and a.child_width != b.width
        ) as c
    </select>
    <select id="getOrderGlassDetailByProductIdGlassChild" >
        select a.glass_child
        from sd.order_glass_detail as a
        where a.order_id = #{orderId}
          and a.order_number = #{orderNumber}
        group by a.glass_child
    </select>
    <select id="getOrderGlassDetailByProductId" >
        select *
        from sd.order_detail od
                 LEFT join sd.order_glass_detail  ogd on ogd.order_id=od.order_id and ogd.order_number=od.order_number
        where od.order_id = #{orderId} and od.product_id=#{productId}
          and  ogd.glass_child=#{glassChild}
    </select>
    <select id="getMinIdByGroup" >
        select min(id) from sd.order_glass_detail as a
        where a.order_id = #{orderId}
          and a.order_number = #{orderNumber}
        and a.`group` = #{group}
    </select>
</mapper>