| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.example.erp.mapper.pp.GlassOptimizeMapper"> |
| | | <resultMap id="wordOrderMap" type="com.example.erp.entity.sd.OrderGlassDetail"> |
| | | |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="production_id" property="productionId"/> |
| | | <result column="splitting_status" property="splittingStatus"/> |
| | | <result column="founder" property="founder"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <!--接收其他外键实体类数据--> |
| | | <result column="batch" property="order.batch"/> |
| | | <result column="order_type" property="order.orderType"/> |
| | | <result column="project" property="order.project"/> |
| | | <result column="area" property="order.area"/> |
| | | <result column="creator" property="order.creator"/> |
| | | <result column="customer_name" property="order.customerName"/> |
| | | <result column="processing_note" property="order.processingNote"/> |
| | | <!-- <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail">--> |
| | | <!-- <result column="product_id" property="productId"/>--> |
| | | <!-- <result column="product_name" property="productName"/>--> |
| | | <!-- <result column="compute_area" property="computeArea"/>--> |
| | | <result column="quantity" property="orderDetail.quantity"/> |
| | | <!-- <result column="compute_gross_area" property="computeGrossArea"/>--> |
| | | <!-- <result column="perimeter" property="perimeter"/>--> |
| | | <!-- <result column="bend_radius" property="bendRadius"/>--> |
| | | <!-- <result column="processing_note" property="processingNote"/>--> |
| | | <result column="gross_area" property="orderDetail.grossArea"/> |
| | | |
| | | <!-- </association>--> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="selectWordOrder" resultMap="wordOrderMap"> |
| | | select |
| | | o.order_id, |
| | | o.batch, |
| | | o.project, |
| | | o.order_type, |
| | | o.area as gross_area, |
| | | o.quantity as quantity, |
| | | o.creator, |
| | | o.customer_name, |
| | | o.processing_note |
| | | from sd.order_detail as od |
| | | left join `order` as o |
| | | on o.order_id=od.order_id |
| | | where o.production_order!=2 and o.order_review=2 |
| | | |
| | | <if test="orderGlassDetail.orderId != null and orderGlassDetail.orderId != ''"> |
| | | and o.order_id regexp #{orderGlassDetail.orderId} |
| | | </if> |
| | | |
| | | <if test="orderGlassDetail.order.batch != null and orderGlassDetail.order.batch != ''"> |
| | | and o.batch regexp #{orderGlassDetail.order.batch} |
| | | </if> |
| | | <if test="orderGlassDetail.order.project != null and orderGlassDetail.order.project!= ''"> |
| | | and o.project regexp #{orderGlassDetail.order.project} |
| | | </if> |
| | | <if test="orderGlassDetail.order.orderType != null and orderGlassDetail.order.orderType!= ''"> |
| | | and o.order_type regexp #{orderGlassDetail.order.orderType} |
| | | </if> |
| | | <if test="orderGlassDetail.order.customerName != null and orderGlassDetail.order.customerName!= ''"> |
| | | and o.customer_name regexp #{orderGlassDetail.order.customerName} |
| | | </if> |
| | | <if test="orderGlassDetail.order.processingNote != null and orderGlassDetail.order.processingNote!= ''"> |
| | | and o.processing_note regexp #{orderGlassDetail.order.processingNote} |
| | | </if> |
| | | |
| | | <if test="orderGlassDetail.createTime != ''"> |
| | | and DATE_FORMAT((o.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 } |
| | | </if> |
| | | |
| | | group by o.order_id |
| | | order by o.id desc |
| | | |
| | | |
| | | ; |
| | | </select> |
| | | |
| | | <select id="getFlowCardListMp"> |
| | | select fc.process_id, |
| | | fc.technology_number, |
| | | fcss.TotalFloors, |
| | | COUNT(fc.order_number) as TotalNumber, |
| | | SUM(fc.quantity) as quantity, |
| | | ROUND(SUM(od.width * od.height * fc.quantity / 1000000), 2) as area, |
| | | o.project, |
| | | ogd.glass_child, |
| | | od.shape |
| | | |
| | | from pp.flow_card as fc |
| | | left join sd.`order` as o on fc.order_id = o.order_id |
| | | left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number |
| | | left join sd.order_glass_detail as ogd |
| | | on ogd.order_id = fc.order_id and ogd.order_number = fc.order_number and |
| | | ogd.technology_number = fc.technology_number |
| | | left join (select fcs.process_id, |
| | | fcs.order_number, |
| | | COUNT(DISTINCT fcs.technology_number) as TotalFloors |
| | | from pp.flow_card as fcs |
| | | GROUP BY fcs.process_id, fcs.order_number) as fcss |
| | | on fcss.process_id = fc.process_id and fcss.order_number = fc.order_number |
| | | where position(#{optionVal} in ogd.glass_child) |
| | | GROUP BY fc.process_id, fc.technology_number |
| | | ORDER BY fc.process_id,fc.technology_number |
| | | </select> |
| | | |
| | | </mapper> |