select
ifnull(SUBSTR(max(order_id) from 9),0)
from
`order` as a
where
date(a.create_time) = curdate()
order by id desc,order_id desc limit 1
update `order` o
left join
(select a.order_id,sum(a.perimeter) as aa,sum(a.quantity) as b,sum(a.compute_gross_area) as c
from sd.order_detail as a group by a.order_id) od
on o.order_id = od.order_id
set
o.quantity = od.b,
o.area = od.c,
o.perimeter= od.aa
where
o.order_id = #{orderId}
select
*
from
`order` as o
where date(o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate}
and o.create_order = #{orderType}
and o.order_id REGEXP #{order.orderId}
and o.customer_id REGEXP #{order.customerId}
and o.customer_name REGEXP #{order.customerName}
and o.project REGEXP #{order.project}
and o.batch REGEXP #{order.batch}
and o.quantity REGEXP #{order.quantity}
and o.area REGEXP REGEXP_REPLACE(#{order.area}, '\\.0+$', '')
and date(o.create_time) = #{order.createTime}
and o.pack_type REGEXP #{order.packType}
and o.order_type REGEXP #{order.orderType}
and o.salesman REGEXP #{order.salesman}
and o.perimeter REGEXP #{order.perimeter}
and o.delivery_date REGEXP #{order.deliveryDate}
and o.customer_batch REGEXP #{order.customerBatch}
and o.other_remarks REGEXP #{order.otherRemarks}
and o.delivery_address REGEXP #{order.deliveryAddress}
order by o.id desc
limit #{offset},#{pageSize}
select
CEILING(count(o.id)/#{pageSize}) as 'pageTotal',
count(o.id) as 'total'
from
`order` as o
where date (o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate}
and o.create_order = #{orderType}
and o.order_id REGEXP #{order.orderId}
and o.customer_id REGEXP #{order.customerId}
and o.customer_name REGEXP #{order.customerName}
and o.project REGEXP #{order.project}
and o.batch REGEXP #{order.batch}
and o.quantity REGEXP #{order.quantity}
and o.area REGEXP #{order.area}
and date(o.create_time) = #{order.createTime}
and o.pack_type REGEXP #{order.packType}
and o.order_type REGEXP #{order.orderType}
and o.salesman REGEXP #{order.salesman}
and o.perimeter REGEXP #{order.perimeter}
and o.delivery_date REGEXP #{order.deliveryDate}
and o.customer_batch REGEXP #{order.customerBatch}
and o.other_remarks REGEXP #{order.otherRemarks}
and o.delivery_address REGEXP #{order.deliveryAddress}
order by o.id desc
limit #{offset},#{pageSize}
update `order` set order_review = #{status} where order_id = #{id}
update `order` set process_review = #{status} where order_id = #{id}
update `order` set money = #{order.money} where order_id = #{order.orderId}