Closed GoogleCodeExporter closed 8 years ago
Original comment by vuongfat
on 11 Jan 2012 at 2:54
v
Original comment by vuongfat
on 11 Jan 2012 at 4:32
Original comment by vuongfat
on 15 Jan 2012 at 1:18
Original comment by vuongfat
on 22 Feb 2012 at 10:16
Original comment by tungdt....@gmail.com
on 22 Feb 2012 at 2:25
dung cau query sau de hien thi, neu 1 xe cho hang cho nhieu to khai thi hien
thi to khai cuoi cung
select table1.[VehicleID]
,table1.[PlateNumber]
,table1.[NumberOfContainer]
,table1.[DriverName]
,table1.[ImportDate]
,table1.[IsImport]
,table1.[ExportDate]
,table1.[IsExport]
,table1.[Note]
,table1.[Status]
,table1.[IsCompleted]
,table1.[IsGoodsImported]
,table1.[ImportStatus]
,table1.[ImportedLocalTime]
,table1.[HasGoodsImported]
,table1.[ConfirmImportBy]
,table1.[ConfirmExportBy]
,table1.[ConfirmLocalImportBy]
,table1.DeclarationID
,table1.[Number]
,table1.[ProductName]
,table1.[CompanyName]
,table1.[ProductAmount]
,table1.[Unit]
,table1.[CreatedByID]
,table1.[ModifiedByID]
,table1.[ModifiedDate]
,table1.[CreatedDate]
,table1.[HasDeclaration]
,table1.[Type]
,table1.[CompanyCode]
,table1.[RegisterDate]
,table1.[DeclarationType]
,table1.[ConfirmExportByName]
,table1.[ConfirmImportByName]
,table1.[ConfirmLocalImportByName]
,table1.[ConfirmStatus]
,table1.[ConfirmDate]
,table1.[Parking]
,table1.[ParkingDate]
,table1.[Money]
,table1.[DateHandover]
,table1.[Seal]
,table1.[NumberTemp]
,table1.[GateExport]
,table1.[DateReturn]
,table1.[NumberHandover]
,table1.[RegisterPlace]
,table1.[TypeOption]
from ViewAllVehicleHasGood as table1
inner join
(select VehicleID as VehicleID,max(tblDeclarationVehicle.DeclarationID) as
maxDeclarationID from tblDeclarationVehicle
where 1=1
group by tblDeclarationVehicle.VehicleID) as table2
on table1.VehicleID = table2.VehicleID and table1.DeclarationID =
table2.maxDeclarationID
and
(table1.DeclarationID > 0 OR table1.DeclarationID = 1)
AND table1.HasGoodsImported = 1
AND table1.DeclarationType = 1
AND table1.IsImport = 1
AND table1.ImportDate >= '2011-02-22 00:00' AND table1.ImportDate < = '2012-02-23 23:59'
Original comment by tungdt....@gmail.com
on 23 Feb 2012 at 5:14
Original comment by tungdt....@gmail.com
on 25 Feb 2012 at 10:53
fixed
Original comment by tungdt....@gmail.com
on 25 Feb 2012 at 10:54
Cai nay van co van de, êm lai nhe, như trong email cua Mr Chung
Original comment by vuongfat
on 6 Mar 2012 at 6:20
Cái chức năng này cũng chưa được đâu Tùng nhé, em nhớ check
lại.
Original comment by vuongfat
on 10 Mar 2012 at 5:28
Original comment by tungdt....@gmail.com
on 10 Mar 2012 at 12:57
Em test chức năng in danh sách xe nhập khẩu có hàng kĩ rồi. Không
bị lỗi trùng lặp xe.
Mỗi xe (tính theo vehicleId) chỉ có một tờ khai duy nhất là tờ
khai nhập mới nhất mà chứa xe đó.
test_case_1:
* tao xe khong co bien so 20A123456, cho xuat khau va nhap khau co hang.
* in danh sach xe nhap khau co hang
=> Output: danh sach chi hien thi 1 xe duy nhat co so to khai = "";
* Tao to khai nhap co so to khai "123123", them xe 20A123456 tu danh sach xe
xuat vao.
* In danh sach xe nhap khau co hang
=> Output: danh sach chi hien thi 1 xe duy nhat co bien so 20A123456 va co so
to khai = "123123";
Tao to khai nhap co so to khai "111111", them xe 20A123456 tu danh sach xe xuat
vao.
* In danh sach xe nhap khau co hang
=> Output: danh sach chi hien thi 1 xe duy nhat co bien so 20A123456 va co so
to khai = "111111";
Original comment by tungdt....@gmail.com
on 11 Mar 2012 at 8:40
Original comment by tungdt....@gmail.com
on 11 Mar 2012 at 8:44
Co the view cua moi nguoi co su sai lenh
view cua em nhu sau:
CREATE VIEW [dbo].[ViewAllVehicleHasGood]
AS
SELECT dbo.tblVehicle.VehicleID, dbo.tblVehicle.PlateNumber,
dbo.tblVehicle.NumberOfContainer, dbo.tblVehicle.DriverName,
dbo.tblVehicle.ImportDate,
dbo.tblVehicle.IsImport, dbo.tblVehicle.ExportDate, dbo.tblVehicle.IsExport, dbo.tblVehicle.Note, dbo.tblVehicle.Status, dbo.tblVehicle.IsCompleted,
dbo.tblVehicle.IsGoodsImported, dbo.tblVehicle.ImportStatus, dbo.tblVehicle.ImportedLocalTime, dbo.tblVehicle.HasGoodsImported, dbo.tblVehicle.ConfirmImportBy,
dbo.tblVehicle.ConfirmExportBy, dbo.tblVehicle.ConfirmLocalImportBy, dbo.tblDeclaration.DeclarationID, dbo.tblDeclaration.Number, dbo.tblDeclaration.ProductName,
dbo.tblDeclaration.CompanyName, dbo.tblDeclaration.ProductAmount, dbo.tblDeclaration.Unit, dbo.tblDeclaration.CreatedByID, dbo.tblDeclaration.ModifiedByID,
dbo.tblDeclaration.ModifiedDate, dbo.tblDeclaration.CreatedDate, dbo.tblDeclaration.HasDeclaration, dbo.tblDeclaration.Type, dbo.tblDeclaration.CompanyCode,
dbo.tblDeclaration.RegisterDate, dbo.tblDeclaration.DeclarationType, dbo.fn_GetNameById(dbo.tblVehicle.ConfirmExportBy) AS ConfirmExportByName,
dbo.fn_GetNameById(dbo.tblVehicle.ConfirmImportBy) AS ConfirmImportByName, dbo.fn_GetNameById(dbo.tblVehicle.ConfirmLocalImportBy)
AS ConfirmLocalImportByName, dbo.tblDeclaration.ConfirmStatus, dbo.tblDeclaration.ConfirmDate, dbo.tblVehicle.Parking, dbo.tblVehicle.ParkingDate,
dbo.tblDeclaration.Money, dbo.tblDeclaration.DateHandover, dbo.tblDeclaration.Seal, dbo.tblDeclaration.GateExport, dbo.tblDeclaration.DateReturn,
dbo.tblDeclaration.NumberHandover, dbo.tblDeclaration.RegisterPlace, dbo.tblDeclaration.TypeOption, dbo.tblDeclaration.NumberTemp
FROM dbo.tblVehicle INNER JOIN
dbo.tblDeclarationVehicle ON dbo.tblVehicle.VehicleID = dbo.tblDeclarationVehicle.VehicleID INNER JOIN
dbo.tblDeclaration ON dbo.tblDeclarationVehicle.DeclarationID = dbo.tblDeclaration.DeclarationID
WHERE (dbo.tblVehicle.VehicleID IN
(SELECT VehicleID
FROM dbo.tblDeclarationVehicle AS tblDeclarationVehicle_1))
Original comment by tungdt....@gmail.com
on 11 Mar 2012 at 8:49
Original comment by vuongfat
on 11 Mar 2012 at 3:52
Original issue reported on code.google.com by
vuongfat
on 10 Jan 2012 at 4:13