|
|
@ -277,6 +277,73 @@ |
|
|
|
|
|
|
|
|
</where> |
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
<select id="searchShopOrderByPaging" parameterType="com.gaotao.modules.shopOrder.entity.SearchShopOrder" resultType="com.gaotao.modules.shopOrder.entity.SearchShopOrder"> |
|
|
|
|
|
Select T.OrderNo,T.NeedDate,T.OrderType,T.PartNo,p.PartDescription+' / '+isnull(p.Spec,'') as PartDescription, |
|
|
|
|
|
T.LotSize,T.Planner,T.Status,T.CustomerID,P.ConfigurationTemplateID as CustomerName,T.PlanStartDate,T.Leadtime, |
|
|
|
|
|
T.EnterDate,T.Username,T.FinishedQty,T.ReleaseDate,T.ReleaseGuys,T.ScheduleDate,T.Scheduler,T.IssueDate, |
|
|
|
|
|
T.ReportDate,T.ReceiveDate,T.Printed,T.ProjectID,pr.ProjectName,T.BOMRevNo,T.RoutingRevNo,T.OriginalNeedDate, |
|
|
|
|
|
T.OrderRef1,T.OrderRef2,T.Site,T.Remark,CostRollUpFlag,T.ManualFlag,T.OriSOOrderNo,P.FamilyID, |
|
|
|
|
|
dbo.Get_PartFamilyDesc(P.Site,P.FamilyID) as FamilyName,P.GroupID,dbo.Get_PartGroupDesc(P.Site,P.GroupID) as |
|
|
|
|
|
GroupName, |
|
|
|
|
|
T.ReceiveStatus,T.RepairSOFlag,T.E_OriginalOrderType,T.E_OriginalOrderNo,T.E_Levels,P.PartType,P.Remark as |
|
|
|
|
|
CustPartNo, |
|
|
|
|
|
T.NeedDate as COPlanShipDate, T.batch_no batchNo |
|
|
|
|
|
from Part as p,ShopOrder as T |
|
|
|
|
|
left join Project as pr on pr.Site=T.Site and pr.Projectid=T.ProjectID |
|
|
|
|
|
<where> |
|
|
|
|
|
AND T.Site=p.Site and T.PartNo=p.PartNo |
|
|
|
|
|
and T.site in (Select Site from AccessSite where upper(UserID)=#{query.user}) |
|
|
|
|
|
<if test=" query.orderType != null and query.orderType != ''"> |
|
|
|
|
|
AND T.OrderType like #{query.orderType} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.planner != null and query.planner != ''"> |
|
|
|
|
|
AND T.Planner like #{query.planner} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.site != null and query.site != ''"> |
|
|
|
|
|
AND T.Site like #{query.site} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.partType != null and query.partType != ''"> |
|
|
|
|
|
AND P.PartType like #{query.partType} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.partNo != null and query.partNo != ''"> |
|
|
|
|
|
AND T.PartNo like #{query.partNo} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.partDescription != null and query.partDescription != ''"> |
|
|
|
|
|
AND p.PartDescription like #{query.partDescription} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.projectID != null and query.projectID != ''"> |
|
|
|
|
|
AND T.ProjectID like #{query.projectID} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.remark != null and query.remark != ''"> |
|
|
|
|
|
AND T.Remark like #{query.remark} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.orderNo != null and query.orderNo != ''"> |
|
|
|
|
|
AND T.OrderNo like #{query.orderNo} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.orderRef1 != null and query.orderRef1 != ''"> |
|
|
|
|
|
AND T.OrderRef1 like #{query.orderRef1} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.costRollUpFlag != null and query.costRollUpFlag != ''"> |
|
|
|
|
|
AND CostRollUpFlag like #{query.costRollUpFlag} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.status != null and query.status != ''"> |
|
|
|
|
|
AND T.Status = #{query.status} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.date1 != null "> |
|
|
|
|
|
AND T.EnterDate >= #{query.date1} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.date2 != null "> |
|
|
|
|
|
AND dateadd( DAY, 1, #{query.date2} ) > T.EnterDate |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.date3 != null "> |
|
|
|
|
|
AND T.PlanStartTime >= #{query.date3} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" query.date4 != null "> |
|
|
|
|
|
AND dateadd( DAY, 1, #{query.date4} ) > T.PlanStartTime |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
</where> |
|
|
|
|
|
</select> |
|
|
<select id="getShopOrderData" resultType="com.gaotao.modules.shopOrder.entity.ShopOrderData"> |
|
|
<select id="getShopOrderData" resultType="com.gaotao.modules.shopOrder.entity.ShopOrderData"> |
|
|
SELECT |
|
|
SELECT |
|
|
T.*,dbo.Get_ProjectDesc(T.Site,T.ProjectID) as ProjectIDName,P.Remark as PartRemark,P.ConfigurationTemplateID, |
|
|
T.*,dbo.Get_ProjectDesc(T.Site,T.ProjectID) as ProjectIDName,P.Remark as PartRemark,P.ConfigurationTemplateID, |
|
|
@ -306,7 +373,7 @@ |
|
|
AND T.PartNo like #{partNo} |
|
|
AND T.PartNo like #{partNo} |
|
|
</if> |
|
|
</if> |
|
|
<if test=" status != null and status != ''"> |
|
|
<if test=" status != null and status != ''"> |
|
|
AND T.Status = ${status} |
|
|
|
|
|
|
|
|
AND T.Status = #{status} |
|
|
</if> |
|
|
</if> |
|
|
<if test=" date1 != null "> |
|
|
<if test=" date1 != null "> |
|
|
AND T.NeedDate >= #{date1} |
|
|
AND T.NeedDate >= #{date1} |
|
|
|