|
|
@ -229,33 +229,21 @@ |
|
|
</if> |
|
|
</if> |
|
|
<if test="params.summaryType != null and params.summaryType >= 3"> |
|
|
<if test="params.summaryType != null and params.summaryType >= 3"> |
|
|
T.BatchNo, |
|
|
T.BatchNo, |
|
|
|
|
|
max(T.LatestOutDate) as LatestOutDate, |
|
|
|
|
|
max(T.LatestInDate) as LatestInDate, |
|
|
|
|
|
max(T.ActiveDate) as ActiveDate, |
|
|
|
|
|
min(T.ManufactureDate) as ManufactureDate, |
|
|
|
|
|
max(T.ExpiredDate) as ExpiredDate, |
|
|
|
|
|
max(T.DemandPartnerType) as DemandPartnerType, |
|
|
|
|
|
max(T.DemandPartnerName) as DemandPartnerName, |
|
|
</if> |
|
|
</if> |
|
|
min(T.FirstInDate) as FirstInDate, |
|
|
min(T.FirstInDate) as FirstInDate, |
|
|
max(T.LatestCountDate) as LatestCountDate, |
|
|
|
|
|
min(T.Freezeflag) as Freezeflag, |
|
|
|
|
|
P.PartType, |
|
|
|
|
|
P.FamilyID, |
|
|
|
|
|
dbo.Get_PartFamilyDesc(P.Site, P.FamilyID) as FamilyName, |
|
|
|
|
|
P.GroupID, |
|
|
|
|
|
dbo.Get_PartGroupDesc(T.Site, P.GroupID) as PartGroup, |
|
|
|
|
|
max(T.LatestOutDate) as LatestOutDate, |
|
|
|
|
|
max(T.LatestInDate) as LatestInDate, |
|
|
|
|
|
max(T.ActiveDate) as ActiveDate, |
|
|
|
|
|
max(T.PartnerID) as PartnerID, |
|
|
|
|
|
max(T.PartnerType) as PartnerType, |
|
|
|
|
|
min(T.ManufactureDate) as ManufactureDate, |
|
|
|
|
|
max(T.ExpiredDate) as ExpiredDate, |
|
|
|
|
|
sum(Round(T.QtyOnHand, 3)) as QtyOnHand, |
|
|
|
|
|
sum(Round(isnull(T.QtyReserved, 0), 3)) as QtyReserved, |
|
|
|
|
|
sum(Round(isnull(T.InStandardValue, 0), 4) - Round(isnull(T.OutStandardValue, 0), 4)) as StandartStockValue, |
|
|
|
|
|
sum(Round(isnull(T.InActualValue, 0), 4) - Round(isnull(T.OutActualValue, 0), 4)) as ActualStockValue, |
|
|
|
|
|
max(T.DemandPartnerType) as DemandPartnerType, |
|
|
|
|
|
max(T.DemandPartnerID) as DemandPartnerID, |
|
|
|
|
|
max(T.DemandPartnerName) as DemandPartnerName, |
|
|
|
|
|
|
|
|
sum(Round(T.QtyOnHand, 3)) as QtyOnHand |
|
|
from InventoryStock as T, |
|
|
from InventoryStock as T, |
|
|
Part as P |
|
|
Part as P |
|
|
where T.Site = P.Site |
|
|
where T.Site = P.Site |
|
|
and T.PartNo = P.PartNo |
|
|
and T.PartNo = P.PartNo |
|
|
|
|
|
and Round(T.QtyOnHand, 3) > 0 |
|
|
<if test="params.loginUser != null and params.loginUser != ''"> |
|
|
<if test="params.loginUser != null and params.loginUser != ''"> |
|
|
and T.Site in (Select Site from AccessSite where upper(UserID) = #{params.loginUser}) |
|
|
and T.Site in (Select Site from AccessSite where upper(UserID) = #{params.loginUser}) |
|
|
</if> |
|
|
</if> |
|
|
@ -302,24 +290,21 @@ |
|
|
and #{params.endExpiredDate} >= T.ExpiredDate |
|
|
and #{params.endExpiredDate} >= T.ExpiredDate |
|
|
</if> |
|
|
</if> |
|
|
group by |
|
|
group by |
|
|
T.Site, |
|
|
|
|
|
T.PartNo, |
|
|
|
|
|
P.PartDescription, |
|
|
|
|
|
P.Spec, |
|
|
|
|
|
<if test="params.summaryType != null and params.summaryType >= 1"> |
|
|
|
|
|
T.WarehouseID, |
|
|
|
|
|
</if> |
|
|
|
|
|
P.UMID, |
|
|
|
|
|
<if test="params.summaryType != null and params.summaryType >= 2"> |
|
|
|
|
|
T.LocationID, |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="params.summaryType != null and params.summaryType >= 3"> |
|
|
|
|
|
T.BatchNo, |
|
|
|
|
|
</if> |
|
|
|
|
|
P.Site, |
|
|
|
|
|
P.FamilyID, |
|
|
|
|
|
P.GroupID, |
|
|
|
|
|
P.PartType |
|
|
|
|
|
|
|
|
T.Site, |
|
|
|
|
|
T.PartNo, |
|
|
|
|
|
P.PartDescription, |
|
|
|
|
|
P.Spec, |
|
|
|
|
|
<if test="params.summaryType != null and params.summaryType >= 1"> |
|
|
|
|
|
T.WarehouseID, |
|
|
|
|
|
</if> |
|
|
|
|
|
P.UMID, |
|
|
|
|
|
<if test="params.summaryType != null and params.summaryType >= 2"> |
|
|
|
|
|
T.LocationID, |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="params.summaryType != null and params.summaryType >= 3"> |
|
|
|
|
|
T.BatchNo, |
|
|
|
|
|
</if> |
|
|
|
|
|
P.Site |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
</mapper> |
|
|
</mapper> |