|
@@ -470,18 +470,9 @@ public class TbAssetInventoryServiceImpl implements ITbAssetInventoryService
|
|
|
*/
|
|
|
public List<DepAssetLossResultDto> inventoryDepAssetById(String depId) throws Exception {
|
|
|
|
|
|
- /* 本想这样写sql的:
|
|
|
- select inventory_metadata metadata
|
|
|
- from tb_inventory_detail
|
|
|
- where order_number in
|
|
|
- (select order_number
|
|
|
- from tb_asset_inventory
|
|
|
- where inventory_status = 2 and inventory_department = 206
|
|
|
- order by inventory_date desc
|
|
|
- limit 0,2)
|
|
|
- 但是,语法不支持,会报错:This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
|
|
|
- 暂时选择以下方法解决,要连接四次数据库,很可能需要优化
|
|
|
- */
|
|
|
+ /**
|
|
|
+ 在for循环中查询数据库,数据量多的时候时间花销大
|
|
|
+ */
|
|
|
|
|
|
List<String> childDeptIdList = tbAssetInventoryMapper.getChildDeptId(depId);
|
|
|
if(childDeptIdList == null || childDeptIdList.size()==0){
|
|
@@ -508,6 +499,8 @@ public class TbAssetInventoryServiceImpl implements ITbAssetInventoryService
|
|
|
resultDto.setDeptName(new_inv.getDeptName());
|
|
|
}
|
|
|
resultDtoList.add(resultDto);
|
|
|
+ //清空列表数据
|
|
|
+ invs.clear();
|
|
|
}
|
|
|
|
|
|
|