guoyujie
13 小时以前 9ccc8bd3a53160a40cf60f14e5867f6ce9f6c58f
north-glass-erp/src/main/resources/mapper/sd/OrderGlassDetailMapper.xml
@@ -23,7 +23,11 @@
            od.order_id,
            od.order_number,
            pd.glass_sort,
            if(pd.glass_sort=1,'(外)',if(pd2.glass_sort=pd.glass_sort,'(内)','')),
            if(pd.glass_sort=1 or pd2.glass_sort=pd.glass_sort,
                if(JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.position'))='',
                    if(pd.glass_sort=1,#{outside},#{inside})
                    ,JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.position'))),
                ''),
            pd.detail,
            if( od.bend_radius!='',
                round(od.width*
@@ -93,6 +97,7 @@
        <result column="child_width" property="childWidth"/>
        <result column="child_height" property="childHeight"/>
        <result column="arc" property="arc"/>
        <result column="arch_rise" property="archRise"/>
        <result column="icon" property="icon"/>
        <result column="process" property="process"/>
        <result column="area" property="area"/>
@@ -133,6 +138,7 @@
           a.child_width,
           a.child_height,a.arc,
           a.icon,
           a.arch_rise,
           a.area,
           b.quantity,
           a.process,
@@ -156,7 +162,8 @@
                a.total_area = #{item.area}*b.quantity,
                a.icon = #{item.icon},
                a.process = #{item.process},
                a.arc = #{item.arc}
                a.arc = #{item.arc},
                a.arch_rise = #{item.archRise}
            where
                a.order_id = b.order_id
                and a.order_id = #{item.orderId}
@@ -167,12 +174,15 @@
    </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 or a.child_height != b.height)
        ) as c
    </select>
    <select id="getOrderGlassDetailByProductIdGlassChild" >
@@ -199,4 +209,29 @@
    </select>
    <select id="getMaxIdByGroup" >
        select max(id) from sd.order_glass_detail as a
        where a.order_id = #{orderId}
          and a.order_number = #{orderNumber}
          and a.`group` = #{group}
    </select>
    <select id="getMinTechnologyNumberByGroup" >
        select min(technology_number) from sd.order_glass_detail as a
        where a.order_id = #{orderId}
          and a.order_number = #{orderNumber}
          and a.`group` = #{group}
    </select>
    <select id="getMaxTechnologyNumberByGroup" >
        select max(technology_number) from sd.order_glass_detail as a
        where a.order_id = #{orderId}
          and a.order_number = #{orderNumber}
          and a.`group` = #{group}
    </select>
</mapper>