|
|
|
@ -220,14 +220,14 @@ |
|
|
|
T.PartNo, |
|
|
|
P.PartDescription, |
|
|
|
P.Spec, |
|
|
|
<if test="summaryType != null and summaryType >= 1"> |
|
|
|
<if test="params.summaryType != null and params.summaryType >= 1"> |
|
|
|
T.WarehouseID, |
|
|
|
</if> |
|
|
|
P.UMID, |
|
|
|
<if test="summaryType != null and summaryType >= 2"> |
|
|
|
<if test="params.summaryType != null and params.summaryType >= 2"> |
|
|
|
T.LocationID, |
|
|
|
</if> |
|
|
|
<if test="summaryType != null and summaryType >= 3"> |
|
|
|
<if test="params.summaryType != null and params.summaryType >= 3"> |
|
|
|
T.BatchNo, |
|
|
|
</if> |
|
|
|
min(T.FirstInDate) as FirstInDate, |
|
|
|
@ -256,64 +256,64 @@ |
|
|
|
Part as P |
|
|
|
where T.Site = P.Site |
|
|
|
and T.PartNo = P.PartNo |
|
|
|
<if test="loginUser != null and loginUser != ''"> |
|
|
|
and T.Site in (Select Site from AccessSite where upper(UserID) = #{loginUser}) |
|
|
|
<if test="params.loginUser != null and params.loginUser != ''"> |
|
|
|
and T.Site in (Select Site from AccessSite where upper(UserID) = #{params.loginUser}) |
|
|
|
</if> |
|
|
|
<if test="partNo != null and partNo != ''"> |
|
|
|
and T.PartNo like #{partNo} |
|
|
|
<if test="params.partNo != null and params.partNo != ''"> |
|
|
|
and T.PartNo like #{params.partNo} |
|
|
|
</if> |
|
|
|
<if test="partDescription != null and partDescription != ''"> |
|
|
|
and P.PartDescription like #{partDescription} |
|
|
|
<if test="params.partDescription != null and params.partDescription != ''"> |
|
|
|
and P.PartDescription like #{params.partDescription} |
|
|
|
</if> |
|
|
|
<if test="spec != null and spec != ''"> |
|
|
|
and P.Spec like #{spec} |
|
|
|
<if test="params.spec != null and params.spec != ''"> |
|
|
|
and P.Spec like #{params.spec} |
|
|
|
</if> |
|
|
|
<if test="site != null and site != ''"> |
|
|
|
and T.Site = #{site} |
|
|
|
<if test="params.site != null and params.site != ''"> |
|
|
|
and T.Site = #{params.site} |
|
|
|
</if> |
|
|
|
<if test="partType != null and partType != ''"> |
|
|
|
and P.PartType like #{partType} |
|
|
|
<if test="params.partType != null and params.partType != ''"> |
|
|
|
and P.PartType like #{params.partType} |
|
|
|
</if> |
|
|
|
<if test="warehouseId != null and warehouseId != ''"> |
|
|
|
and T.WarehouseID = #{warehouseId} |
|
|
|
<if test="params.warehouseId != null and params.warehouseId != ''"> |
|
|
|
and T.WarehouseID = #{params.warehouseId} |
|
|
|
</if> |
|
|
|
<if test="locationId != null and locationId != '' and summaryType != null and summaryType >= 2"> |
|
|
|
and T.LocationID = #{locationId} |
|
|
|
<if test="params.locationId != null and params.locationId != '' and params.summaryType != null and params.summaryType >= 2"> |
|
|
|
and T.LocationID = #{params.locationId} |
|
|
|
</if> |
|
|
|
<if test="batchNo != null and batchNo != '' and summaryType != null and summaryType >= 3"> |
|
|
|
and T.BatchNo = #{batchNo} |
|
|
|
<if test="params.batchNo != null and params.batchNo != '' and params.summaryType != null and params.summaryType >= 3"> |
|
|
|
and T.BatchNo = #{params.batchNo} |
|
|
|
</if> |
|
|
|
<if test="familyId != null and familyId != ''"> |
|
|
|
and P.FamilyID like #{familyId} |
|
|
|
<if test="params.familyId != null and params.familyId != ''"> |
|
|
|
and P.FamilyID like #{params.familyId} |
|
|
|
</if> |
|
|
|
<if test="familyName != null and familyName != ''"> |
|
|
|
and dbo.Get_PartFamilyDesc(P.Site, P.FamilyID) like #{familyName} |
|
|
|
<if test="params.familyName != null and params.familyName != ''"> |
|
|
|
and dbo.Get_PartFamilyDesc(P.Site, P.FamilyID) like #{params.familyName} |
|
|
|
</if> |
|
|
|
<if test="startFirstInDate != null"> |
|
|
|
and T.FirstInDate >= #{startFirstInDate} |
|
|
|
<if test="params.startFirstInDate != null"> |
|
|
|
and T.FirstInDate >= #{params.startFirstInDate} |
|
|
|
</if> |
|
|
|
<if test="endFirstInDate != null"> |
|
|
|
and #{endFirstInDate} >= T.FirstInDate |
|
|
|
<if test="params.endFirstInDate != null"> |
|
|
|
and #{params.endFirstInDate} >= T.FirstInDate |
|
|
|
</if> |
|
|
|
<if test="startExpiredDate != null"> |
|
|
|
and T.ExpiredDate >= #{startExpiredDate} |
|
|
|
<if test="params.startExpiredDate != null"> |
|
|
|
and T.ExpiredDate >= #{params.startExpiredDate} |
|
|
|
</if> |
|
|
|
<if test="endExpiredDate != null"> |
|
|
|
and #{endExpiredDate} >= T.ExpiredDate |
|
|
|
<if test="params.endExpiredDate != null"> |
|
|
|
and #{params.endExpiredDate} >= T.ExpiredDate |
|
|
|
</if> |
|
|
|
group by |
|
|
|
T.Site, |
|
|
|
T.PartNo, |
|
|
|
P.PartDescription, |
|
|
|
P.Spec, |
|
|
|
<if test="summaryType != null and summaryType >= 1"> |
|
|
|
<if test="params.summaryType != null and params.summaryType >= 1"> |
|
|
|
T.WarehouseID, |
|
|
|
</if> |
|
|
|
P.UMID, |
|
|
|
<if test="summaryType != null and summaryType >= 2"> |
|
|
|
<if test="params.summaryType != null and params.summaryType >= 2"> |
|
|
|
T.LocationID, |
|
|
|
</if> |
|
|
|
<if test="summaryType != null and summaryType >= 3"> |
|
|
|
<if test="params.summaryType != null and params.summaryType >= 3"> |
|
|
|
T.BatchNo, |
|
|
|
</if> |
|
|
|
P.Site, |
|
|
|
|