1501这个机床order 1 2 3 1 2 3 1 2 3
1502这个机床order 2 3 1 2 3 1 2 3 1
原因是order存在一致的 第一个123 第二个也有123 所以存在随机情况 正常应该是123456 但是需求是123 123 所以再按照id重新排序一下
原sql :select
bindType.id,
bindType.process_num as techniqueProcessCode,
bindType.workpiece_num as workpieceCode,
bindType.procedure_num as procedureNum,
machine.position_id as machineToolId,
bindType.work_order_type_code as largeCategory,
detail.insert_order as insertOrder,
detail.`order` as sort,
detail.select_type_code as workOrderTypeNum,
detail.trial_subject_code as trialSubject,
detail.work_order_code as workOrderCode
from
ims_technique_work_rule_bind_work_type bindType
INNER JOIN ims_technique_work_rule_bind_work_type_detail detail on bindType.id = detail.work_rule_bind_work_type_id
INNER JOIN ims_technique_lathe machine ON bindType.machine_id = machine.technique_id
WHERE
machine.del_flag = 'false'
and bindType.process_num = '002'
order by
process_num,
procedure_num,
machine_num,
work_order_type_code
修改后sql: select
bindType.id,
bindType.process_num as techniqueProcessCode,
bindType.workpiece_num as workpieceCode,
bindType.procedure_num as procedureNum,
machine.position_id as machineToolId,
bindType.work_order_type_code as largeCategory,
detail.insert_order as insertOrder,
detail.`order` as sort,
detail.select_type_code as workOrderTypeNum,
detail.trial_subject_code as trialSubject,
detail.work_order_code as workOrderCode
from
ims_technique_work_rule_bind_work_type bindType
INNER JOIN ims_technique_work_rule_bind_work_type_detail detail on bindType.id = detail.work_rule_bind_work_type_id
INNER JOIN ims_technique_lathe machine ON bindType.machine_id = machine.technique_id
WHERE
machine.del_flag = 'false'
and bindType.process_num = '002'
order by
process_num,
procedure_num,
machine_num,
work_order_type_code,
detail.id
修改后sql多了个id排序