select top 1 a.NotifyNo,a.Site,a.NotifyDate,a.UserName,a.EnteredDate,a.Receiver,a.DepartmentID,a.Remark,a.CreditFlag,a.IssueFlag,
a.IssueResult,a.PlanIssueDate,a.RealIssueDate,a.Status,a.HaveIssueRecordFlag,a.CalcFlag,a.NeedApproveFlag,a.ApprovedFlag,
a.Approver,a.ApproveDate,a.WarehouseID,a.RecordVersion,a.OutWorkOrderFlag,a.ProjectID,a.OrderType,a.AuthRuleID,a.bu
from SOIssueNotifyHeader a
where a.Site=#{site} and a.UserName=#{userName} and a.Status='已计划'
order by a.EnteredDate desc
insert into SOIssueNotifyHeader (NotifyNo,Site,NotifyDate,UserName,EnteredDate,Receiver,DepartmentID,Remark,CreditFlag,IssueFlag,IssueResult,PlanIssueDate,
RealIssueDate,Status,HaveIssueRecordFlag,CalcFlag,NeedApproveFlag,ApprovedFlag,Approver,ApproveDate,WarehouseID,
RecordVersion,OutWorkOrderFlag,ProjectID,OrderType,AuthRuleID,bu, work_center_no, category)
values(#{notifyNo},#{site},#{notifyDate},#{userName},#{enteredDate},#{receiver},#{departmentID},#{remark},#{creditFlag},#{issueFlag},#{issueResult},#{planIssueDate},
#{realIssueDate},#{status},#{haveIssueRecordFlag},#{calcFlag},#{needApproveFlag},#{approvedFlag},#{approver},#{approveDate},#{warehouseID},
#{recordVersion},#{outWorkOrderFlag},#{projectID},#{orderType},#{authRuleID},#{bu}, #{workCenterNo}, #{category})
update SOIssueNotifyHeader set bu=#{bu} where site=#{site} and NotifyNo=#{notifyNo}
select
a.NotifyNo,
a.Site,
a.ItemNo,
a.FGPartNo,
a.SOOrderNo,
a.OpsItemNo,
a.SeqNo,
a.IssureQty,
a.OutWorkOrderFlag,
a.locationNo,
a.needDate,
b.OperationDesc itemDesc,
a.aps_resource_total,
a.not_yet_started_resource_total
from SOIssueNotifyOrderList a
left join sorouting b on a.site = b.site and a.SOOrderNo = b.OrderNo and b.ItemNo = a.OpsItemNo
where a.site = #{site} and a.NotifyNo = #{notifyNo}
select a.site,a.OrderNo orderno,a.ItemNo itemNo,b.OperationDesc itemDesc,a.seqno ,a.qtyrequired,a.qtyreported,a.remark,
a.s_scheduleddate,a.S_ResourceID sResourceid,dbo.getResourceDesc(a.site,a.S_ResourceID) resourceDesc,a.S_ShiftNo sShiftno,
dbo.getScheduleShiftDesc(a.site,a.s_shiftno) shiftDesc,a.s_workcenterno,s.PartNo partNo,
c.WorkCenterDesc workCenterDesc,dbo.Get_PartDesc(a.site,s.PartNo) partDesc
from SOScheduledRouting a
left join ShopOrder s on a.site=s.site and a.OrderNo=s.OrderNo
left join SORouting b on a.site=b.site and a.OrderNo=b.OrderNo and b.ItemNo=a.ItemNo
left join workcenter c on a.site=c.site and a.S_WorkCenterNo=c.WorkCenterNo
left join part d on a.site=d.site and d.PartNo=s.PartNo
and a.site=#{site}
and d.bu_no=#{bu}
and a.ClosedFlag='N'
and s.PartNo like '%' + #{partNo} + '%'
and a.seqno like '%' + #{seqno} + '%'
and a.OrderNo like '%' + #{orderno} + '%'
and a.S_ShiftNo like '%' + #{sShiftno} + '%'
and a.S_ResourceID like '%' + #{sResourceid} + '%'
and a.s_workcenterno like '%' + #{sWorkcenterno} + '%'
AND a.S_ScheduledDate >= #{startDate}
AND #{endDate} >= a.S_ScheduledDate
order by a.OrderNo
select a.site,a.OrderNo orderno,a.ItemNo itemNo,b.OperationDesc itemDesc,a.seqno ,a.qtyrequired,a.qtyreported,a.remark,
a.s_scheduleddate,a.S_ResourceID sResourceid,dbo.getResourceDesc(a.site,a.S_ResourceID) resourceDesc,a.S_ShiftNo sShiftno,
dbo.getScheduleShiftDesc(a.site,a.s_shiftno) shiftDesc,a.s_workcenterno,s.PartNo partNo,
c.WorkCenterDesc workCenterDesc,dbo.Get_PartDesc(a.site,s.PartNo) partDesc,
0 alreadyApplyTotal
from SOScheduledRouting a
left join ShopOrder s on a.site=s.site and a.OrderNo=s.OrderNo
left join SORouting b on a.site=b.site and a.OrderNo=b.OrderNo and b.ItemNo=a.ItemNo
left join workcenter c on a.site=c.site and a.S_WorkCenterNo=c.WorkCenterNo
and a.site=#{query.site}
and s.bu_no=#{query.bu}
and a.ClosedFlag='N'
and s.PartNo like '%' + #{query.partNo} + '%'
and a.seqno like '%' + #{query.seqno} + '%'
and a.OrderNo like '%' + #{query.orderno} + '%'
and a.S_ShiftNo like '%' + #{query.sShiftno} + '%'
and a.S_ResourceID like '%' + #{query.sResourceid} + '%'
and a.s_workcenterno like '%' + #{query.sWorkcenterno} + '%'
AND a.S_ScheduledDate >= #{query.startDate}
AND #{query.endDate} >= a.S_ScheduledDate
order by a.OrderNo
select a.site,b.ItemNo,a.item_no_mat as BOMItemNo,a.component_partno as ComponentPartNo,
round(a.qty_assembly*b.IssureQty,2) qty_required , round(a.qty_issue,2) qty_issue,c.QtyToIssue,#{notifyNo} as notifyNo
,dbo.Get_PartDesc(a.site,a.component_partno) partDesc,Round( dbo.get_MaterialOnUse(a.site,a.order_no,a.item_no,a.component_partno),3) qtyOnHand,
round(sum(h.qty_on_hand),2) stockQty,c.remark
from so_bom a
left join SOIssueNotifyOrderList b on a.site=b.site and b.NotifyNo=#{notifyNo} and b.seqNo=#{seqno}
left join SOIssueNotifyOrderMaterialList c on a.site=c.site and a.item_no_mat=c.BOMItemNo and c.NotifyNo=#{notifyNo} and c.itemNo=b.itemNo
left join view_custdev_currentstock h on a.site=h.site and a.component_partno=h.part_no
where a.site=#{site} and a.order_no=#{orderno} and a.item_no=#{itemno,jdbcType=DOUBLE} and a.control_mes='Y'
group by a.site,b.ItemNo,a.item_no_mat,a.component_partno,a.qty_assembly,b.IssureQty,a.qty_issue,c.QtyToIssue,a.order_no,a.item_no,a.control_mes,c.remark
select
a.Site as site,
a.ItemNo as itemNo,
a.OrderNo as orderNo,
a.ComponentPartNo as ComponentPartNo,
round(a.QtyAssembly,3) as qtyAssembly,
round(a.QtyRequired,3) as qtyRequired,
round(a.QtyIssue,3) as qtyIssue,
dbo.Get_PartDesc(a.Site,a.ComponentPartNo) as partDesc,
a.Remark as remark,
a.issue_method as issueMethod,
a.outbound_warehouse_id as outboundWarehouseId
from SOBOM a
where a.Site = #{site} and a.OrderNo = #{orderno} and a.issue_method ]]> '入库倒冲'
and a.ComponentPartNo is not null
select NotifyNo,Site,ItemNo,BOMItemNo,ComponentPartNo,QtyToIssue,QtyToIssue_Original,issueType
,dbo.Get_PartDesc(site,ComponentPartNo) partDesc,remark
from SOIssueNotifyOrderMaterialList where NotifyNo=#{notifyNo} and site=#{site} and issueType=#{issueType}
select isnull(max(ItemNo),0)+1 from SOIssueNotifyOrderList where site=#{site} and NotifyNo=#{notifyNo} and 998>ItemNo
insert into SOIssueNotifyOrderList(NotifyNo,Site,ItemNo,FGPartNo,SOOrderNo,OpsItemNo,SeqNo,IssureQty,OutWorkOrderFlag,LocationNo,needDate, resourceId, aps_resource_total, not_yet_started_resource_total)
values(#{notifyNo},#{site},#{itemNo},#{fGPartNo},#{sOOrderNo},#{opsItemNo},#{seqNo},#{issureQty,jdbcType=DECIMAL},#{outWorkOrderFlag}
,#{locationNo},#{needDate}, #{resourceId}, #{apsResourceTotal,jdbcType=INTEGER}, #{notYetStartedResourceTotal,jdbcType=INTEGER})
delete from SOIssueNotifyOrderMaterialList where site=#{site} and NotifyNo=#{notifyNo} and ItemNo=#{itemNo}
insert into SOIssueNotifyOrderMaterialList
(NotifyNo, Site, ItemNo, BOMItemNo, ComponentPartNo, QtyToIssue, QtyToIssue_Original, issueType, remark, warehouse_id, standard_dosage)
values
(#{item.notifyNo}, #{item.site}, #{item.itemNo}, #{item.bOMItemNo}, #{item.componentPartNo}, #{item.qtyToIssue}, 0, #{item.issueType}, #{item.remark}, #{item.warehouseId}, #{item.standardDosage,jdbcType=FLOAT})
insert into SOIssueNotifyOrderMaterialList
(NotifyNo,Site,ItemNo,BOMItemNo,ComponentPartNo,QtyToIssue,QtyToIssue_Original,issueType,remark)
values
(#{notifyNo},#{site},#{itemNo},#{bOMItemNo},#{componentPartNo},#{qtyToIssue},0,#{issueType},#{remark})
delete from SOIssueNotifyOrderList where site=#{site} and NotifyNo=#{notifyNo} and ItemNo=#{itemNo}
update SOIssueNotifyHeader
set status = '编辑中'
where site = #{site}
and NotifyNo = #{notifyNo}
select
a.NotifyNo,
a.Site,
a.ItemNo,
a.FGPartNo,
a.SOOrderNo,
a.OpsItemNo,
a.SeqNo,
a.IssureQty,
a.OutWorkOrderFlag,
b.OperationDesc itemDesc,
a.locationNo,
a.needDate,
dbo.Get_PartDesc(a.site,a.FGPartNo) partDesc,
a.resourceId,
a.aps_resource_total,
a.not_yet_started_resource_total,
so.out_batchNo as outBatchNo
from SOIssueNotifyOrderList a
left join SORouting b on a.site=b.site and a.SOOrderNo=b.OrderNo and a.OpsItemNo=b.ItemNo
left join ShopOrder so on a.site=so.site and a.SOOrderNo=so.OrderNo
where a.site=#{site} and a.NotifyNo=#{notifyNo}
order by a.ItemNo
select
a.NotifyNo,
a.Site,
a.ItemNo,
a.ComponentPartNo,
a.QtyToIssue,
a.QtyToIssue_Original,
b.FGPartNo,
b.OpsItemNo,
b.SOOrderNo orderNo,
b.SeqNo,
dbo.Get_PartDesc(a.site,a.ComponentPartNo) partDesc,
b.locationNo,
a.issueType,
b.needDate,
a.remark,
isnull(c.issue_method,d.issue_method) issue_method,
a.warehouse_id,
W.WareHouseName AS warehouseName,
a.BOMItemNo as bOMItemNo,
a.component_scrap,
a.first_inspection_qty,
a.standard_dosage,
d.UMID as umId,
um.UMName as umName
from SOIssueNotifyOrderMaterialList a
left join SOIssueNotifyOrderList b on a.site = b.site and a.NotifyNo = b.NotifyNo and a.ItemNo = b.ItemNo
left join SOBOM c on c.site = A.site and b.SOOrderNo = c.OrderNo and c.ItemNo = A.BOMItemNo and c.ComponentPartNo = a.ComponentPartNo
left join part d on d.site = a.site and d.PartNo = a.ComponentPartNo
left join um as um on d.site = um.site and d.UMID = um.UMID
left join WareHouse w on a.site = w.site and a.warehouse_id = w.WareHouseID
where a.NotifyNo = #{notifyNo} and a.site = #{site}
order by b.needDate, a.ItemNo
select
a.site,
b.bu,
A.NotifyNo,
a.ComponentPartNo,
sum(a.QtyToIssue) QtyToIssue,
sum(a.actual_out_qty) as QtyToIssue_Original,
dbo.Get_PartDesc(a.site,a.ComponentPartNo) partDesc,
a.issueType,
a.warehouse_id,
W.WareHouseName AS warehouseName
from SOIssueNotifyHeader B
INNER JOIN SOIssueNotifyOrderList C ON B.SITE = C.SITE AND B.NotifyNo = C.NotifyNo
INNER JOIN SOIssueNotifyOrderMaterialList a ON A.SITE = C.SITE AND A.NotifyNo = C.NotifyNo AND A.ItemNo = C.ItemNo
left join WareHouse w on a.site = w.site and a.warehouse_id = w.WareHouseID
where a.NotifyNo = #{notifyNo} and a.site = #{site} and b.bu = #{bu}
group by a.site, a.ComponentPartNo, a.issueType , b.BU ,a.warehouse_id ,wareHouseName, A.NotifyNo
order by a.issueType
select P.PartNo partNo,P.PartDescription partDesc,P.umid,P.spec,P.sku from part P
LEFT JOIN SOBOM s on P.site = s.site and P.PartNo = s.ComponentPartNo
and P.site = #{site} and P.bu_no = #{sourceBu} AND s.Site IS NULL
AND P.PartNo LIKE '%'+ #{partNo} + '%'
AND P.PartDescription LIKE '%'+ #{partDesc}+ '%'
AND P.spec LIKE '%'+ #{spec}+ '%'
select P.PartNo partNo,P.PartDescription partDesc,P.umid,P.spec,P.sku from part P
LEFT JOIN SOBOM s on P.site = s.site and P.PartNo = s.ComponentPartNo
and P.site = #{query.site} and P.bu_no = #{query.sourceBu} AND s.Site IS NULL
AND P.PartNo LIKE '%'+ #{query.partNo} + '%'
AND P.PartDescription LIKE '%'+ #{query.partDesc}+ '%'
AND P.spec LIKE '%'+ #{query.spec}+ '%'
select top 1000 part_no, PartDescription as part_desc, umid, spec, sku, cinv_source_code
from part
and site = #{site} and sourceBu = #{sourceBu} and control_mes='N'
AND part_no LIKE '%'+ #{partNo} + '%'
AND PartDescription LIKE '%'+ #{partDesc}+ '%'
AND spec LIKE '%'+ #{spec}+ '%'
select g.ComponentPartNo,g.QtyToIssue ,g.partDesc,sum(h.qty_on_hand) qty_on_hand,sum(h.qty_available) qty_available
from
(
select a.ComponentPartNo,sum(a.QtyToIssue) QtyToIssue,sum(isnull(a.QtyToIssue_Original,0)) QtyToIssue_Original,
dbo.Get_PartDesc(a.site,a.ComponentPartNo) partDesc,a.site
from SOIssueNotifyOrderMaterialList a
where a.NotifyNo=#{notifyNo} and a.site=#{site}
group by a.site,a.ComponentPartNo
) g left join view_custdev_currentstock h on g.site=h.site and g.ComponentPartNo=h.part_no
group by g.ComponentPartNo,g.QtyToIssue ,g.partDesc
select NotifyNo,Site,ItemNo,ComponentPartNo,QtyToIssue,QtyToIssue_Original
from SOIssueNotifyOrderMaterialList where Site=#{site} and NotifyNo=#{notifyNo}
and ItemNo=#{itemNo,jdbcType=DOUBLE}
update SOIssueNotifyHeader set status = #{status}
where Site = #{site} and NotifyNo = #{notifyNo}
select NotifyNo,Site,ItemNo,ComponentPartNo,QtyToIssue,QtyToIssue_Original,issueType
from SOIssueNotifyOrderMaterialList where Site=#{site} and NotifyNo=#{notifyNo}
and ItemNo=#{itemNo}
delete from SOIssueNotifyOrderMaterialList
where Site = #{site} and NotifyNo = #{notifyNo}
and ItemNo = #{itemNo}
delete from SOIssueNotifyOrderMaterialList
where Site=#{site} and NotifyNo=#{notifyNo}
and BOMItemNo=#{bOMItemNo}
insert into IssueNotifyChangeLog (Site,NotifyNo,ItemNo,SOOrderNo,SeqNo,ComponentPartNo,QtyToIssue,updateType,updateBy,updateDate,issueType)
values (#{site},#{notifyNo},#{itemNo},#{sOOrderNo},#{seqNo},#{componentPartNo},#{qtyToIssue,jdbcType=DOUBLE},#{updateType},#{updateBy},#{updateDate},#{issueType})
insert into IssueNotifyChangeLog (Site,NotifyNo,ItemNo,SOOrderNo,SeqNo,ComponentPartNo,QtyToIssue,updateType,updateBy,updateDate,issueType)
values
(#{item.site},#{item.notifyNo},#{item.itemNo},#{item.sOOrderNo},#{item.seqNo},#{item.componentPartNo},#{item.qtyToIssue,jdbcType=DOUBLE},#{item.updateType},#{item.updateBy},#{item.updateDate},#{item.issueType})
select NotifyNo,Site,ItemNo,FGPartNo,SOOrderNo,OpsItemNo,SeqNo,IssureQty,OutWorkOrderFlag,LocationNo,needDate,aps_resource_total,not_yet_started_resource_total
from SOIssueNotifyOrderList where Site=#{site} and NotifyNo=#{notifyNo}
and ItemNo=#{itemNo}
select NotifyNo,Site,ItemNo,BOMItemNo,ComponentPartNo,QtyToIssue,QtyToIssue_Original
from SOIssueNotifyOrderMaterialList where Site=#{site} and NotifyNo=#{notifyNo}
and ComponentPartNo=#{componentPartNo}
SELECT #{str}+
CONVERT(VARCHAR(50),isnull( max(CONVERT(int,SUBSTRING(BOMItemNo, LEN(#{str})+1, LEN(BOMItemNo)))+1),1))
FROM SOIssueNotifyOrderMaterialList where Site=#{site} and NotifyNo=#{notifyNo}
and BOMItemNo like #{str}+'%'
select Site,NotifyNo,ItemNo,SOOrderNo,SeqNo,ComponentPartNo,QtyToIssue,updateType,updateBy,updateDate,issueType
from IssueNotifyChangeLog where Site=#{site} and NotifyNo=#{notifyNo}
insert into SOIssueNotifyLog (Site, NotifyNo, [Action], username, ActionTime, ActionRemark)
values (#{site}, #{notifyNo}, '关闭', #{username}, GetDate(), #{closeRemark})
SELECT
CASE
WHEN MAX(BOMItemNo) IS NULL THEN '10'
ELSE
CASE
WHEN ISNUMERIC(MAX(BOMItemNo)) = 1 THEN
CAST(CAST(MAX(BOMItemNo) AS DECIMAL(10,0)) + 10 AS VARCHAR)
ELSE '10'
END
END
FROM SOIssueNotifyOrderMaterialList
WHERE Site = #{site}
AND NotifyNo = #{notifyNo}
AND ItemNo = #{itemNo}
AND ISNUMERIC(BOMItemNo) = 1
INSERT INTO SOIssueNotifyOrderMaterialList
(NotifyNo, Site, ItemNo, BOMItemNo, ComponentPartNo, QtyToIssue, QtyToIssue_Original, issueType, remark, warehouse_id, component_scrap, first_inspection_qty, standard_dosage)
VALUES
(#{notifyNo}, #{site}, #{itemNo,jdbcType=FLOAT}, #{bOMItemNo}, #{componentPartNo}, #{qtyToIssue,jdbcType=FLOAT}, #{qtyToIssueOriginal,jdbcType=FLOAT}, #{issueType}, #{remark}, #{warehouseId}, #{componentScrap,jdbcType=FLOAT}, #{firstInspectionQty,jdbcType=FLOAT}, #{standardDosage,jdbcType=FLOAT})
select id,Site,NotifyNo,[Action],username,ActionTime,ActionRemark ,dbo.plm_get_user_display(Site,username) userDisplay
from SOIssueNotifyLog where site=#{site} and NotifyNo=#{notifyNo}
order by id
SELECT
a.site,
a.bu_no,
b.bu_desc
FROM AccessBu as a
left join bu as b on a.bu_no = b.bu_no and a.site = b.site
WHERE a.username = #{username} and a.site = #{site}
EXEC UpdateTransNo #{site}, #{transTypeDB}
SELECT
#{site} as site,
dbo.Get_TransNo(#{site},#{transTypeDB}) as transNo
select WorkCenterNo WorkShopId,WorkCenterDesc WorkShopName from WorkCenter
SELECT
b.id,
a.site,
c.sitename,
(a.site + '_' + a.bu_no) as buNo,
b.bu_desc
FROM AccessBu as a
left join bu as b on a.bu_no = b.bu_no and a.site = b.site
left join site as c on a.site = c.siteid
WHERE a.username = #{username}
UPDATE SOIssueNotifyOrderMaterialList
SET QtyToIssue = #{qtyToIssue,jdbcType=DOUBLE},
component_scrap = #{componentScrap,jdbcType=DOUBLE},
first_inspection_qty = #{firstInspectionQty,jdbcType=DOUBLE},
standard_dosage = #{standardDosage,jdbcType=DOUBLE},
warehouse_id = #{warehouseId}
WHERE Site = #{site} and NotifyNo = #{notifyNo} and ItemNo = #{itemNo} and BOMItemNo = #{bOMItemNo}
SELECT
PartNo as partNo,
PartDescription as partDesc,
Site as site,
issue_method as issueMethod,
outbound_warehouse_id as outboundWarehouseId
FROM part
WHERE Site = #{site} AND PartNo = #{partNo}
SELECT DISTINCT
C.alternative_part_no AS alternativePartNo, -- 替代料编码
DBO.Get_PartDesc(A.SITE, C.alternative_part_no) AS alternativePartDesc, -- 替代料名称
C.replacement_ratio AS replacementRatio, -- 替代比例
C.priority AS priority -- 优先级
FROM SOIssueNotifyOrderList A
INNER JOIN ShopOrder B ON A.SITE = B.SITE AND A.SOOrderNo = B.OrderNo
INNER JOIN BomAlternativeParts C ON B.SITE = C.SITE AND B.PartNo = C.part_no AND B.BOMRevNo = C.bom_version
WHERE A.site = #{site}
AND A.NotifyNo = #{notifyNo}
AND A.SOOrderNo = #{orderNo}
AND C.component_part = #{componentPart}
AND C.active = 'Y'
ORDER BY C.priority
select
site,
bu_no,
WorkCenterNo,
WorkCenterDesc
from WorkCenter
where site in (select site from AccessSite where userID = #{username})
and bu_no in (select bu_no from AccessBu where username = #{username})
SELECT
A.NotifyNo AS notifyNo,
CONVERT(VARCHAR(10), A.NotifyDate, 23) AS notifyDate,
A.Status AS status,
B.SOOrderNo AS soOrderNo,
C.BOMItemNo AS bomItemNo,
C.ComponentPartNo AS componentPartNo,
P.PartDescription AS partDescription,
P.Spec AS spec,
U.UMName AS umName,
C.component_scrap AS componentScrap,
C.first_inspection_qty AS firstInspectionQty,
C.standard_dosage AS standardDosage,
C.QtyToIssue AS qtyToIssue,
ISNULL(C.actual_out_qty, 0) AS actualOutQty,
A.work_center_no AS workCenterNo,
so.out_batchNo AS outBatchNo,
W.WareHouseName AS warehouseName,
C.warehouse_id
FROM SOIssueNotifyHeader A
INNER JOIN SOIssueNotifyOrderList B ON A.Site = B.Site AND A.NotifyNo = B.NotifyNo
LEFT JOIN ShopOrder so ON B.Site = so.Site AND B.SOOrderNo = so.OrderNo
INNER JOIN SOIssueNotifyOrderMaterialList C ON B.Site = C.Site AND B.NotifyNo = C.NotifyNo AND B.ItemNo = C.ItemNo
INNER JOIN Part P ON C.Site = P.Site AND C.ComponentPartNo = P.PartNo
INNER JOIN UM U ON U.Site = P.Site AND U.UMID = P.UMID
LEFT JOIN WareHouse W ON C.Site = W.Site AND C.warehouse_id = W.WareHouseID
A.site IN (SELECT site FROM AccessSite WHERE userID = #{query.userName})
AND A.NotifyNo LIKE '%' + #{query.notifyNo} + '%'
AND A.NotifyDate >= #{query.startDate}
AND A.NotifyDate <= #{query.endDate} + ' 23:59:59'
AND A.Status = #{query.status}
AND B.SOOrderNo LIKE '%' + #{query.soOrderNo} + '%'
AND C.BOMItemNo = #{query.bomItemNo}
AND C.ComponentPartNo LIKE '%' + #{query.componentPartNo} + '%'
AND P.PartDescription LIKE '%' + #{query.partDescription} + '%'
AND P.Spec LIKE '%' + #{query.spec} + '%'
AND A.work_center_no IN
#{item}
AND C.warehouse_id IN
#{item}
ORDER BY A.NotifyNo, B.SOOrderNo, C.BOMItemNo