
-- 添加是否可预约字段
ALTER TABLE `fund_info`
	ADD COLUMN `type` INT(3) NOT NULL DEFAULT '0' COMMENT '是否可预约 0:不可预约 1:可预约' AFTER `fund_type`;

ALTER TABLE `fund_count`
	ADD COLUMN `substrategy` INT(4) NULL DEFAULT NULL COMMENT '融智子策略分类:1010-主观多头 1020-股票多空 1030-量化多头 2010-宏观策略 3010-主观趋势 3020-主观套利 3030-量化趋势 3040-量化套利 3050-管理期货复合 4010-并购重组 4020-定向增发 4030-大宗交易 4040-事件驱动复合 5010-股票市场中性 5020-套利 5030-相对价值复合 6010-纯债策略 6020-强债策略 6030-固收复合 7010-MOM 7020-FOF 8010-主观多策略 8020-量化多策略 -1-其他策略\'' AFTER `strategy`,
	ADD COLUMN `type` INT(3) NOT NULL DEFAULT '0' COMMENT '是否可预约 0:不可预约 1:可预约' AFTER `substrategy`;

update fund_count t set t.type = 1 where t.fund_id in(select id from fund_info t1 where t1.`type` = 1);

-- 更新表数据
update fund_count t,fund_info t1 set t.substrategy = t1.substrategy where t.fund_id = t1.id;

