sap.sql 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. ALTER TABLE `pasture`
  2. ADD COLUMN `empId` int NULL COMMENT '供应负责人';
  3. ALTER TABLE `diesel`
  4. ADD COLUMN `sort` int(11) DEFAULT NULL;
  5. ALTER TABLE `diesel`
  6. ADD COLUMN `oilType` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '柴油类型 0: 空 1: 0# 2: -10# 3: -20# 4: -30# 5: -35#';
  7. ALTER TABLE `diesel`
  8. ADD COLUMN `oilName` varchar(255) NOT NULL DEFAULT '' COMMENT '柴油类型名称';
  9. ALTER TABLE `diesel`
  10. ADD COLUMN`dieselCode` varchar(50) DEFAULT NULL;
  11. ALTER TABLE `diesel`
  12. ADD COLUMN
  13. `ProofCode` varchar(50) DEFAULT NULL;
  14. CREATE TABLE `diesel_off` (
  15. `id` int(11) NOT NULL,
  16. `pastureId` int(11) NOT NULL COMMENT '牧场ID',
  17. `deptId` int(11) DEFAULT NULL,
  18. `eqId` int(11) DEFAULT NULL COMMENT '备件编号',
  19. `eqCode` varchar(100) DEFAULT NULL,
  20. `oilcardId` int(11) DEFAULT NULL,
  21. `cardNumber` varchar(200) NOT NULL COMMENT '卡号',
  22. `oilClass` varchar(100) DEFAULT NULL COMMENT '加油工班',
  23. `oilAmount` decimal(20,2) DEFAULT NULL COMMENT '油量',
  24. `nowPrice` decimal(10,2) DEFAULT NULL COMMENT '本次金额',
  25. `price` decimal(10,2) DEFAULT NULL COMMENT '单价',
  26. `empId` varchar(100) DEFAULT NULL COMMENT '上班加油工',
  27. `inputId` int(11) DEFAULT NULL COMMENT '录入人',
  28. `selTime` varchar(100) DEFAULT NULL COMMENT '交易时间',
  29. `note` varchar(255) DEFAULT NULL COMMENT '备注',
  30. `ProofCode` varchar(50) DEFAULT NULL,
  31. `oilType` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '柴油类型 0: 空 1: 0# 2: -10# 3: -20# 4: -30# 5: -35#',
  32. `oilName` varchar(255) NOT NULL DEFAULT '' COMMENT '柴油类型名称',
  33. `dieselCode` varchar(50) DEFAULT NULL,
  34. `sort` int(11) DEFAULT NULL,
  35. `createTime` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  36. PRIMARY KEY (`id`) USING BTREE,
  37. KEY `selTime` (`selTime`) USING BTREE
  38. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  39. -- 水费
  40. insert into feequery(pastureId,RBUKRS,WERKS,FYLX,GJAHR,POPER,HSL,Date)
  41. select pastureId,p.company_code,p.factory_code,"水费", date_format(date ,'%Y'),date_format(date ,'%m'), sum(sumPrice) sumPrice, date_format(date ,'%Y-%m') from water join pasture p on p.id = pastureId where date_format(date ,'%Y') = '2022'
  42. group by pastureId,date_format(date ,'%Y-%m')
  43. -- 电费
  44. insert into feequery(pastureId,RBUKRS,WERKS,FYLX,GJAHR,POPER,HSL,Date)
  45. select pastureId,p.company_code,p.factory_code,"电费", date_format(date ,'%Y'),date_format(date ,'%m'), sum(sumPrice) sumPrice, date_format(date ,'%Y-%m') from electricity join pasture p on p.id = pastureId where date_format(date ,'%Y') = '2022'
  46. group by pastureId,date_format(date ,'%Y-%m')
  47. -- 燃动费
  48. insert into feequery(pastureId,RBUKRS,WERKS,FYLX,GJAHR,POPER,HSL,Date)
  49. select pastureId,p.company_code,p.factory_code,"燃动费", date_format(selTime ,'%Y'),date_format(selTime ,'%m'), sum(nowPrice) sumPrice, date_format(selTime ,'%Y-%m') from diesel join pasture p on p.id = pastureId where date_format(selTime ,'%Y') = '2022'
  50. group by pastureId,date_format(selTime ,'%Y-%m')
  51. ALTER TABLE `eq`.`equipment`
  52. ADD COLUMN `deptId` varchar(30) NULL COMMENT '成本部门' AFTER `levelthreeTime`;
  53. ALTER TABLE `eq`.`maintain`
  54. ADD COLUMN `remark` varchar(255) NULL COMMENT '备注' AFTER `outsourcing`;
  55. ALTER TABLE `equipment`
  56. ADD COLUMN `duration` decimal(15, 2) NULL COMMENT '标准时长' AFTER `license`,
  57. ADD COLUMN `pushStatus` tinyint(1) NOT NULL DEFAULT 0 COMMENT ' 0 报废 1 新增 2 更新' AFTER `duration`
  58. -----------------------------------
  59. ALTER TABLE `partpurchase`
  60. ADD COLUMN `reject` tinyint(1) NOT NULL DEFAULT 0 COMMENT ' 1 驳回' AFTER `ContractVarianceItem`,
  61. ADD COLUMN `departmentId` int NULL COMMENT '部门' AFTER `reject`
  62. ALTER TABLE `partpurchase`
  63. ADD COLUMN `date` datetime NULL COMMENT '申购时间' AFTER `explain`
  64. ALTER TABLE `partpurchase`
  65. ADD COLUMN `employeId` int NULL COMMENT '申购人' AFTER `date`
  66. ALTER TABLE `bigpartpurchase`
  67. ADD COLUMN `positionId` int NULL COMMENT '职能中心' AFTER `financedate`,
  68. ADD COLUMN `positiondate` datetime NULL AFTER `positionId`
  69. ALTER TABLE `bigacceptance`
  70. ADD COLUMN `remark` varchar(100) NULL COMMENT '备注' AFTER `isAcceptance`
  71. ALTER TABLE `bigpartpurchase`
  72. ADD COLUMN `isMilk` tinyint(1) NOT NULL DEFAULT 0 COMMENT '1 奶厅' AFTER `positiondate`;
  73. ---------------------------
  74. ALTER TABLE `eq`.`equipment`
  75. ADD COLUMN `work` varchar(30) NULL COMMENT '工作类别' AFTER `pushStatus`;
  76. ALTER TABLE buydetail
  77. ADD COLUMN `reportery` decimal(12, 2) NOT NULL DEFAULT 0 COMMENT '库存' AFTER `rowNumber`;