SET FOREIGN_KEY_CHECKS=0;

CREATE TABLE IF NOT EXISTS `t_machine_calculation`  (
  `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  `data_id` varchar(25) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
  `affair_id` int(11) NOT NULL,
  `tagIds` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
  `calculation_condition` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
  `call_time` datetime(0) NOT NULL,
  `calculation_key` varchar(13) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
  `calculation_time` datetime(0) NOT NULL ,
  `calculation_time2` datetime(0) NOT NULL ,
  `product_id` int(11) NOT NULL DEFAULT 0,
  `single_weight` decimal(22, 2) NULL DEFAULT 0.00 ,
  `pipe_weight` decimal(22, 2) NULL DEFAULT 0.00 ,
  `machine_horse` bigint(22) NULL DEFAULT NULL,
  `pan_head_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`calculation_id`, `data_id`) USING BTREE,
  INDEX `call_time`(`call_time`) USING BTREE,
  INDEX ` calculation_value`(`affair_id`, `calculation_key`, `calculation_condition`, `calculation_time`, `product_id`, `tagIds`, `calculation_time2`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS=1;