ko.del_flag = 0
and ko.create_time >= #{orderListParam.startTime,jdbcType=TIMESTAMP}
and ko.create_time <= #{orderListParam.endTime,jdbcType=TIMESTAMP}
and (ko.`order_no` like concat('%', #{orderListParam.orderNo,jdbcType=VARCHAR}, '%'))
and ko.status = #{orderListParam.status}
and ko.cy_company_id = #{owCompany}
and ko.order_source = #{orderListParam.orderSource}
and ko.type_handling = #{orderListParam.typeHandling}
and ko.tenant_id = #{orderListParam.tenantId}
select *
from kw_order ko
order by ko.create_time desc
select
o.id,
o.order_source orderSource,
o.order_no orderNo,
o.create_time createTime,
o.create_by createBy,
o.status,
o.pid,
o.type_handling typeHandling,
o.ty_company_id tyCompanId,
o.ty_company tyCompany,
o.ty_phone tyPhone,
o.cy_company_id cyCompanyId,
o.cy_company cyCompany,
o.cy_phone cyPhone,
o.fh_company_id fhCompanyId,
o.fh_company fhCompany,
o.fh_phone fhPhone,
o.sh_company_id shCompanyId,
o.sh_company shCompany,
o.sh_phone shPhone,
o.remain_num remainNum, #剩余代运量
o.remain_allocation remainAllocation, #剩余代分配量
o.total_load_amount totalLoadAmount,
o.total_unload_amount totalUnLoadAmount,
o.tenant_id tenantId,
tg.goods_id goodsId,
tg.goods_name goodsName,
tg.goods_type goodsType,
tg.goods_unit goodsUnit,
tg.goods_num goodsNum,
tg.goods_volume goodsVolume,
tg.goods_weight goodsWeight,
tpr.per_start_time perStartTime,
tpr.per_end_time perEndTime,
tpr.billing_cycle settlementCycle,
tpr.pay_method payment,
tpr.pay_company payCompany,
tpr.billing_mode billingMode,
tpr.gathering_company gatheringCompany,
tpr.price,
tdg.rational_loss rationalLoss,
tdg.ded_price dedPrice,
tm.truck_type truckType,
tm.truck_type_str truckTypeStr,
tm.estimate_freight estimateFreight,
tm.remark
from kw_order o
left join kw_order_usual_land_transport_more tm on o.id = tm.order_id
left join kw_order_usual_land_transport_goods tg on o.id = tg.order_id
left join kw_order_usual_land_transport_def_goods tdg on o.id = tdg.order_id
left join kw_order_usual_transport_per tpr on o.id = tpr.order_id
o.del_flag = 0
and o.id = #{orderId}
select *
from kw_order
where del_flag = 0
and id = #{id, jdbcType=BIGINT}
and pid in (#{pid, jdbcType=VARCHAR})
and status = #{status, jdbcType=INTEGER}
and FIND_IN_SET(#{upperlOrderId, jdbcType=BIGINT}, pids)
and FIND_IN_SET(id, #{belowlOrderId, jdbcType=VARCHAR})
and id != #{ownOrderId, jdbcType=BIGINT}
and (
FIND_IN_SET(#{plOrderIds, jdbcType=BIGINT}
, pids)
or FIND_IN_SET(id
, #{currentlOrderId, jdbcType=VARCHAR})
)
and id in (select l_order_id from kw_order_usual_land_transport_unit where unit_type = 1
and top_ent_id = #{checkEntId, jdbcType=BIGINT})
SELECT
IFNULL(sum(load_amount), 0.0) loadAmount, IFNULL(sum(unload_amount), 0.0) unloadAmount,
IFNULL(sum(total_load_amount), 0.0) totalLoadAmount, IFNULL(sum(total_unload_amount), 0.0) totalUnloadAmount
from kw_order where del_flag = 0
and t_order_id = #{tOrderId, jdbcType=BIGINT}
and id = #{lOrderId, jdbcType=BIGINT}
and pid is null
and status in (4, 5, 6)
and status = #{lOrderId, jdbcType=INTEGER}
and FIND_IN_SET(#{upperlOrderId, jdbcType=BIGINT}, pids)
and FIND_IN_SET(id, #{belowlOrderId, jdbcType=VARCHAR})
SELECT `status`, COUNT(*) AS count FROM kw_order where del_flag = 0 GROUP BY `status`
select COALESCE(count(id), 0) from kw_waybill_order where order_id = #{#orderId} and status = 5 and del_flag = 0
select COALESCE(SUM(total_load_amount), 0) from kw_order where id = #{#orderId} and status = 9 and del_flag = 0