select
a.order_Id,
a.process_Id,
c.product_id,
c.product_name,
b.project,
a.quantity,
c.compute_gross_area,
a.founder,
c.processing_note
from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id
left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number
where a.create_time between #{selectTime1} and #{selectTime2}
and a.order_id regexp #{flowCard.orderId}
and a.process_Id regexp #{flowCard.productionId}
and c.product_id regexp #{flowCard.orderDetail.productId}
and c.product_name regexp #{flowCard.orderDetail.productName}
and b.project regexp #{flowCard.order.project}
group by a.process_Id
ORDER BY a.id desc
limit #{offset},#{pageSize};
select
CEILING(count(a.process_Id)/#{pageSize}) as 'pageTotal',
count(distinct a.process_Id) as 'total'
from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id
left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number
where a.create_time between #{selectTime1} and #{selectTime2}
and a.order_id regexp #{flowCard.orderId}
and a.process_Id regexp #{flowCard.productionId}
and c.product_id regexp #{flowCard.orderDetail.productId}
and c.product_name regexp #{flowCard.orderDetail.productName}
and b.project regexp #{flowCard.order.project}
limit #{offset},#{pageSize};
select o.order_id,
o.customer_name,
o.project,
o.batch,
o.other_remarks,
o.icon,
o.order_type,
o.salesman,
o.processing_note,
o.delivery_address
from sd.`order` as o
left join sd.order_glass_detail ogd on o.order_id = ogd.order_id
where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and #{selectTime2}
and o.order_id regexp #{flowCard.order.orderId}
and o.customer_name regexp #{flowCard.order.customerName}
and o.project regexp #{flowCard.order.project}
and o.batch regexp #{flowCard.order.batch}
and o.other_remarks regexp #{flowCard.order.otherRemarks}
and o.icon regexp #{flowCard.order.icon}
and o.order_type regexp #{flowCard.order.orderType}
and o.salesman regexp #{flowCard.order.salesman}
group by o.order_id
;
select od.order_id,
ogd.production_id,
od.product_id,
od.product_name,
SUM( od.quantity) as quantity,
SUM(od.compute_gross_area) as compute_gross_area,
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
where od.order_id = #{orderId} and ogd.splitting_status=0
and od.order_id regexp #{flowCard.orderDetail.orderId}
and ogd.production_id regexp #{flowCard.orderGlassDetail.productionId}
and od.product_id regexp #{flowCard.orderDetail.productId}
and od.product_name regexp #{flowCard.orderDetail.productName}
group by od.order_id, ogd.production_id
update
sd.order_glass_detail as ogd left join flow_card as fc
on ogd.order_id=fc.order_id and ogd.order_number=fc.order_number
set ogd.splitting_status=0
where ogd.order_id=#{orderId} and fc.process_id=#{processId}
delete from flow_card as fc where fc.process_id=#{processId}
select
od.order_number,
od.order_number AS 'orderNumber',
od.width,
od.height,
od.shape,
od.quantity,
od.compute_gross_area,
p.total_thickness,
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 and od.order_number=ogd.order_number
left join sd.product as p on od.product_name=p.product_name
where od.order_id=#{orderId} and ogd.production_id=#{productionId} and ogd.splitting_status=0
GROUP BY od.order_number;
update flow_card as fc
set fc.layout_status=2
where fc.process_id = #{processId}
select fc.layout_status
from flow_card as fc
where fc.process_id = #{processId}
LIMIT 1
select COUNT(rw.process_id)
from reporting_work as rw
where rw.process_id = #{processId}
insert into
flow_card (
order_id,
production_id,
process_id,
landing_sequence,
order_number,
technology_number,
quantity,
founder,
layers_number,
splitFrame_time,
create_time
)
select
ogd.order_id,
ogd.production_id,
#{processId},
#{landingSequence},
ogd.order_number,
ogd.technology_number,
#{quantity},
#{userName},
#{layer},
NOW(),
NOW()
from sd.order_glass_detail as ogd
where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
GROUP BY ogd.technology_number
update sd.order_glass_detail as ogd
set ogd.splitting_status=1
where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
select COUNT(*)
from sd.order_glass_detail as ogd
where ogd.order_id = left(#{productionId},10)
and ogd.splitting_status = 0
update sd.`order` as o
set o.processing_card=#{state}
where o.order_id=left(#{productionId},10)
select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
round(od.width*od.height*od.quantity/1000000,2),
(od.quantity-IFNULL(ps.scheduling_quantity,0)),
round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2),
IFNULL(ps.scheduling_quantity,0),
round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2),
od.product_name,od.shape
from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id
left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
where od.order_id=#{orderId} and ps.processes=#{processes} and ps.scheduling_id IS NOT NULL
select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
round(od.width*od.height*od.quantity/1000000,2) as area,
(od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity,
round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea,
IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity,
round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea,
od.product_name,od.shape
from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id
left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
where od.create_time between #{selectTime1} and #{selectTime2}
select COUNT(ogd.order_number)
from sd.order_glass_detail as ogd
where ogd.production_id = #{productionId}
and ogd.order_number=#{orderNumber}