Subversion Repositories SmartDukaan

Rev

Rev 7838 | Rev 8580 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7838 Rev 7957
Line 301... Line 301...
301
 	SELECT toWarehouseId  
301
 	SELECT toWarehouseId  
302
 	FROM possibleWarehouseMovement  
302
 	FROM possibleWarehouseMovement  
303
 	WHERE fromWarehouseId = #{warehouseId}
303
 	WHERE fromWarehouseId = #{warehouseId}
304
 </select>
304
 </select>
305
 
305
 
-
 
306
<select id = "getHistoricBadInventoryByScans" resultType = "inventoryAvailability" parameterType = "date">
-
 
307
	SELECT x.itemId, ci.brand, ci.model_name as modelName, ci.model_number as modelNumber, 
-
 
308
	ci.color as color, (x.inx-if(y.outx is null,0,y.outx)) as quantity 
306
 
309
	FROM 
-
 
310
		(SELECT i.itemId, count(*) as inx FROM scanNew s JOIN inventoryItem i ON 
-
 
311
		(i.id = s.inventoryItemId) JOIN catalog.item c ON i.itemId = c.id 
-
 
312
		where s.type in ('DOA_IN', 'SALE_RET_UNUSABLE') and 
-
 
313
		s.scannedAt &lt; #{date} group by i.itemId ) as x 
-
 
314
		LEFT JOIN 
-
 
315
		(SELECT i.itemId, count(*) as outx FROM scanNew s JOIN inventoryItem i ON
-
 
316
		i.id = s.inventoryItemId JOIN catalog.item c ON i.itemId = c.id WHERE 
-
 
317
		s.type in ('DOA_OUT') and s.scannedAt &lt; #{date} group by i.itemId) as y 
-
 
318
		ON x.itemId = y.itemId 
-
 
319
		JOIN catalog.item ci ON ci.id = x.itemId 
-
 
320
	having quantity>0;
-
 
321
</select>
307
 
322
 
308
<select id = "getScansForTransferLot" resultType = "scan" parameterType = "java.lang.Long">
323
<select id = "getScansForTransferLot" resultType = "scan" parameterType = "java.lang.Long">
309
	SELECT * 
324
	SELECT * 
310
	FROM scanNew
325
	FROM scanNew
311
	WHERE transferLotId = #{id}
326
	WHERE transferLotId = #{id}