廖井涛
2024-02-23 b0edff4c02128b722a9a6674b016536d4395872d
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -27,6 +27,21 @@
            <result column="product_name" property="productName"/>
            <result column="compute_gross_area" property="computeGrossArea"/>
            <result column="processing_note" property="processingNote"/>
            <result column="quantity" property="quantity"/>
            <result column="compute_gross_area" property="computeGrossArea"/>
            <result column="perimeter" property="perimeter"/>
            <result column="order_number" property="orderNumber"/>
            <result column="width" property="width"/>
            <result column="height" property="height"/>
            <result column="shape" property="shape"/>
            <result column="weight" property="weight"/>
        </association>
        <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail">
            <result column="production_id" property="productionId"/>
        </association>
        <association property="product" javaType="com.example.erp.entity.sd.Product">
            <result column="total_thickness" property="totalThickness"/>
            <result column="thickness" property="thickness"/>
        </association>
        <!--<result column="g_typeId" property="glassTypes.typeId"/>
@@ -75,8 +90,7 @@
    </select>
    <select id="selectFlowCardMp">
    <select id="selectFlowCardMp" resultMap="flowCardMap">
        select o.order_id,
        o.customer_name,
        o.project,
@@ -88,7 +102,7 @@
        o.processing_note,
        o.delivery_address
        from sd.`order`  as o
        where o.create_time between #{selectTime1} and #{selectTime2}
        where o.production_order=2 and o.create_time between #{selectTime1} and #{selectTime2}
        <!--        <where>-->
        <!--            <if test="flowCard.orderId != null and flowCard.orderId != ''">-->
        <!--                and a.order_id regexp #{flowCard.orderId}-->
@@ -108,15 +122,11 @@
        <!--            </if>-->
        <!--            <if test="flowCard.createTime != null and flowCard.createTime != ''">-->
        <!--                and DATE_FORMAT((a.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 }-->
        <!--            </if>-->
        <!--        </where>-->
      ;
    </select>
    
    <select id="DetailsSelectMp">
    <select id="DetailsSelectMp" resultMap="flowCardMap">
        select od.order_id,
               ogd.production_id,
               od.product_id,
@@ -126,8 +136,56 @@
               od.perimeter
        from sd.order_detail as od
        left join sd.order_glass_detail as ogd
        on od.order_id = ogd.order_id and od.order_number = ogd.order_number
                           on od.order_id = ogd.order_id
        where od.order_id = #{orderId}
        group by od.order_id,ogd.production_id
    </select>
    <update id="DeleteFlowCardMp">
        update sd.order_detail as od left join sd.order_glass_detail as ogd
            on od.order_id = ogd.order_id and od.order_number = ogd.order_number
        set ogd.production_id=null,
            ogd.production_time=null,
            ogd.founder=null
        where od.order_id = #{orderId}
          and od.product_name = #{productName}
    </update>
<!--resultMap="flowCardMap"-->
    <select id="SelectNoCardMp" >
        select
        od.order_number AS 'orderNumber',
        od.width,
        od.height,
        od.shape,
        od.quantity,
        od.quantity as baiscQuantity,
        od.compute_gross_area as 'computeGrossArea',
        p.total_thickness AS 'totalThickness',
        p.thickness,
        od.weight
        from
        sd.order_detail as od
        left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id
        left join sd.product as p on od.product_name=p.product_name
        where od.order_id=#{orderId}and ogd.production_id=#{productionId}
        <if test="flowCard.orderDetail.orderNumber != null and flowCard.orderDetail.orderNumber != ''">
            and od.order_number regexp #{flowCard.orderDetail.orderNumber}
        </if>
        <if test="flowCard.orderDetail.width != null and flowCard.orderDetail.width != ''">
            and od.width regexp #{flowCard.orderDetail.width}
        </if>
        <if test="flowCard.orderDetail.height != null and flowCard.orderDetail.height != ''">
            and od.height regexp #{flowCard.orderDetail.height}
        </if>
        <if test="flowCard.orderDetail.shape != null and flowCard.orderDetail.shape != ''">
            and od.shape regexp #{flowCard.orderDetail.shape}
        </if>
        GROUP BY od.order_number;
    </select>
</mapper>