shish il y a 5 ans
Parent
commit
fa369019af
1 fichiers modifiés avec 74 ajouts et 0 suppressions
  1. 74 0
      sql.sql

+ 74 - 0
sql.sql

@@ -1759,3 +1759,77 @@ ALTER TABLE xhGhsPurchaseOrder MODIFY `status` TINYINT NOT NULL DEFAULT 1 COMMEN
 ALTER TABLE xhSjExtend RENAME TO xhSjExt;
 ALTER TABLE xhApplyExtend RENAME TO xhApplyExt;
 
+==========
+==shish 2021-03-27
+ALTER TABLE `xhStatYj` DROP INDEX `yj`;
+ALTER TABLE `xhStatYj` ADD UNIQUE INDEX `yj`(`shopId`,`time`);
+ALTER TABLE `xhStatYjMonth` DROP INDEX `yj`;
+ALTER TABLE `xhStatYjMonth` ADD UNIQUE INDEX `yj`(`shopId`,`time`);
+ALTER TABLE `xhGhsStatYj` DROP INDEX `yj`;
+ALTER TABLE `xhGhsStatYj` ADD UNIQUE INDEX `yj`(`shopId`,`time`);
+ALTER TABLE `xhGhsStatYjMonth` DROP INDEX `yj`;
+ALTER TABLE `xhGhsStatYjMonth` ADD UNIQUE INDEX `yj`(`shopId`,`time`);
+
+DROP TABLE IF EXISTS `xhStatYj`;
+CREATE TABLE IF NOT EXISTS `xhStatYj` (
+  `id` INT(11) NOT NULL AUTO_INCREMENT,
+  `time` INT(11) NOT NULL DEFAULT '0' COMMENT '时间戳',
+  `amount` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '开单金额',
+  `totalAmount` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '总金额',
+  `num` INT(11) NOT NULL DEFAULT '0' COMMENT '开单数量',
+  `totalNum` INT(11) NOT NULL DEFAULT '0' COMMENT '总数量',
+  `sjId` INT(11) NOT NULL DEFAULT '0' COMMENT '商家id',
+  `shopId` INT(11) NOT NULL DEFAULT '0' COMMENT '门店id',
+  `shopAdminId` INT(11) NOT NULL DEFAULT '0' COMMENT '员工id',
+  `addTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `yj` (`shopId`,`shopAdminId`,`time`)
+) COMMENT='员工每天开单业绩';
+DROP TABLE IF EXISTS `xhStatYjMonth`;
+CREATE TABLE IF NOT EXISTS `xhStatYjMonth` (
+  `id` INT(11) NOT NULL AUTO_INCREMENT,
+  `time` INT(11) NOT NULL DEFAULT '0' COMMENT '月份',
+  `year` SMALLINT(6) NOT NULL DEFAULT '0' COMMENT '年',
+  `month` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '月份',
+  `amount` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '开单金额',
+  `totalAmount` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '总金额',
+  `num` INT(11) NOT NULL DEFAULT '0' COMMENT '开单数量',
+  `totalNum` INT(11) NOT NULL DEFAULT '0' COMMENT '总数量',
+  `sjId` INT(11) NOT NULL DEFAULT '0' COMMENT '商家id',
+  `shopId` INT(11) NOT NULL DEFAULT '0' COMMENT '门店id',
+  `shopAdminId` INT(11) NOT NULL DEFAULT '0' COMMENT '员工id',
+  `addTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `yj` (`shopId`,`shopAdminId`,`time`)
+)COMMENT='员工每月开单业绩';
+DROP TABLE IF EXISTS `xhGhsStatYj`;
+CREATE TABLE IF NOT EXISTS `xhGhsStatYj` (
+  `id` INT(11) NOT NULL AUTO_INCREMENT,
+  `time` INT(11) NOT NULL DEFAULT '0' COMMENT '时间戳',
+  `amount` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '开单金额',
+  `totalAmount` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '总金额',
+  `num` INT(11) NOT NULL DEFAULT '0' COMMENT '开单数量',
+  `totalNum` INT(11) NOT NULL DEFAULT '0' COMMENT '总数量',
+  `sjId` INT(11) NOT NULL DEFAULT '0' COMMENT '商家id',
+  `shopId` INT(11) NOT NULL DEFAULT '0' COMMENT '门店id',
+  `shopAdminId` INT(11) NOT NULL DEFAULT '0' COMMENT '员工id',
+  `addTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `yj` (`shopId`,`shopAdminId`,`time`)
+)COMMENT='员工每天开单业绩';
+DROP TABLE IF EXISTS `xhGhsStatYjMonth`;
+CREATE TABLE IF NOT EXISTS `xhGhsStatYjMonth` (
+  `id` INT(11) NOT NULL AUTO_INCREMENT,
+  `time` INT(11) NOT NULL DEFAULT '0' COMMENT '月份',
+  `year` SMALLINT(6) NOT NULL DEFAULT '0' COMMENT '年',
+  `month` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '月份',
+  `amount` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '开单金额',
+  `totalAmount` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '总金额',
+  `num` INT(11) NOT NULL DEFAULT '0' COMMENT '开单数量',
+  `totalNum` INT(11) NOT NULL DEFAULT '0' COMMENT '总数量',
+  `sjId` INT(11) NOT NULL DEFAULT '0' COMMENT '商家id',
+  `shopId` INT(11) NOT NULL DEFAULT '0' COMMENT '门店id',
+  `shopAdminId` INT(11) NOT NULL DEFAULT '0' COMMENT '员工id',
+  `addTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
+  PRIMARY KEY (`id`)
+) COMMENT='员工每月开单业绩';