truncate zt_chart;
INSERT INTO `zt_chart` VALUES (1001,'年度总结-登录次数',1,'card',0,'','','{\"value\": {\"type\": \"agg\", \"field\": \"login\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT sum(t2.login) AS login, `year`, account, realname\r\nFROM zt_user t1 \r\nLEFT JOIN (SELECT count(1) as login, actor, YEAR(`date`) as \'year\' FROM zt_action GROUP BY actor, `year`) t2 on t1.account = t2.actor \r\nWHERE t1.deleted = \'0\'\r\nGROUP BY `year`, account, realname','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1002,'年度总结-操作次数',1,'card',0,'','','{\"value\": {\"type\": \"agg\", \"field\": \"allAction\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT sum(t2.allAction) as allAction, `year` , account, realname\r\nFROM zt_user t1\r\nLEFT JOIN (SELECT count(1) as allAction, actor, YEAR(`date`) as \'year\' FROM zt_action GROUP BY actor, `year`) t2 on t1.account = t2.actor \r\nWHERE t1.deleted = \'0\'\r\nGROUP BY `year`, account, realname','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1003,'年度总结-消耗工时',1,'card',0,'','','{\"value\": {\"type\": \"agg\", \"field\": \"consumed\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT ROUND(SUM(t2.consumed)) AS consumed, `year` , t1.account, realname\r\nFROM zt_user t1\r\nLEFT JOIN (SELECT sum(consumed) as consumed, account, YEAR(`date`) as \'year\' FROM zt_effort WHERE deleted = \'0\' GROUP BY account, `year` ) t2 on t1.account = t2.account \r\nWHERE t1.deleted = \'0\'\r\nGROUP BY `year`, t1.account, realname','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1004,'年度总结-待办数',1,'card',0,'','','{\"value\": {\"type\": \"agg\", \"field\": \"todo\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT sum(t2.todo) AS todo,sum(t2.undone) AS undone,sum(t2.done) AS done,t2.`year`, t1.account, realname, dept\r\nFROM zt_user t1\r\nLEFT JOIN (SELECT count(1) AS \'todo\', sum(if((`status` != \'done\'), 1, 0)) AS `undone`, sum(if((`status` = \'done\'), 1, 0)) AS `done`, account, YEAR(`date`) AS \'year\' FROM zt_todo WHERE deleted = \'0\' GROUP BY account, `year`) t2 on t1.account = t2.account \r\nWHERE t1.deleted = \'0\'\r\nGROUP BY t2.`year`, t1.account, realname, dept','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1005,'年度总结-贡献数',1,'card',0,'','','{\"value\": {\"type\": \"agg\", \"field\": \"num\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'select tt.year,tt.actor as account, count(1) as num from (\r\nSELECT YEAR(t1.date) as `year`, t1.actor, t1.objectType, t1.action\r\nfrom zt_action t1\r\nWHERE \r\n(\r\n(t1.objectType = \'bug\' AND t1.action in(\'resolved\',\'opened\',\'closed\',\'activated\') and (select deleted from zt_bug where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'task\' AND t1.action in(\'finished\',\'opened\',\'closed\',\'activated\',\'assigned\') and (select deleted from zt_task where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'story\' AND t1.action in(\'opened\',\'reviewed\',\'closed\') and (select deleted from zt_story where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'execution\' AND t1.action in(\'opened\',\'edited\',\'started\',\'closed\') and (select deleted from zt_project where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'product\' AND t1.action in(\'opened\',\'edited\',\'closed\') and (select deleted from zt_product where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'case\' AND t1.action in(\'opened\',\'run\') and (select deleted from zt_case where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'testtask\' AND t1.action in(\'opened\',\'edited\') and (select deleted from zt_testtask where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'productplan\' AND t1.action in(\'opened\') and (select deleted from zt_productplan where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'release\' AND t1.action in(\'opened\') and (select deleted from zt_release where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'doc\' AND t1.action in(\'created\',\'edited\') and (select deleted from zt_doc where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'build\' AND t1.action in(\'opened\') and (select deleted from zt_build where id = t1.objectID) = \'0\')\r\n)\r\nunion all\r\nSELECT YEAR(t1.date) as `year`, t1.actor, \'code\' as objectType, t1.action from zt_action t1\r\nwhere t1.action in (\'gitcommited\', \'svncommited\') and t1.objectType = \'task\'\r\n) tt group by actor','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1006,'年度总结-贡献数据',1,'bar',0,'','','{\r\n\"xaxis\":[{\"field\":\"objectType\",\"name\":\"对象类型\"}],\r\n\"yaxis\":[{\"type\":\"agg\",\"field\":\"create\",\"agg\":\"sum\",\"name\":\"创建\",\"valOrAgg\":\"sum\"},{\"type\":\"value\",\"field\":\"edit\",\"agg\":\"sum\",\"name\":\"编辑\",\"valOrAgg\":\"sum\"}]\r\n}','[]','',0,NULL,'SELECT t2.year, t1.dept, t2.account, t2.objectType, t2.create, t2.edit\r\nFROM zt_user AS t1\r\nLEFT JOIN\r\n(SELECT \r\n  YEAR(t1.date) AS `year`, t1.actor AS account, \"产品\" AS objectType, \r\n  SUM(IF(t1.action = \'opened\', 1, 0)) AS `create`, \r\n  SUM(IF(t1.action = \'edited\', 1, 0)) AS `edit`\r\nFROM zt_action AS t1 \r\nLEFT JOIN zt_product AS t2 ON t1.objectID = t2.id\r\nWHERE t1.objectType = \'product\' AND t1.action IN (\'opened\', \'edited\') AND t2.deleted = \'0\'\r\nGROUP BY `year`, actor, objectType\r\nUNION ALL\r\nSELECT \r\n  YEAR(t1.date) AS `year`, t1.actor, \"需求\" AS objectType, \r\n  SUM(IF(t1.action = \'opened\', 1, 0)) AS `create`,  \r\n  SUM(IF(t1.action = \'edited\', 1, 0)) AS `edit`\r\nFROM zt_action AS t1 \r\nLEFT JOIN zt_story AS t2 ON t1.objectID = t2.id\r\nWHERE t1.objectType = \'story\' AND t1.action IN (\'opened\', \'edited\') AND t2.deleted = \'0\'\r\nGROUP BY `year`, actor, objectType\r\nUNION ALL\r\nSELECT \r\n  YEAR(t1.date) AS `year`, t1.actor, \"计划\" AS objectType, \r\n  SUM(IF(t1.action = \'opened\', 1, 0)) AS `create`,  \r\n  SUM(IF(t1.action = \'edited\', 1, 0)) AS `edit`\r\nFROM zt_action AS t1 \r\nLEFT JOIN zt_productplan AS t2 ON t1.objectID = t2.id\r\nWHERE t1.objectType = \'productplan\' AND t1.action IN (\'opened\', \'edited\') AND t2.deleted = \'0\'\r\nGROUP BY `year`, actor, objectType\r\nUNION ALL\r\nSELECT \r\n  YEAR(t1.date) AS `year`, t1.actor, \"发布\" AS objectType, \r\n  SUM(IF(t1.action = \'opened\', 1, 0)) AS `create`,  \r\n  SUM(IF(t1.action = \'edited\', 1, 0)) AS `edit`\r\nFROM zt_action AS t1 \r\nLEFT JOIN zt_release AS t2 ON t1.objectID = t2.id\r\nWHERE t1.objectType = \'release\' AND t1.action IN (\'opened\', \'edited\') AND t2.deleted = \'0\'\r\nGROUP BY `year`, actor, objectType\r\nUNION ALL\r\nSELECT \r\n  YEAR(t1.date) AS `year`, t1.actor, \"执行\" AS objectType, \r\n  SUM(IF(t1.action = \'opened\', 1, 0)) AS `create`, \r\n  SUM(IF(t1.action = \'edited\', 1, 0)) AS `edit`\r\nFROM zt_action AS t1 \r\nLEFT JOIN zt_project AS t2 ON t1.objectID = t2.id\r\nWHERE t1.objectType = \'execution\' AND t1.action IN (\'opened\', \'edited\') AND t2.deleted = \'0\' AND t2.type IN (\'sprint\', \'stage\', \'kanban\')\r\nGROUP BY `year`, actor, objectType\r\nUNION ALL\r\nSELECT \r\n  YEAR(t1.date) AS `year`, t1.actor, \"任务\" AS objectType, \r\n  SUM(IF(t1.action = \'opened\', 1, 0)) AS `create`,  \r\n  SUM(IF(t1.action = \'edited\', 1, 0)) AS `edit`\r\nFROM zt_action AS t1 \r\nLEFT JOIN zt_task AS t2 ON t1.objectID = t2.id\r\nWHERE t1.objectType = \'task\' AND t1.action IN (\'opened\', \'edited\') AND t2.deleted = \'0\'\r\nGROUP BY `year`, actor, objectType\r\nUNION ALL\r\nSELECT \r\n  YEAR(t1.date) AS `year`, t1.actor, \'Bug\' AS objectType, \r\n  SUM(IF(t1.action = \'opened\', 1, 0)) AS `create`,  \r\n  SUM(IF(t1.action = \'edited\', 1, 0)) AS `edit`\r\nFROM zt_action AS t1 \r\nLEFT JOIN zt_bug AS t2 ON t1.objectID = t2.id\r\nWHERE t1.objectType = \'bug\' AND t1.action IN (\'opened\', \'edited\') AND t2.deleted = \'0\'\r\nGROUP BY `year`, actor, objectType\r\nUNION ALL\r\nSELECT \r\n  YEAR(t1.date) AS `year`, t1.actor, \"版本\" AS objectType, \r\n  SUM(IF(t1.action = \'opened\', 1, 0)) AS `create`, \r\n  SUM(IF(t1.action = \'edited\', 1, 0)) AS `edit` \r\nFROM zt_action AS t1 \r\nLEFT JOIN zt_build AS t2 ON t1.objectID = t2.id\r\nWHERE t1.objectType = \'build\' AND t1.action IN (\'opened\', \'edited\') AND t2.deleted = \'0\'\r\nGROUP BY `year`, actor, objectType\r\nUNION ALL\r\nSELECT \r\n  YEAR(t1.date) AS `year`, t1.actor, \"用例\" AS objectType, \r\n  SUM(IF(t1.action = \'opened\', 1, 0)) AS `create`,   \r\n  SUM(IF(t1.action = \'edited\', 1, 0)) AS `edit`\r\nFROM zt_action AS t1 \r\nLEFT JOIN zt_case AS t2 ON t1.objectID = t2.id\r\nWHERE t1.objectType = \'case\' AND t1.action IN (\'opened\', \'edited\') AND t2.deleted = \'0\'\r\nGROUP BY `year`, actor, objectType\r\nUNION ALL\r\nSELECT \r\n  YEAR(t1.date) AS `year`, t1.actor, \"测试单\" AS objectType, \r\n  SUM(IF(t1.action = \'opened\', 1, 0)) AS `create`, \r\n  SUM(IF(t1.action = \'edited\', 1, 0)) AS `edit`\r\nFROM zt_action AS t1 \r\nLEFT JOIN zt_testtask AS t2 ON t1.objectID = t2.id\r\nWHERE t1.objectType = \'testtask\' AND t1.action IN (\'opened\', \'edited\') AND t2.deleted = \'0\'\r\nGROUP BY `year`, actor, objectType\r\nUNION ALL\r\nSELECT \r\n  YEAR(t1.date) AS `year`, t1.actor, \"文档\" AS objectType, \r\n  SUM(IF(t1.action = \'opened\', 1, 0)) AS `create`, \r\n  SUM(IF(t1.action = \'edited\', 1, 0)) AS `edit`\r\nFROM zt_action AS t1 \r\nLEFT JOIN zt_doc AS t2 ON t1.objectID = t2.id\r\nWHERE t1.objectType = \'doc\' AND t1.action IN (\'opened\', \'edited\') AND t2.deleted = \'0\'\r\nGROUP BY `year`, actor, objectType) AS t2 ON t1.account = t2.account\r\nWHERE t2.account IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1007,'年度总结-能力雷达图',1,'radar',0,'','','{\r\n\"group\":[{\"field\":\"dimension\",\"name\":\"维度\"}],\r\n\"metric\":[\r\n  {\"type\":\"value\",\"field\":\"num\",\"agg\":\"value\",\"name\": \"产品管理\", \"key\":\"product\",\"valOrAgg\":\"value\"},\r\n  {\"type\":\"value\",\"field\":\"num\",\"agg\":\"value\",\"name\": \"项目管理\", \"key\":\"project\",\"valOrAgg\":\"value\"},\r\n  {\"type\":\"value\",\"field\":\"num\",\"agg\":\"value\",\"name\": \"研发\", \"key\":\"dev\",\"valOrAgg\":\"value\"},\r\n  {\"type\":\"value\",\"field\":\"num\",\"agg\":\"value\",\"name\": \"测试\", \"key\":\"qa\",\"valOrAgg\":\"value\"},\r\n  {\"type\":\"value\",\"field\":\"num\",\"agg\":\"value\",\"name\": \"其他\", \"key\":\"other\",\"valOrAgg\":\"value\"}\r\n]}','[]','',0,NULL,'select tt.year, tt.actor AS account,tt.dimension, count(1) as num from (\r\nSELECT YEAR(t1.date) as `year`, t1.actor, \'product\' as dimension\r\nfrom zt_action t1\r\nWHERE \r\n(\r\n(t1.objectType = \'product\' AND t1.action in(\'opened\',\'edited\') and (select deleted from zt_product where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'story\' AND t1.action in(\'opened\',\'reviewed\',\'closed\') and (select deleted from zt_story where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'productplan\' AND t1.action in(\'opened\') and (select deleted from zt_productplan where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'release\' AND t1.action in(\'opened\') and (select deleted from zt_release where id = t1.objectID) = \'0\')\r\n)\r\nunion all\r\nSELECT YEAR(t1.date) as `year`, t1.actor, \'execution\' as dimension\r\nfrom zt_action t1\r\nWHERE \r\n(\r\n(t1.objectType = \'execution\' AND t1.action in(\'opened\',\'edited\',\'started\',\'closed\') and (select deleted from zt_project where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'build\' AND t1.action in(\'opened\') and (select deleted from zt_build where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'task\' AND t1.action in(\'opened\',\'closed\',\'activated\',\'assigned\') and (select deleted from zt_task where id = t1.objectID) = \'0\')\r\n)\r\nunion all\r\nSELECT YEAR(t1.date) as `year`, t1.actor, \'devel\' as dimension\r\nfrom zt_action t1\r\nWHERE \r\n(\r\n(t1.objectType = \'execution\' AND t1.action in(\'opened\',\'edited\',\'started\',\'closed\') and (select deleted from zt_project where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'build\' AND t1.action in(\'opened\') and (select deleted from zt_build where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'task\' AND t1.action in(\'opened\',\'closed\',\'assigned\') and (select deleted from zt_task where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'task\' and t1.action in (\'gitcommited\', \'svncommited\'))\r\nOR (t1.objectType = \'bug\' AND t1.action in(\'resolved\') and (select deleted from zt_bug where id = t1.objectID) = \'0\')\r\n)\r\nunion all\r\nSELECT YEAR(t1.date) as `year`, t1.actor, \'qa\' as dimension\r\nfrom zt_action t1\r\nWHERE \r\n(\r\n(t1.objectType = \'bug\' AND t1.action in(\'opened\',\'closed\',\'activated\') and (select deleted from zt_bug where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'case\' AND t1.action in(\'opened\',\'run\') and (select deleted from zt_case where id = t1.objectID) = \'0\')\r\nOR (t1.objectType = \'testtask\' AND t1.action in(\'opened\',\'edited\') and (select deleted from zt_testtask where id = t1.objectID) = \'0\')\r\n)\r\n) tt WHERE tt.year != \'0000\'\r\nGROUP BY tt.year, tt.dimension','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1008,'年度总结-迭代数据',1,'table',0,'','','{\"group\":[],\"column\":[\r\n{\"field\":\"name\",\"valOrAgg\":\"value\",\"name\":\"迭代名称\"},{\"field\":\"finishedStory\",\"valOrAgg\":\"value\",\"name\":\"完成需求数\"},\r\n{\"field\":\"finishedTask\",\"valOrAgg\":\"value\",\"name\":\"完成任务数\"},\r\n{\"field\":\"resolvedBug\",\"valOrAgg\":\"value\",\"name\":\"解决Bug数\"}\r\n],\"filter\":[]}','[]','',0,NULL,'SELECT \r\ntt.id, \r\ntt.name, \r\ntt.year, \r\ntt.account,\r\ntt.finishedStory,\r\ntt.finishedTask,\r\ncount(t3.id) as resolvedBug\r\nfrom (\r\nSELECT \r\ntt.id, \r\nt2.name, \r\ntt.year, \r\ntt.account,\r\nSUM(if((t1.story != 0), 1 , 0)) as finishedStory,\r\ncount(t1.id) as finishedTask\r\nfrom (\r\nSELECT \r\n*\r\nfrom (\r\nSELECT id, YEAR(begin) as year, openedBy as account from zt_project\r\nWHERE deleted = \'0\' AND type = \'sprint\' and multiple = \'1\' and YEAR(begin) != \'0000\'\r\nunion all\r\nSELECT id, YEAR(begin) as year, PO as account from zt_project\r\nWHERE deleted = \'0\' AND type = \'sprint\' and multiple = \'1\' and YEAR(begin) != \'0000\'\r\nunion all\r\nSELECT id, YEAR(begin) as year, PM as account from zt_project\r\nWHERE deleted = \'0\' AND type = \'sprint\' and multiple = \'1\' and YEAR(begin) != \'0000\'\r\nunion all\r\nSELECT id, YEAR(begin) as year, QD as account from zt_project\r\nWHERE deleted = \'0\' AND type = \'sprint\' and multiple = \'1\' and YEAR(begin) != \'0000\'\r\nunion all\r\nSELECT id, YEAR(begin) as year, RD as account from zt_project\r\nWHERE deleted = \'0\' AND type = \'sprint\' and multiple = \'1\' and YEAR(begin) != \'0000\'\r\nunion all\r\nSELECT id, YEAR(end) as year, openedBy as account from zt_project\r\nWHERE deleted = \'0\' AND type = \'sprint\' and multiple = \'1\' and YEAR(end) != \'0000\'\r\nunion all\r\nSELECT id, YEAR(end) as year, PO as account from zt_project\r\nWHERE deleted = \'0\' AND type = \'sprint\' and multiple = \'1\' and YEAR(end) != \'0000\'\r\nunion all\r\nSELECT id, YEAR(end) as year, PM as account from zt_project\r\nWHERE deleted = \'0\' AND type = \'sprint\' and multiple = \'1\' and YEAR(end) != \'0000\'\r\nunion all\r\nSELECT id, YEAR(end) as year, QD as account from zt_project\r\nWHERE deleted = \'0\' AND type = \'sprint\' and multiple = \'1\' and YEAR(end) != \'0000\'\r\nunion all\r\nSELECT id, YEAR(end) as year, RD as account from zt_project\r\nWHERE deleted = \'0\' AND type = \'sprint\' and multiple = \'1\' and YEAR(end) != \'0000\'\r\nunion all\r\nSELECT t1.root as id, YEAR(t1.`join`) as year, t1.account from zt_team t1\r\nRIGHT JOIN zt_project t2 on t2.id = t1.root and t2.deleted = \'0\' and t2.type = \'sprint\'\r\nWHERE t1.type = \'execution\' and YEAR(t1.`join`) != \'0000\'\r\nunion all\r\nSELECT t1.execution as id, YEAR(t1.finishedDate) as year, t1.finishedBy as account from zt_task t1\r\nRIGHT JOIN zt_project t2 on t2.id = t1.execution and t2.deleted = \'0\' and t2.type = \'sprint\'\r\nWHERE t1.deleted = \'0\' and YEAR(t1.finishedDate) != \'0000\'\r\n) tt \r\nwhere tt.account != \'\'\r\nGROUP BY tt.id, tt.`year`, tt.account\r\n) tt\r\nLEFT JOIN zt_task t1 on t1.execution = tt.id and YEAR(t1.finishedDate) = tt.year and t1.deleted = \'0\' and t1.finishedBy = tt.account\r\nLEFT JOIN zt_project t2 on t2.id = tt.id\r\nGROUP BY tt.id, tt.`year`, tt.account\r\n) tt\r\nLEFT JOIN zt_bug t2 on t2.resolvedBy = tt.account and YEAR(t2.resolvedDate) = tt.year\r\nleft join zt_build t3 on t2.resolvedBuild = t3.id and t3.execution = tt.id\r\nWHERE t2.deleted = \'0\'\r\nGROUP BY tt.account, tt.`year`, tt.id','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1009,'年度总结-产品数据',1,'table',0,'','','{\"group\":[],\"column\":[\r\n{\"field\":\"name\",\"valOrAgg\":\"value\",\"name\":\"产品名称\"},{\"field\":\"plan\",\"valOrAgg\":\"value\",\"name\":\"计划数\"},\r\n{\"field\":\"requirement\",\"valOrAgg\":\"value\",\"name\":\"创建用户需求数\"},\r\n{\"field\":\"story\",\"valOrAgg\":\"value\",\"name\":\"创建需求数\"},\r\n{\"field\":\"closedStory\",\"valOrAgg\":\"value\",\"name\":\"关闭需求数\"}\r\n],\"filter\":[]}','[]','',0,NULL,'select * from (\r\nselect tt.id, t2.name, tt.year, tt.account, tt.plans, tt.requirement, tt.story, count(t1.id) as closedStory\r\nfrom(\r\n  select tt.id, tt.year, tt.account, tt.plans,\r\nsum(if((type = \'requirement\'), 1, 0)) as requirement,\r\nsum(if((type = \'story\'), 1, 0)) as story\r\nfrom (\r\nselect tt.id, tt.year, tt.account,\r\ncount(t2.id) as plans\r\nfrom (\r\nselect * from (\r\nselect id, YEAR(createdDate) as `year`, createdBy as account from zt_product\r\nwhere deleted = \'0\' and shadow = \'0\'\r\nunion all\r\nselect id, YEAR(createdDate) as `year`, PO as account from zt_product\r\nwhere deleted = \'0\' and shadow = \'0\'\r\nunion all\r\nselect id, YEAR(createdDate) as `year`, QD as account from zt_product\r\nwhere deleted = \'0\' and shadow = \'0\'\r\nunion all\r\nselect id, YEAR(createdDate) as `year`, RD as account from zt_product\r\nwhere deleted = \'0\' and shadow = \'0\'\r\n) tt\r\nWHERE tt.account != \'\' and tt.year != \'0000\'\r\nGROUP BY tt.account, tt.year, tt.id\r\n) tt\r\nLEFT JOIN zt_productplan t1 on t1.product = tt.id\r\nLEFT JOIN zt_action t2 on t1.id = t2.objectID and YEAR(t2.date) = tt.year\r\nand t2.objectType = \'productplan\'\r\nand t1.deleted = \'0\'\r\nand t2.actor = tt.account\r\nand t2.action = \'opened\'\r\nGROUP BY tt.account, tt.year, tt.id) tt\r\nLEFT JOIN zt_story t1 on t1.product = tt.id and YEAR(t1.openedDate) = tt.year and t1.openedBy = tt.account and t1.deleted = \'0\'\r\nGROUP BY tt.account, tt.year, tt.id) tt\r\nLEFT JOIN zt_story t1 on t1.product = tt.id and YEAR(t1.closedDate) = tt.year and t1.closedBy = tt.account and t1.deleted = \'0\'\r\nLEFT JOIN zt_product t2 on t2.id = tt.id\r\nGROUP BY tt.account, tt.year, tt.id) tt\r\nWHERE tt.account = \'zhangpeng\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1010,'年度总结-任务状态分布',1,'pie',0,'','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"任务数\",\"valOrAgg\":\"count\"}]}','[]','',0,NULL,'SELECT\r\nYEAR(t1.date) AS `year`,\r\nt3.account,\r\nt3.realname,\r\nCASE t2.status\r\nWHEN \'wait\' THEN \"未开始\"\r\nWHEN \'doing\' THEN \"进行中\"\r\nWHEN \'done\' THEN \"已完成\"\r\nWHEN \'closed\' THEN \"已关闭\"\r\nELSE \"未设置\" END status,\r\nt1.id\r\nFROM zt_action t1\r\nLEFT JOIN zt_task t2 on t1.objectID=t2.id RIGHT JOIN zt_user t3 on t1.actor=t3.account\r\nWHERE t1.objectType = \'task\'\r\nand t2.deleted = \'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1011,'年度总结-每月任务操作情况',1,'bar',0,'','','{\n  \"xaxis\":[{\"field\":\"actionDate\",\"name\":\"日期\",\"group\":\"value\"}],\n  \"yaxis\":[{\"type\":\"agg\",\"field\":\"opened\",\"agg\":\"sum\",\"name\":\"创建\",\"valOrAgg\":\"sum\"},\n{\"type\":\"agg\",\"field\":\"started\",\"agg\":\"sum\",\"name\":\"开始\",\"valOrAgg\":\"sum\"},\n{\"type\":\"agg\",\"field\":\"finished\",\"agg\":\"sum\",\"name\":\"完成\",\"valOrAgg\":\"sum\"},\n{\"type\":\"agg\",\"field\":\"paused\",\"agg\":\"sum\",\"name\":\"暂停\",\"valOrAgg\":\"sum\"},\n{\"type\":\"agg\",\"field\":\"activated\",\"agg\":\"sum\",\"name\":\"激活\",\"valOrAgg\":\"sum\"},\n{\"type\":\"agg\",\"field\":\"canceled\",\"agg\":\"sum\",\"name\":\"取消\",\"valOrAgg\":\"sum\"},\n{\"type\":\"agg\",\"field\":\"closed\",\"agg\":\"sum\",\"name\":\"关闭\",\"valOrAgg\":\"sum\"}\n]}','[]','',0,NULL,'SELECT t2.opened,t2.started,t2.finished,t2.paused,t2.activated,t2.canceled,t2.closed,t1.account,t2.actionDate,YEAR(CONCAT(t2.actionDate, \'-01\')) AS `year`,realname,t3.`name` AS deptName FROM zt_user AS t1\nLEFT JOIN (\n    SELECT t21.actor,LEFT(t21.`date`,7) AS actionDate,\n    SUM(if(t21.action = \'opened\', 1, 0)) as opened,\n    SUM(if(t21.action = \'started\', 1, 0)) as started,\n    SUM(if(t21.action = \'finished\', 1, 0)) as finished,\n    SUM(if(t21.action = \'paused\', 1, 0)) as paused,\n    SUM(if(t21.action = \'activated\', 1, 0)) as activated,\n    SUM(if(t21.action = \'canceled\', 1, 0)) as canceled,\n    SUM(if(t21.action = \'closed\', 1, 0)) as closed FROM zt_action AS t21\n    LEFT JOIN zt_story AS t22 ON t21.objectID=t22.id\n    WHERE t21.objectType=\'bug\'\n    AND t22.deleted=\'0\'\n    GROUP BY t21.actor,actionDate\n) AS t2 ON t1.account=t2.actor\nLEFT JOIN zt_dept AS t3 ON t1.dept=t3.id\nWHERE t1.deleted=\'0\'\nAND t2.actor IS NOT NULL\nGROUP BY t2.actionDate,deptName,t1.account,realname\n','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1012,'年度总结-需求状态分布',1,'pie',0,'','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"需求数\",\"valOrAgg\":\"count\"}]}','[]','',0,NULL,'SELECT\r\nYEAR(t1.date) AS `year`,\r\nt3.account,\r\nt3.realname,\r\nCASE t2.status\r\nWHEN \'wait\' THEN \"未开始\"\r\nWHEN \'doing\' THEN \"进行中\"\r\nWHEN \'done\' THEN \"已完成\"\r\nWHEN \'colsed\' THEN \"已关闭\"\r\nELSE \"未设置\"\r\nEND status,\r\nt1.id\r\nFROM zt_action t1\r\nLEFT JOIN zt_task t2 on t1.objectID=t2.id RIGHT JOIN zt_user t3 on t1.actor=t3.account\r\nWHERE t1.objectType = \'story\'\r\nand t2.deleted = \'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1013,'年度总结-每月需求操作情况',1,'bar',0,'','','{\n  \"xaxis\":[{\"field\":\"actionDate\",\"name\":\"日期\",\"group\":\"value\"}],\n  \"yaxis\":[{\"type\":\"value\",\"field\":\"opened\",\"agg\":\"value\",\"name\":\"创建\",\"valOrAgg\":\"value\"},\n{\"type\":\"value\",\"field\":\"activated\",\"agg\":\"value\",\"name\":\"激活\",\"valOrAgg\":\"value\"},\n{\"type\":\"value\",\"field\":\"changed\",\"agg\":\"value\",\"name\":\"变更\",\"valOrAgg\":\"value\"},\n{\"type\":\"value\",\"field\":\"closed\",\"agg\":\"value\",\"name\":\"关闭\",\"valOrAgg\":\"value\"}\n]}','[]','',0,NULL,'SELECT t2.opened,t2.activated,t2.closed,t2.`changed`,t1.account,t2.actionDate,YEAR(CONCAT(t2.actionDate,\'-01\')) AS `year`,realname,t3.`name` AS deptName FROM zt_user AS t1\nLEFT JOIN (\n    SELECT t21.actor,LEFT(t21.`date`, 7) AS actionDate,\n    SUM(IF(t21.action=\'opened\',1,0)) AS opened,\n    SUM(IF(t21.action=\'activated\',1,0)) AS activated,\n    SUM(IF(t21.action=\'closed\',1,0)) AS closed,\n    SUM(IF(t21.action=\'changed\',1,0)) AS `changed` FROM zt_action AS t21\n    LEFT JOIN zt_story AS t22 ON t21.objectID=t22.id\n    WHERE t21.objectType=\'story\'\n    AND t22.deleted=\'0\'\n    GROUP BY t21.actor,actionDate\n) AS t2 ON t1.account=t2.actor\nLEFT JOIN zt_dept AS t3 ON t1.dept=t3.id\nWHERE t1.deleted=\'0\'\nAND t2.actor IS NOT NULL\nGROUP BY t2.actionDate,deptName,t1.account,realname\n','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1014,'年度总结-Bug状态分布',1,'pie',0,'','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"Bug数\",\"valOrAgg\":\"count\"}]}','[]','',0,NULL,'SELECT\r\nYEAR(t1.date) AS `year`, t3.account,\r\nt3.realname,\r\nCASE t2.status\r\nWHEN \'wait\' THEN \"未开始\"\r\nWHEN \'doing\' THEN \"进行中\"\r\nWHEN \'done\' THEN \"已完成\"\r\nWHEN \'closed\' THEN \"已关闭\"\r\nELSE \"未设置\"\r\nEND status,\r\nt1.id\r\nFROM zt_action t1\r\nLEFT JOIN zt_task t2 on t1.objectID=t2.id RIGHT JOIN zt_user t3 on t1.actor=t3.account\r\nWHERE t1.objectType = \'bug\'\r\nand t2.deleted = \'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1015,'年度总结-每月Bug操作情况',1,'bar',0,'','','{\n  \"xaxis\":[{\"field\":\"actionDate\",\"name\":\"日期\",\"group\":\"value\"}],\n  \"yaxis\":[{\"type\":\"value\",\"field\":\"opened\",\"agg\":\"value\",\"name\":\"创建\",\"valOrAgg\":\"value\"},\n{\"type\":\"value\",\"field\":\"bugconfirmed\",\"agg\":\"value\",\"name\":\"确认\",\"valOrAgg\":\"value\"},\n{\"type\":\"value\",\"field\":\"activated\",\"agg\":\"value\",\"name\":\"激活\",\"valOrAgg\":\"value\"},\n{\"type\":\"value\",\"field\":\"resolved\",\"agg\":\"value\",\"name\":\"解决\",\"valOrAgg\":\"value\"},\n{\"type\":\"value\",\"field\":\"closed\",\"agg\":\"value\",\"name\":\"关闭\",\"valOrAgg\":\"value\"}\n]}','[]','',0,NULL,'SELECT t2.opened,t2.bugconfirmed,t2.activated,t2.resolved,t2.closed,t1.account,t2.actionDate,YEAR(CONCAT(t2.actionDate, \'-01\')) AS \n`year`,realname,t3.`name` AS deptName FROM zt_user AS t1\nLEFT JOIN (\n    SELECT t21.actor,LEFT(t21.`date`, 7) AS actionDate,\n    SUM(IF(t21.action=\'opened\',1,0)) AS opened,\n    SUM(IF(t21.action=\'bugconfirmed\',1,0)) AS bugconfirmed,\n    SUM(IF(t21.action=\'activated\',1,0)) AS activated,\n    SUM(IF(t21.action=\'resolved\',1,0)) AS resolved,\n    SUM(IF(t21.action=\'closed\',1,0)) AS closed FROM zt_action AS t21\n    LEFT JOIN zt_story AS t22 ON t21.objectID=t22.id\n    WHERE t21.objectType=\'bug\'\n    AND t22.deleted=\'0\'\n    GROUP BY t21.actor,actionDate\n) AS t2 ON t1.account=t2.actor\nLEFT JOIN zt_dept AS t3 ON t1.dept=t3.id\nWHERE t1.deleted=\'0\'\nAND t2.actor IS NOT NULL\nGROUP BY t2.actionDate,deptName,t1.account,realname','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1016,'年度总结-用例结果分布',1,'pie',0,'','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"个数\",\"valOrAgg\":\"count\"}]}','[]','',0,NULL,'SELECT count ,t2.caseResult as status,t2.`year`, t1.account, realname, dept\r\nFROM zt_user t1\r\nLEFT JOIN (\r\n    SELECT t21.lastRunner, YEAR(t21.`date`) as \'year\', t21.caseResult, count(distinct t21.`id`) as count\r\n    FROM zt_testresult t21 \r\n    LEFT JOIN zt_case t22 on t21.case = t22.id\r\n    WHERE t22.deleted = \'0\'\r\n    GROUP BY t21.lastRunner, `year`, t21.caseResult\r\n) t2 on t1.account = t2.lastRunner\r\nWHERE t1.deleted = \'0\'\r\nGROUP BY t2.caseResult,t2.`year`, t1.account, realname, dept','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1017,'年度总结-每月用例操作情况',1,'bar',0,'','','{\r\n  \"xaxis\":[{\"field\":\"actionDate\",\"name\":\"日期\",\"group\":\"value\"}],\r\n  \"yaxis\":[{\"type\":\"value\",\"field\":\"createdCases\",\"agg\":\"value\",\"name\":\"创建\",\"valOrAgg\":\"value\"},\r\n{\"type\":\"value\",\"field\":\"toBugCases\",\"agg\":\"value\",\"name\":\"转Bug\",\"valOrAgg\":\"value\"},\r\n{\"type\":\"value\",\"field\":\"runCases\",\"agg\":\"value\",\"name\":\"执行\",\"valOrAgg\":\"value\"}\r\n]}','[]','',0,NULL,'SELECT SUM(createdCases) AS createdCases, SUM(toBugCases) AS toBugCases, SUM(runCases) AS runCases, YEAR(CONCAT(t2.actionDate, \'-01\')) AS `year`, t1.account, realname, dept\r\nFROM zt_user t1\r\nLEFT JOIN (\r\n    SELECT t21.actor, LEFT(t21.`date`, 7) as actionDate, \r\n    SUM(IF((t22.id IS NOT NULL AND t23.id IS NULL), 1, 0)) AS createdCases, \r\n    SUM(IF((t22.id IS NOT NULL AND t23.id IS NOT NULL), 1, 0)) AS toBugCases, \r\n    SUM(IF((t24.lastRunner = t21.actor AND t21.action = \'run\' AND t21.`date` = t24.`date`), 1, 0)) AS runCases\r\n    FROM zt_action t21 \r\n    LEFT JOIN zt_case t22 on t21.objectID = t22.id\r\n    LEFT JOIN zt_bug t23 on t22.id = t23.case\r\n    LEFT JOIN zt_testresult t24 on t22.id = t24.`case` AND t24.lastRunner = t21.actor AND t21.action = \'run\' AND t21.`date` = t24.`date`\r\n    WHERE t21.objectType = \'case\'\r\n    AND t21.action in (\'opened\', \'run\')\r\n    AND t22.deleted = \'0\'\r\n    AND (t23.deleted = \'0\' OR t23.id IS NULL)\r\n    GROUP BY t21.actor, actionDate\r\n) t2 on t1.account = t2.actor\r\nWHERE t1.deleted = \'0\'\r\nAND t2.actor is not null\r\nGROUP BY t2.actionDate, t1.account, realname, dept','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1018,'宏观数据-一级项目集个数',1,'card',45,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','{}',0,NULL,'SELECT id,name FROM zt_project WHERE type=\'program\' AND parent=0 AND deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1019,'宏观数据-项目个数',1,'card',46,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM zt_project WHERE type=\'project\' AND deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1020,'宏观数据-产品个数',1,'card',47,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM zt_product WHERE deleted=\'0\' AND shadow = \'0\' AND vision = \'rnd\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1021,'宏观数据-计划个数',1,'card',48,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM zt_productplan WHERE deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1022,'宏观数据-执行个数',1,'card',49,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM zt_project WHERE type IN (\'sprint\',\'stage\',\'kanban\') AND deleted=\'0\' AND multiple = \'1\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1023,'宏观数据-发布个数',1,'card',50,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\n\"type\": \"value\"\n}','[]','',0,NULL,'SELECT id FROM zt_release WHERE deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1024,'宏观数据-需求个数',1,'card',51,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM zt_story WHERE deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1025,'宏观数据-任务个数',1,'card',52,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM zt_task WHERE deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1026,'宏观数据-缺陷个数',1,'card',53,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM zt_bug WHERE deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1027,'宏观数据-文档个数',1,'card',54,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM zt_doc WHERE deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1028,'宏观数据-现有人员个数',1,'card',55,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM zt_user WHERE deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1029,'宏观数据-累计消耗工时',1,'card',55,'','','{\"value\": {\"type\": \"agg\", \"field\": \"consumed\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT consumed FROM zt_effort WHERE deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1030,'宏观数据-禅道使用时长',1,'card',58,'','','{\"value\": {\"type\": \"value\", \"field\": \"period\", \"agg\": \"value\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\n\"type\": \"value\"\n}','[]','',0,NULL,'SELECT if(t2.`year` > 0, concat(t2.`year`, \'年\', t2.`day`, \'天\'), concat(t2.`day`, \'天\')) as period from (\nSELECT TIMESTAMPDIFF(YEAR,t1.firstDay,t1.today) AS `year`,DATEDIFF(DATE_SUB(t1.today,INTERVAL TIMESTAMPDIFF(YEAR,t1.firstDay,t1.today) YEAR), t1.firstDay) AS `day`  \nFROM (SELECT MIN(date) AS firstDay, now() AS today FROM zt_action WHERE date > \'1970-01-01\') AS t1\n) t2','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1031,'宏观数据-需求完成率',1,'piecircle',36,'','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"需求数\",\"valOrAgg\":\"count\"}]}','[]','',0,NULL,'SELECT id, IF(closedReason=\'done\', \'done\', \'undone\') AS status FROM zt_story WHERE deleted=\'0\' AND (status != \'closed\' OR closedReason=\'done\')','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1032,'宏观数据-Bug修复率',1,'piecircle',44,'','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"Bug数\",\"valOrAgg\":\"count\"}]}','[]','',0,NULL,'SELECT id, IF(`status`=\'closed\' AND resolution=\'fixed\', \'done\', \'undone\') AS status FROM zt_bug WHERE deleted=\'0\' AND (status = \'active\' OR resolution in (\'fixed\', \'postponed\'))','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1033,'宏观数据-未完成的一级项目集个数',1,'card',45,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM zt_project WHERE type=\'program\' AND `status`!=\'closed\' AND deleted=\'0\' AND grade=\'1\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1034,'宏观数据-未完成的需求',1,'card',51,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM zt_story WHERE `status`!=\'closed\' AND deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1035,'宏观数据-未完成的产品',1,'card',47,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\n\"type\": \"value\"\n}','[]','',0,NULL,'SELECT id FROM zt_product WHERE `status`!=\'closed\' AND deleted=\'0\' AND shadow=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1036,'宏观数据-未完成的项目',1,'card',46,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM zt_project WHERE type=\'project\' AND `status`!=\'closed\' AND deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1037,'宏观数据-未完成的计划',1,'card',48,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM (SELECT id,deleted FROM zt_productplan WHERE NOT ((`status`=\'closed\' AND closedReason=\'done\') OR `status`=\'done\')) AS plan WHERE plan.deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1038,'宏观数据-未完成的执行',1,'card',49,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM zt_project WHERE type IN (\'sprint\',\'stage\',\'kanban\') AND `status`!=\'closed\' AND deleted=\'0\' AND multiple = \'1\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1039,'宏观数据-未完成的缺陷',1,'card',53,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM zt_bug WHERE `status`!=\'closed\' AND deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1040,'宏观数据-未完成的任务',1,'card',52,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,NULL,'SELECT id FROM (SELECT id,deleted FROM zt_task WHERE NOT ((`status`=\'closed\' AND closedReason=\'cancel\') OR `status`=\'done\')) AS task WHERE task.deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1041,'宏观数据-项目集数据概览',1,'table',64,'','','{\"group\":[],\"column\":[\r\n{\"field\":\"topProgram\",\"valOrAgg\":\"value\",\"name\":\"一级项目集\"},{\"field\":\"subProgram\",\"valOrAgg\":\"value\",\"name\":\"子项目集数\"},\r\n{\"field\":\"product\",\"valOrAgg\":\"value\",\"name\":\"产品数\"},\r\n{\"field\":\"story\",\"valOrAgg\":\"value\",\"name\":\"研发需求数\"},\r\n{\"field\":\"bug\",\"valOrAgg\":\"value\",\"name\":\"Bug数\"},\r\n{\"field\":\"release\",\"valOrAgg\":\"value\",\"name\":\"发布数\"},\r\n{\"field\":\"project\",\"valOrAgg\":\"value\",\"name\":\"项目数\"},\r\n{\"field\":\"execution\",\"valOrAgg\":\"value\",\"name\":\"执行数\"},\r\n{\"field\":\"task\",\"valOrAgg\":\"value\",\"name\":\"任务数\"}\r\n],\"filter\":[]}','[]','',0,NULL,'SELECT\r\n  t1.name AS topProgram,\r\n  IFNULL(t2.subProgram, 0) AS subProgram,\r\n  COUNT(DISTINCT t3.id) AS product,\r\n  SUM(IFNULL(t4.story, 0)) AS story,\r\n  SUM(IFNULL(t5.`release`, 0)) AS \"release\",\r\n  SUM(IFNULL(t6.bug, 0)) AS bug,\r\n  IFNULL(t7.project, 0) AS project,\r\n  IFNULL(t7.execution, 0) AS execution,\r\n  IFNULL(t7.task, 0) AS task\r\nFROM zt_project AS t1\r\nLEFT JOIN (SELECT SUBSTR(path, 2, POSITION(\',\' IN SUBSTR(path, 2)) -1) AS topProgram, COUNT(1) AS subProgram FROM zt_project WHERE deleted = \'0\' AND type = \'program\' AND grade > 1 GROUP BY topProgram) AS t2 ON t1.id = t2.topProgram\r\nLEFT JOIN zt_product AS t3 ON t1.id = t3.program AND t3.deleted = \'0\' AND t3.shadow = \'0\' AND t3.vision = \'rnd\'\r\nLEFT JOIN (SELECT product, COUNT(1) AS story FROM zt_story WHERE deleted = \'0\' GROUP BY product) AS t4 ON t3.id = t4.product\r\nLEFT JOIN (SELECT product, COUNT(1) AS \"release\" FROM zt_release WHERE deleted = \'0\' GROUP BY product) AS t5 ON t3.id = t5.product\r\nLEFT JOIN (SELECT product, COUNT(1) AS bug FROM zt_bug WHERE deleted = \'0\' GROUP BY product) AS t6 ON t3.id = t6.product\r\nLEFT JOIN (\r\n  SELECT t1.topProgram, COUNT(DISTINCT t1.project) AS project, SUM(t2.task) AS task, SUM(t3.execution) AS execution\r\n  FROM (SELECT SUBSTR(path, 2, POSITION(\',\' IN SUBSTR(path, 2)) -1) AS topProgram, id AS project FROM zt_project WHERE deleted = \'0\' AND type = \'project\') AS t1\r\n  LEFT JOIN (SELECT COUNT(1) AS task, project FROM zt_task WHERE deleted = \'0\' GROUP BY project) AS t2 ON t1.project = t2.project\r\n  LEFT JOIN (SELECT COUNT(1) AS execution,project FROM zt_project WHERE deleted = \'0\' AND type IN (\'sprint\', \'stage\', \'kanban\') GROUP BY project) AS t3 ON t1.project = t3.project\r\n  GROUP BY t1.topProgram\r\n) AS t7 ON t1.id = t7.topProgram\r\nWHERE t1.deleted = \'0\' AND t1.type = \'program\' AND t1.grade = 1\r\nGROUP BY t1.name','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1042,'宏观数据-项目集需求完成率与Bug修复率',1,'bar',45,'','','{\r\n\"xaxis\":[{\"field\":\"topProgram\",\"name\":\"项目集\"}],\r\n\"yaxis\":[\r\n    {\"type\":\"value\",\"field\":\"storyDoneRate\",\"agg\":\"value\",\"name\":\"需求完成率\",\"valOrAgg\":\"value\"},\r\n    {\"type\":\"value\",\"field\":\"bugSolvedRate\",\"agg\":\"value\",\"name\":\"Bug修复率\",\"valOrAgg\":\"value\"}\r\n]}','[]','',0,NULL,'SELECT\r\n    t1.name AS topProgram,\r\n    SUM(IFNULL(t3.doneStory,0)) as doneStory,\r\n    SUM(IFNULL(t4.allStory,0)) as allStory,\r\n    CONVERT(IF(SUM(IFNULL(t4.allStory,0)) <= 0, 0, SUM(IFNULL(t3.doneStory,0)) / SUM(IFNULL(t4.allStory,0))*100), decimal(10,2)) as storyDoneRate,                                                                                                                                         \r\n    SUM(IFNULL(t5.solvedBug,0)) as solvedBug,\r\n    SUM(IFNULL(t6.allBug,0)) as allBug,\r\n    CONVERT(IF(SUM(IFNULL(t6.allBug,0)) <= 0, 0, SUM(IFNULL(t5.solvedBug,0)) / SUM(IFNULL(t6.allBug,0))*100), decimal(10,2)) as bugSolvedRate\r\nFROM zt_project AS t1\r\nLEFT JOIN zt_product AS t2 ON t1.id = t2.program\r\nLEFT JOIN (SELECT COUNT(1) as doneStory, product FROM zt_story WHERE deleted = \'0\' AND closedReason = \'done\' AND status = \'closed\' GROUP BY product) AS t3 ON t2.id = t3.product\r\nLEFT JOIN (SELECT COUNT(1) as allStory, product FROM zt_story WHERE deleted = \'0\' AND ((closedReason = \'done\' AND status = \'closed\') OR status != \'closed\') GROUP BY product) AS t4 ON t2.id = t4.product\r\nLEFT JOIN (SELECT COUNT(1) as solvedBug, product FROM zt_bug WHERE deleted = \'0\' AND resolution = \'fixed\' AND status = \'closed\' GROUP BY product) AS t5 ON t2.id = t5.product\r\nLEFT JOIN (SELECT COUNT(1) as allBug, product FROM zt_bug WHERE deleted = \'0\' AND (resolution in (\'fixed\', \'postponed\') OR status = \'active\') GROUP BY product) AS t6 ON t2.id = t6.product\r\nWHERE t1.type = \'program\' AND t1.grade = 1 AND t1.deleted = \'0\'\r\nAND t2.deleted = \'0\'\r\nGROUP BY t1.name\r\nORDER BY t1.`order` DESC','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1043,'宏观数据-公司项目集状态分布',1,'pie',45,'','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"项目集数\",\"valOrAgg\":\"count\"}]}','[]','',0,NULL,'SELECT id, CASE `status` WHEN \'wait\' then \"未开始\" WHEN \'doing\' THEN \"进行中\" WHEN \'suspended\' THEN \"已挂起\" ELSE \"已关闭\" END status FROM zt_project  WHERE type = \'program\' AND grade = 1 AND deleted = \'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1044,'宏观数据-公司项目状态分布',1,'pie',38,'','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"项目数\",\"valOrAgg\":\"count\"}]}','[]','',0,NULL,'SELECT id, CASE `status` WHEN \'wait\' then \"未开始\" WHEN \'doing\' THEN \"进行中\" WHEN \'suspended\' THEN \"已挂起\" ELSE \"已关闭\" END status FROM zt_project  WHERE type = \'project\' AND deleted = \'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1045,'宏观数据-产品数据概览',1,'table',63,'','','{\"group\":[],\"column\":[\r\n{\"field\":\"program\",\"valOrAgg\":\"value\",\"name\":\"一级项目集\"},{\"field\":\"productLine\",\"valOrAgg\":\"value\",\"name\":\"产品线\"},\r\n{\"field\":\"product\",\"valOrAgg\":\"value\",\"name\":\"产品\"},\r\n{\"field\":\"story\",\"valOrAgg\":\"value\",\"name\":\"需求数\"},\r\n{\"field\":\"bug\",\"valOrAgg\":\"value\",\"name\":\"Bug数\"},\r\n{\"field\":\"plan\",\"valOrAgg\":\"value\",\"name\":\"计划数\"},\r\n{\"field\":\"release\",\"valOrAgg\":\"value\",\"name\":\"发布数\"}],\"filter\":[]}','[]','',0,NULL,'SELECT \r\n  t1.name AS product, \r\n  IFNULL(t2.name, \'/\') AS program, \r\n  IFNULL(t3.name, \'/\') AS productLine, \r\n  IFNULL(t4.plan, 0) AS plan, \r\n  IFNULL(t5.release, 0) AS `release`, \r\n  IFNULL(t6.story, 0) AS story, \r\n  IFNULL(t7.bug, 0) AS bug \r\nFROM \r\n  zt_product AS t1 \r\n  LEFT JOIN zt_project AS t2 ON t1.program = t2.id AND t2.type = \'program\' AND t2.grade = 1 \r\n  LEFT JOIN zt_module AS t3 ON t1.line = t3.id AND t3.type = \'line\' \r\n  LEFT JOIN (SELECT product, COUNT(1) AS plan FROM zt_productplan WHERE deleted = \'0\' GROUP BY product) AS t4 ON t1.id = t4.product \r\n  LEFT JOIN (SELECT product, COUNT(1) AS `release` FROM zt_release WHERE deleted = \'0\' GROUP BY product) AS t5 ON t1.id = t5.product \r\n  LEFT JOIN (SELECT product, COUNT(1) AS story FROM zt_story WHERE deleted = \'0\' GROUP BY product) AS t6 ON t1.id = t6.product \r\n  LEFT JOIN (SELECT product, COUNT(1) AS bug FROM zt_bug WHERE deleted = \'0\' GROUP BY product) AS t7 ON t1.id = t7.product \r\nWHERE t1.deleted = \'0\' AND t1.status != \'closed\' AND t1.shadow = \'0\'AND t1.vision = \'rnd\'\r\nORDER BY t1.order','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1046,'宏观数据-产品需求完成率',1,'bar',36,'','','{\r\n\"xaxis\":[{\"field\":\"product\",\"name\":\"产品\"}],\r\n\"yaxis\":[\r\n    {\"type\":\"value\",\"field\":\"closedRate\",\"agg\":\"value\",\"name\":\"需求完成率\",\"valOrAgg\":\"value\"}\r\n]}','[]','',0,NULL,'SELECT\r\n  t1.name AS product,\r\n  IFNULL(t2.name, \'/\') AS program, \r\n  IFNULL(t3.name, \'/\') AS productLine,   \r\n  IFNULL(t4.story, 0) AS closedStory, \r\n  t5.story AS totalStory, \r\n  ROUND(IFNULL(t4.story, 0) / t5.story * 100, 2) AS closedRate \r\nFROM zt_product AS t1 \r\nLEFT JOIN zt_project AS t2 ON t1.program = t2.id AND t2.type = \'program\' AND t2.grade = 1 \r\nLEFT JOIN zt_module AS t3 ON t1.line = t3.id AND t3.type = \'line\' \r\nLEFT JOIN (SELECT product, COUNT(1) AS story FROM zt_story WHERE deleted = \'0\' AND closedReason = \'done\' GROUP BY product) AS t4 ON t1.id = t4.product \r\nLEFT JOIN (SELECT product, COUNT(1) AS story FROM zt_story WHERE deleted = \'0\' AND ( closedReason = \'done\' OR status != \'closed\') GROUP BY product) AS t5 ON t1.id = t5.product \r\nWHERE t1.deleted = \'0\' AND t1.status != \'closed\' AND t1.shadow = \'0\' AND t1.vision = \'rnd\' AND t5.story IS NOT NULL \r\nORDER BY t1.order DESC','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1047,'宏观数据-产品Bug修复率',1,'bar',44,'','','{\r\n\"xaxis\":[{\"field\":\"product\",\"name\":\"产品\"}],\r\n\"yaxis\":[\r\n    {\"type\":\"value\",\"field\":\"fixedRate\",\"agg\":\"value\",\"name\":\"Bug修复率\",\"valOrAgg\":\"value\"}\r\n]}','[]','',0,NULL,'SELECT \r\n  t1.name AS product,\r\n  IFNULL(t2.name, \'/\') AS program,\r\n  IFNULL(t3.name, \'/\') AS productLine,\r\n  IFNULL(t4.bug, 0) AS fixedBug,\r\n  t5.bug AS totalBug,\r\n  ROUND(IFNULL(t4.bug, 0) / t5.bug * 100, 2) AS fixedRate\r\nFROM zt_product AS t1\r\nLEFT JOIN zt_project AS t2 ON t1.program = t2.id AND t2.type = \'program\' AND t2.grade = 1\r\nLEFT JOIN zt_module AS t3 ON t1.line = t3.id AND t3.type = \'line\'\r\nLEFT JOIN (SELECT product, COUNT(1) AS bug FROM zt_bug WHERE deleted = \'0\' AND resolution = \'fixed\' AND status = \'closed\' GROUP BY product) AS t4 ON t1.id = t4.product\r\nLEFT JOIN (SELECT product, COUNT(1) AS bug FROM zt_bug WHERE deleted = \'0\' AND (resolution = \'fixed\' OR resolution = \'postponed\' OR status = \'active\') GROUP BY product) AS t5 ON t1.id = t5.product\r\nWHERE t1.deleted = \'0\' AND t1.status != \'closed\' AND t1.shadow = \'0\' AND t1.vision = \'rnd\'  AND t5.bug IS NOT NULL\r\nORDER BY t1.order DESC','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1049,'宏观数据-部门人员分布图',1,'bar',56,'','','{\r\n\"xaxis\":[{\"field\":\"deptName\",\"name\":\"部门\"}],\r\n\"yaxis\":[\r\n    {\"type\":\"value\",\"field\":\"count\",\"agg\":\"value\",\"name\":\"部门人数\",\"valOrAgg\":\"value\"}\r\n]}','[]','',0,NULL,'SELECT IF(t3.id IS NOT NULL, t3.`name`, \"空\") AS deptName,count(1) as count, \r\nIF(t3.id IS NOT NULL, t3.`order`, 9999) AS deptOrder \r\nFROM zentao_18_9.`zt_user` AS t1 \r\nLEFT JOIN zentao_18_9.`zt_dept` AS t2 ON t1.dept = t2.id\r\nLEFT JOIN zentao_18_9.`zt_dept` AS t3 ON FIND_IN_SET(TRIM(\',\' FROM t3.path), TRIM(\',\' FROM t2.path)) AND t3.grade = \'1\'\r\nWHERE t1.deleted = \'0\'\r\nGROUP BY deptName, deptOrder \r\nORDER BY deptOrder  ASC','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1050,'宏观数据-公司角色分布图',1,'pie',56,'','','{\"group\":[{\"field\":\"role\",\"name\":\"类型\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"account\",\"agg\":\"count\",\"name\":\"人数\",\"valOrAgg\":\"count\"}]}','[]','',0,NULL,'SELECT\n	account,\nCASE\n		ROLE \n		WHEN \'dev\' THEN\n		\"研发\" \n		WHEN \'qa\' THEN\r\n		\"测试\"\r\n		WHEN \'pm\' THEN\r\n		\"项目经理\"\r\n		WHEN \'others\' THEN\r\n		\"其他\"\r\n		WHEN \'td\' THEN\r\n		\"研发主管\"\r\n		WHEN \'pd\' THEN\r\n		\"产品主管\"\r\n		WHEN \'po\' THEN\r\n		\"产品经理\"\r\n		WHEN \'qd\' THEN\r\n		\"测试主管\"\r\n		WHEN \'top\' THEN\r\n		\"高层管理\"\r\n		ELSE\r\n		\"未知\"\r\n		END\r\n		role\n	FROM\n		zentao_18_9.`zt_user` \n	WHERE\n		deleted = \'0\' ','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1051,'宏观数据-人员工龄分布图',1,'bar',56,'','','{\r\n\"xaxis\":[{\"field\":\"joinDate\",\"name\":\"工龄\"}],\r\n\"yaxis\":[\r\n    {\"type\":\"value\",\"field\":\"count\",\"agg\":\"value\",\"name\":\"人数\",\"valOrAgg\":\"value\"}\r\n]}','[]','',0,NULL,'SELECT count(1) as count, \"0-1年\" as joinDate FROM zentao_18_9.`zt_user` WHERE deleted = \'0\' AND `join` > DATE_SUB(NOW(), INTERVAL 1 YEAR)\r\nunion\r\nSELECT count(1) as count, \"1-3年\" as joinDate FROM zentao_18_9.`zt_user` WHERE deleted = \'0\' AND `join` > DATE_SUB(NOW(), INTERVAL 3 YEAR) AND `join` <= DATE_SUB(NOW(), INTERVAL 1 YEAR)\r\nunion\r\nSELECT count(1) as count, \"3-5年\" as joinDate FROM zentao_18_9.`zt_user` WHERE deleted = \'0\' AND `join` > DATE_SUB(NOW(), INTERVAL 5 YEAR) AND `join` <= DATE_SUB(NOW(), INTERVAL 3 YEAR)\r\nunion\r\nSELECT count(1) as count, \"5-10年\" as joinDate FROM zentao_18_9.`zt_user` WHERE deleted = \'0\' AND `join` > DATE_SUB(NOW(), INTERVAL 10 YEAR) AND `join` <= DATE_SUB(NOW(), INTERVAL 5 YEAR)\r\nunion\r\nSELECT count(1) as count, \"10年以上\" as joinDate FROM zentao_18_9.`zt_user` WHERE deleted = \'0\' AND `join` < DATE_SUB(NOW(), INTERVAL 10 YEAR) AND LEFT(`join`, 4) != \'0000\'\r\nunion                                                                                                                                                                                                                                                          \r\nSELECT count(1) as count, \"未知\" as joinDate FROM zentao_18_9.`zt_user` WHERE deleted = \'0\' AND LEFT(`join`, 4) = \'0000\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(1055,'年度新增-一级项目集个数',1,'card',45,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\n\"type\": \"value\"\n}','',NULL,0,NULL,'SELECT\r\n	t1.`year`,\r\n	t2.id,\r\n	t2.name\r\nFROM\r\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\r\n	LEFT JOIN (\r\n	SELECT\r\n		id, name,\r\n		YEAR ( openedDate ) AS `year` \r\n	FROM\r\n		zt_project \r\n	WHERE\r\n		`type` = \'program\' \r\n		AND deleted = \'0\' \r\n		AND grade = \'1\'  \r\n	) t2 ON t1.`year` = t2.`year`	\r\n WHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1056,'年度新增-产品个数',1,'card',47,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\n\"type\": \"value\"\n}','',NULL,0,NULL,'SELECT\r\n	t1.`year`,\r\n	t2.id,\r\n	t2.name\r\nFROM\r\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\r\n	LEFT JOIN (\r\n	SELECT\r\n		id, name,\r\n		YEAR ( createdDate ) AS `year` \r\n	FROM\r\n		zt_product \r\n	WHERE\r\n		deleted = \'0\' \r\n		AND shadow = \'0\' \r\n	) t2 ON t1.`year` = t2.`year`	\r\n WHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1057,'年度新增-需求个数',1,'card',51,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\n\"type\": \"value\"\n}','',NULL,0,NULL,'SELECT\n	t1.`year`,\n	t2.id,\r\n	t2.title\nFROM\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\n	LEFT JOIN ( SELECT id, title, YEAR ( openedDate ) AS `year` FROM zt_story WHERE deleted = \'0\' ) AS t2 ON t1.`year` = t2.`year`	\r\n WHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1058,'年度新增-Bug个数',1,'card',53,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\n\"type\": \"value\"\n}','',NULL,0,NULL,'SELECT\r\n	t1.`year`,\r\n	t2.id,\r\n	t2.title\r\nFROM\r\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\r\n	LEFT JOIN ( SELECT id, title, YEAR ( openedDate ) AS `year` FROM zt_bug WHERE deleted = \'0\' ) AS t2 ON t1.`year` = t2.`year`	\r\n WHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1059,'年度新增-计划个数',1,'card',48,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\n\"type\": \"value\"\n}','',NULL,0,NULL,'SELECT\n	t1.`year`,\n	t2.id,\r\n	t2.title\nFROM\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\n	LEFT JOIN ( SELECT id, title, YEAR ( createdDate ) AS `year` FROM zt_productplan WHERE deleted = \'0\') AS t2 ON t1.`year` = t2.`year`	\r\n WHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1060,'年度新增-项目个数',1,'card',46,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\n\"type\": \"value\"\n}','',NULL,0,NULL,'SELECT\r\n	t1.`year`,\r\n	t2.id,\r\n	t2.name\r\nFROM\r\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\r\n	LEFT JOIN (\r\n	SELECT\r\n		id, name,\r\n		YEAR ( openedDate ) AS `year` \r\n	FROM\r\n		zt_project \r\n	WHERE\r\n		`type` = \'project\' \r\n		AND deleted = \'0\' \r\n	) t2 ON t1.`year` = t2.`year`	\r\n WHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1061,'年度新增-执行个数',1,'card',49,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','',NULL,0,NULL,'SELECT t1.`year`, t2.id, t2.name\r\nFROM (SELECT DISTINCT YEAR(`date`) AS \"year\" FROM zt_action) AS t1\r\nLEFT JOIN (SELECT id,name, YEAR(openedDate) AS `year` FROM zt_project WHERE `type` IN ( \'sprint\', \'stage\', \'kanban\' ) AND deleted = \'0\' AND multiple = \'1\') AS t2 ON t1.`year` = t2.`year` \r\nWHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1062,'年度新增-任务数',1,'card',52,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','',NULL,0,NULL,'SELECT\r\n	t1.`year`,\r\n	t2.id,\r\n	t2.name\r\nFROM\r\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\r\n	LEFT JOIN ( SELECT id, name, YEAR ( openedDate ) AS `year` FROM zt_task WHERE deleted = \'0\') AS t2 ON t1.`year` = t2.`year`	\r\n WHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1063,'年度新增-文档个数',1,'card',54,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\n\"type\": \"value\"\n}','',NULL,0,NULL,'SELECT\n	t1.`year`,\n	t2.id,\r\n	t2.title\nFROM\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\n	LEFT JOIN ( SELECT id, title, YEAR ( addedDate ) AS `year` FROM zt_doc WHERE deleted = \'0\') AS t2 ON t1.`year` = t2.`year`	\r\n WHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1064,'年度新增-发布个数',1,'card',50,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','',NULL,0,NULL,'SELECT\r\n	t1.`year`,\r\n	t2.id,\r\n	t2.name\r\nFROM\r\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\r\n	LEFT JOIN ( SELECT id, name, YEAR ( `date` ) AS `year` FROM zt_release WHERE deleted = \'0\') AS t2 ON t1.`year` = t2.`year`\r\nWHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1065,'年度新增-人员个数',1,'card',56,'','','{\"value\": {\"type\": \"agg\", \"field\": \"account\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"realname\": \"\"},\n\"type\": \"value\"\n}','',NULL,0,NULL,'SELECT\n	t1.`year`,\r\n	t2.account,\r\n	t2.realname\nFROM\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\n	LEFT JOIN (\n	SELECT\n		account, realname,\n		YEAR ( t112.`date` ) AS \'year\' \n	FROM\n		zt_user AS t111\n		LEFT JOIN zt_action t112 ON t111.id = t112.objectID \n		AND t112.objectType = \'user\' \n	WHERE\n		t111.deleted = \'0\' \n		AND t112.action = \'created\' \n	) AS t2 ON t1.`year` = t2.`year` 	\r\n WHERE t2.account IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1066,'年度新增-完成项目数',1,'card',46,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','',NULL,0,NULL,'SELECT\r\nt1.`year`,\r\nt2.id,\r\nt2.name\r\nFROM\r\n( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\r\nLEFT JOIN (\r\nSELECT\r\nid, name,\r\nYEAR ( closedDate ) AS `year` \r\nFROM\r\nzt_project \r\nWHERE\r\n`type` = \'project\' \r\nAND deleted = \'0\' \r\n) t2 ON t1.`year` = t2.`year`\r\n WHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1067,'年度新增-完成执行数',1,'card',49,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','',NULL,0,NULL,'SELECT t1.`year`, t2.id, t2.name\r\nFROM (SELECT DISTINCT YEAR(date) AS \"year\" FROM zt_action) AS t1\r\nLEFT JOIN (SELECT id, name, YEAR(closedDate) AS `year` FROM zt_project WHERE `type` IN ( \'sprint\', \'stage\', \'kanban\' ) AND deleted = \'0\' AND multiple = \'1\' AND status = \'closed\') AS t2 ON t1.`year` = t2.`year` \r\nWHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1068,'年度新增-完成发布数',1,'card',50,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\n\"type\": \"value\"\n}','',NULL,0,NULL,'SELECT\r\n	t1.`year`,\r\n	t2.id,\r\n	t2.name\r\nFROM\r\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\r\n	LEFT JOIN ( SELECT id, name, YEAR ( `date` ) AS `year` FROM zt_release WHERE deleted = \'0\') AS t2 ON t1.`year` = t2.`year`	\r\n WHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1069,'年度新增-完成需求数',1,'card',51,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\n\"type\": \"value\"\n}','',NULL,0,NULL,'SELECT\n	t1.`year`,\n	t2.id,\n	t2.title\nFROM\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\n	LEFT JOIN (\n	SELECT\n		id, title,\n		YEAR ( closedDate ) AS `year` \n	FROM\n		zt_story \n	WHERE\n		deleted = \'0\' \n		AND closedReason = \'done\' \n		AND STATUS = \'closed\' \n	) AS t2 ON t1.`year` = t2.`year`	\n WHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1070,'年度新增-解决Bug数',1,'card',53,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','',NULL,0,NULL,'SELECT\r\n	t1.`year`,\r\n	t2.id,\r\n	t2.title\r\nFROM\r\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\r\n	LEFT JOIN (\r\n	SELECT\r\n		id, title,\r\n		YEAR ( closedDate ) AS `year` \r\n	FROM\r\n		zt_bug \r\n	WHERE\r\n		deleted = \'0\' \r\n		AND resolution = \'fixed\' \r\n		AND STATUS = \'closed\' \r\n	) AS t2 ON t1.`year` = t2.`year`	\r\n WHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1071,'年度新增-完成任务数',1,'card',52,'','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','',NULL,0,NULL,'SELECT\r\n	t1.`year`,\r\n	t2.id,\r\n	t2.name\r\nFROM\r\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\r\n	LEFT JOIN (\r\n	SELECT\r\n		id, name,\r\n		YEAR ( finishedDate ) AS `year` \r\n	FROM\r\n		zt_task \r\n	WHERE\r\n		deleted = \'0\' \r\n		AND STATUS = \'closed\' \r\n		AND closedReason = \'done\' \r\n	) AS t2 ON t1.`year` = t2.`year`	\r\n WHERE t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1072,'年度新增-投入工时数',1,'card',57,'','','{\"value\": {\"type\": \"value\", \"field\": \"consumed\", \"agg\": \"value\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','',NULL,0,NULL,'SELECT\r\n	t1.`year`,\r\n	IFNULL( t2.consumed, 0 ) AS consumed \r\nFROM\r\n	( SELECT DISTINCT YEAR ( `date` ) AS \"year\" FROM zt_action ) AS t1\r\n	LEFT JOIN ( SELECT ROUND( SUM( consumed )) AS consumed, YEAR ( `date` ) AS \"year\" FROM zt_effort WHERE deleted = \'0\' GROUP BY `year`) AS t2 ON t1.`year` = t2.`year` ','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1073,'年度新增-项目集年度新增数据汇总表',1,'table',64,'','','{\"group\":[],\"column\":[\r\n{\"field\":\"topProgram\",\"valOrAgg\":\"value\",\"name\":\"一级项目集\"},\r\n{\"field\":\"product\",\"valOrAgg\":\"value\",\"name\":\"产品数\"},\r\n{\"field\":\"plan\",\"valOrAgg\":\"value\",\"name\":\"计划数\"},\r\n{\"field\":\"story\",\"valOrAgg\":\"value\",\"name\":\"需求数\"},\r\n{\"field\":\"bug\",\"valOrAgg\":\"value\",\"name\":\"Bug数\"},\r\n{\"field\":\"release\",\"valOrAgg\":\"value\",\"name\":\"发布数\"},\r\n{\"field\":\"doc\",\"valOrAgg\":\"value\",\"name\":\"文档数\"}\r\n],\"filter\":[]}','',NULL,0,NULL,'SELECT\r\n    t1.name AS topProgram,t1.id, t2.`year`, (SELECT COUNT(1) as product FROM zt_product WHERE deleted = \'0\' AND shadow = \'0\' AND YEAR(createdDate) = t2.`year` AND program = t1.id) as product, SUM(IFNULL(t4.plan, 0)) AS plan, SUM(IFNULL(t5.story, 0)) AS story, SUM(IFNULL(t6.bug, 0)) AS bug, SUM(IFNULL(t7.`release`, 0)) AS \'release\', SUM(IFNULL(t8.doc, 0)) AS doc\r\nFROM zt_project AS t1\r\nLEFT JOIN (SELECT DISTINCT YEAR(`date`) as \'year\' FROM zt_action) as t2 ON 1 = 1 LEFT JOIN (SELECT id, program FROM zt_product WHERE deleted = \'0\') AS t3 ON t1.id = t3.program\r\nLEFT JOIN (SELECT COUNT(1) as \'plan\', product, YEAR(createdDate) as \'year\' FROM zt_productplan WHERE deleted = \'0\' GROUP BY product,`year`) AS t4 on t3.id = t4.product AND t4.`year`= t2.`year` LEFT JOIN (SELECT COUNT(1) as \'story\', product, YEAR(openedDate) as \'year\' FROM zt_story WHERE deleted = \'0\' GROUP BY product,`year`) AS t5 on t3.id = t5.product AND t5.`year`= t2.`year` LEFT JOIN (SELECT COUNT(1) as \'bug\', product, YEAR(openedDate) as \"year\" FROM zt_bug WHERE deleted = \'0\' GROUP BY product,`year`) AS t6 on t3.id = t6.product AND t6.`year` = t2.`year` LEFT JOIN (SELECT COUNT(1) as \'release\', product, YEAR(`date`) as \"year\" FROM zt_release WHERE deleted = \'0\' GROUP BY product,`year`) AS t7 on t3.id = t7.product AND t7.`year` = t2.`year` LEFT JOIN (SELECT COUNT(1) as \'doc\', product, YEAR(addedDate) as \"year\" FROM zt_doc WHERE deleted = \'0\' GROUP BY product,`year`) AS t8 on t3.id = t8.product AND t8.`year` = t2.`year` WHERE t1.type = \'program\' AND t1.grade = 1 AND t1.deleted = \'0\'AND t1.status != \'closed\' GROUP BY topProgram,id,`year` ORDER BY `year`, topProgram','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1074,'年度新增-项目集年度完成数据概览',1,'table',64,'','','{\"group\":[],\"column\":[\r\n{\"field\":\"topProgram\",\"valOrAgg\":\"value\",\"name\":\"一级项目集\"},\r\n{\"field\":\"projectA\",\"valOrAgg\":\"value\",\"name\":\"项目数\"},\r\n{\"field\":\"executionA\",\"valOrAgg\":\"value\",\"name\":\"执行数\"},\r\n{\"field\":\"release\",\"valOrAgg\":\"value\",\"name\":\"发布数\"},\r\n{\"field\":\"story\",\"valOrAgg\":\"value\",\"name\":\"需求数\"},\r\n{\"field\":\"bug\",\"valOrAgg\":\"value\",\"name\":\"Bug数\"}\r\n],\"filter\":[]}','',NULL,0,NULL,'SELECT\r\n    t1.name AS topProgram,t1.id,t2.`year`,\r\n    SUM(IF((t3.`status` = \'closed\'), 1, 0)) as projectA,\r\n    SUM(IFNULL(t4.execution, 0)) as executionA,\r\n    SUM(IFNULL(t6.`release`, 0)) AS \'release\',\r\n    SUM(IFNULL(t7.story, 0)) AS story,\r\n    SUM(IFNULL(t8.bug, 0)) AS bug\r\nFROM zt_project AS t1\r\nLEFT JOIN (SELECT DISTINCT YEAR(`date`) as \"year\" FROM zt_action) as t2 ON 1 = 1\r\nLEFT JOIN zt_project AS t3 ON FIND_IN_SET(t1.id, t3.path) and t3.type = \'project\' AND YEAR(t3.closedDate) = t2.`year`\r\nLEFT JOIN (SELECT COUNT(1) AS \'execution\', parent,YEAR(closedDate) AS `year` FROM zt_project WHERE type IN (\'sprint\', \'stage\', \'kanban\') AND `status` = \'closed\' GROUP BY `year`, parent) AS t4 ON t3.id = t4.parent AND t4.`year` = t2.`year`\r\nLEFT JOIN (SELECT id,program FROM zt_product WHERE deleted = \'0\') AS t5 ON t1.id = t5.program\r\nLEFT JOIN (SELECT COUNT(1) as \'release\', product, YEAR(`date`) as `year` FROM zt_release WHERE deleted = \'0\' GROUP BY product, `year`) AS t6 ON t5.id = t6.product AND t6.`year` = t2.`year`\r\nLEFT JOIN (SELECT COUNT(1) as \'story\', product, YEAR(closedDate) as `year` FROM zt_story WHERE deleted = \'0\' AND closedReason = \'done\' AND status = \'closed\' GROUP BY product, `year`) AS t7 on t5.id = t7.product AND t7.`year` = t2.`year`\r\nLEFT JOIN (SELECT COUNT(1) as \'bug\', product, YEAR(resolvedDate) as `year` FROM zt_bug WHERE deleted = \'0\' AND resolution = \'fixed\' AND status = \'closed\' GROUP BY product, `year`) AS t8 on t5.id = t8.product AND t8.`year` = t2.`year`\r\nWHERE t1.type = \'program\' AND t1.grade = 1 AND t1.deleted = \'0\'\r\nGROUP BY t1.name,t1.id,t2.`year`','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1075,'年度新增-产品年度新增数据汇总表',1,'table',63,'','','{\"group\":[],\"column\":[\r\n{\"field\":\"name\",\"valOrAgg\":\"value\",\"name\":\"产品\"},\r\n{\"field\":\"story\",\"valOrAgg\":\"value\",\"name\":\"需求数\"},\r\n{\"field\":\"bug\",\"valOrAgg\":\"value\",\"name\":\"Bug数\"},\r\n{\"field\":\"plan\",\"valOrAgg\":\"value\",\"name\":\"计划数\"},\r\n{\"field\":\"release\",\"valOrAgg\":\"value\",\"name\":\"发布数\"}\r\n],\"filter\":[]}','',NULL,0,NULL,'SELECT\r\n    t1.name,t1.id,t2.`year`,IF(YEAR(t1.createdDate) = t2.`year`, 1, 0) as newProduct,\r\n    SUM(IFNULL(t3.story, 0)) AS story,\r\n    SUM(IFNULL(t4.bug, 0)) AS bug,\r\n    SUM(IFNULL(t5.`plan`, 0)) AS \'plan\',\r\n    SUM(IFNULL(t6.`release`, 0)) AS \'release\'\r\nFROM zt_product AS t1\r\nLEFT JOIN (SELECT DISTINCT YEAR(`date`) as \"year\" FROM zt_action) as t2 ON 1 = 1\r\nLEFT JOIN (SELECT COUNT(1) as \'story\', product, YEAR(openedDate) as `year` FROM zt_story WHERE deleted = \'0\' AND closedReason = \'done\' AND status = \'closed\' GROUP BY product, `year`) AS t3 on t1.id = t3.product AND t3.`year` = t2.`year`\r\nLEFT JOIN (SELECT COUNT(1) as \'bug\', product, YEAR(openedDate) as `year` FROM zt_bug WHERE deleted = \'0\' AND resolution = \'fixed\' AND status = \'closed\' GROUP BY product, `year`) AS t4 on t1.id = t4.product AND t4.`year` = t2.`year`\r\nLEFT JOIN (SELECT COUNT(1) as \'plan\', product, YEAR(createdDate) AS \"year\" FROM zt_productplan WHERE deleted = \'0\' GROUP BY product,`year`) AS t5 on t1.id = t5.product AND t5.`year` = t2.`year`\r\nLEFT JOIN (SELECT COUNT(1) as \'release\', product, YEAR(`date`) as `year` FROM zt_release WHERE deleted = \'0\' GROUP BY product, `year`) AS t6 ON t1.id = t6.product AND t6.`year` = t2.`year`\r\nWHERE t1.deleted = \'0\' AND t1.status != \'closed\' AND t1.shadow = \'0\'\r\n GROUP BY t1.name,t1.id,t2.`year`,newProduct','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1076,'年度新增-产品年度完成数据汇总表',1,'table',63,'','','{\"group\":[],\"column\":[\r\n{\"field\":\"name\",\"valOrAgg\":\"value\",\"name\":\"产品\"},\r\n{\"field\":\"story\",\"valOrAgg\":\"value\",\"name\":\"需求数\"},\r\n{\"field\":\"bug\",\"valOrAgg\":\"value\",\"name\":\"Bug数\"},\r\n{\"field\":\"plan\",\"valOrAgg\":\"value\",\"name\":\"计划数\"},\r\n{\"field\":\"release\",\"valOrAgg\":\"value\",\"name\":\"发布数\"}\r\n],\"filter\":[]}','',NULL,0,NULL,'SELECT\r\n    t1.name,t1.id,t2.`year`,IF(YEAR(t1.createdDate) = t2.`year`, 1, 0) as newProduct,\r\n    SUM(IFNULL(t3.story, 0)) AS story,\r\n    SUM(IFNULL(t4.bug, 0)) AS bug,\r\n    SUM(IFNULL(t5.`plan`, 0)) AS \'plan\',\r\n    SUM(IFNULL(t6.`release`, 0)) AS \'release\'\r\nFROM zt_product AS t1\r\nLEFT JOIN (SELECT DISTINCT YEAR(`date`) as \"year\" FROM zt_action) as t2 ON 1 = 1\r\nLEFT JOIN (SELECT COUNT(1) as \'story\', product, YEAR(closedDate) as `year` FROM zt_story WHERE deleted = \'0\' AND closedReason = \'done\' AND status = \'closed\' GROUP BY product, `year`) AS t3 on t1.id = t3.product AND t3.`year` = t2.`year`\r\nLEFT JOIN (SELECT COUNT(1) as \'bug\', product, YEAR(resolvedDate) as `year` FROM zt_bug WHERE deleted = \'0\' AND resolution = \'fixed\' AND status = \'closed\' GROUP BY product, `year`) AS t4 on t1.id = t4.product AND t4.`year` = t2.`year`\r\nLEFT JOIN (\r\n    SELECT COUNT(DISTINCT t51.id) as \'plan\', t51.product, YEAR(t52.`date`) AS \"year\"\r\n    FROM zt_productplan AS t51\r\n    LEFT JOIN (SELECT objectID,objectType,action,MAX(`date`) as \'date\' FROM zt_action GROUP BY objectID,objectType, action) AS t52 ON t51.id = t52.objectID AND t52.objectType = \'productplan\'\r\n    WHERE t51.deleted = \'0\' AND t51.closedReason = \'done\' AND t51.status = \'closed\' \r\n    AND t52.action = \'closed\'\r\n    GROUP BY t51.product,`year`\r\n) AS t5 on t1.id = t5.product AND t5.`year` = t2.`year`\r\nLEFT JOIN (SELECT COUNT(1) as \'release\', product, YEAR(`date`) as `year` FROM zt_release WHERE deleted = \'0\' GROUP BY product, `year`) AS t6 ON t1.id = t6.product AND t6.`year` = t2.`year`\r\nWHERE t1.deleted = \'0\' AND t1.status != \'closed\' AND t1.shadow = \'0\'\r\nGROUP BY t1.name,t1.id,t2.`year`,newProduct','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1077,'年度新增-需求年度新增和完成趋势图',1,'line',36,'','','{\r\n  \"xaxis\":[{\"field\":\"month\",\"name\":\"月份\",\"group\":\"value\"}],\r\n  \"yaxis\":[{\"type\":\"value\",\"field\":\"newStory\",\"agg\":\"value\",\"name\":\"新增需求数\",\"valOrAgg\":\"value\"},\r\n             {\"type\":\"value\",\"field\":\"closedStory\",\"agg\":\"value\",\"name\":\"完成需求数\",\"valOrAgg\":\"value\"}\r\n]}','',NULL,0,NULL,'SELECT t1.year, CONCAT(t1.month, \"月\") AS `month`, IFNULL(t2.story, 0) AS newStory, IFNULL(t3.story, 0) AS closedStory\r\nFROM (SELECT DISTINCT Year(date) AS `year`, MONTH(date) AS `month` FROM zt_action) AS t1\r\nLEFT JOIN (SELECT YEAR(openedDate) AS `year`, MONTH(openedDate) AS `month`, COUNT(1) AS story FROM zt_story WHERE deleted = \'0\' GROUP BY `year`, `month`) AS t2 ON t1.year = t2.year AND t1.month = t2.month\r\nLEFT JOIN (SELECT YEAR(closedDate) AS `year`, MONTH(closedDate) AS `month`, COUNT(1) AS story FROM zt_story WHERE deleted = \'0\' AND closedReason = \'done\' GROUP BY `year`, `month`) AS t3 ON t1.year = t3.year AND t1.month = t3.month\r\nORDER BY `year`, t1.month','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1078,'年度新增-Bug年度新增和解决趋势图',1,'line',44,'','','{\r\n  \"xaxis\":[{\"field\":\"month\",\"name\":\"月份\",\"group\":\"value\"}],\r\n  \"yaxis\":[{\"type\":\"value\",\"field\":\"newBug\",\"agg\":\"value\",\"name\":\"新增Bug数\",\"valOrAgg\":\"value\"},\r\n             {\"type\":\"value\",\"field\":\"fixedBug\",\"agg\":\"value\",\"name\":\"解决Bug数\",\"valOrAgg\":\"value\"}\r\n]}','',NULL,0,NULL,'SELECT t1.year, CONCAT(t1.month, \"月\") AS `month`, IFNULL(t2.bug, 0) AS newBug, IFNULL(t3.bug, 0) AS fixedBug\r\nFROM (SELECT DISTINCT Year(date) AS `year`, MONTH(date) AS `month` FROM zt_action) AS t1\r\nLEFT JOIN (SELECT YEAR(openedDate) AS `year`, MONTH(openedDate) AS `month`, COUNT(1) AS bug FROM zt_bug WHERE deleted = \'0\' GROUP BY `year`, `month`) AS t2 ON t1.year = t2.year AND t1.month = t2.month\r\nLEFT JOIN (SELECT YEAR(closedDate) AS `year`, MONTH(closedDate) AS `month`, COUNT(1) AS bug FROM zt_bug WHERE deleted = \'0\' AND resolution = \'fixed\' AND status = \'closed\' GROUP BY `year`, `month`) AS t3 ON t1.year = t3.year AND t1.month = t3.month\r\nORDER BY `year`, t1.month','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1079,'年度新增-任务年度新增和完成趋势图',1,'line',39,'','','{\r\n  \"xaxis\":[{\"field\":\"month\",\"name\":\"月份\",\"group\":\"value\"}],\r\n  \"yaxis\":[{\"type\":\"value\",\"field\":\"newTask\",\"agg\":\"value\",\"name\":\"新增任务数\",\"valOrAgg\":\"value\"},\r\n             {\"type\":\"value\",\"field\":\"closedTask\",\"agg\":\"value\",\"name\":\"完成任务数\",\"valOrAgg\":\"value\"}\r\n]}','',NULL,0,NULL,'SELECT t1.year, CONCAT(t1.month, \"月\") AS `month`, IFNULL(t2.task, 0) AS newTask, IFNULL(t3.task, 0) AS closedTask\r\nFROM (SELECT DISTINCT Year(date) AS `year`, MONTH(date) AS `month` FROM zt_action) AS t1\r\nLEFT JOIN (SELECT YEAR(openedDate) AS `year`, MONTH(openedDate) AS `month`, COUNT(1) AS task FROM zt_task WHERE deleted = \'0\' GROUP BY `year`, `month`) AS t2 ON t1.year = t2.year AND t1.month = t2.month\r\nLEFT JOIN (SELECT YEAR(closedDate) AS `year`, MONTH(closedDate) AS `month`, COUNT(1) AS task FROM zt_task WHERE deleted = \'0\' AND status = \'closed\' GROUP BY `year`, `month`) AS t3 ON t1.year = t3.year AND t1.month = t3.month\r\nORDER BY `year`, t1.month','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1080,'年度新增-项目年度新增和完成趋势图',1,'line',38,'','','{\r\n  \"xaxis\":[{\"field\":\"month\",\"name\":\"月份\",\"group\":\"value\"}],\r\n  \"yaxis\":[{\"type\":\"value\",\"field\":\"newProject\",\"agg\":\"value\",\"name\":\"新增项目数\",\"valOrAgg\":\"value\"},\r\n             {\"type\":\"value\",\"field\":\"closedProject\",\"agg\":\"value\",\"name\":\"完成项目数\",\"valOrAgg\":\"value\"}\r\n]}','',NULL,0,NULL,'SELECT t1.year, CONCAT(t1.month, \"月\") AS `month`, IFNULL(t2.project, 0) AS newProject, IFNULL(t3.project, 0) AS closedProject\r\nFROM (SELECT DISTINCT Year(date) AS `year`, MONTH(date) AS `month` FROM zt_action) AS t1\r\nLEFT JOIN (SELECT YEAR(openedDate) AS `year`, MONTH(openedDate) AS `month`, COUNT(1) AS project FROM zt_project WHERE deleted = \'0\' AND type = \'project\' GROUP BY `year`, `month`) AS t2 ON t1.year = t2.year AND t1.month = t2.month\r\nLEFT JOIN (SELECT YEAR(closedDate) AS `year`, MONTH(closedDate) AS `month`, COUNT(1) AS project FROM zt_project WHERE deleted = \'0\' AND type = \'project\' AND status = \'closed\' GROUP BY `year`, `month`) AS t3 ON t1.year = t3.year AND t1.month = t3.month\r\nORDER BY `year`, t1.month','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1081,'年度新增-执行年度新增和完成趋势图',1,'line',40,'','','{\r\n  \"xaxis\":[{\"field\":\"month\",\"name\":\"月份\",\"group\":\"value\"}],\r\n  \"yaxis\":[{\"type\":\"value\",\"field\":\"newExecution\",\"agg\":\"value\",\"name\":\"新增执行数\",\"valOrAgg\":\"value\"},\r\n             {\"type\":\"value\",\"field\":\"closedExecution\",\"agg\":\"value\",\"name\":\"完成执行数\",\"valOrAgg\":\"value\"}\r\n]}','',NULL,0,NULL,'SELECT t1.year, CONCAT(t1.month, \"月\") AS `month`, IFNULL(t2.execution, 0) AS newExecution, IFNULL(t3.execution, 0) AS closedExecution\r\nFROM (SELECT DISTINCT YEAR(date) AS `year`, MONTH(date) AS `month` FROM zt_action) AS t1\r\nLEFT JOIN (SELECT YEAR(openedDate) AS `year`, MONTH(openedDate) AS `month`, COUNT(1) AS execution FROM zt_project WHERE deleted = \'0\' AND type IN (\'sprint\', \'stage\', \'kanban\') AND multiple = \'1\' GROUP BY `year`, `month`) AS t2 ON t1.year = t2.year AND t1.month = t2.month\r\nLEFT JOIN (SELECT YEAR(closedDate) AS `year`, MONTH(closedDate) AS `month`, COUNT(1) AS execution FROM zt_project WHERE deleted = \'0\' AND type IN (\'sprint\', \'stage\', \'kanban\') AND status = \'closed\' AND multiple = \'1\' GROUP BY `year`, `month`) AS t3 ON t1.year = t3.year AND t1.month = t3.month\r\nORDER BY `year`, t1.month','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1082,'年度新增-产品发布次数年度趋势图',1,'line',37,'','','{\r\n  \"xaxis\":[{\"field\":\"month\",\"name\":\"月份\",\"group\":\"value\"}],\r\n  \"yaxis\":[{\"type\":\"value\",\"field\":\"release\",\"agg\":\"value\",\"name\":\"发布次数\",\"valOrAgg\":\"value\"}\r\n]}','',NULL,0,NULL,'SELECT t1.year, CONCAT(t1.month, \"月\") AS `month`, IFNULL(t2.release, 0) AS `release`\r\nFROM (SELECT DISTINCT Year(date) AS `year`, MONTH(date) AS `month` FROM zt_action) AS t1\r\nLEFT JOIN (SELECT YEAR(createdDate) AS `year`, MONTH(createdDate) AS `month`, COUNT(1) AS `release` FROM zt_release WHERE deleted = \'0\' GROUP BY `year`, `month`) AS t2 ON t1.year = t2.year AND t1.month = t2.month\r\nORDER BY `year`, t1.month','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1083,'年度新增-年度投入产出比',1,'line',45,'','','{\r\n  \"xaxis\":[{\"field\":\"month\",\"name\":\"月份\",\"group\":\"value\"}],\r\n  \"yaxis\":[{\"type\":\"value\",\"field\":\"ratio\",\"agg\":\"value\",\"name\":\"投入产出比\",\"valOrAgg\":\"value\"},\r\n{\"type\":\"value\",\"field\":\"story\",\"agg\":\"value\",\"name\":\"需求交付\",\"valOrAgg\":\"value\"},\r\n{\"type\":\"value\",\"field\":\"consumed\",\"agg\":\"value\",\"name\":\"工时消耗\",\"valOrAgg\":\"value\"}\r\n]}','',NULL,0,NULL,'SELECT t1.`year`, CONCAT(t1.`month`, \"月\") AS `month`, IFNULL(t2.story, 0) AS story, IFNULL(t3.consumed, 0) AS consumed, ROUND(IF(IFNULL(t3.consumed, 0) = 0, 0, IFNULL(t2.story, 0) / IFNULL(t3.consumed, 0)), 2) AS ratio\r\nFROM (SELECT YEAR(`date`) AS \'year\', MONTH(`date`) AS \'month\' FROM zt_action GROUP BY `year`,`month`) AS t1\r\nLEFT JOIN (SELECT ROUND(SUM(estimate)) AS story, YEAR(`closedDate`) AS \'year\', MONTH(`closedDate`) AS \'month\' FROM zt_story WHERE deleted = \'0\' AND closedReason = \'done\' AND status = \'closed\' GROUP BY `year`,`month`) AS t2 ON t1.`year` = t2.`year` AND t1.`month` = t2.`month`\r\nLEFT JOIN (SELECT ROUND(SUM(consumed)) as consumed, YEAR(`date`) as \'year\', MONTH(`date`) AS \'month\' FROM zt_effort WHERE deleted = \'0\' GROUP BY `year`,`month`) AS t3 ON t1.`year` = t3.`year` AND t1.`month` = t3.`month`','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1085,'年度排行-项目集-预算投入榜',1,'bar',41,'','','{\"xaxis\":[{\"field\":\"program\",\"name\":\"项目集\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"budget\",\"agg\":\"value\",\"name\":\"预算\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT \r\n  YEAR(t2.openedDate) AS `year`, \r\n  t1.id,\r\n  t1.name AS program, \r\n  ROUND(\r\n    SUM(\r\n      IFNULL(t2.budget, 0)\r\n    ) / 10000, \r\n    2\r\n  ) AS budget \r\nFROM \r\n  zt_project AS t1 \r\n  LEFT JOIN zt_project AS t2 ON FIND_IN_SET(t1.id, t2.path) \r\n  AND t2.deleted = \'0\' \r\n  AND t2.type = \'project\' \r\nWHERE \r\n  t1.deleted = \'0\' \r\n  AND t1.type = \'program\' \r\n  AND t1.grade = 1 \r\nGROUP BY \r\n  `year`, \r\n  id,\r\n  program \r\nORDER BY \r\n  `year`, \r\n  budget DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1086,'年度排行-项目集-人员投入榜',1,'bar',41,'','','{\"xaxis\":[{\"field\":\"setName\",\"name\":\"项目集\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"number\",\"agg\":\"value\",\"name\":\"人数\",\"valOrAgg\":\"value\"}]}','','',0,NULL,'SELECT tt.join as `year`, count(1) as number, tt.setName from (\r\nselect \r\nYEAR(t1.join) as `join`, t4.name as setName \r\nfrom zt_team t1 \r\nRIGHT JOIN zt_project t2 on t2.id = t1.root\r\nLEFT JOIN zt_project t4 on FIND_IN_SET(t4.id,t2.path) and t4.grade = 1\r\nRIGHT JOIN zt_user t3 on t3.account = t1.account\r\nWHERE t1.type = \'project\'\r\nAND t2.deleted = \'0\'\r\nAND t3.deleted = \'0\'\r\n) tt\r\nGROUP BY tt.setName, tt.join\r\nORDER BY tt.join, number desc, tt.setName','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1087,'年度排行-项目集-工时消耗榜',1,'bar',41,'','','{\"xaxis\":[{\"field\":\"program\",\"name\":\"项目集\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"consumed\",\"agg\":\"value\",\"name\":\"消耗工时\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT \r\n  YEAR(t5.date) AS `year`, \r\n  t1.id,\r\n  t1.name AS program, \r\n  ROUND(\r\n    SUM(t5.consumed), \r\n    2\r\n  ) AS consumed \r\nFROM \r\n  zt_project AS t1 \r\n  LEFT JOIN zt_project AS t2 ON FIND_IN_SET(t1.id, t2.path) \r\n  AND t2.deleted = \'0\' \r\n  AND t2.type = \'project\' \r\n  LEFT JOIN zt_project AS t3 ON t2.id = t3.parent \r\n  AND t3.deleted = \'0\' \r\n  AND t3.type IN (\'sprint\', \'stage\', \'kanban\') \r\n  LEFT JOIN zt_task AS t4 ON t3.id = t4.execution \r\n  AND t4.deleted = \'0\' \r\n  AND t4.status != \'cancel\' \r\n  LEFT JOIN zt_effort AS t5 ON t4.id = t5.objectID \r\n  AND t5.deleted = \'0\' \r\n  AND t5.objectType = \'task\' \r\nWHERE \r\n  t1.deleted = \'0\' \r\n  AND t1.type = \'program\' \r\n  AND t1.grade = 1 \r\n  AND t5.id IS NOT NULL \r\nGROUP BY \r\n  `year`, \r\n  id,\r\n  program \r\nORDER BY \r\n  `year`, \r\n  consumed DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1088,'年度排行-项目集-新增需求条目榜',1,'bar',36,'','','{\"xaxis\":[{\"field\":\"program\",\"name\":\"项目集\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"story\",\"agg\":\"value\",\"name\":\"新增需求条数\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT \r\n  YEAR(t3.openedDate) AS `year`,\r\n  t1.id, \r\n  t1.name AS program, \r\n  COUNT(1) AS story \r\nFROM \r\n  zt_project AS t1 \r\n  LEFT JOIN zt_product AS t2 ON t1.id = t2.program \r\n  AND t2.deleted = \'0\' \r\n  LEFT JOIN zt_story AS t3 ON t2.id = t3.product \r\n  AND t3.deleted = \'0\' \r\nWHERE \r\n  t1.deleted = \'0\' \r\n  AND t1.type = \'program\' \r\n  AND t1.grade = 1 \r\n  AND t3.id IS NOT NULL \r\nGROUP BY \r\n  `year`, \r\n  id,\r\n  program \r\nORDER BY \r\n  `year`, \r\n  story DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1089,'年度排行-项目集-新增需求规模榜',1,'bar',36,'','','{\"xaxis\":[{\"field\":\"program\",\"name\":\"项目集\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"story\",\"agg\":\"value\",\"name\":\"新增需求规模\",\"valOrAgg\":\"value\"}]}','','',0,NULL,'SELECT \r\n  YEAR(t3.openedDate) AS `year`, \r\n  t1.id,\r\n  t1.name AS program, \r\n  ROUND(\r\n    SUM(t3.estimate), \r\n    2\r\n  ) AS story \r\nFROM \r\n  zt_project AS t1 \r\n  LEFT JOIN zt_product AS t2 ON t1.id = t2.program \r\n  AND t2.deleted = \'0\' \r\n  LEFT JOIN zt_story AS t3 ON t2.id = t3.product \r\n  AND t3.deleted = \'0\' \r\nWHERE \r\n  t1.deleted = \'0\' \r\n  AND t1.type = \'program\' \r\n  AND t1.grade = 1 \r\n  AND t3.id IS NOT NULL \r\nGROUP BY \r\n  `year`,\r\n  id, \r\n  program \r\nORDER BY \r\n  `year`, \r\n  story DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1090,'年度排行-项目集-新增Bug条目榜',1,'bar',44,'','','{\"xaxis\":[{\"field\":\"program\",\"name\":\"项目集\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"bug\",\"agg\":\"value\",\"name\":\"新增Bug条目\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT \r\n  YEAR(t3.openedDate) AS `year`,\r\n  t1.id, \r\n  t1.name AS program, \r\n  COUNT(1) AS bug \r\nFROM \r\n  zt_project AS t1 \r\n  LEFT JOIN zt_product AS t2 ON t1.id = t2.program \r\n  AND t2.deleted = \'0\' \r\n  LEFT JOIN zt_bug AS t3 ON t2.id = t3.product \r\n  AND t3.deleted = \'0\' \r\nWHERE \r\n  t1.deleted = \'0\' \r\n  AND t1.type = \'program\' \r\n  AND t1.grade = 1 \r\n  AND t3.id IS NOT NULL \r\nGROUP BY \r\n  `year`, \r\n  id,\r\n  program \r\nORDER BY \r\n  `year`, \r\n  bug DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1091,'年度排行-项目集-完成需求条目榜',1,'bar',43,'','','{\"xaxis\":[{\"field\":\"program\",\"name\":\"项目集\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"story\",\"agg\":\"value\",\"name\":\"完成需求条目\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT \r\n  YEAR(t3.closedDate) AS `year`, \r\n  t1.id,\r\n  t1.name AS program, \r\n  COUNT(1) AS story \r\nFROM \r\n  zt_project AS t1 \r\n  LEFT JOIN zt_product AS t2 ON t1.id = t2.program \r\n  AND t2.deleted = \'0\' \r\n  LEFT JOIN zt_story AS t3 ON t2.id = t3.product \r\n  AND t3.deleted = \'0\' \r\n  AND t3.closedReason = \'done\' \r\nWHERE \r\n  t1.deleted = \'0\' \r\n  AND t1.type = \'program\' \r\n  AND t1.grade = 1 \r\n  AND t3.id IS NOT NULL \r\nGROUP BY \r\n  `year`,\r\n  id,  \r\n  program \r\nORDER BY \r\n  `year`, \r\n  story DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1092,'年度排行-项目集-完成需求规模榜',1,'bar',36,'','','{\"xaxis\":[{\"field\":\"program\",\"name\":\"项目集\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"story\",\"agg\":\"value\",\"name\":\"完成需求规模\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT \r\n  YEAR(t3.closedDate) AS `year`, \r\n  t1.id,\r\n  t1.name AS program, \r\n  ROUND(\r\n    SUM(t3.estimate), \r\n    2\r\n  ) AS story \r\nFROM \r\n  zt_project AS t1 \r\n  LEFT JOIN zt_product AS t2 ON t1.id = t2.program \r\n  AND t2.deleted = \'0\' \r\n  LEFT JOIN zt_story AS t3 ON t2.id = t3.product \r\n  AND t3.deleted = \'0\' \r\n  AND t3.closedReason = \'done\' \r\nWHERE \r\n  t1.deleted = \'0\' \r\n  AND t1.type = \'program\' \r\n  AND t1.grade = 1 \r\n  AND t3.id IS NOT NULL \r\nGROUP BY \r\n  `year`, \r\n  id,\r\n  program \r\nORDER BY \r\n  `year`, \r\n  story DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1093,'年度排行-项目集-修复Bug条目榜',1,'bar',44,'','','{\"xaxis\":[{\"field\":\"program\",\"name\":\"项目集\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"bug\",\"agg\":\"value\",\"name\":\"修复Bug条目\",\"valOrAgg\":\"value\"}]}','','',0,NULL,'SELECT \r\n  YEAR(t3.closedDate) AS `year`,\r\n  t1.id,  \r\n  t1.name AS program, \r\n  COUNT(1) AS bug \r\nFROM \r\n  zt_project AS t1 \r\n  LEFT JOIN zt_product AS t2 ON t1.id = t2.program \r\n  AND t2.deleted = \'0\' \r\n  LEFT JOIN zt_bug AS t3 ON t2.id = t3.product \r\n  AND t3.deleted = \'0\' \r\n  AND t3.resolution = \'fixed\' \r\n  AND t3.status = \'closed\' \r\nWHERE \r\n  t1.deleted = \'0\' \r\n  AND t1.type = \'program\' \r\n  AND t1.grade = 1 \r\n  AND t3.id IS NOT NULL \r\nGROUP BY \r\n  `year`, \r\n  id,\r\n  program \r\nORDER BY \r\n  `year`, \r\n  bug DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1094,'年度排行-项目-工期榜',1,'bar',42,'','','{\"xaxis\":[{\"field\":\"name\",\"name\":\"项目\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"duration\",\"agg\":\"value\",\"name\":\"工期\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT `year`, id,name,status,realBegan,realEnd,IF(status = \'closed\', DATEDIFF(realEnd, realBegan), DATEDIFF(NOW(),realBegan)) as duration\r\nFROM (SELECT DISTINCT YEAR(`date`) as \'year\' FROM zt_action) AS t1\r\nLEFT JOIN zt_project AS t2 ON 1 = 1 WHERE deleted = \'0\' AND type = \'project\' AND YEAR(realBegan) <= `year` AND LEFT(realBegan, 4) != \'0000\' AND (status =\'doing\' OR (status = \'suspended\' AND YEAR(suspendedDate) >= `year`) OR (status = \'closed\' AND YEAR(realEnd) >= `year`)) HAVING 1=1 ORDER BY `year`, duration desc','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1096,'年度排行-项目-工期偏差榜',1,'bar',42,'','','{\"xaxis\":[{\"field\":\"name\",\"name\":\"项目\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"duration\",\"agg\":\"value\",\"name\":\"工期\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT `year`, id,name,status,`begin`,`end`,realBegan,realEnd,\nROUND((IF(LEFT(realEnd,4) != \'0000\', DATEDIFF(realEnd, realBegan), DATEDIFF(NOW(),realBegan)) - DATEDIFF(`end`, `begin`)) / DATEDIFF(`end`,`begin`) * 100) as duration\nFROM (SELECT DISTINCT YEAR(`date`) as \'year\' FROM zt_action) AS t1\nLEFT JOIN zt_project AS t2 ON 1 = 1 \nWHERE deleted = \'0\' AND type = \'project\'\nAND YEAR(realBegan) <= `year` AND LEFT(realBegan, 4) != \'0000\'\nAND (YEAR(realEnd) >= `year` OR LEFT(realEnd, 4) = \'0000\') AND YEAR(`end`) != \'2059\'\nHAVING 1=1\nORDER BY duration ASC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1097,'年度排行-项目-人员投入榜',1,'bar',41,'','','{\"xaxis\":[{\"field\":\"name\",\"name\":\"项目\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"number\",\"agg\":\"value\",\"name\":\"人数\",\"valOrAgg\":\"value\"}]}','','',0,NULL,'SELECT tt.join as `year`, count(1) as number, tt.name from (\r\nselect \r\nt2.name, YEAR(t1.join) as `join`\r\nfrom zt_team t1 \r\nRIGHT JOIN zt_project t2 on t2.id = t1.root\r\nRIGHT JOIN zt_user t3 on t3.account = t1.account\r\nWHERE t1.type = \'project\'\r\nAND t2.deleted = \'0\'\r\n) tt\r\nGROUP BY tt.`name`, tt.join\r\nORDER BY tt.join, number desc, tt.name','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1098,'年度排行-项目-工时消耗榜',1,'bar',41,'','','{\"xaxis\":[{\"field\":\"project\",\"name\":\"项目\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"consumed\",\"agg\":\"value\",\"name\":\"消耗工时\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT \r\n  YEAR(t4.date) AS `year`,\r\n  t1.id,  \r\n  t1.name AS project, \r\n  ROUND(\r\n    SUM(t4.consumed), \r\n    2\r\n  ) AS consumed \r\nFROM \r\n  zt_project AS t1 \r\n  LEFT JOIN zt_project AS t2 ON t1.id = t2.parent \r\n  AND t2.deleted = \'0\' \r\n  AND t2.type IN (\'sprint\', \'stage\', \'kanban\') \r\n  LEFT JOIN zt_task AS t3 ON t2.id = t3.execution \r\n  AND t3.deleted = \'0\' \r\n  AND t3.status != \'cancel\' \r\n  LEFT JOIN zt_effort AS t4 ON t3.id = t4.objectID \r\n  AND t4.deleted = \'0\' \r\n  AND t4.objectType = \'task\' \r\nWHERE \r\n  t1.deleted = \'0\' \r\n  AND t1.type = \'project\' \r\n  AND t4.id IS NOT NULL \r\nGROUP BY \r\n  `year`, \r\n  id,\r\n  project \r\nORDER BY \r\n  `year`, \r\n  consumed DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1099,'年度排行-项目-完成需求条目榜',1,'bar',36,'','','{\"xaxis\":[{\"field\":\"project\",\"name\":\"项目\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"story\",\"agg\":\"value\",\"name\":\"完成需求条目\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT \r\n  YEAR(t1.closedDate) AS `year`, \r\n  t1.id, \r\n  t1.project, \r\n  COUNT(1) AS story \r\nFROM \r\n  (\r\n    SELECT \r\n      DISTINCT t1.id, \r\n      t1.name AS project, \r\n      t4.id AS story, \r\n      t4.closedDate \r\n    FROM \r\n      zt_project AS t1 \r\n      LEFT JOIN zt_project AS t2 ON t1.id = t2.parent \r\n      AND t2.deleted = \'0\' \r\n      AND t2.type IN (\'sprint\', \'stage\', \'kanban\') \r\n      LEFT JOIN zt_projectstory AS t3 ON t2.id = t3.project \r\n      LEFT JOIN zt_story AS t4 ON t3.story = t4.id \r\n      AND t4.deleted = \'0\' \r\n      AND t4.closedReason = \'done\' \r\n    WHERE \r\n      t1.deleted = \'0\' \r\n      AND t1.type = \'project\' \r\n      AND t4.id IS NOT NULL\r\n  ) AS t1 \r\nGROUP BY \r\n  `year`, \r\n  id, \r\n  project \r\nORDER BY \r\n  `year`, \r\n  story DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1100,'年度排行-项目-完成需求规模榜',1,'bar',43,'','','{\"xaxis\":[{\"field\":\"project\",\"name\":\"项目\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"story\",\"agg\":\"value\",\"name\":\"完成需求规模\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT \r\n  YEAR(t1.closedDate) AS `year`, \r\n  t1.id, \r\n  t1.project, \r\n  ROUND(\r\n    SUM(t1.estimate), \r\n    2\r\n  ) AS story \r\nFROM \r\n  (\r\n    SELECT \r\n      DISTINCT t1.id, \r\n      t1.name AS project, \r\n      t4.id AS story, \r\n      t4.estimate, \r\n      t4.closedDate \r\n    FROM \r\n      zt_project AS t1 \r\n      LEFT JOIN zt_project AS t2 ON t1.id = t2.parent \r\n      AND t2.deleted = \'0\' \r\n      AND t2.type IN (\'sprint\', \'stage\', \'kanban\') \r\n      LEFT JOIN zt_projectstory AS t3 ON t2.id = t3.project \r\n      LEFT JOIN zt_story AS t4 ON t3.story = t4.id \r\n      AND t4.deleted = \'0\' \r\n      AND t4.closedReason = \'done\' \r\n    WHERE \r\n      t1.deleted = \'0\' \r\n      AND t1.type = \'project\' \r\n      AND t4.id IS NOT NULL\r\n  ) AS t1 \r\nGROUP BY \r\n  `year`, \r\n  id, \r\n  project \r\nORDER BY \r\n  `year`, \r\n  story DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1101,'年度排行-产品-新增需求条目榜',1,'bar',36,'','','{\"xaxis\":[{\"field\":\"product\",\"name\":\"产品\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"story\",\"agg\":\"value\",\"name\":\"新增需求条目\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT YEAR(t2.openedDate) AS `year`, t1.id,  t1.name AS product, COUNT(1) AS story\r\nFROM zt_product AS t1\r\nLEFT JOIN zt_story AS t2 ON t1.id = t2.product AND t2.deleted = \'0\'\r\nWHERE t1.deleted = \'0\' AND t1.shadow = \'0\' AND t1.vision = \'rnd\' AND t2.id IS NOT NULL\r\nGROUP BY `year`, id, product\r\nORDER BY `year`, story DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1102,'年度排行-产品-完成需求规模榜',1,'bar',36,'','','{\"xaxis\":[{\"field\":\"product\",\"name\":\"产品\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"story\",\"agg\":\"value\",\"name\":\"完成需求规模\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT YEAR(t2.closedDate) AS `year`, t1.id, t1.name AS product, ROUND(SUM(t2.estimate), 1) AS story\r\nFROM zt_product AS t1\r\nLEFT JOIN zt_story AS t2 ON t1.id = t2.product AND t2.deleted = \'0\' AND t2.closedReason = \'done\'\r\nWHERE t1.deleted = \'0\' AND t1.shadow = \'0\' AND t1.vision = \'rnd\' AND t2.id IS NOT NULL\r\nGROUP BY `year`, id, product\r\nORDER BY `year`, story DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1103,'年度排行-产品-新增Bug条目榜',1,'bar',44,'','','{\"xaxis\":[{\"field\":\"product\",\"name\":\"产品\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"bug\",\"agg\":\"value\",\"name\":\"新增Bug条目\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT YEAR(t2.openedDate) AS `year`, t1.id,  t1.name AS product, COUNT(1) AS bug\r\nFROM zt_product AS t1\r\nLEFT JOIN zt_bug AS t2 ON t1.id = t2.product AND t2.deleted = \'0\'\r\nWHERE t1.deleted = \'0\' AND t1.shadow = \'0\' AND t1.vision = \'rnd\' AND t2.id IS NOT NULL\r\nGROUP BY `year`, id, product\r\nORDER BY `year`, bug DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1104,'年度排行-产品-修复Bug条目榜',1,'bar',44,'','','{\"xaxis\":[{\"field\":\"product\",\"name\":\"产品\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"bug\",\"agg\":\"value\",\"name\":\"修复Bug条目\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT YEAR(t2.closedDate) AS `year`, t1.id, t1.name AS product, COUNT(1) AS bug\r\nFROM zt_product AS t1\r\nLEFT JOIN zt_bug AS t2 ON t1.id = t2.product AND t2.deleted = \'0\' AND t2.resolution = \'fixed\' AND t2.status = \'closed\'\r\nWHERE t1.deleted = \'0\' AND t1.shadow = \'0\' AND t1.vision = \'rnd\' AND t2.id IS NOT NULL\r\nGROUP BY `year`, id, product\r\nORDER BY `year`, bug DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1105,'年度排行-个人-创建需求条目榜',1,'bar',56,'','','{\"xaxis\":[{\"field\":\"realname\",\"name\":\"用户\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"count\",\"agg\":\"value\",\"name\":\"创建需求条目\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT \r\nYEAR(t3.openedDate) AS `year`,t2.realname,count(1) AS count\r\nFROM zt_action AS t1 RIGHT JOIN zt_user AS t2 ON t1.actor=t2.account LEFT JOIN zt_story AS t3 ON t1.objectID=t3.id\r\nWHERE t1.objectType=\'story\' AND t1.action=\'opened\' AND t3.deleted=\'0\'\r\nGROUP BY `year`,t2.account ORDER BY `year`,count DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1106,'年度排行-个人-创建用例条目榜',1,'bar',56,'','','{\"xaxis\":[{\"field\":\"realname\",\"name\":\"用户\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"count\",\"agg\":\"value\",\"name\":\"创建需用例条目\",\"valOrAgg\":\"value\"}]}','','',0,NULL,'SELECT \nYEAR(t3.openedDate) AS `year`,t2.realname,count(1) AS count\nFROM zt_action AS t1 RIGHT JOIN zt_user AS t2 ON t1.actor=t2.account LEFT JOIN zt_case AS t3 ON t1.objectID=t3.id\nWHERE t1.objectType=\'case\' AND t1.action=\'opened\' AND t3.deleted=\'0\'\nGROUP BY `year`,t2.account ORDER BY `year`,count DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1107,'年度排行-个人-创建Bug条目榜',1,'bar',56,'','','{\"xaxis\":[{\"field\":\"realname\",\"name\":\"用户\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"count\",\"agg\":\"value\",\"name\":\"创建Bug条目\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT \nYEAR(t3.openedDate) AS `year`,t2.realname,count(1) AS count\nFROM zt_action AS t1 RIGHT JOIN zt_user AS t2 ON t1.actor=t2.account LEFT JOIN zt_bug AS t3 ON t1.objectID=t3.id\nWHERE t1.objectType=\'bug\' AND t1.action=\'opened\' AND t3.deleted=\'0\'\nGROUP BY `year`,t2.account ORDER BY `year`,count DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1108,'年度排行-个人-修复Bug条目榜',1,'bar',56,'','','{\"xaxis\":[{\"field\":\"realname\",\"name\":\"用户\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"count\",\"agg\":\"value\",\"name\":\"修复Bug条目\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT \r\nYEAR(t3.openedDate) AS `year`,t2.realname,count(DISTINCT t3.id) AS count\r\nFROM zt_action AS t1 RIGHT JOIN zt_user AS t2 ON t1.actor=t2.account LEFT JOIN zt_bug AS t3 ON t1.objectID=t3.id\r\nWHERE t1.objectType=\'bug\' AND t1.action=\'resolved\' AND t3.deleted=\'0\'\r\nGROUP BY `year`,t2.account ORDER BY `year`,count DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1109,'年度排行-个人-工时消耗榜',1,'bar',56,'','','{\"xaxis\":[{\"field\":\"realname\",\"name\":\"用户\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"consumed\",\"agg\":\"value\",\"name\":\"消耗工时\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT YEAR(t1.date) AS `year`, t2.realname, ROUND(SUM(t1.consumed),1) AS consumed\nFROM zt_effort AS t1 LEFT JOIN zt_user AS t2 ON t1.account = t2.account\nWHERE t1.deleted = \'0\' AND t2.deleted = \'0\'\nGROUP BY `year`, realname\nORDER BY `year`, consumed DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(1110,'年度排行-个人-禅道操作次数榜',1,'bar',56,'','','{\"xaxis\":[{\"field\":\"realname\",\"name\":\"用户\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"count\",\"agg\":\"value\",\"name\":\"操作次数\",\"valOrAgg\":\"value\"}]}','',NULL,0,NULL,'SELECT YEAR(t1.date) AS `year`,IFNULL(t2.realname,t1.actor) AS realname,count(1) AS count\r\nFROM zt_action t1 LEFT JOIN zt_user AS t2 ON t1.actor=t2.account\r\nGROUP BY `year`,t1.actor\r\nORDER BY `year`, `count` DESC','published',1,'','admin','2023-11-24 15:34:00','',NULL,0),(10000,'年度完成项目-完成项目数',2,'card',72,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,'','SELECT COUNT(1) AS number,YEAR(`closedDate`) AS \'year\' FROM zt_project WHERE type=\'project\' AND status=\'closed\' AND deleted=\'0\' GROUP BY `year`','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10001,'年度完成项目-按时完成项目数',2,'card',72,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,'','SELECT COUNT(1) AS number,YEAR(`closedDate`) as \'year\' FROM (SELECT id, begin, end, IF(left(realEnd, 4) = \'0000\', LEFT(closedDate,10), realEnd) AS realEnd,closedDate FROM zt_project WHERE deleted=\'0\' AND type=\'project\' AND status=\'closed\') t1 WHERE t1.realEnd<=end GROUP BY `year`','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10002,'年度完成项目-延期完成项目数',2,'card',72,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,'','SELECT COUNT(1) AS number,YEAR(`closedDate`) AS \'year\' FROM (SELECT id, begin, end, IF(left(realEnd, 4) = \'0000\', LEFT(closedDate,10), realEnd) AS realEnd,closedDate FROM zt_project WHERE deleted=\'0\' AND type=\'project\' AND status=\'closed\') t1 WHERE t1.realEnd>end GROUP BY `year`','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10003,'年度完成项目-完成需求条目数',2,'card',75,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,'','SELECT COUNT(1) AS number,YEAR(`closedDate`) AS \'year\' FROM zt_story WHERE deleted=\'0\' AND status=\'closed\' AND closedReason=\'done\' GROUP BY `year`','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10004,'年度完成项目-完成需求规模数',2,'card',75,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,'','SELECT ROUND(SUM(estimate),2) AS number,YEAR(`closedDate`) AS \'year\' FROM zt_story WHERE deleted=\'0\' AND status=\'closed\' AND closedReason=\'done\'  GROUP BY `year`','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10005,'年度完成项目-完成发布数',2,'card',74,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,'','SELECT COUNT(1) AS number,YEAR(`date`) AS \'year\' FROM zt_release WHERE deleted=\'0\' GROUP BY `year`','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10006,'年度完成项目-解决bug数',2,'card',77,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,'','SELECT SUM(CASE WHEN resolution=\'fixed\' THEN 1 ELSE 0 END) AS number,YEAR(`resolvedDate`) AS \'year\' FROM zt_bug WHERE deleted=\'0\' GROUP BY `year`','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10007,'年度完成项目-完成执行数',2,'card',73,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,'','SELECT COUNT(1) AS number,YEAR(`closedDate`) AS \'year\' FROM zt_project WHERE type=\'sprint\' AND status=\'closed\' AND deleted=\'0\' GROUP BY `year`','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10008,'年度完成项目-按时完成执行数',2,'card',73,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,'','SELECT COUNT(1) AS number,YEAR(`closedDate`) AS \'year\' FROM (SELECT id, begin, end, IF(LEFT(realEnd,4) = \'0000\', LEFT(closedDate,10), realEnd) AS realEnd,closedDate FROM zt_project WHERE deleted=\'0\' AND type=\'sprint\' AND status=\'closed\') t1 WHERE t1.realEnd<=end GROUP BY `year`','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10009,'年度完成项目-延期完成执行数',2,'card',73,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,'','SELECT COUNT(1) AS number,YEAR(`closedDate`) AS \'year\' FROM (SELECT id, begin, end, IF(LEFT(realEnd, 4) = \'0000\', LEFT(closedDate,10), realEnd) AS realEnd, closedDate FROM zt_project WHERE deleted=\'0\' AND type=\'sprint\' AND status=\'closed\') t1 WHERE t1.realEnd>end GROUP BY `year`','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10010,'年度完成项目-完成任务条目数',2,'card',76,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,'','SELECT COUNT(1) AS number,YEAR(`closedDate`) AS \'year\' FROM zt_task WHERE deleted=\'0\' AND status=\'closed\' AND closedReason=\'done\' GROUP BY `year`','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10011,'年度完成项目-完成任务预计工时数',2,'card',78,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,'','SELECT ROUND(SUM(estimate),2) AS number,YEAR(`closedDate`) AS \'year\' FROM zt_task WHERE deleted=\'0\' AND status=\'closed\' AND closedReason=\'done\' GROUP BY `year`','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10012,'年度完成项目-完成任务消耗工时数',2,'card',78,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,'','SELECT ROUND(SUM(consumed),2) AS number,YEAR(`closedDate`) AS \'year\' FROM zt_task WHERE deleted=\'0\' AND status=\'closed\' AND closedReason=\'done\' GROUP BY `year`','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10013,'年度完成项目-投入的总人天',2,'card',78,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"},\r\n\"type\": \"value\"\r\n}','[]','',0,'','SELECT SUM(t2.people*DATEDIFF(t1.realEnd,t1.realBegan)) AS number,YEAR(`closedDate`) AS \'year\' FROM (SELECT id, realBegan, IF(LEFT(realEnd, 4) = \'0000\', closedDate, realEnd) AS realEnd, closedDate FROM zt_project WHERE deleted=\'0\' AND status=\'closed\' AND type=\'project\' AND realBegan != \'1970-01-01\') t1 LEFT JOIN (SELECT root, COUNT(id) people FROM zt_team WHERE type=\'project\' GROUP BY `root`) t2 ON t1.id=t2.root GROUP BY `year`','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10014,'年度完成项目-项目按期完成率',2,'piecircle',71,'0','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"需求数\",\"valOrAgg\":\"count\"}]}','[]','',0,'','SELECT t1.id,IF(t1.realEnd<=t1.end,\'done\',\'undone\') AS \'status\', YEAR(`closedDate`) AS \'year\' FROM(SELECT id, begin, end, IF(LEFT(realEnd, 4) = \'0000\', LEFT(closedDate,10), realEnd) AS realEnd, closedDate FROM zt_project WHERE deleted=\'0\' AND type=\'project\' AND status=\'closed\') t1','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10015,'年度完成项目-执行按期完成率',2,'piecircle',71,'0','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"需求数\",\"valOrAgg\":\"count\"}]}','[]','',0,'','SELECT IF(t1.realEnd<=t1.end,\'done\',\'undone\') AS \'status\', YEAR(`closedDate`) AS \'year\' FROM (SELECT id, begin, end, IF(LEFT(realEnd,4)=\'0000\',LEFT(closedDate,10), realEnd) AS realEnd, closedDate FROM zt_project WHERE deleted=\'0\' and type=\'sprint\' and status=\'closed\') t1','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10016,'年度完成项目-项目延期率',2,'piecircle',71,'0','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"需求数\",\"valOrAgg\":\"count\"}]}','[]','',0,'','SELECT IF(t1.realEnd>t1.end ,\'done\',\'undone\') AS \'status\', YEAR(`closedDate`) AS \'year\' FROM (SELECT id, begin, end, IF(LEFT(realEnd, 4) = \'0000\', LEFT(closedDate,10), realEnd) AS realEnd, closedDate FROM zt_project WHERE deleted=\'0\' AND type=\'project\' AND status=\'closed\') t1','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10017,'年度完成项目-执行延期率',2,'piecircle',71,'0','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"需求数\",\"valOrAgg\":\"count\"}]}','[]','',0,'','SELECT IF(t1.realEnd>t1.end,\'done\',\'undone\') AS \'status\', YEAR(`closedDate`) AS \'year\' FROM(SELECT id, begin, end, IF(LEFT(realEnd, 4) = \'0000\', LEFT(closedDate,10), realEnd) AS realEnd, closedDate FROM zt_project WHERE deleted=\'0\' and type=\'sprint\' and status=\'closed\') t1','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10018,'年度完成项目-完成项目工期偏差条形图',2,'pie',71,'0','','[{\"type\":\"cluBarY\",\"xaxis\":[{\"field\":\"name\",\"name\":\"\\u9879\\u76ee\\u540d\\u79f0\",\"group\":\"\"}],\"yaxis\":[{\"field\":\"daterate\",\"name\":\"daterate\",\"valOrAgg\":\"sum\"}]}]','[{\"field\":\"closedDate\",\"type\":\"date\",\"name\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"default\":{\"begin\":\"\",\"end\":\"\"}}]','{\"name\":{\"name\":\"\\u9879\\u76ee\\u540d\\u79f0\",\"object\":\"project\",\"field\":\"name\",\"type\":\"string\"},\"closedDate\":{\"name\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"object\":\"project\",\"field\":\"closedDate\",\"type\":\"date\"},\"daterate\":{\"name\":\"daterate\",\"object\":\"project\",\"field\":\"daterate\",\"type\":\"number\"}}',0,'{\"name\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"closedDate\":{\"zh-cn\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"daterate\":{\"zh-cn\":\"\\u5de5\\u671f\\u504f\\u5dee\\u7387\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"}}','select\nt1.name,\nt1.closedDate,\nround(t1.realduration-t1.planduration)/t1.planduration as daterate\nfrom(\nselect\nname,\nid,\nclosedDate,\nbegin,\nend,\ndatediff(`end`,`begin`) planduration,\nrealBegan,\nrealEnd,\nifnull(if(left(realEnd,4) != \'0000\',datediff(`realEnd`,`realBegan`),datediff(`closedDate`,`realBegan`)),0) realduration\nfrom\nzt_project\nwhere deleted=\'0\'\nand status=\'closed\'\nand type=\'project\'\n) t1','published',1,'','admin','2023-11-24 15:34:00','admin','2023-04-06 12:18:07',0),(10019,'年度完成项目-单位工时交付需求规模数对比图',2,'pie',71,'0','','[{\"type\":\"cluBarX\",\"xaxis\":[{\"field\":\"project\",\"name\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"group\":\"\"}],\"yaxis\":[{\"field\":\"\\u5355\\u4f4d\\u65f6\\u95f4\\u4ea4\\u4ed8\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"name\":\"\\u5355\\u4f4d\\u65f6\\u95f4\\u4ea4\\u4ed8\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"valOrAgg\":\"sum\"}]}]','[{\"field\":\"project\",\"type\":\"input\",\"name\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"default\":\"\"}]','{\"project\":{\"name\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"object\":\"project\",\"field\":\"project\",\"type\":\"string\"},\"\\u6545\\u4e8b\\u70b9\":{\"name\":\"\\u6545\\u4e8b\\u70b9\",\"object\":\"project\",\"field\":\"\\u6545\\u4e8b\\u70b9\",\"type\":\"number\"},\"\\u5de5\\u65f6\":{\"name\":\"\\u5de5\\u65f6\",\"object\":\"project\",\"field\":\"\\u5de5\\u65f6\",\"type\":\"number\"},\"\\u5355\\u4f4d\\u65f6\\u95f4\\u4ea4\\u4ed8\\u9700\\u6c42\\u89c4\\u6a21\\u6570\":{\"name\":\"\\u5355\\u4f4d\\u65f6\\u95f4\\u4ea4\\u4ed8\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"object\":\"project\",\"field\":\"\\u5355\\u4f4d\\u65f6\\u95f4\\u4ea4\\u4ed8\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"type\":\"number\"}}',0,'','select tt.*,\ntt.`故事点` / tt.`工时` as \"单位时间交付需求规模数\"\nfrom (\nselect\nt1.name as project, \n(\n	select round(sum(t3.estimate), 1) from zt_projectstory t2\n	left join zt_story t3 on t3.id= t2.story and t3.status=\'closed\' and t3.closedReason = \'done\'\n	where t2.project = t1.id\n) as \"故事点\",\n(\n	select round(sum(t5.consumed), 1) from zt_project t4\n	left join zt_task t5 on t5.execution = t4.id and t5.deleted = \'0\' and t5.parent in (0, -1)\n  where t4.project = t1.id and t4.type = \'sprint\'\n) as \"工时\"\nfrom zt_project t1\nwhere t1.status = \'closed\'\nand t1.deleted = \'0\'\nand t1.type = \'project\'\ngroup by t1.id) tt','published',1,'','admin','2023-11-24 15:34:00','admin','2023-04-06 13:41:05',0),(10020,'年度完成项目-项目完成分布图',2,'pie',71,'0','','[{\"type\":\"pie\",\"group\":[{\"field\":\"\\u9879\\u76ee\\u5b8c\\u6210\\u60c5\\u51b5\",\"name\":\"\\u9879\\u76ee\\u5b8c\\u6210\\u60c5\\u51b5\",\"group\":\"\"}],\"metric\":[{\"field\":\"id\",\"name\":\"\\u9879\\u76eeID\",\"valOrAgg\":\"count\"}]}]','[{\"field\":\"closedDate\",\"type\":\"date\",\"name\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"default\":{\"begin\":\"\",\"end\":\"\"}}]','{\"id\":{\"name\":\"\\u9879\\u76eeID\",\"object\":\"project\",\"field\":\"id\",\"type\":\"number\"},\"\\u9879\\u76ee\\u5b8c\\u6210\\u60c5\\u51b5\":{\"name\":\"\\u9879\\u76ee\\u5b8c\\u6210\\u60c5\\u51b5\",\"object\":\"project\",\"field\":\"\\u9879\\u76ee\\u5b8c\\u6210\\u60c5\\u51b5\",\"type\":\"string\"},\"closedDate\":{\"name\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"object\":\"project\",\"field\":\"closedDate\",\"type\":\"date\"}}',0,'','select\nt1.id,\n(case when t1.realEnd<t1.end then \"提前完成项目\" when t1.realEnd=t1.end then \"正常完成项目\" else \"延期完成项目\" end) \"项目完成情况\",\nt1.closedDate\nfrom(\nselect\nid,\nclosedDate,\nend,\nif(left(realEnd, 4) = \'0000\', closedDate, realEnd) as realEnd\nfrom\nzt_project\nwhere deleted=\'0\'\nand status=\'closed\'\nand type=\'project\') t1','published',1,'','admin','2023-11-24 15:34:00','admin','2023-04-06 12:22:34',0),(10021,'年度完成项目-执行完成分布图',2,'pie',71,'0','','[{\"type\":\"pie\",\"group\":[{\"field\":\"\\u6267\\u884c\\u5b8c\\u6210\\u60c5\\u51b5\",\"name\":\"\\u6267\\u884c\\u5b8c\\u6210\\u60c5\\u51b5\",\"group\":\"\"}],\"metric\":[{\"field\":\"id\",\"name\":\"\\u9879\\u76eeID\",\"valOrAgg\":\"count\"}]}]','[{\"field\":\"closedDate\",\"type\":\"date\",\"name\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"default\":{\"begin\":\"\",\"end\":\"\"}}]','{\"id\":{\"name\":\"\\u9879\\u76eeID\",\"object\":\"project\",\"field\":\"id\",\"type\":\"number\"},\"\\u6267\\u884c\\u5b8c\\u6210\\u60c5\\u51b5\":{\"name\":\"\\u6267\\u884c\\u5b8c\\u6210\\u60c5\\u51b5\",\"object\":\"project\",\"field\":\"\\u6267\\u884c\\u5b8c\\u6210\\u60c5\\u51b5\",\"type\":\"string\"},\"closedDate\":{\"name\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"object\":\"project\",\"field\":\"closedDate\",\"type\":\"date\"}}',0,'','select\nt1.id,\n(case when t1.realEnd<t1.end then \"提前完成执行\" when t1.realEnd=t1.end then \"正常完成执行\" else \"延期完成执行\" end) \"执行完成情况\",\nt1.closedDate\nfrom(\nselect\nid,\nclosedDate,\nend,\nif(left(realEnd, 4) = \'0000\', closedDate, realEnd) as realEnd\nfrom\nzt_project\nwhere deleted=\'0\'\nand status=\'closed\'\nand type=\'sprint\') t1','published',1,'','admin','2023-11-24 15:34:00','admin','2023-04-06 12:22:34',0),(10022,'年度完成项目-完成项目工时偏差条形图',2,'cluBarY',70,'0','','[{\"type\":\"cluBarY\",\"xaxis\":[{\"field\":\"name\",\"name\":\"\\u4efb\\u52a1\\u540d\\u79f0\",\"group\":\"\"}],\"yaxis\":[{\"field\":\"rate\",\"name\":\"rate\",\"valOrAgg\":\"sum\"}]}]','[{\"field\":\"closedDate\",\"type\":\"date\",\"name\":\"\\u5173\\u95ed\\u65f6\\u95f4\",\"default\":{\"begin\":\"\",\"end\":\"\"}}]','{\"name\":{\"name\":\"\\u4efb\\u52a1\\u540d\\u79f0\",\"object\":\"task\",\"field\":\"name\",\"type\":\"string\"},\"id\":{\"name\":\"\\u7f16\\u53f7\",\"object\":\"task\",\"field\":\"id\",\"type\":\"number\"},\"closedDate\":{\"name\":\"\\u5173\\u95ed\\u65f6\\u95f4\",\"object\":\"task\",\"field\":\"closedDate\",\"type\":\"date\"},\"estimate\":{\"name\":\"\\u6700\\u521d\\u9884\\u8ba1\",\"object\":\"task\",\"field\":\"estimate\",\"type\":\"string\"},\"consumed\":{\"name\":\"\\u603b\\u8ba1\\u6d88\\u8017\",\"object\":\"task\",\"field\":\"consumed\",\"type\":\"string\"},\"left\":{\"name\":\"\\u9884\\u8ba1\\u5269\\u4f59\",\"object\":\"task\",\"field\":\"left\",\"type\":\"string\"},\"deviation\":{\"name\":\"deviation\",\"object\":\"task\",\"field\":\"deviation\",\"type\":\"number\"},\"rate\":{\"name\":\"rate\",\"object\":\"task\",\"field\":\"rate\",\"type\":\"number\"}}',0,'{\"name\":{\"zh-cn\":\"\\u4efb\\u52a1\\u540d\\u79f0\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"id\":{\"zh-cn\":\"\\u7f16\\u53f7\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"closedDate\":{\"zh-cn\":\"\\u5173\\u95ed\\u65f6\\u95f4\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"estimate\":{\"zh-cn\":\"\\u6700\\u521d\\u9884\\u8ba1\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"consumed\":{\"zh-cn\":\"\\u603b\\u8ba1\\u6d88\\u8017\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"left\":{\"zh-cn\":\"\\u9884\\u8ba1\\u5269\\u4f59\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"deviation\":{\"zh-cn\":\"deviation\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"rate\":{\"zh-cn\":\"\\u5de5\\u65f6\\u504f\\u5dee\\u7387\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"}}','select\n*,\nround(tt.deviation/tt.estimate,3) rate\nfrom(\nselect\nt1.name,\nt1.id,\nt1.closedDate,\nt2.estimate estimate,\nt2.consumed consumed,\nt2.`left`,\nt2.consumed-t2.estimate deviation\nfrom\nzt_project t1\nleft join\n(select\nproject,\nsum(estimate) estimate,\nsum(consumed) consumed,\nsum(`left`) `left`\nfrom\nzt_task\ngroup by project) t2\non t1.id=t2.project\nwhere t1.deleted=\'0\'\nand t1.status=\'closed\'\nand t1.type=\'project\') tt','published',1,'','admin','2023-11-24 15:34:00','admin','2023-04-06 12:16:04',0),(10101,'年度进行中项目-进行中的项目数',2,'card',72,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT id FROM zt_project WHERE deleted = \'0\' AND status = \'doing\' AND type = \'project\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10102,'年度进行中项目-进行中的迭代数',2,'card',73,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT id,type FROM zt_project WHERE deleted = \'0\' AND status = \'doing\' AND type IN (\'sprint\', \'stage\', \'kanban\') AND multiple = \'1\'','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10103,'年度进行中项目-进展顺利项目数',2,'card',72,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT t1.id, t1.name, IFNULL(prograss, 0) AS prograss, ROUND(DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100, 2)  AS planPrograss,LEFT(t1.`end`, 4) AS endYear\nFROM zt_project AS t1\nLEFT JOIN (\n    SELECT t22.project,\n    ROUND(IF(SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0)) > 0, SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0))), 0) * 100, 2) AS prograss\n    FROM zt_project AS t21\n    LEFT JOIN zt_task AS t22 ON t21.id = t22.execution\n    WHERE t21.deleted = \'0\' AND t21.type IN (\'sprint\', \'kanban\')\n    AND t22.deleted = \'0\' AND t22.parent < 1\n    GROUP BY t22.project\n    UNION\n    SELECT  t.project, ROUND(SUM(t.prograss * (t.percent / 100)), 2) as prograss\n    FROM (\n        SELECT t21.id,t21.percent, t22.project,\n        IF(SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0)) > 0, ROUND(SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0))) * 1000 / 1000 * 100, 2), 0)  AS prograss\n        FROM zt_project AS t21\n        LEFT JOIN zt_task AS t22 ON t21.id = t22.execution\n        WHERE t21.deleted = \'0\' AND t21.type = \'stage\'\n        AND t22.deleted = \'0\' AND t22.parent < 1\n        AND t22.id IS NOT NULL\n        GROUP BY t21.id, t21.percent, t22.project\n    ) t\n    GROUP BY t.project\n) AS t2 ON t1.id = t2.project \nWHERE t1.deleted = \'0\'\nAND t1.status = \'doing\' \nAND t1.type = \'project\'\nAND ((IFNULL(prograss, 0) >= (DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100) AND LEFT(t1.`end`, 4) != \'2059\' AND DATEDIFF(`end`, NOW()) >= 0) OR LEFT(t1.`end`, 4) = \'2059\' )','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10104,'年度进行中项目-进展顺利迭代数',2,'card',73,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT id, prograss, planPrograss, `end`\nFROM (\nSELECT t1.id,ROUND(DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100, 2) AS planPrograss,t1.`end`,\nROUND(IF(SUM(t2.consumed) + SUM(IF(t2.status != \'closed\' && t2.status != \'cancel\', t2.`left`, 0)) > 0, SUM(t2.consumed) / (SUM(t2.consumed) + SUM(IF(t2.status != \'closed\' && t2.status != \'cancel\', t2.`left`, 0))), 0) * 100, 2) AS prograss\nFROM zt_project AS t1\nLEFT JOIN zt_task AS t2 ON t1.id = t2.execution\nWHERE t1.deleted = \'0\' AND t1.type IN (\'sprint\', \'stage\', \'kanban\') AND t1.status = \'doing\' AND t1.multiple = \'1\'\nAND t2.deleted = \'0\' AND t2.parent < 1\nGROUP BY t1.id\n) AS t\nWHERE prograss >= planPrograss AND DATEDIFF(`end`, NOW()) >= 0','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10105,'年度进行中项目-进度滞后项目数',2,'card',72,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT t1.id, t1.name, IFNULL(prograss, 0) AS prograss, ROUND(DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100, 2)  AS planPrograss\n, LEFT(t1.`end`, 4) AS endYear\nFROM zt_project AS t1\nLEFT JOIN (\n    SELECT t22.project,\n    ROUND(IF(SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0)) > 0, SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0))), 0) * 100, 2) AS prograss\n    FROM zt_project AS t21\n    LEFT JOIN zt_task AS t22 ON t21.id = t22.execution\n    WHERE t21.deleted = \'0\' AND t21.type IN (\'sprint\', \'kanban\')\n    AND t22.deleted = \'0\' AND t22.parent < 1\n    GROUP BY t22.project\n    UNION\n    SELECT  t.project, ROUND(SUM(t.prograss * (t.percent / 100)), 2) as prograss\n    FROM (\n        SELECT t21.id,t21.percent, t22.project,\n        IF(SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0)) > 0, ROUND(SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0))) * 1000 / 1000 * 100, 2), 0)  AS prograss\n        FROM zt_project AS t21\n        LEFT JOIN zt_task AS t22 ON t21.id = t22.execution\n        WHERE t21.deleted = \'0\' AND t21.type = \'stage\'\n        AND t22.deleted = \'0\' AND t22.parent < 1\n        AND t22.id IS NOT NULL\n        GROUP BY t21.id, t21.percent, t22.project\n    ) t\n    GROUP BY t.project\n) AS t2 ON t1.id = t2.project \nWHERE t1.deleted = \'0\'\nAND t1.status = \'doing\' \nAND t1.type = \'project\'\nAND LEFT(t1.`end`, 4) != \'2059\'\nAND IFNULL(prograss, 0) < (DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100)  AND DATEDIFF(`end`, NOW()) >= 0','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10106,'年度进行中项目-进度滞后迭代数',2,'card',73,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT id, prograss, planPrograss\nFROM (\nSELECT t1.id,ROUND(DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100, 2) AS planPrograss,\nROUND(IF(SUM(t2.consumed) + SUM(IF(t2.status != \'closed\' && t2.status != \'cancel\', t2.`left`, 0)) > 0, SUM(t2.consumed) / (SUM(t2.consumed) + SUM(IF(t2.status != \'closed\' && t2.status != \'cancel\', t2.`left`, 0))), 0) * 100, 2) AS prograss\nFROM zt_project AS t1\nLEFT JOIN zt_task AS t2 ON t1.id = t2.execution\nWHERE t1.deleted = \'0\' AND t1.type IN (\'sprint\', \'stage\', \'kanban\') AND t1.status = \'doing\' AND t1.multiple = \'1\' AND DATEDIFF(t1.`end`, NOW()) >= 0\nAND t2.deleted = \'0\' AND t2.parent < 1\nGROUP BY t1.id\n) AS t\nWHERE prograss < planPrograss','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10107,'年度进行中项目-已延期项目数',2,'card',72,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT id, name FROM zt_project WHERE deleted = \'0\' AND status = \'doing\' AND type = \'project\' AND LEFT(`end`, 4) != \'2059\' AND DATEDIFF(`end`, NOW()) < 0','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10108,'年度进行中项目-已延期迭代数',2,'card',73,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT id, name FROM zt_project WHERE deleted = \'0\' AND status = \'doing\' AND type IN (\'sprint\', \'stage\', \'kanban\') AND DATEDIFF(`end`, NOW()) < 0 AND multiple = \'1\'','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10109,'年度进行中项目-未完成需求条目数',2,'card',75,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT DISTINCT t3.id, t3.estimate\nFROM zt_project AS t1\nLEFT JOIN zt_projectstory AS t2 ON t1.id = t2.project\nLEFT JOIN zt_story AS t3 ON t2.story = t3.id\nWHERE t1.deleted = \'0\' AND t1.status = \'doing\' AND t1.type = \'project\'\nAND t3.deleted = \'0\' AND t3.stage NOT IN (\'verified\', \'released\', \'closed\')','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10110,'年度进行中项目-未完成任务数',2,'card',76,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT DISTINCT t2.id\nFROM zt_project AS t1\nLEFT JOIN zt_task AS t2 ON t1.id = t2.execution\nWHERE t1.deleted = \'0\' AND t1.status = \'doing\' AND t1.type IN (\'sprint\', \'stage\', \'kanban\')\nAND t2.deleted = \'0\' AND t2.status IN (\'wait\', \'doing\', \'pause\') AND t2.id IS NOT NULL','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10111,'年度进行中项目-未完成需求规模数',2,'card',75,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"estimate\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT DISTINCT t3.id, t3.estimate\nFROM zt_project AS t1\nLEFT JOIN zt_projectstory AS t2 ON t1.id = t2.project\nLEFT JOIN zt_story AS t3 ON t2.story = t3.id\nWHERE t1.deleted = \'0\' AND t1.status = \'doing\' AND t1.type = \'project\'\nAND t3.deleted = \'0\' AND t3.stage NOT IN (\'verified\', \'released\', \'closed\')','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10112,'年度进行中项目-剩余工时数',2,'card',78,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"taskleft\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT t1.id, t1.name, `taskleft`\nFROM zt_project AS t1\nLEFT JOIN (\n    SELECT t22.project,\n    ROUND(SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0)), 2) AS `taskleft`\n    FROM zt_project AS t21\n    LEFT JOIN zt_task AS t22 ON t21.id = t22.execution\n    WHERE t21.deleted = \'0\' AND t21.type IN (\'sprint\', \'stage\', \'kanban\')\n    AND t22.deleted = \'0\' AND t22.parent < 1\n    GROUP BY t22.project\n) AS t2 ON t1.id = t2.project \nWHERE t1.deleted = \'0\'\nAND t1.status = \'doing\' \nAND t1.type = \'project\'','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10113,'年度进行中项目-投入总人次',2,'card',78,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"id\", \"agg\": \"count\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT t1.id,t1.type,t1.account\nFROM zt_team AS t1\nLEFT JOIN zt_user AS t2 on t1.account = t2.account\nWHERE t1.type = \'project\' AND t2.deleted = \'0\'','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10114,'年度进行中项目-项目进度分布图',2,'pie',69,'0','','{\"group\":[{\"field\":\"status\",\"name\":\"进度\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"项目数\",\"valOrAgg\":\"count\"}]}','[]','',0,'','\r\nSELECT t1.id, t1.name, \r\nIF(\r\n    DATEDIFF(t1.`end`, NOW()) < 0, \r\n    \"延期\", \r\n    (IF(\r\n        (IFNULL(prograss, 0) >= (DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100) AND LEFT(t1.`end`, 4) != \'2059\') \r\n        OR LEFT(t1.`end`, 4) = \'2059\' ,\r\n        \"顺利\",\r\n        \"滞后\"\r\n    ))) AS \'status\',\r\nIFNULL(prograss, 0) AS prograss, ROUND(DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100, 2)  AS planPrograss,LEFT(t1.`end`, 4) AS endYear\r\nFROM zt_project AS t1\r\nLEFT JOIN (\r\n    SELECT t22.project,\r\n    ROUND(IF(SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0)) > 0, SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0))), 0) * 100, 2) AS prograss\r\n    FROM zt_project AS t21\r\n    LEFT JOIN zt_task AS t22 ON t21.id = t22.execution\r\n    WHERE t21.deleted = \'0\' AND t21.type IN (\'sprint\', \'kanban\')\r\n    AND t22.deleted = \'0\' AND t22.parent < 1\r\n    GROUP BY t22.project\r\n    UNION\r\n    SELECT  t.project, ROUND(SUM(t.prograss * (t.percent / 100)), 2) as prograss\r\n    FROM (\r\n        SELECT t21.id,t21.percent, t22.project,\r\n        IF(SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0)) > 0, ROUND(SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0))) * 1000 / 1000 * 100, 2), 0)  AS prograss\r\n        FROM zt_project AS t21\r\n        LEFT JOIN zt_task AS t22 ON t21.id = t22.execution\r\n        WHERE t21.deleted = \'0\' AND t21.type = \'stage\'\r\n        AND t22.deleted = \'0\' AND t22.parent < 1\r\n        AND t22.id IS NOT NULL\r\n        GROUP BY t21.id, t21.percent, t22.project\r\n    ) t\r\n    GROUP BY t.project\r\n) AS t2 ON t1.id = t2.project \r\nWHERE t1.deleted = \'0\'\r\nAND t1.status = \'doing\' \r\nAND t1.type = \'project\'','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10115,'年度进行中项目-迭代进度分布图',2,'pie',69,'0','','{\"group\":[{\"field\":\"status\",\"name\":\"进度\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"迭代数\",\"valOrAgg\":\"count\"}]}','[]','',0,'','SELECT id, name,IF(\r\n    DATEDIFF(`end`, NOW()) < 0,\r\n    \"延期\",\r\n    (IF(\r\n        prograss >= planPrograss,\r\n        \"顺利\",\r\n        \"滞后\"\r\n    ))\r\n) AS status,\r\nprograss, planPrograss, `end`\r\nFROM (\r\nSELECT t1.id,t1.name,ROUND(DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100, 2) AS planPrograss,t1.`end`,\r\nROUND(IF(SUM(t2.consumed) + SUM(IF(t2.status != \'closed\' && t2.status != \'cancel\', t2.`left`, 0)) > 0, SUM(t2.consumed) / (SUM(t2.consumed) + SUM(IF(t2.status != \'closed\' && t2.status != \'cancel\', t2.`left`, 0))), 0) * 100, 2) AS prograss\r\nFROM zt_project AS t1\r\nLEFT JOIN zt_task AS t2 ON t1.id = t2.execution\r\nWHERE t1.deleted = \'0\' AND t1.type IN (\'sprint\', \'stage\', \'kanban\') AND t1.status = \'doing\' AND t1.multiple = \'1\'\r\nAND ((t2.deleted = \'0\' AND t2.parent < 1) OR t2.id IS NULL)\r\nGROUP BY t1.id\r\n) AS t','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10116,'年度进行中项目-项目进度透视表',2,'table',84,'0','','{\"group\":[],\"column\":[{\"field\":\"program\",\"valOrAgg\":\"value\",\"name\":\"一级项目集\"},{\"field\":\"name\",\"valOrAgg\":\"value\",\"name\":\"项目\"},{\"field\":\"begin\",\"valOrAgg\":\"value\",\"name\":\"计划开始日期\"},{\"field\":\"end\",\"valOrAgg\":\"value\",\"name\":\"计划完成日期\"},{\"field\":\"planDuration\",\"valOrAgg\":\"value\",\"name\":\"计划工期\"},{\"field\":\"realBegan\",\"valOrAgg\":\"value\",\"name\":\"实际开始日期\"},{\"field\":\"realDuration\",\"valOrAgg\":\"value\",\"name\":\"剩余工期天数\"},{\"field\":\"prograss\",\"valOrAgg\":\"value\",\"name\":\"工期进度\"},{\"field\":\"status\",\"valOrAgg\":\"value\",\"name\":\"进度状态\"}],\"filter\":[]}','[]','',0,'','SELECT t1.id, t1.name, IFNULL(t3.name, \'/\') AS program,t1.`begin`, IF(YEAR(t1.`end`) = \'2059\', \"长期\", t1.`end`) AS `end`, IF(YEAR(t1.`end`) = \'2059\', \"长期\", DATEDIFF(t1.`end`, t1.`begin`) + 1) AS planDuration,\r\nIF(LEFT(t1.realBegan, 4) = \'0000\', \'/\', t1.realBegan) AS realBegan, IF(YEAR(t1.`end`) = \'2059\', \"长期\", IF(DATEDIFF(t1.`end`, NOW()) >= 0, DATEDIFF(t1.`end`, NOW()) + 1, 0)) AS realDuration,\r\nIF(\r\n    DATEDIFF(t1.`end`, NOW()) < 0, \r\n    \"延期\", \r\n    (IF(\r\n        (IFNULL(prograss, 0) >= (DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100) AND LEFT(t1.`end`, 4) != \'2059\') \r\n        OR LEFT(t1.`end`, 4) = \'2059\' ,\r\n        \"顺利\",\r\n        \"滞后\"\r\n    ))) AS \'status\',\r\nCONCAT(IFNULL(prograss, 0), \'%\') AS prograss\r\nFROM zt_project AS t1\r\nLEFT JOIN (\r\n    SELECT t22.project,\r\n    ROUND(IF(SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0)) > 0, SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0))), 0) * 100, 2) AS prograss\r\n    FROM zt_project AS t21\r\n    LEFT JOIN zt_task AS t22 ON t21.id = t22.execution\r\n    WHERE t21.deleted = \'0\' AND t21.type IN (\'sprint\', \'kanban\')\r\n    AND t22.deleted = \'0\' AND t22.parent < 1\r\n    GROUP BY t22.project\r\n    UNION\r\n    SELECT  t.project, ROUND(SUM(t.prograss * (t.percent / 100)), 2) as prograss\r\n    FROM (\r\n        SELECT t21.id,t21.percent, t22.project,\r\n        IF(SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0)) > 0, ROUND(SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != \'closed\' && t22.status != \'cancel\', t22.`left`, 0))) * 1000 / 1000 * 100, 2), 0)  AS prograss\r\n        FROM zt_project AS t21\r\n        LEFT JOIN zt_task AS t22 ON t21.id = t22.execution\r\n        WHERE t21.deleted = \'0\' AND t21.type = \'stage\'\r\n        AND t22.deleted = \'0\' AND t22.parent < 1\r\n        AND t22.id IS NOT NULL\r\n        GROUP BY t21.id, t21.percent, t22.project\r\n    ) t\r\n    GROUP BY t.project\r\n) AS t2 ON t1.id = t2.project \r\nLEFT JOIN zt_project AS t3 ON SUBSTR(t1.path, 2, POSITION(\',\' IN SUBSTR(t1.path, 2)) -1) = t3.id AND t3.type = \'program\' AND t3.deleted = \'0\'\r\nWHERE t1.deleted = \'0\'\r\nAND t1.status = \'doing\' \r\nAND t1.type = \'project\'','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10117,'年度进行中项目-迭代进度透视表',2,'table',84,'0','','{\"group\":[],\"column\":[{\"field\":\"project\",\"valOrAgg\":\"value\",\"name\":\"项目\"},{\"field\":\"name\",\"valOrAgg\":\"value\",\"name\":\"迭代\"},{\"field\":\"begin\",\"valOrAgg\":\"value\",\"name\":\"计划开始日期\"},{\"field\":\"end\",\"valOrAgg\":\"value\",\"name\":\"计划完成日期\"},{\"field\":\"planDuration\",\"valOrAgg\":\"value\",\"name\":\"计划工期\"},{\"field\":\"realBegan\",\"valOrAgg\":\"value\",\"name\":\"实际开始日期\"},{\"field\":\"realDuration\",\"valOrAgg\":\"value\",\"name\":\"剩余工期天数\"},{\"field\":\"prograss\",\"valOrAgg\":\"value\",\"name\":\"工期进度\"},{\"field\":\"status\",\"valOrAgg\":\"value\",\"name\":\"进度状态\"}],\"filter\":[]}','[]','',0,'','SELECT id, name,project,`begin`, `end`, planDuration, IF(LEFT(realBegan, 4) = \'0000\', \'/\', realBegan) as realBegan, realDuration, CONCAT(prograss, \'%\') as prograss,\r\nIF(\r\n    DATEDIFF(`end`, NOW()) < 0,\r\n    \"延期\",\r\n    (IF(\r\n        prograss >= planPrograss,\r\n        \"顺利\",\r\n        \"滞后\"\r\n    ))\r\n) AS status\r\nFROM (\r\nSELECT t1.id,t1.name,t1.`begin`,t1.`end`,t1.`realBegan`,IFNULL(t3.name, \'/\') AS project,t3.id AS projectID,\r\nDATEDIFF(t1.`end`, t1.`begin`) + 1 AS planDuration, IF(DATEDIFF(t1.`end`, NOW()) >= 0, DATEDIFF(t1.`end`, NOW()) + 1, 0) AS realDuration,\r\nROUND(DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100, 2) AS planPrograss,\r\nROUND(IF(SUM(t2.consumed) + SUM(IF(t2.status != \'closed\' && t2.status != \'cancel\', t2.`left`, 0)) > 0, SUM(t2.consumed) / (SUM(t2.consumed) + SUM(IF(t2.status != \'closed\' && t2.status != \'cancel\', t2.`left`, 0))), 0) * 100, 2) AS prograss\r\nFROM zt_project AS t1\r\nLEFT JOIN zt_task AS t2 ON t1.id = t2.execution\r\nLEFT JOIN zt_project AS t3 on t1.project = t3.id AND t3.type = \'project\' AND t3.deleted = \'0\'\r\nWHERE t1.deleted = \'0\' AND t1.type IN (\'sprint\', \'stage\', \'kanban\') AND t1.status = \'doing\' AND t1.multiple = \'1\'\r\nAND t2.deleted = \'0\' AND t2.parent < 1\r\nGROUP BY t1.id\r\n) AS t\r\nORDER BY projectID ASC, id ASC','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10118,'年度进行中项目-项目剩余工作量透视表',2,'table',83,'0','','{\"group\":[],\"column\":[{\"field\":\"program\",\"valOrAgg\":\"value\",\"name\":\"一级项目集\"},{\"field\":\"project\",\"valOrAgg\":\"value\",\"name\":\"项目\"},{\"field\":\"story\",\"valOrAgg\":\"value\",\"name\":\"剩余需求数\"},{\"field\":\"estimate\",\"valOrAgg\":\"value\",\"name\":\"剩余需求规模数\"},{\"field\":\"execution\",\"valOrAgg\":\"value\",\"name\":\"剩余执行数\"},{\"field\":\"workhour\",\"valOrAgg\":\"value\",\"name\":\"剩余工时\"}],\"filter\":[]}','[]','',0,'','SELECT\r\n  t1.id,\r\n  t1.name AS project,\r\n  IFNULL(t2.name, \'/\') AS program,\r\n  IFNULL(t3.story, 0) AS story,\r\n  IFNULL(t3.estimate, 0) AS estimate,\r\n  IFNULL(t4.execution, 0) AS execution,  \r\n  IFNULL(t5.workhour, 0) AS workhour\r\nFROM zt_project AS t1\r\nLEFT JOIN zt_project AS t2 ON FIND_IN_SET(t2.id, t1.path) AND t2.deleted = \'0\' AND t2.type = \'program\' AND t2.grade = 1\r\nLEFT JOIN (\r\n  SELECT t1.parent AS project, COUNT(1) AS story, ROUND(SUM(t1.estimate), 1) AS estimate\r\n  FROM (\r\n    SELECT DISTINCT t1.parent, t3.id, t3.estimate\r\n    FROM zt_project AS t1\r\n    LEFT JOIN zt_projectstory AS t2 ON t1.id = t2.project\r\n    LEFT JOIN zt_story AS t3 ON t2.story = t3.id AND t3.deleted = \'0\' AND t3.stage NOT IN (\'verified\', \'released\', \'closed\')\r\n    WHERE t1.deleted = \'0\' AND t1.type IN (\'sprint\', \'stage\', \'kanban\') AND t3.id IS NOT NULL\r\n  ) AS t1 GROUP BY project\r\n) AS t3 ON t1.id = t3.project\r\nLEFT JOIN (SELECT parent AS project, COUNT(1) AS execution FROM zt_project WHERE deleted = \'0\' AND type IN (\'sprint\', \'stage\', \'kanban\') AND status NOT IN (\'done\', \'closed\') GROUP BY project) AS t4 ON t1.id = t4.project\r\nLEFT JOIN (\r\n  SELECT t1.parent AS project, ROUND(SUM(t2.left), 1) AS workhour\r\n  FROM zt_project AS t1\r\n  LEFT JOIN zt_task AS t2 ON t1.id = t2.execution AND t2.deleted = \'0\' AND t2.parent < 1\r\n  WHERE t1.deleted = \'0\' AND t1.type IN (\'sprint\', \'stage\', \'kanban\') AND t1.status NOT IN (\'done\', \'closed\') AND t2.id IS NOT NULL\r\n  GROUP BY project\r\n) AS t5 ON t1.id = t5.project\r\nWHERE t1.deleted = \'0\' AND t1.type = \'project\' AND t1.status = \'doing\'','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10119,'年度进行中项目-迭代剩余工作量透视表',2,'table',83,'0','','{\"group\":[],\"column\":[{\"field\":\"project\",\"valOrAgg\":\"value\",\"name\":\"项目\"},{\"field\":\"execution\",\"valOrAgg\":\"value\",\"name\":\"迭代\"},{\"field\":\"story\",\"valOrAgg\":\"value\",\"name\":\"剩余需求数\"},{\"field\":\"estimate\",\"valOrAgg\":\"value\",\"name\":\"剩余需求规模数\"},{\"field\":\"task\",\"valOrAgg\":\"value\",\"name\":\"剩余任务数\"},{\"field\":\"workhour\",\"valOrAgg\":\"value\",\"name\":\"剩余工时\"}],\"filter\":[]}','[]','',0,'','SELECT\r\n  t1.id,\r\n  t1.name AS execution,\r\n  IFNULL(t2.name, \'/\') AS project,\r\n  IFNULL(t3.story, 0) AS story,\r\n  IFNULL(t3.estimate, 0) AS estimate,\r\n  IFNULL(t4.task, 0) AS task,  \r\n  IFNULL(t4.workhour, 0) AS workhour\r\nFROM zt_project AS t1\r\nLEFT JOIN zt_project AS t2 ON t1.project = t2.id AND t2.type = \'project\'\r\nLEFT JOIN (\r\n  SELECT t1.id AS execution, COUNT(1) AS story, ROUND(SUM(t3.estimate), 1) AS estimate\r\n  FROM zt_project AS t1\r\n  LEFT JOIN zt_projectstory AS t2 ON t1.id = t2.project\r\n  LEFT JOIN zt_story AS t3 ON t2.story = t3.id AND t3.deleted = \'0\' AND t3.stage NOT IN (\'verified\', \'released\', \'closed\')\r\n  WHERE t1.deleted = \'0\' AND t1.type IN (\'sprint\', \'stage\', \'kanban\') AND t1.status = \'doing\' AND t1.multiple = \'1\'\r\n  GROUP BY execution\r\n) AS t3 ON t1.id = t3.execution\r\nLEFT JOIN (\r\n  SELECT t1.id AS execution, SUM(IF(t2.status IN (\'wait\', \'doing\'), 1, 0)) AS task, ROUND(SUM(IF(t2.status IN (\'wait\', \'doing\', \'pause\'), t2.left, 0)), 1) AS workhour\r\n  FROM zt_project AS t1\r\n  LEFT JOIN zt_task AS t2 ON t1.id = t2.execution AND t2.deleted = \'0\' AND t2.parent < 1\r\n  WHERE t1.deleted = \'0\' AND t1.type IN (\'sprint\', \'stage\', \'kanban\') AND t1.status = \'doing\' AND t1.multiple = \'1\'\r\n  GROUP BY execution\r\n) AS t4 ON t1.id = t4.execution\r\nWHERE t1.deleted = \'0\' AND t1.type IN (\'sprint\', \'stage\', \'kanban\') AND t1.status = \'doing\' AND t1.multiple = \'1\'\r\nORDER BY t2.id ASC, t1.id ASC','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10201,'质量数据-研发完成需求数',3,'card',93,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT COUNT(id) AS number FROM zt_story WHERE deleted=\'0\' AND (stage IN (\'developed\',\'testing\',\'verfied\',\'released\') OR (status=\'closed\' AND closedReason=\'done\'))','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10202,'质量数据-研发完成需求规模数',3,'card',93,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT ROUND(SUM(estimate),2) AS number FROM zt_story WHERE deleted=\'0\' AND (stage IN (\'developed\',\'testing\',\'verfied\',\'released\') OR (status=\'closed\' AND closedReason=\'done\'))','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10203,'质量数据-研发完成需求用例数',3,'card',95,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT SUM(t2.cases) AS number FROM (SELECT t1.story story, COUNT(t1.id) cases FROM (SELECT story,id FROM zt_case WHERE deleted=\'0\') t1 GROUP BY t1.story) t2 LEFT JOIN (SELECT id,stage,status,closedReason,deleted FROM zt_story) t3 ON t2.story=t3.id WHERE t3.deleted=\'0\' AND (t3.stage IN (\'developed\',\'testing\',\'verfied\',\'released\') OR (t3.status=\'closed\' AND t3.closedReason=\'done\'))','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10204,'质量数据-Bug总数',3,'card',94,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT COUNT(id) AS number FROM zt_bug WHERE deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10205,'质量数据-有效Bug数',3,'card',94,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT SUM(CASE WHEN resolution IN (\'fixed\',\'postponed\') OR status=\'active\' THEN 1 ELSE 0 END) AS number FROM zt_bug WHERE deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10206,'质量数据-修复Bug数',3,'card',94,'0','','{\"value\": {\"type\": \"agg\", \"field\": \"number\", \"agg\": \"sum\"}, \"title\": {\"type\": \"text\", \"name\": \"\"}, \"type\": \"value\"}','[]','',0,'','SELECT SUM(CASE WHEN resolution=\'fixed\' THEN 1 ELSE 0 END) AS number FROM zt_bug WHERE deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10207,'质量数据-研发完成需求用例覆盖率',3,'waterpolo',92,'0','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"需求数\",\"valOrAgg\":\"count\"}]}','[]','',0,'','SELECT ROUND(SUM(t3.havecasefixstory)/COUNT(t3.fixstory),2) AS status FROM (SELECT t2.storyid \'fixstory\', (CASE WHEN t2.cases=0 THEN 0 ELSE 1 END) havecasefixstory FROM (SELECT t1.storyid, SUM(t1.iscase) cases FROM (SELECT zt_story.id storyid, (CASE WHEN zt_case.id is null THEN 0 ELSE 1 END) iscase FROM zt_story LEFT JOIN zt_case ON zt_story.id=zt_case.story WHERE zt_story.deleted=\'0\' AND (zt_story.stage IN (\'developed\',\'testing\',\'verfied\',\'released\') OR (zt_story.status=\'closed\' AND zt_story.closedReason=\'done\'))) t1 GROUP BY t1.storyid ORDER BY cases DESC) t2) t3','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10208,'质量数据-研发完成需求用例密度',3,'waterpolo',92,'0','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"需求数\",\"valOrAgg\":\"count\"}]}','[]','',0,'','SELECT ROUND(SUM(t2.cases)/SUM(t2.estimate),2) AS status FROM (SELECT t1.storyid, t1.estimate, SUM(t1.iscase) cases FROM (SELECT zt_story.id storyid, zt_story.estimate, (CASE WHEN zt_case.id is null THEN 0 ELSE 1 END) iscase FROM zt_story LEFT JOIN zt_case ON zt_story.id=zt_case.story WHERE zt_story.deleted=\'0\' AND (zt_story.stage IN (\'developed\',\'testing\',\'verfied\',\'released\') OR (zt_story.status=\'closed\' AND zt_story.closedReason=\'done\'))) t1 GROUP BY t1.storyid, t1.estimate ORDER BY cases DESC) t2','published',1,'','admin','2023-11-24 15:34:00','','2022-12-07 14:59:41',0),(10209,'质量数据-Bug密度',3,'waterpolo',91,'0','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"需求数\",\"valOrAgg\":\"count\"}]}','[]','',0,'','SELECT SUM(t3.bug)/SUM(t3.estimate) AS status FROM (SELECT t1.product product, IFNULL(t1.estimate,0) estimate, IFNULL(t2.bug,0) bug FROM (SELECT product, ROUND(SUM(estimate),2) estimate FROM zt_story WHERE deleted=\'0\' AND (stage IN (\'developed\',\'testing\',\'verfied\',\'released\') OR (status=\'closed\' AND closedReason=\'done\')) GROUP BY product) t1 LEFT JOIN (SELECT product, COUNT(id) bug FROM zt_bug WHERE deleted=\'0\' GROUP BY product) t2 ON t1.product=t2.product) t3','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10210,'质量数据-Bug修复率',3,'waterpolo',91,'0','','{\"group\":[{\"field\":\"status\",\"name\":\"状态\"}],\"metric\":[{\"type\":\"agg\",\"field\":\"id\",\"agg\":\"count\",\"name\":\"需求数\",\"valOrAgg\":\"count\"}]}','[]','',0,'','SELECT SUM(CASE WHEN resolution=\'fixed\' THEN 1 ELSE 0 END)/COUNT(id) AS status FROM zt_bug WHERE deleted = \'0\' ','published',1,'','admin','2023-11-24 15:34:00','admin','2022-12-07 14:59:41',0),(10211,'质量数据-Bug总数、有效Bug与解决Bug数近30天统计柱形图',3,'cluBarX',91,'0','','[{\"type\":\"cluBarX\",\"xaxis\":[{\"field\":\"\\u65e5\\u671f\",\"name\":\"\\u65e5\\u671f\",\"group\":\"day\"}],\"yaxis\":[{\"field\":\"Bug\\u603b\\u6570\",\"name\":\"Bug\\u603b\\u6570\",\"valOrAgg\":\"count\"},{\"field\":\"\\u6709\\u6548Bug\",\"name\":\"\\u6709\\u6548Bug\",\"valOrAgg\":\"sum\"},{\"field\":\"\\u5df2\\u89e3\\u51b3Bug\",\"name\":\"\\u5df2\\u89e3\\u51b3Bug\",\"valOrAgg\":\"sum\"}]}]','[]','{\"Bug\\u603b\\u6570\":{\"name\":\"Bug\\u603b\\u6570\",\"object\":\"bug\",\"field\":\"Bug\\u603b\\u6570\",\"type\":\"number\"},\"\\u6709\\u6548Bug\":{\"name\":\"\\u6709\\u6548Bug\",\"object\":\"bug\",\"field\":\"\\u6709\\u6548Bug\",\"type\":\"string\"},\"\\u5df2\\u89e3\\u51b3Bug\":{\"name\":\"\\u5df2\\u89e3\\u51b3Bug\",\"object\":\"bug\",\"field\":\"\\u5df2\\u89e3\\u51b3Bug\",\"type\":\"string\"},\"\\u65e5\\u671f\":{\"name\":\"\\u65e5\\u671f\",\"object\":\"bug\",\"field\":\"\\u65e5\\u671f\",\"type\":\"date\"}}',4,'','select \nid \"Bug总数\",\n(case when  resolution in (\'fixed\',\'postponed\') or status=\'active\' then 1 else 0 end) \"有效Bug\",\n(case when  resolution=\'fixed\' then 1 else 0 end) \"已解决Bug\",\nopenedDate \"日期\"\nfrom zt_bug\nwhere left(openedDate,10) > (select DATE_sub(MAX(NOW()), INTERVAL \'30\' DAY)) \nand left(openedDate,10) < NOW()\nand deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','admin','2023-04-06 12:51:56',0),(10212,'质量数据-有效Bug率年度趋势图',3,'line',91,'0','','[{\"type\":\"line\",\"xaxis\":[{\"field\":\"\\u5e74\\u4efd\",\"name\":\"\\u5e74\\u4efd\",\"group\":\"\"}],\"yaxis\":[{\"field\":\"\\u6709\\u6548Bug\\u7387\",\"name\":\"\\u6709\\u6548Bug\\u7387\",\"valOrAgg\":\"sum\"}]}]','[{\"field\":\"\\u5e74\\u4efd\",\"type\":\"select\",\"name\":\"\\u5e74\\u4efd\"}]','{\"\\u5e74\\u4efd\":{\"name\":\"\\u5e74\\u4efd\",\"object\":\"bug\",\"field\":\"\\u5e74\\u4efd\",\"type\":\"string\"},\"\\u6240\\u6709Bug\\u6570\":{\"name\":\"\\u6240\\u6709Bug\\u6570\",\"object\":\"bug\",\"field\":\"\\u6240\\u6709Bug\\u6570\",\"type\":\"string\"},\"\\u6709\\u6548Bug\\u6570\":{\"name\":\"\\u6709\\u6548Bug\\u6570\",\"object\":\"bug\",\"field\":\"\\u6709\\u6548Bug\\u6570\",\"type\":\"number\"},\"\\u6709\\u6548Bug\\u7387\":{\"name\":\"\\u6709\\u6548Bug\\u7387\",\"object\":\"bug\",\"field\":\"\\u6709\\u6548Bug\\u7387\",\"type\":\"number\"}}',4,'','select\nyear \"年份\",\ncount(a.id) \"所有Bug数\",\nsum(a.effectivebug) \"有效Bug数\",\nsum(a.effectivebug)/count(a.id) \"有效Bug率\"\nfrom(\nselect \nleft(openedDate,4) year,\nid,\n(case when  resolution in (\'fixed\',\'postponed\') or status=\'active\' then 1 else 0 end) effectivebug,\n(case when  resolution=\'fixed\' then 1 else 0 end) fixedBug\nfrom zt_bug\nwhere zt_bug.deleted=\'0\'\n) a\ngroup by a.year\norder by  a.year','published',1,'','admin','2023-11-24 15:34:00','admin','2023-04-06 13:00:04',0),(10213,'质量数据-Bug密度年度趋势图',3,'line',91,'0','','[{\"type\":\"line\",\"yaxis\":[{\"field\":\"\\u5355\\u4f4d\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u4ea7\\u751f\\u7684bug\\u6570\",\"name\":\"\\u5355\\u4f4d\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u4ea7\\u751f\\u7684bug\\u6570\",\"valOrAgg\":\"sum\"}],\"xaxis\":[{\"field\":\"\\u5e74\\u4efd\",\"name\":\"\\u5e74\\u4efd\",\"group\":\"\"}]}]','[{\"field\":\"\\u5e74\\u4efd\",\"type\":\"select\",\"name\":\"\\u5e74\\u4efd\"}]','{\"\\u5e74\\u4efd\":{\"name\":\"\\u5e74\\u4efd\",\"object\":\"story\",\"field\":\"\\u5e74\\u4efd\",\"type\":\"string\"},\"\\u4ea7\\u751fBug\":{\"name\":\"\\u4ea7\\u751fBug\",\"object\":\"story\",\"field\":\"\\u4ea7\\u751fBug\",\"type\":\"string\"},\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\":{\"name\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"object\":\"story\",\"field\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"type\":\"number\"},\"\\u5355\\u4f4d\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u4ea7\\u751f\\u7684bug\\u6570\":{\"name\":\"\\u5355\\u4f4d\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u4ea7\\u751f\\u7684bug\\u6570\",\"object\":\"story\",\"field\":\"\\u5355\\u4f4d\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u4ea7\\u751f\\u7684bug\\u6570\",\"type\":\"number\"}}',4,'','select\nbug.year \"年份\",\ncreatbugs \"产生Bug\", \nexfixedstoryestimate \"完成需求数\",\nround(creatbugs/exfixedstoryestimate,2) \"单位完成需求规模产生的bug数\"\nfrom\n(select \nleft(openedDate,4) year,\ncount(id) creatbugs\nfrom zt_bug\nwhere zt_bug.deleted=\'0\'\ngroup by year\n) bug\nleft join\n(select\nsum(estimate) exfixedstoryestimate,\nleft(closedDate,4) year\nfrom\nzt_story\nwhere zt_story.deleted=\'0\' and zt_story.status=\'closed\' and zt_story.closedReason=\'done\'\ngroup by year\n) story\non story.year=bug.year\norder by bug.year','published',1,'','admin','2023-11-24 15:34:00','admin','2023-04-06 13:05:10',0),(10214,'质量数据-Bug严重程度年度堆积柱状图',3,'stackedBar',91,'0','','[{\"type\":\"stackedBar\",\"xaxis\":[{\"field\":\"\\u5e74\\u4efd\",\"name\":\"\\u5e74\\u4efd\",\"group\":\"\"}],\"yaxis\":[{\"field\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e3a1\\u7ea7\\u7684Bug\",\"name\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e3a1\\u7ea7\\u7684Bug\",\"valOrAgg\":\"sum\"},{\"field\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e3a2\\u7ea7\\u7684Bug\",\"name\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e3a2\\u7ea7\\u7684Bug\",\"valOrAgg\":\"sum\"},{\"field\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4f4e\\u4e8e2\\u7ea7\\u7684Bug\",\"name\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4f4e\\u4e8e2\\u7ea7\\u7684Bug\",\"valOrAgg\":\"sum\"}]}]','[{\"field\":\"\\u5e74\\u4efd\",\"type\":\"select\",\"name\":\"\\u5e74\\u4efd\"}]','{\"\\u6240\\u6709Bug\\u6570\":{\"name\":\"\\u6240\\u6709Bug\\u6570\",\"object\":\"bug\",\"field\":\"\\u6240\\u6709Bug\\u6570\",\"type\":\"string\"},\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e3a1\\u7ea7\\u7684Bug\":{\"name\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e3a1\\u7ea7\\u7684Bug\",\"object\":\"bug\",\"field\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e3a1\\u7ea7\\u7684Bug\",\"type\":\"number\"},\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e3a2\\u7ea7\\u7684Bug\":{\"name\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e3a2\\u7ea7\\u7684Bug\",\"object\":\"bug\",\"field\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e3a2\\u7ea7\\u7684Bug\",\"type\":\"number\"},\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4f4e\\u4e8e2\\u7ea7\\u7684Bug\":{\"name\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4f4e\\u4e8e2\\u7ea7\\u7684Bug\",\"object\":\"bug\",\"field\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4f4e\\u4e8e2\\u7ea7\\u7684Bug\",\"type\":\"number\"},\"\\u5e74\\u4efd\":{\"name\":\"\\u5e74\\u4efd\",\"object\":\"bug\",\"field\":\"\\u5e74\\u4efd\",\"type\":\"string\"}}',4,'','select\ncount(id) \"所有Bug数\",\nsum(case when severity=1 then 1 else 0 end) \"严重程度为1级的Bug\",\nsum(case when severity=2 then 1 else 0 end) \"严重程度为2级的Bug\",\nsum(case when severity not in (1,2) then 1 else 0 end) \"严重程度低于2级的Bug\",\nleft(openedDate,4) \"年份\"\nfrom\nzt_bug\nwhere deleted=\'0\'\ngroup by left(openedDate,4)\norder by left(openedDate,4)','published',1,'','admin','2023-11-24 15:34:00','admin','2023-04-06 13:12:34',0),(10215,'质量数据-产品用例数量统计条形图',3,'cluBarY',91,'0','','[{\"type\":\"cluBarY\",\"xaxis\":[{\"field\":\"name\",\"name\":\"name\",\"group\":\"\"}],\"yaxis\":[{\"field\":\"\\u7528\\u4f8b\",\"name\":\"\\u7528\\u4f8b\",\"valOrAgg\":\"sum\"}]}]','[{\"field\":\"name\",\"type\":\"select\",\"name\":\"\\u4ea7\\u54c1\"}]','{\"name\":{\"name\":\"name\",\"object\":\"testcase\",\"field\":\"name\",\"type\":\"string\"},\"\\u7528\\u4f8b\":{\"name\":\"\\u7528\\u4f8b\",\"object\":\"testcase\",\"field\":\"\\u7528\\u4f8b\",\"type\":\"string\"}}',4,'','select \nt1.name,\nifnull(t2.cases,0) \"用例\"\nfrom\nzt_product t1\nleft join\n(\nselect\nproduct,\ncount(id) cases \nfrom\nzt_case\nwhere deleted=\'0\'\ngroup by product )\nt2 on t1.id=t2.product','published',1,'','admin','2023-11-24 15:34:00','admin','2023-04-06 13:33:48',0),(10216,'质量数据-产品Bug数量统计条形图',3,'cluBarY',91,'0','','[{\"type\":\"cluBarY\",\"xaxis\":[{\"field\":\"name\",\"name\":\"name\",\"group\":\"\"}],\"yaxis\":[{\"field\":\"bug\",\"name\":\"bug\",\"valOrAgg\":\"sum\"}]}]','[{\"field\":\"name\",\"type\":\"select\",\"name\":\"\\u4ea7\\u54c1\"}]','{\"name\":{\"name\":\"name\",\"object\":\"bug\",\"field\":\"name\",\"type\":\"string\"},\"bug\":{\"name\":\"bug\",\"object\":\"bug\",\"field\":\"bug\",\"type\":\"string\"}}',4,'','select \nt1.name,\nifnull(t2.bugs,0) bug\nfrom\nzt_product t1\nleft join\n(\nselect\nproduct,\ncount(id) bugs \nfrom\nzt_bug\nwhere zt_bug.deleted=\'0\'\ngroup by product )\nt2 on t1.id=t2.product','published',1,'','admin','2023-11-24 15:34:00','admin','2023-04-06 13:35:24',0),(10217,'质量数据-Bug状态分布图',3,'pie',91,'0','','[{\"type\":\"pie\",\"group\":[{\"field\":\"status\",\"name\":\"Bug\\u72b6\\u6001\",\"group\":\"\"}],\"metric\":[{\"field\":\"id\",\"name\":\"Bug\\u7f16\\u53f7\",\"valOrAgg\":\"count\"}]}]','[{\"field\":\"openedDate\",\"type\":\"date\",\"name\":\"\\u521b\\u5efa\\u65e5\\u671f\",\"default\":{\"begin\":\"\",\"end\":\"\"}}]','{\"id\":{\"name\":\"Bug\\u7f16\\u53f7\",\"object\":\"bug\",\"field\":\"id\",\"type\":\"number\"},\"project\":{\"name\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"object\":\"bug\",\"field\":\"project\",\"type\":\"string\"},\"company\":{\"name\":\"company\",\"object\":\"bug\",\"field\":\"company\",\"type\":\"number\"},\"product\":{\"name\":\"\\u6240\\u5c5e\\u4ea7\\u54c1\",\"object\":\"bug\",\"field\":\"product\",\"type\":\"string\"},\"injection\":{\"name\":\"\\u6ce8\\u5165\\u9636\\u6bb5\",\"object\":\"bug\",\"field\":\"injection\",\"type\":\"number\"},\"identify\":{\"name\":\"\\u73af\\u8282\",\"object\":\"bug\",\"field\":\"identify\",\"type\":\"number\"},\"branch\":{\"name\":\"\\u5e73\\u53f0\\/\\u5206\\u652f\",\"object\":\"bug\",\"field\":\"branch\",\"type\":\"number\"},\"module\":{\"name\":\"\\u6240\\u5c5e\\u6a21\\u5757\",\"object\":\"bug\",\"field\":\"module\",\"type\":\"number\"},\"execution\":{\"name\":\"\\u6240\\u5c5e\\u6267\\u884c\",\"object\":\"bug\",\"field\":\"execution\",\"type\":\"number\"},\"plan\":{\"name\":\"\\u6240\\u5c5e\\u8ba1\\u5212\",\"object\":\"bug\",\"field\":\"plan\",\"type\":\"number\"},\"story\":{\"name\":\"\\u76f8\\u5173\\u9700\\u6c42\",\"object\":\"bug\",\"field\":\"story\",\"type\":\"string\"},\"storyVersion\":{\"name\":\"\\u7814\\u53d1\\u9700\\u6c42\\u7248\\u672c\",\"object\":\"bug\",\"field\":\"storyVersion\",\"type\":\"number\"},\"task\":{\"name\":\"\\u76f8\\u5173\\u4efb\\u52a1\",\"object\":\"bug\",\"field\":\"task\",\"type\":\"number\"},\"toTask\":{\"name\":\"\\u8f6c\\u4efb\\u52a1\",\"object\":\"bug\",\"field\":\"toTask\",\"type\":\"number\"},\"toStory\":{\"name\":\"\\u8f6c\\u7814\\u53d1\\u9700\\u6c42\",\"object\":\"bug\",\"field\":\"toStory\",\"type\":\"number\"},\"title\":{\"name\":\"Bug\\u6807\\u9898\",\"object\":\"bug\",\"field\":\"title\",\"type\":\"string\"},\"keywords\":{\"name\":\"\\u5173\\u952e\\u8bcd\",\"object\":\"bug\",\"field\":\"keywords\",\"type\":\"string\"},\"severity\":{\"name\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\",\"object\":\"bug\",\"field\":\"severity\",\"type\":\"option\"},\"pri\":{\"name\":\"\\u4f18\\u5148\\u7ea7\",\"object\":\"bug\",\"field\":\"pri\",\"type\":\"option\"},\"type\":{\"name\":\"Bug\\u7c7b\\u578b\",\"object\":\"bug\",\"field\":\"type\",\"type\":\"string\"},\"os\":{\"name\":\"\\u64cd\\u4f5c\\u7cfb\\u7edf\",\"object\":\"bug\",\"field\":\"os\",\"type\":\"string\"},\"browser\":{\"name\":\"\\u6d4f\\u89c8\\u5668\",\"object\":\"bug\",\"field\":\"browser\",\"type\":\"string\"},\"hardware\":{\"name\":\"\\u786c\\u4ef6\",\"object\":\"bug\",\"field\":\"hardware\",\"type\":\"string\"},\"found\":{\"name\":\"\\u53d1\\u73b0\\u8005\",\"object\":\"bug\",\"field\":\"found\",\"type\":\"string\"},\"steps\":{\"name\":\"\\u91cd\\u73b0\\u6b65\\u9aa4\",\"object\":\"bug\",\"field\":\"steps\",\"type\":\"text\"},\"status\":{\"name\":\"Bug\\u72b6\\u6001\",\"object\":\"bug\",\"field\":\"status\",\"type\":\"option\"},\"subStatus\":{\"name\":\"\\u5b50\\u72b6\\u6001\",\"object\":\"bug\",\"field\":\"subStatus\",\"type\":\"string\"},\"color\":{\"name\":\"\\u6807\\u9898\\u989c\\u8272\",\"object\":\"bug\",\"field\":\"color\",\"type\":\"string\"},\"confirmed\":{\"name\":\"\\u662f\\u5426\\u786e\\u8ba4\",\"object\":\"bug\",\"field\":\"confirmed\",\"type\":\"option\"},\"activatedCount\":{\"name\":\"\\u6fc0\\u6d3b\\u6b21\\u6570\",\"object\":\"bug\",\"field\":\"activatedCount\",\"type\":\"number\"},\"activatedDate\":{\"name\":\"\\u6fc0\\u6d3b\\u65e5\\u671f\",\"object\":\"bug\",\"field\":\"activatedDate\",\"type\":\"date\"},\"feedbackBy\":{\"name\":\"\\u53cd\\u9988\\u8005\",\"object\":\"bug\",\"field\":\"feedbackBy\",\"type\":\"string\"},\"notifyEmail\":{\"name\":\"\\u901a\\u77e5\\u90ae\\u7bb1\",\"object\":\"bug\",\"field\":\"notifyEmail\",\"type\":\"string\"},\"mailto\":{\"name\":\"\\u6284\\u9001\\u7ed9\",\"object\":\"bug\",\"field\":\"mailto\",\"type\":\"string\"},\"openedBy\":{\"name\":\"\\u7531\\u8c01\\u521b\\u5efa\",\"object\":\"bug\",\"field\":\"openedBy\",\"type\":\"user\"},\"openedDate\":{\"name\":\"\\u521b\\u5efa\\u65e5\\u671f\",\"object\":\"bug\",\"field\":\"openedDate\",\"type\":\"date\"},\"openedBuild\":{\"name\":\"\\u5f71\\u54cd\\u7248\\u672c\",\"object\":\"bug\",\"field\":\"openedBuild\",\"type\":\"string\"},\"assignedTo\":{\"name\":\"\\u6307\\u6d3e\\u7ed9\",\"object\":\"bug\",\"field\":\"assignedTo\",\"type\":\"string\"},\"assignedDate\":{\"name\":\"\\u6307\\u6d3e\\u65e5\\u671f\",\"object\":\"bug\",\"field\":\"assignedDate\",\"type\":\"date\"},\"deadline\":{\"name\":\"\\u622a\\u6b62\\u65e5\\u671f\",\"object\":\"bug\",\"field\":\"deadline\",\"type\":\"date\"},\"resolvedBy\":{\"name\":\"\\u89e3\\u51b3\\u8005\",\"object\":\"bug\",\"field\":\"resolvedBy\",\"type\":\"user\"},\"resolution\":{\"name\":\"\\u89e3\\u51b3\\u65b9\\u6848\",\"object\":\"bug\",\"field\":\"resolution\",\"type\":\"option\"},\"resolvedBuild\":{\"name\":\"\\u89e3\\u51b3\\u7248\\u672c\",\"object\":\"bug\",\"field\":\"resolvedBuild\",\"type\":\"string\"},\"resolvedDate\":{\"name\":\"\\u89e3\\u51b3\\u65e5\\u671f\",\"object\":\"bug\",\"field\":\"resolvedDate\",\"type\":\"date\"},\"closedBy\":{\"name\":\"\\u7531\\u8c01\\u5173\\u95ed\",\"object\":\"bug\",\"field\":\"closedBy\",\"type\":\"string\"},\"closedDate\":{\"name\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"object\":\"bug\",\"field\":\"closedDate\",\"type\":\"date\"},\"duplicateBug\":{\"name\":\"\\u91cd\\u590dBug\",\"object\":\"bug\",\"field\":\"duplicateBug\",\"type\":\"number\"},\"linkBug\":{\"name\":\"\\u76f8\\u5173Bug\",\"object\":\"bug\",\"field\":\"linkBug\",\"type\":\"string\"},\"case\":{\"name\":\"\\u76f8\\u5173\\u7528\\u4f8b\",\"object\":\"bug\",\"field\":\"case\",\"type\":\"number\"},\"caseVersion\":{\"name\":\"\\u7528\\u4f8b\\u7248\\u672c\",\"object\":\"bug\",\"field\":\"caseVersion\",\"type\":\"number\"},\"feedback\":{\"name\":\"\\u53cd\\u9988\",\"object\":\"bug\",\"field\":\"feedback\",\"type\":\"number\"},\"result\":{\"name\":\"\\u7ed3\\u679c\",\"object\":\"bug\",\"field\":\"result\",\"type\":\"number\"},\"testtask\":{\"name\":\"\\u6d4b\\u8bd5\\u5355\",\"object\":\"bug\",\"field\":\"testtask\",\"type\":\"number\"},\"repo\":{\"name\":\"\\u6240\\u5c5e\\u7248\\u672c\\u5e93\",\"object\":\"bug\",\"field\":\"repo\",\"type\":\"number\"},\"mr\":{\"name\":\"\\u5408\\u5e76\\u8bf7\\u6c42\",\"object\":\"bug\",\"field\":\"mr\",\"type\":\"number\"},\"entry\":{\"name\":\"\\u4ee3\\u7801\\u8def\\u5f84\",\"object\":\"bug\",\"field\":\"entry\",\"type\":\"string\"},\"lines\":{\"name\":\"\\u4ee3\\u7801\\u884c\",\"object\":\"bug\",\"field\":\"lines\",\"type\":\"string\"},\"v1\":{\"name\":\"\\u7248\\u672c1\",\"object\":\"bug\",\"field\":\"v1\",\"type\":\"string\"},\"v2\":{\"name\":\"\\u7248\\u672c2\",\"object\":\"bug\",\"field\":\"v2\",\"type\":\"string\"},\"repoType\":{\"name\":\"\\u7248\\u672c\\u5e93\\u7c7b\\u578b\",\"object\":\"bug\",\"field\":\"repoType\",\"type\":\"string\"},\"issueKey\":{\"name\":\"Sonarqube\\u95ee\\u9898\\u952e\\u503c\",\"object\":\"bug\",\"field\":\"issueKey\",\"type\":\"string\"},\"lastEditedBy\":{\"name\":\"\\u6700\\u540e\\u4fee\\u6539\\u8005\",\"object\":\"bug\",\"field\":\"lastEditedBy\",\"type\":\"string\"},\"lastEditedDate\":{\"name\":\"\\u4fee\\u6539\\u65e5\\u671f\",\"object\":\"bug\",\"field\":\"lastEditedDate\",\"type\":\"date\"},\"deleted\":{\"name\":\"\\u5df2\\u5220\\u9664\",\"object\":\"bug\",\"field\":\"deleted\",\"type\":\"string\"}}',0,'','select * from zt_bug\nwhere deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','admin','2023-04-06 12:25:00',0),(10218,'质量数据-Bug类型分布',3,'pie',91,'0','','[{\"type\":\"pie\",\"group\":[{\"field\":\"type\",\"name\":\"Bug\\u7c7b\\u578b\",\"group\":\"\"}],\"metric\":[{\"field\":\"id\",\"name\":\"Bug\\u7f16\\u53f7\",\"valOrAgg\":\"count\"}]}]','[{\"field\":\"openedDate\",\"type\":\"date\",\"name\":\"\\u521b\\u5efa\\u65e5\\u671f\",\"default\":{\"begin\":\"\",\"end\":\"\"}}]','{\"id\":{\"name\":\"Bug\\u7f16\\u53f7\",\"object\":\"bug\",\"field\":\"id\",\"type\":\"number\"},\"type\":{\"name\":\"Bug\\u7c7b\\u578b\",\"object\":\"bug\",\"field\":\"type\",\"type\":\"option\"},\"openedDate\":{\"name\":\"\\u521b\\u5efa\\u65e5\\u671f\",\"object\":\"bug\",\"field\":\"openedDate\",\"type\":\"date\"}}',0,'','select\nid,type,openedDate\nfrom\nzt_bug\nwhere deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','admin','2023-04-18 13:34:46',0),(10219,'质量数据-Bug严重程度分布',3,'pie',91,'0','','[{\"type\":\"pie\",\"group\":[{\"field\":\"severity\",\"name\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\",\"group\":\"\"}],\"metric\":[{\"field\":\"id\",\"name\":\"Bug\\u7f16\\u53f7\",\"valOrAgg\":\"count\"}]}]','[{\"field\":\"openedDate\",\"type\":\"date\",\"name\":\"\\u521b\\u5efa\\u65e5\\u671f\",\"default\":{\"begin\":\"\",\"end\":\"\"}}]','{\"id\":{\"name\":\"Bug\\u7f16\\u53f7\",\"object\":\"bug\",\"field\":\"id\",\"type\":\"number\"},\"severity\":{\"name\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\",\"object\":\"bug\",\"field\":\"severity\",\"type\":\"option\"},\"openedDate\":{\"name\":\"\\u521b\\u5efa\\u65e5\\u671f\",\"object\":\"bug\",\"field\":\"openedDate\",\"type\":\"date\"}}',0,'','select\nid,severity,openedDate\nfrom\nzt_bug\nwhere deleted=\'0\'','published',1,'','admin','2023-11-24 15:34:00','admin','2023-04-18 13:36:37',0),(10220,'质量数据-Bug解决方案分布',3,'pie',91,'0','','[{\"type\":\"pie\",\"group\":[{\"field\":\"resolution\",\"name\":\"\\u89e3\\u51b3\\u65b9\\u6848\",\"group\":\"\"}],\"metric\":[{\"field\":\"id\",\"name\":\"Bug\\u7f16\\u53f7\",\"valOrAgg\":\"count\"}]}]','[{\"field\":\"resolvedDate\",\"type\":\"date\",\"name\":\"\\u89e3\\u51b3\\u65e5\\u671f\",\"default\":{\"begin\":\"\",\"end\":\"\"}}]','{\"id\":{\"name\":\"Bug\\u7f16\\u53f7\",\"object\":\"bug\",\"field\":\"id\",\"type\":\"number\"},\"resolution\":{\"name\":\"\\u89e3\\u51b3\\u65b9\\u6848\",\"object\":\"bug\",\"field\":\"resolution\",\"type\":\"option\"},\"resolvedDate\":{\"name\":\"\\u89e3\\u51b3\\u65e5\\u671f\",\"object\":\"bug\",\"field\":\"resolvedDate\",\"type\":\"date\"}}',0,'','select id,resolution,resolvedDate from zt_bug\nwhere deleted=\'0\' and resolution!=\' \'','published',1,'','admin','2023-11-24 15:34:00','','2023-04-18 13:37:24',0);