-- 常量数据准备 fatools
INSERT INTO `sys_constant` (`id`, `constant_group`, `constant_code`, `constant_name`, `constant_value`, `constant_description`, `org_id`, `create_time`, `create_by`, `update_time`, `update_by`, `delete_tag`, `cd_paixu`, `cd_show`) VALUES (''tamp_pro_sub_1'', ''tampsubstrategy'', ''1010'', ''主观多头'', ''1010'', NULL, NULL, ''2020-10-16 10:19:30'', NULL, ''2020-10-16 10:19:33'', NULL, 0, 1, 0);
INSERT INTO `sys_constant` (`id`, `constant_group`, `constant_code`, `constant_name`, `constant_value`, `constant_description`, `org_id`, `create_time`, `create_by`, `update_time`, `update_by`, `delete_tag`, `cd_paixu`, `cd_show`) VALUES (''tamp_pro_sub_3'', ''tampsubstrategy'', ''1030'', ''量化多头'', ''1030'', NULL, NULL, ''2020-10-16 10:19:30'', NULL, ''2020-10-16 10:19:33'', NULL, 0, 3, 0);
INSERT INTO `sys_constant` (`id`, `constant_group`, `constant_code`, `constant_name`, `constant_value`, `constant_description`, `org_id`, `create_time`, `create_by`, `update_time`, `update_by`, `delete_tag`, `cd_paixu`, `cd_show`) VALUES (''tamp_pro_sub_4'', ''tampsubstrategy'', ''2010'', ''宏观策略'', ''2010'', NULL, NULL, ''2020-10-16 10:19:30'', NULL, ''2020-10-16 10:19:33'', NULL, 0, 4, 0);
INSERT INTO `sys_constant` (`id`, `constant_group`, `constant_code`, `constant_name`, `constant_value`, `constant_description`, `org_id`, `create_time`, `create_by`, `update_time`, `update_by`, `delete_tag`, `cd_paixu`, `cd_show`) VALUES (''tamp_pro_sub_6'', ''tampsubstrategy'', ''3020'', ''主观套利'', ''3020'', NULL, NULL, ''2020-10-16 10:19:30'', NULL, ''2020-10-16 10:19:33'', NULL, 0, 6, 0);
INSERT INTO `sys_constant` (`id`, `constant_group`, `constant_code`, `constant_name`, `constant_value`, `constant_description`, `org_id`, `create_time`, `create_by`, `update_time`, `update_by`, `delete_tag`, `cd_paixu`, `cd_show`) VALUES (''tamp_pro_sub_7'', ''tampsubstrategy'', ''3030'', ''量化趋势'', ''3030'', NULL, NULL, ''2020-10-16 10:19:30'', NULL, ''2020-10-16 10:19:33'', NULL, 0, 7, 0);
INSERT INTO `sys_constant` (`id`, `constant_group`, `constant_code`, `constant_name`, `constant_value`, `constant_description`, `org_id`, `create_time`, `create_by`, `update_time`, `update_by`, `delete_tag`, `cd_paixu`, `cd_show`) VALUES (''tamp_pro_sub_8'', ''tampsubstrategy'', ''3040'', ''量化套利'', ''3040'', NULL, NULL, ''2020-10-16 10:19:30'', NULL, ''2020-10-16 10:19:33'', NULL, 0, 8, 0);
INSERT INTO `sys_constant` (`id`, `constant_group`, `constant_code`, `constant_name`, `constant_value`, `constant_description`, `org_id`, `create_time`, `create_by`, `update_time`, `update_by`, `delete_tag`, `cd_paixu`, `cd_show`) VALUES (''tamp_pro_sub_9'', ''tampsubstrategy'', ''3050'', ''CTA策略'', ''3050'', NULL, NULL, ''2020-10-16 10:19:30'', NULL, ''2020-10-16 10:19:33'', NULL, 0, 9, 0);
INSERT INTO `sys_constant` (`id`, `constant_group`, `constant_code`, `constant_name`, `constant_value`, `constant_description`, `org_id`, `create_time`, `create_by`, `update_time`, `update_by`, `delete_tag`, `cd_paixu`, `cd_show`) VALUES (''tamp_pro_sub_14'', ''tampsubstrategy'', ''5010'', ''市场中性'', ''5010'', NULL, NULL, ''2020-10-16 10:19:30'', NULL, ''2020-10-16 10:19:33'', NULL, 0, 14, 0);
INSERT INTO `sys_constant` (`id`, `constant_group`, `constant_code`, `constant_name`, `constant_value`, `constant_description`, `org_id`, `create_time`, `create_by`, `update_time`, `update_by`, `delete_tag`, `cd_paixu`, `cd_show`) VALUES (''tamp_pro_sub_15'', ''tampsubstrategy'', ''5020'', ''套利策略'', ''5020'', NULL, NULL, ''2020-10-16 10:19:30'', NULL, ''2020-10-16 10:19:33'', NULL, 0, 15, 0);
INSERT INTO `sys_constant` (`id`, `constant_group`, `constant_code`, `constant_name`, `constant_value`, `constant_description`, `org_id`, `create_time`, `create_by`, `update_time`, `update_by`, `delete_tag`, `cd_paixu`, `cd_show`) VALUES (''tamp_pro_sub_16'', ''tampsubstrategy'', ''5030'', ''相对价值复合'', ''5030'', NULL, NULL, ''2020-10-16 10:19:30'', NULL, ''2020-10-16 10:19:33'', NULL, 0, 16, 0);
INSERT INTO `sys_constant` (`id`, `constant_group`, `constant_code`, `constant_name`, `constant_value`, `constant_description`, `org_id`, `create_time`, `create_by`, `update_time`, `update_by`, `delete_tag`, `cd_paixu`, `cd_show`) VALUES (''tamp_pro_sub_17'', ''tampsubstrategy'', ''6010'', ''纯债策略'', ''6010'', NULL, NULL, ''2020-10-16 10:19:30'', NULL, ''2020-10-16 10:19:33'', NULL, 0, 17, 0);
INSERT INTO `sys_constant` (`id`, `constant_group`, `constant_code`, `constant_name`, `constant_value`, `constant_description`, `org_id`, `create_time`, `create_by`, `update_time`, `update_by`, `delete_tag`, `cd_paixu`, `cd_show`) VALUES (''tamp_pro_sub_26'', ''tampsubstrategy'', ''6030'', ''债券策略'', ''6030'', NULL, NULL, ''2020-10-16 10:19:30'', NULL, ''2020-10-16 10:19:33'', NULL, 0, 17, 0);
INSERT INTO `sys_constant` (`id`, `constant_group`, `constant_code`, `constant_name`, `constant_value`, `constant_description`, `org_id`, `create_time`, `create_by`, `update_time`, `update_by`, `delete_tag`, `cd_paixu`, `cd_show`) VALUES (''tamp_pro_sub_22'', ''tampsubstrategy'', ''8010'', ''主观多策略'', ''8010'', NULL, NULL, ''2020-10-16 10:19:30'', NULL, ''2020-10-16 10:19:33'', NULL, 0, 22, 0);
INSERT INTO `sys_constant` (`id`, `constant_group`, `constant_code`, `constant_name`, `constant_value`, `constant_description`, `org_id`, `create_time`, `create_by`, `update_time`, `update_by`, `delete_tag`, `cd_paixu`, `cd_show`) VALUES (''tamp_pro_sub_23'', ''tampsubstrategy'', ''8020'', ''量化多策略'', ''8020'', NULL, NULL, ''2020-10-16 10:19:30'', NULL, ''2020-10-16 10:19:33'', NULL, 0, 23, 0);



