提交拣货界面SQL

main
userName 2025-06-19 14:41:35 +08:00
parent 5b5d072423
commit 235402c0aa
1 changed files with 99 additions and 105 deletions

View File

@ -153,12 +153,11 @@
</remote> </remote>
</inputUIs> </inputUIs>
</search> </search>
<datasource type="hql"><![CDATA[ select <datasource type="hql"><![CDATA[ select t.id,
t.id, pt.code,
pickTicket.code, pt.order_Date,
pickTicket.orderDate, t.end_Region,
t.endRegion, sw.name,
t.seedWall.name,
agv.robotJobId, agv.robotJobId,
agv.status, agv.status,
agv.createTime, agv.createTime,
@ -166,56 +165,56 @@
agv.dateTime2, agv.dateTime2,
agv.dateTime3, agv.dateTime3,
agv.jobPriorityType, agv.jobPriorityType,
t.oldGzz, t.old_Gzz,
t.oldZrw, t.old_Zrw,
szone.name, z.name,
pickTicket.sourceType, pt.sourceType,
billType.name, bt.name,
t.billCode, t.billCode,
item.code, item.code,
item.name, item.name,
item.unit, item.unit,
item.shipRules, item.ship_Rules,
srcLoc.code, loc.code,
dstLP.remark, s.remark,
zone.name, zlc.name,
dstLoc.code, lc.code,
t.strBill4, t.strBill4,
t.yc_qty, t.yc_qty,
t.planQuantityMU, t.PLAN_QUANTITY,
t.movedQuantityMU, t.MOVED_QUANTITY_MU,
case WHEN t.planQuantity-t.movedQuantityMU <=0 then '处理完成' WHEN t.movedQuantityMU =0 then '未处理' else '处理中' end as aa , case WHEN t.PLAN_QUANTITY-t.MOVED_QUANTITY_MU <=0 then '处理完成' WHEN t.MOVED_QUANTITY_MU =0 then '未处理' else '处理中' end as aa ,
itemKey.lotInfo.propC1, ik.prop_C1,
itemKey.lotInfo.propC2, ik.prop_C2,
itemKey.lotInfo.propC3, ik.prop_C3,
itemKey.lotInfo.propC5, ik.prop_C5,
itemKey.lotInfo.propC9, ik.prop_C9,
pickTicket.equatedQuantity, pt.equated_Quantity,
t.barCode, t.bar_Code,
pickTicketDetail.strBill12, ptd.strBill12,
t.inventoryStatus, t.inventory_Status,
t.strBill10, t.strBill10,
t.ncrCode, t.ncr_Code,
pickTicketDetail.lineNumber, ptd.line_Number,
t.smallUnit, t.small_Unit,
pickTicket.updateTime, pt.update_Time,
pickTicket.updateTime, pt.update_Time,
t.strBill1, t.strBill1,
t.dateBill1, t.dateBill1,
t.dateBill1, t.dateBill1,
t.dateBill4, t.dateBill4,
t.dateBill4, t.dateBill4,
t.worker1.name, w1.name,
t.worker4.name, w4.name,
t.operateTime, t.operate_Time,
t.operateTime, t.operate_Time,
t.operator, t.operator,
waveDoc.code, wd.code,
t.createTime, t.create_Time,
t.createTime, t.create_Time,
t.worker2.name, w2.name,
t.arrivalTime, t.arrival_Time,
t.arrivalTime, t.arrival_Time,
t.dateBill5, t.dateBill5,
t.dateBill5, t.dateBill5,
t.strBill5, t.strBill5,
@ -224,80 +223,75 @@
case when t.positionStatus='1' then t.operator when t.positionStatus='0' then '' end, case when t.positionStatus='1' then t.operator when t.positionStatus='0' then '' end,
case when t.positionStatus='1' then t.dateline when t.positionStatus='0' then '' end, case when t.positionStatus='1' then t.dateline when t.positionStatus='0' then '' end,
case when t.positionStatus='1' then t.dateline when t.positionStatus='0' then '' end, case when t.positionStatus='1' then t.dateline when t.positionStatus='0' then '' end,
DATEDIFF(second, pickTicket.updateTime,t.dateBill1 )/60 , DATEDIFF(second, pt.update_Time,t.dateBill1 )/60 ,
DATEDIFF(second, t.dateBill1,t.operateTime )/60 , DATEDIFF(second, t.dateBill1,t.operate_Time )/60 ,
DATEDIFF(second, t.operateTime,t.dateBill3)/60 , DATEDIFF(second, t.operate_Time,t.dateBill3)/60 ,
DATEDIFF(second, t.dateBill3,t.dateline )/60 , DATEDIFF(second, t.dateBill3,t.dateline )/60 ,
DATEDIFF(second, t.operateTime,t.arrivalTime )/60 , DATEDIFF(second, t.operate_Time,t.arrival_Time )/60 ,
DATEDIFF(second, t.arrivalTime,t.dateBill3 )/60 , DATEDIFF(second, t.arrival_Time,t.dateBill3 )/60 ,
DATEDIFF(second, t.operateTime,t.dateline )/60 , DATEDIFF(second, t.operate_Time,t.dateline )/60 ,
t.statusCode, t.statusCode,
t.agvStatus, t.agv_Status,
t.popular, t.popular,
t.code, t.code,
t.strBill6, t.strBill6,
pickTicket.relatedBill3, pt.related_Bill3,
pickTicket.logisticsCompany pt.logistics_Company
from Task t
left join t.pickTicketDetail as pickTicketDetail
left join pickTicketDetail.pickTicket as pickTicket from task t
left join pickTicket.billType as billType left OUTER join PICK_TICKET_DETAIL ptd on ptd.id=t.PICK_TICKET_DETAIL_ID
left join t.warehouseArea as warehouseArea left OUTER join PICK_TICKET pt on pt.id=ptd.PICK_TICKET_ID
left join t.dstLoc as dstLoc left OUTER join BILL_TYPE bt on bt.id=pt.BILL_TYPE_ID
left join t.seedWall as seed left OUTER join ITEM_KEY ik on ik.id=t.ITEM_KEY_ID
left join dstLoc.zone as zone left OUTER join item item on item.id=ik.ITEM_ID
left join t.srcLoc as srcLoc left OUTER join LOCATION lc on lc.id= t.DST_LOC_ID
left join srcLoc.zone as szone left OUTER join [ZONE] zlc on zlc.id=lc.ZONE_ID
left join t.itemKey as itemKey left OUTER join LOCATION loc on loc.id=t.SRC_LOC_ID
left join itemKey.item as item left OUTER join [ZONE] z on z.id=loc.ZONE_ID
left join t.waveDoc as waveDoc left OUTER join Seed_Wall sw on sw.id=t.Seed_Wall_ID
left join t.worker4 left OUTER join WAVE_DOC wd on wd.id=t.WAVE_DOC_ID
left join t.worker1 left OUTER join STOCK s on s.id=t.DST_LP
left join t.worker2 left OUTER join agvtask agv on agv.id=t.agvTask_ID
left join t.worker3 left OUTER join WORKER w1 on w1.id=t.WORKER1_ID
left join t.agvTask agv left OUTER join WORKER w2 on w1.id=t.WORKER2_ID
left join t.dstLP dstLP left OUTER join WORKER w4 on w1.id=t.WORKER4_ID
where 1=1 and t.type ='MV_PICKTICKET' and t.planQuantity>0
and ( (t.inventoryStatus not in ('交单完成')) /~ordersAll: or 1=1 ~/) where 1=1 and t.type ='MV_PICKTICKET' AND t.PLAN_QUANTITY> 0
and ( (zone.id <> 1787 or zone.name is null) /~ordersAll: or 1=1 ~/) and ( (t.INVENTORY_STATUS not in ('交单完成')) /~ordersAll: or 1=1 ~/)
and ( ((pickTicket.sourceType <>'411' and t.planQuantity<=t.movedQuantityMU) or and ( (zlc.id <> 1787 or zlc.name is null) /~ordersAll: or 1=1 ~/)
( t.planQuantity>t.movedQuantityMU) ) /~ordersAll: or 1=1 ~/) and ( ((pt.sourceType <>'411' and t.PLAN_QUANTITY<=t.MOVED_QUANTITY_MU) or
/~t.worker4.name: AND (t.worker4.id) = {t.worker4.name}~/ ( t.PLAN_QUANTITY>t.MOVED_QUANTITY_MU) ) /~ordersAll: or 1=1 ~/)
/~t.worker4.name: AND w4.id = {t.worker4.name}~/
and (1=1 and (1=1
/~beginDate: AND CONVERT(varchar(100), pickTicket.orderDate, 23) = {beginDate} ~/ /~beginDate: AND CONVERT(varchar(100), pt.order_Date, 23) = {beginDate} ~/
/~endDate: or (CONVERT(varchar(100), pickTicket.orderDate, 23) >= {beginDate} and t.type in('MV_PICKTICKET') and CONVERT(varchar(100), pickTicket.orderDate, 23) <= {endDate}) ~/ /~endDate: or (CONVERT(varchar(100), pt.order_Date, 23) >= {beginDate} and t.type in('MV_PICKTICKET') and CONVERT(varchar(100), pt.order_Date, 23) <= {endDate}) ~/
) and (1=1 ) and (1=1
/~beginDate1: AND CONVERT(varchar(100), t.createTime, 23) = {beginDate1} ~/ /~beginDate1: AND CONVERT(varchar(100), t.create_Time, 23) = {beginDate1} ~/
/~endDate1: or (CONVERT(varchar(100), t.createTime, 23) >= {beginDate1} and t.type in('MV_PICKTICKET') and CONVERT(varchar(100), t.createTime, 23)<= {endDate1} )~/ /~endDate1: or (CONVERT(varchar(100), t.create_Time, 23) >= {beginDate1} and t.type in('MV_PICKTICKET') and CONVERT(varchar(100), t.create_Time, 23)<= {endDate1} )~/
) and (1=1 ) and (1=1
/~beginDate2: AND CONVERT(varchar(100), t.operateTime, 23) = {beginDate2} ~/ /~beginDate2: AND CONVERT(varchar(100), t.operate_Time, 23) = {beginDate2} ~/
/~endDate2: or (CONVERT(varchar(100), t.operateTime, 23) >= {beginDate2} and t.type in('MV_PICKTICKET') and CONVERT(varchar(100), t.operateTime, 23)<= {endDate2}) ~/ /~endDate2: or (CONVERT(varchar(100), t.operate_Time, 23) >= {beginDate2} and t.type in('MV_PICKTICKET') and CONVERT(varchar(100), t.operate_Time, 23)<= {endDate2}) ~/
) )
/~t.agvTask.targetArea: AND (t.endRegion) LIKE {t.agvTask.targetArea}~/ /~t.agvTask.targetArea: AND (t.end_Region) LIKE {t.agvTask.targetArea}~/
/~code: AND ((t.planQuantity>t.movedQuantityMU and 'open' = {code} ) or ( t.planQuantity<=t.movedQuantityMU and 'finish' = {code}))~/ /~code: AND ((t.PLAN_QUANTITY>t.MOVED_QUANTITY_MU and 'open' = {code} ) or ( t.PLAN_QUANTITY<=t.MOVED_QUANTITY_MU and 'finish' = {code}))~/
/~srcLoc.code: AND (srcLoc.code) LIKE ({srcLoc.code})~/ /~srcLoc.code: AND loc.code LIKE {srcLoc.code}~/
/~dstLoc.code: AND ( dstLoc.code) LIKE ({dstLoc.code})~/ /~dstLoc.code: AND lc.code LIKE {dstLoc.code}~/
/~billCode: AND (t.billCode) LIKE ({billCode})~/ /~pickTicket.logisticsCompany: AND (pt.logistics_Company) LIKE ({pickTicket.logisticsCompany}) ~/
/~pickTicket.logisticsCompany: AND (pickTicket.logisticsCompany) LIKE ({pickTicket.logisticsCompany}) ~/ /~t.code: AND t.code LIKE {t.code}~/
/~t.code: AND (t.code) LIKE ({t.code})~/ /~pickTicket.equatedQuantity: AND (({pt.equated_Quantity}=true and pt.equated_Quantity>'A' ) or ({pt.equated_Quantity}=false and pt.equated_Quantity<'A' )) ~/
/~pickTicket.equatedQuantity: AND (({pickTicket.equatedQuantity}=true and pickTicket.equatedQuantity>'A' ) or ({pickTicket.equatedQuantity}=false and pickTicket.equatedQuantity<'A' )) ~/ /~billType.name: AND bt.id = {billType.name}~/
/~billType.name: AND billType.id = {billType.name}~/ /~pickTicketDetail.item.id: AND item.id = {pickTicketDetail.item.id}~/
/~pickTicketDetail.item.id: AND t.pickTicketDetail.item.id = {pickTicketDetail.item.id}~/ /~pickTicketDetail.strBill12: AND ptd.strBill12 LIKE {pickTicketDetail.strBill12}~/
/~dLzone.name: AND dLzone.name = {dLzone.name}~/
/~pickTicketDetail.strBill12: AND (pickTicketDetail.strBill12) LIKE ({pickTicketDetail.strBill12})~/
/~agv.status: AND agv.status ={agv.status} ~/ /~agv.status: AND agv.status ={agv.status} ~/
/~billCode: AND t.billCode LIKE {billCode}~/
/~billCode: AND (t.billCode) LIKE ({billCode})~/
/~t.strBill1: AND t.strBill1 LIKE {t.strBill1}~/ /~t.strBill1: AND t.strBill1 LIKE {t.strBill1}~/
/~warehouseArea.id: AND szone.id = {warehouseArea.id}~/ /~warehouseArea.id: AND z.id = {warehouseArea.id}~/
/~locCode: AND (location.code) LIKE ({locCode})~/ /~pickTicket.code: AND pt.code LIKE {pickTicket.code}~/
/~pickTicket.code: AND (pickTicket.code) LIKE ({pickTicket.code})~/ /~pickTicket.sourceType: AND pt.sourceType LIKE {pickTicket.sourceType}~/
/~pickTicket.sourceType: AND (pickTicket.sourceType) LIKE ({pickTicket.sourceType})~/
/~warehouseArea: AND warehouseArea.name = {warehouseArea}~/
/~locCode: AND (location.code) LIKE ({locCode})~/
/~itemCode: AND item.code LIKE {itemCode} ~/ /~itemCode: AND item.code LIKE {itemCode} ~/
/~waveDoc.code: AND (waveDoc.code) LIKE ({waveDoc.code})~/ /~waveDoc.code: AND wd.code LIKE {waveDoc.code}~/
/~dstLP.remark: AND (dstLP.remark) LIKE ({dstLP.remark})~/ /~dstLP.remark: AND s.remark LIKE {dstLP.remark}~/
order by t.id desc order by t.id desc
]]></datasource> ]]></datasource>
<columns> <columns>