我在angular6中使用setInterval,但是不起作用,请帮忙。 setInterval中的代码永远不会执行
CREATE TABLE `categories` (
`id` int(11) NOT NULL,
`name` varchar(55) NOT NULL,
`parent_id` int(11) NOT NULL,
`slug` varchar(255) NOT NULL,
`description` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `categories` (`id`, `name`, `parent_id`, `slug`, `description`) VALUES
(1, 'Hotel and Tourism', 0, 'hotel-and-tourism', 'Hotel and Tourism'),
(2, 'Agriculture ', 0, 'agriculture', 'Agriculture'),
(3, 'Construction', 0, 'construction', 'Construction'),
(4, 'Industry', 0, 'industry', 'industry'),
(5, 'Mining', 0, 'mining', 'Mining'),
(6, 'Social Services', 0, 'social-services', 'Social Services'),
CREATE TABLE `investments` (
`investment_id` int(11) NOT NULL,
`permit_number` varchar(20) NOT NULL,
`project_name` varchar(255) DEFAULT NULL,
`category` int(11) NOT NULL,
`subcategory` int(11) NOT NULL,
`subsubcategory` int(11) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`office_id` int(11) NOT NULL,
`investor_id` int(11) NOT NULL,
`local_agent` tinyint(1) NOT NULL DEFAULT '0',
`location` varchar(50) NOT NULL,
`woreda_id` int(11) NOT NULL,
`is_fedral_permit` tinyint(1) NOT NULL DEFAULT '0',
`budget_year` date NOT NULL,
`transfer_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `investments` (`investment_id`, `permit_number`, `project_name`, `category`, `subcategory`, `subsubcategory`, `user_id`, `office_id`, `investor_id`, `local_agent`, `location`, `woreda_id`, `is_fedral_permit`, `budget_year`, `transfer_id`) VALUES
(1, 'ኣክ-ኢን-ኢ/2019/0004', 'AS Machinery Rent', 3, 23, NULL, 2, 5, 4, 1, 'Donbosko', 4, 0, '2019-06-02', NULL),
(2, 'ELA-IP/022566/05', 'RSM Hotel', 1, 19, NULL, 2, 5, 2, 1, 'Mekelle', 1, 0, '2019-05-27', NULL),
(3, 'እወ/ኢ/ማ/2019/0006', 'Glass Factory', 3, 23, NULL, 3, 4, 5, 0, 'Daba Guna', 3, 0, '2019-06-16', NULL),
(4, 'ELA-IP/022566/06', 'Gene Gerea Hotel', 1, 7, 35, 2, 5, 4, 1, 'Hawelti', 1, 0, '2018-04-16', NULL),
(7, 'ኣክ-ኢን-ኢ/2019/0010', 'Aluminum Factory ', 2, 26, NULL, 2, 5, 5, 0, 'Hawelti', 2, 0, '2019-06-15', NULL),
(8, '2019/0000', 'Machinery rent', 3, 23, NULL, 2, 5, 7, 0, '17 kebele', 1, 0, '2019-07-11', NULL),
(9, '2019/0000', 'Amnu Reals Estat', 6, 54, 57, 2, 5, 9, 0, 'Mekelle', 3, 0, '2019-07-12', NULL);
CREATE TABLE `investment_details` (
`investment_detailed_id` int(11) NOT NULL,
`investment_id` int(11) NOT NULL,
`old_annual_amount_value` float DEFAULT NULL,
`company_type_id` tinyint(4) NOT NULL,
`asset_capital` float NOT NULL,
`project_details` text NOT NULL,
`land_expenses` float NOT NULL,
`equipment_machinery` float NOT NULL,
`loan` float DEFAULT NULL,
`working_capital` float NOT NULL,
`self_inital` float NOT NULL,
`permanent_male` int(11) NOT NULL,
`permanent_female` int(11) NOT NULL,
`temporary_male` int(11) NOT NULL,
`temporary_female` int(11) NOT NULL,
`start_date` date NOT NULL,
`power` varchar(50) DEFAULT NULL,
`Water` varchar(50) DEFAULT NULL,
`other` varchar(255) DEFAULT NULL,
`land_type_id` tinyint(4) DEFAULT NULL,
`lease` varchar(30) DEFAULT NULL,
`old_usage` varchar(30) DEFAULT NULL,
`from_government` varchar(30) DEFAULT NULL,
`from_farmers` varchar(30) DEFAULT NULL,
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
`user_id` int(11) NOT NULL,
`transfer_id` int(11) DEFAULT NULL,
`is_transferred` tinyint(1) DEFAULT '0',
`joint_share` varchar(20) DEFAULT NULL,
`actual_investment_amount` float DEFAULT NULL,
`actual_permanent_male_employment` int(11) DEFAULT NULL,
`actual_permanent_female_employment` int(11) DEFAULT NULL,
`actual_temporary_male_employment` int(11) DEFAULT NULL,
`actual_temporary_female_employment` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `investment_details` (`investment_detailed_id`, `investment_id`, `old_annual_amount_value`, `company_type_id`, `asset_capital`, `project_details`, `land_expenses`, `equipment_machinery`, `loan`, `working_capital`, `self_inital`, `permanent_male`, `permanent_female`, `temporary_male`, `temporary_female`, `start_date`, `power`, `Water`, `other`, `land_type_id`, `lease`, `old_usage`, `from_government`, `from_farmers`, `created_at`, `updated_at`, `user_id`, `transfer_id`, `is_transferred`, `joint_share`, `actual_investment_amount`, `actual_permanent_male_employment`, `actual_permanent_female_employment`, `actual_temporary_male_employment`, `actual_temporary_female_employment`) VALUES
(1, 1, 0, 1, 1, '<p>asdad</p>', 1, 1, NULL, 1, 4, 1, 1, 0, 0, '0000-00-00', NULL, NULL, NULL, 1, '0', '0', '', '', '2018-06-10 17:10:44', '2019-06-10 17:10:44', 2, NULL, 0, '20000', 20000000, 100, 100, 100, 100),
(2, 2, 0, 1, 2000, '<p>this is a 4 star hotel </p>', 2000, 2000, 3000, 2000, 5000, 10, 5, 2, 2, '0000-00-00', NULL, NULL, NULL, 1, '23', '', '', '', '2019-06-10 18:11:01', '2019-06-10 18:11:01', 2, NULL, 0, '', 10000000, 45, 20, 10, 5),
(3, 3, 0, 1, 25000000, '<p>this is a sole project </p>', 30000000, 100000, 31000000, 5000000, 30000000, 3000, 200, 100, 0, '0000-00-00', NULL, NULL, NULL, 1, '140', '', '', '', '2019-06-10 19:58:02', '2019-07-12 16:09:46', 3, NULL, 0, '', 36666700, 10, 10, 10, 10),
(4, 4, 0, 1, 12000, '<p>Testing Genet Gerea</p>', 120000, 12000, NULL, 12000, 480000, 21, 12, 0, 0, '2019-10-30', NULL, NULL, NULL, 1, '200', '', '', '', '2019-06-10 23:31:55', '2019-06-10 23:31:55', 2, NULL, 0, '211231321', NULL, NULL, NULL, NULL, NULL),
(5, 1, NULL, 2, 1500000, 'this is a third phase of the project ABC trading', 2000000, 2000000, NULL, 200000, 6000000, 250, 250, 10, 5, '2024-11-20', NULL, NULL, NULL, 1, '200', '', '', '', '2019-06-11 23:20:01', '2019-06-11 23:20:01', 2, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(6, 1, NULL, 2, 20, 'this is a second phase of the project ABC trading', 20, 20, 20000000, 20, 100000, 2000, 2000, 200, 200, '0000-00-00', NULL, NULL, NULL, 1, '500', '', '', '', '2019-06-13 00:34:32', '2019-06-13 00:34:32', 2, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(9, 7, 0, 1, 30, '<p>Aluminum and Metal Factory</p>', 30, 30, 0, 30, 1200, 30, 30, 20, 20, '2025-07-24', NULL, NULL, NULL, 1, '30', '', '', '', '2019-06-15 10:44:46', '2019-06-15 12:07:36', 2, NULL, 0, '', NULL, NULL, NULL, NULL, NULL),
(10, 8, NULL, 1, 0, '', 0, 2500000, 1000000, 0, 1500000, 2, 0, 0, 0, '2019-08-03', NULL, NULL, NULL, 0, '', '', '', '', '2019-07-11 18:01:03', '2019-07-11 18:01:03', 2, NULL, 0, '', NULL, NULL, NULL, NULL, NULL),
(11, 9, NULL, 1, 4000000, '<p>project description goes here</p>', 100000, 3000000, 100000, 1000000, 8000000, 20, 16, 10, 6, '2024-07-12', NULL, NULL, NULL, 1, '2', '', '', '', '2019-07-12 10:47:29', '2019-07-12 10:47:29', 2, NULL, 0, '', NULL, NULL, NULL, NULL, NULL);
CREATE TABLE `investment_status` (
`investment_status_id` int(11) NOT NULL,
`project_status_id` int(11) NOT NULL,
`time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`investment_detailed_id` int(11) NOT NULL,
`reason_for_cancellation` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `investment_status` (`investment_status_id`, `project_status_id`, `time`, `investment_detailed_id`, `reason_for_cancellation`) VALUES
(1, 1, '2019-06-10 17:10:44', 1, NULL),
(3, 1, '2019-06-10 18:11:01', 2, NULL),
(4, 3, '2019-06-17 16:25:37', 2, ''),
(5, 1, '2019-06-10 19:58:02', 3, NULL),
(6, 1, '2019-06-10 23:31:55', 4, NULL),
(8, 1, '2019-06-15 10:27:00', 7, NULL),
(9, 1, '2019-06-15 10:31:07', 8, NULL),
(10, 1, '2019-06-15 10:44:46', 9, NULL),
(12, 2, '2019-06-18 15:40:39', 3, ' '),
(13, 3, '2019-06-18 16:13:23', 3, ' '),
(14, 3, '2019-06-22 09:56:20', 1, ' '),
(15, 1, '2019-07-11 18:01:03', 10, NULL),
(16, 1, '2019-07-12 10:47:29', 11, NULL);
CREATE TABLE `investors` (
`investor_id` int(11) NOT NULL,
`full_name` varchar(255) DEFAULT NULL,
`company_name` varchar(255) DEFAULT NULL,
`sex` varchar(10) DEFAULT NULL,
`nationality` varchar(5) DEFAULT NULL,
`company_ownership_type_id` tinyint(4) NOT NULL,
`established_place` varchar(50) DEFAULT NULL,
`investment_ownership_type_id` tinyint(4) NOT NULL,
`project_type_id` tinyint(4) NOT NULL,
`diaspora` tinyint(1) NOT NULL DEFAULT '0',
`user_id` int(11) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `investors` (`investor_id`, `full_name`, `company_name`, `sex`, `nationality`, `company_ownership_type_id`, `established_place`, `investment_ownership_type_id`, `project_type_id`, `diaspora`, `user_id`, `created_at`, `updated_at`) VALUES
(1, 'Girmangus Hailu', 'Rackmitn system PLC', 'male', 'US', 2, 'Mekelle', 2, 2, 0, 0, '2019-06-10 09:29:39', '2019-06-10 09:29:39'),
(2, 'Girmangus', 'Rackmitn System', 'male', 'ET', 1, '', 1, 2, 0, 0, '2019-06-10 09:29:39', '2019-06-10 09:29:39'),
(3, 'IBM', 'IBM', '', 'ET', 2, 'Axum', 2, 2, 1, 0, '2019-06-10 09:29:39', '2019-06-10 09:29:39'),
(4, 'ABC Trading', 'ABC Trading', '', 'ET', 2, 'Mekelle', 3, 2, 0, 2, '2019-06-10 09:29:39', '2019-06-10 09:29:39'),
(5, 'Yemane Gidey', 'Yemane Gidey PLC', 'male', 'ET', 1, '', 1, 2, 0, 0, '2019-06-10 19:51:05', '2019-06-10 19:51:05'),
(6, 'Afework Hailu', 'Af Waters Works', 'male', 'SD', 1, '', 1, 2, 0, 3, '2019-06-10 21:54:08', '2019-06-10 21:54:08'),
(7, 'Abrahm Gebregiories', 'Abrahm Gebregiories PLc', 'male', 'ET', 1, '', 1, 2, 0, 2, '2019-07-11 12:03:55', '2019-07-11 12:03:55'),
(9, 'Amanuel Yohannes', 'Amanuel Yohannes plc', 'male', 'ET', 1, '', 2, 2, 1, 2, '2019-07-12 10:39:55', '2019-07-12 10:39:55'),
(10, 'Tsegabirhan Hailu', 'Tsegabirhan Hailu Trading', NULL, NULL, 0, NULL, 0, 0, 0, 0, '2019-07-15 23:56:24', '2019-07-15 23:56:24'),
(11, 'Tsegabirhan Hailu', 'tsegabirhan plc', NULL, NULL, 0, NULL, 0, 0, 0, 0, '2019-07-16 09:29:38', '2019-07-16 09:29:38');
CREATE TABLE `project_status` (
`project_status_id` int(11) NOT NULL,
`project_status_name` varchar(30) NOT NULL,
`project_description` varchar(255) DEFAULT NULL,
`project_status_name_tg` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `project_status` (`project_status_id`, `project_status_name`, `project_description`, `project_status_name_tg`) VALUES
(1, 'Pre Implementation', 'Operational', 'Pre Implementation'),
(2, 'Implementation', NULL, 'Implementation'),
(3, 'Operational', NULL, 'Operational'),
(4, 'Inactive', NULL, 'Inactive'),
(5, 'Cancellation', NULL, 'Cancellation');
select c.id, c.name, sum(i.sex='male') as male, sum(i.sex='female') as female, sum(i.company_ownership_type_id !=1) as other,count(iv.investment_id) as total from categories c left join investments iv on c.id=iv.category join investors i on iv.investor_id=i.investor_id join investment_details d on iv.investment_id=d.investment_detailed_id join investment_status iss on d.investment_detailed_id=iss.investment_detailed_id where iv.office_id=5 GROUP by c.id