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