三元财务API

档案物资管理建表.sql 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. --创建档案物资表关联客户CustomeBaseNew表中的客户编号
  2. create table archives
  3. (
  4. id int identity primary key , --编号
  5. A_archiveCode nvarchar(100),--关联客户表中的F_CustomerCode客户编号 关联显示客户名称
  6. A_archiveName nvarchar(100),--物资名称
  7. A_archiveState int , --物资状态 关联物质状态表中的主键id
  8. A_archivePeople nvarchar(50), --操作者谁登陆的就填谁
  9. fileid int --附件编号
  10. )
  11. --创建物资状态表
  12. create table archivestate
  13. (
  14. id int identity primary key , --状态id
  15. stateName nvarchar(20) --状态名称
  16. )
  17. --添加状态信息
  18. insert into archivestate(stateName) values('在库');
  19. insert into archivestate(stateName) values('借阅中');
  20. insert into archivestate(stateName) values('已出库');
  21. insert into archivestate(stateName) values('丢失');
  22. --创建外部客户操作表
  23. create table customerBorrow
  24. (
  25. id int identity primary key , --id
  26. archivesid int , --物品编号 关联档案物资 借阅物品名称
  27. BorrowOreturn nvarchar(20), --区分借阅还是归还
  28. BorrowDate datetime, --物品借阅时间
  29. BorrowPeople nvarchar(50) --借阅人/归还人
  30. )
  31. --创建内部员工操作表
  32. create table insideOperation --内部操作
  33. (
  34. id int identity primary key , --id
  35. archivesid int , --物品编号 关联档案物资 入库名称
  36. Warehousing nvarchar(20), --区分出库与入库
  37. WarehousingDate datetime,--出入库时间
  38. Operator nvarchar(50) --操作人
  39. )
  40. --创建操作记录表
  41. create table Operationlog --操作日志
  42. (
  43. id int identity primary key , --id
  44. archivesid int , --关联物资表id
  45. Operator nvarchar(50), --操作人
  46. OperationContent nvarchar(100),--操作内容
  47. OperationDate datetime --操作时间
  48. )
  49. select * from archives
  50. --查询物资状态信息
  51. select * from archivestate
  52. select * from customerBorrow
  53. select * from Operationlog