| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408 |
- <?php
- $config->bi->builtin->charts = array();
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1001,
- 'name' => '年度总结-登录次数',
- 'code' => 'annualSummary_countLogin',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '0',
- 'sql' => <<<EOT
- SELECT sum(t2.login) AS login, `year`, account, realname
- FROM zt_user t1
- LEFT JOIN (SELECT count(1) as login, actor, YEAR(`date`) as `year` FROM zt_action GROUP BY actor, `year`) t2 on t1.account = t2.actor
- WHERE t1.deleted = '0'
- GROUP BY `year`, account, realname
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'login', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1002,
- 'name' => '年度总结-操作次数',
- 'code' => 'annualSummary_countAction',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '0',
- 'sql' => <<<EOT
- SELECT sum(t2.allAction) as allAction, `year` , account, realname
- FROM zt_user t1
- LEFT JOIN (SELECT count(1) as allAction, actor, YEAR(`date`) as `year` FROM zt_action GROUP BY actor, `year`) t2 on t1.account = t2.actor
- WHERE t1.deleted = '0'
- GROUP BY `year`, account, realname
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'allAction', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1003,
- 'name' => '年度总结-消耗工时',
- 'code' => 'annualSummary_consumed',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '0',
- 'sql' => <<<EOT
- SELECT ROUND(SUM(t2.consumed)) AS consumed, `year` , t1.account, realname
- FROM zt_user t1
- LEFT 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
- WHERE t1.deleted = '0'
- GROUP BY `year`, t1.account, realname
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'consumed', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1004,
- 'name' => '年度总结-待办数',
- 'code' => 'annualSummary_countTodo',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '0',
- 'sql' => <<<EOT
- SELECT
- SUM(t2.todo) AS todo,
- SUM(t2.undone) AS undone,
- SUM(t2.done) AS done,
- t2.`year`,
- t1.account,
- realname,
- dept
- FROM zt_user t1
- LEFT JOIN (
- SELECT
- COUNT(1) AS todo,
- SUM(CASE WHEN `status` != 'done' THEN 1 ELSE 0 END) AS undone,
- SUM(CASE WHEN `status` = 'done' THEN 1 ELSE 0 END) AS done,
- account,
- YEAR(`date`) AS `year`
- FROM zt_todo
- WHERE deleted = '0'
- GROUP BY account, `year`
- ) t2 ON t1.account = t2.account
- WHERE t1.deleted = '0'
- GROUP BY t2.`year`, t1.account, realname, dept;
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'todo', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1005,
- 'name' => '年度总结-贡献数',
- 'code' => 'annualSummary_countContributions',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '0',
- 'sql' => <<<EOT
- select tt.year,tt.actor as account, count(1) as num from (
- SELECT YEAR(t1.date) as `year`, t1.actor, t1.objectType, t1.action
- from zt_action t1
- WHERE
- (
- (t1.objectType = 'bug' AND t1.action in('resolved','opened','closed','activated') and (select deleted from zt_bug where id = t1.objectID) = '0')
- OR (t1.objectType = 'task' AND t1.action in('finished','opened','closed','activated','assigned') and (select deleted from zt_task where id = t1.objectID) = '0')
- OR (t1.objectType = 'story' AND t1.action in('opened','reviewed','closed') and (select deleted from zt_story where id = t1.objectID) = '0')
- OR (t1.objectType = 'execution' AND t1.action in('opened','edited','started','closed') and (select deleted from zt_project where id = t1.objectID) = '0')
- OR (t1.objectType = 'product' AND t1.action in('opened','edited','closed') and (select deleted from zt_product where id = t1.objectID) = '0')
- OR (t1.objectType = 'case' AND t1.action in('opened','run') and (select deleted from zt_case where id = t1.objectID) = '0')
- OR (t1.objectType = 'testtask' AND t1.action in('opened','edited') and (select deleted from zt_testtask where id = t1.objectID) = '0')
- OR (t1.objectType = 'productplan' AND t1.action in('opened') and (select deleted from zt_productplan where id = t1.objectID) = '0')
- OR (t1.objectType = 'release' AND t1.action in('opened') and (select deleted from zt_release where id = t1.objectID) = '0')
- OR (t1.objectType = 'doc' AND t1.action in('created','edited') and (select deleted from zt_doc where id = t1.objectID) = '0')
- OR (t1.objectType = 'build' AND t1.action in('opened') and (select deleted from zt_build where id = t1.objectID) = '0')
- )
- union all
- SELECT YEAR(t1.date) as `year`, t1.actor, 'code' as objectType, t1.action from zt_action t1
- where t1.action in ('gitcommited', 'svncommited') and t1.objectType = 'task'
- ) tt group by actor
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'num', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1006,
- 'name' => '年度总结-贡献数据',
- 'code' => 'annualSummary_contributions',
- 'dimension' => '1',
- 'type' => 'bar',
- 'group' => '0',
- 'sql' => <<<EOT
- SELECT t2.year, t1.dept, t2.account, t2.objectType, t2.create, t2.edit
- FROM zt_user AS t1
- LEFT JOIN
- (SELECT
- YEAR(t1.date) AS `year`, t1.actor AS account, '产品' AS objectType,
- SUM(IF(t1.action = 'opened', 1, 0)) AS `create`,
- SUM(IF(t1.action = 'edited', 1, 0)) AS `edit`
- FROM zt_action AS t1
- LEFT JOIN zt_product AS t2 ON t1.objectID = t2.id
- WHERE t1.objectType = 'product' AND t1.action IN ('opened', 'edited') AND t2.deleted = '0'
- GROUP BY `year`, actor, objectType
- UNION ALL
- SELECT
- YEAR(t1.date) AS `year`, t1.actor, '需求' AS objectType,
- SUM(IF(t1.action = 'opened', 1, 0)) AS `create`,
- SUM(IF(t1.action = 'edited', 1, 0)) AS `edit`
- FROM zt_action AS t1
- LEFT JOIN zt_story AS t2 ON t1.objectID = t2.id
- WHERE t1.objectType = 'story' AND t1.action IN ('opened', 'edited') AND t2.deleted = '0'
- GROUP BY `year`, actor, objectType
- UNION ALL
- SELECT
- YEAR(t1.date) AS `year`, t1.actor, '计划' AS objectType,
- SUM(IF(t1.action = 'opened', 1, 0)) AS `create`,
- SUM(IF(t1.action = 'edited', 1, 0)) AS `edit`
- FROM zt_action AS t1
- LEFT JOIN zt_productplan AS t2 ON t1.objectID = t2.id
- WHERE t1.objectType = 'productplan' AND t1.action IN ('opened', 'edited') AND t2.deleted = '0'
- GROUP BY `year`, actor, objectType
- UNION ALL
- SELECT
- YEAR(t1.date) AS `year`, t1.actor, '发布' AS objectType,
- SUM(IF(t1.action = 'opened', 1, 0)) AS `create`,
- SUM(IF(t1.action = 'edited', 1, 0)) AS `edit`
- FROM zt_action AS t1
- LEFT JOIN zt_release AS t2 ON t1.objectID = t2.id
- WHERE t1.objectType = 'release' AND t1.action IN ('opened', 'edited') AND t2.deleted = '0'
- GROUP BY `year`, actor, objectType
- UNION ALL
- SELECT
- YEAR(t1.date) AS `year`, t1.actor, '执行' AS objectType,
- SUM(IF(t1.action = 'opened', 1, 0)) AS `create`,
- SUM(IF(t1.action = 'edited', 1, 0)) AS `edit`
- FROM zt_action AS t1
- LEFT JOIN zt_project AS t2 ON t1.objectID = t2.id
- WHERE t1.objectType = 'execution' AND t1.action IN ('opened', 'edited') AND t2.deleted = '0' AND t2.type IN ('sprint', 'stage', 'kanban') AND t2.isTpl = '0'
- GROUP BY `year`, actor, objectType
- UNION ALL
- SELECT
- YEAR(t1.date) AS `year`, t1.actor, '任务' AS objectType,
- SUM(IF(t1.action = 'opened', 1, 0)) AS `create`,
- SUM(IF(t1.action = 'edited', 1, 0)) AS `edit`
- FROM zt_action AS t1
- LEFT JOIN zt_task AS t2 ON t1.objectID = t2.id
- WHERE t1.objectType = 'task' AND t1.action IN ('opened', 'edited') AND t2.deleted = '0'
- GROUP BY `year`, actor, objectType
- UNION ALL
- SELECT
- YEAR(t1.date) AS `year`, t1.actor, 'Bug' AS objectType,
- SUM(IF(t1.action = 'opened', 1, 0)) AS `create`,
- SUM(IF(t1.action = 'edited', 1, 0)) AS `edit`
- FROM zt_action AS t1
- LEFT JOIN zt_bug AS t2 ON t1.objectID = t2.id
- WHERE t1.objectType = 'bug' AND t1.action IN ('opened', 'edited') AND t2.deleted = '0'
- GROUP BY `year`, actor, objectType
- UNION ALL
- SELECT
- YEAR(t1.date) AS `year`, t1.actor, '版本' AS objectType,
- SUM(IF(t1.action = 'opened', 1, 0)) AS `create`,
- SUM(IF(t1.action = 'edited', 1, 0)) AS `edit`
- FROM zt_action AS t1
- LEFT JOIN zt_build AS t2 ON t1.objectID = t2.id
- WHERE t1.objectType = 'build' AND t1.action IN ('opened', 'edited') AND t2.deleted = '0'
- GROUP BY `year`, actor, objectType
- UNION ALL
- SELECT
- YEAR(t1.date) AS `year`, t1.actor, '用例' AS objectType,
- SUM(IF(t1.action = 'opened', 1, 0)) AS `create`,
- SUM(IF(t1.action = 'edited', 1, 0)) AS `edit`
- FROM zt_action AS t1
- LEFT JOIN zt_case AS t2 ON t1.objectID = t2.id
- WHERE t1.objectType = 'case' AND t1.action IN ('opened', 'edited') AND t2.deleted = '0'
- GROUP BY `year`, actor, objectType
- UNION ALL
- SELECT
- YEAR(t1.date) AS `year`, t1.actor, '测试单' AS objectType,
- SUM(IF(t1.action = 'opened', 1, 0)) AS `create`,
- SUM(IF(t1.action = 'edited', 1, 0)) AS `edit`
- FROM zt_action AS t1
- LEFT JOIN zt_testtask AS t2 ON t1.objectID = t2.id
- WHERE t1.objectType = 'testtask' AND t1.action IN ('opened', 'edited') AND t2.deleted = '0'
- GROUP BY `year`, actor, objectType
- UNION ALL
- SELECT
- YEAR(t1.date) AS `year`, t1.actor, '文档' AS objectType,
- SUM(IF(t1.action = 'opened', 1, 0)) AS `create`,
- SUM(IF(t1.action = 'edited', 1, 0)) AS `edit`
- FROM zt_action AS t1
- LEFT JOIN zt_doc AS t2 ON t1.objectID = t2.id
- WHERE t1.objectType = 'doc' AND t1.action IN ('opened', 'edited') AND t2.deleted = '0'
- GROUP BY `year`, actor, objectType) AS t2 ON t1.account = t2.account
- WHERE t2.account IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'xaxis' => array
- (
- array('field' => 'objectType', 'name' => '对象类型')
- ),
- 'yaxis' => array
- (
- array('type' => 'agg', 'field' => 'create', 'agg' => 'sum', 'name' => '创建', 'valOrAgg' => 'sum'),
- array('type' => 'value', 'field' => 'edit', 'agg' => 'sum', 'name' => '编辑', 'valOrAgg' => 'sum')
- )
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1007,
- 'name' => '年度总结-能力雷达图',
- 'code' => 'annualSummary_capabilityRadar',
- 'dimension' => '1',
- 'type' => 'radar',
- 'group' => '0',
- 'sql' => <<<EOT
- select tt.year, tt.actor AS account,tt.dimension, count(1) as num from (
- SELECT YEAR(t1.date) as `year`, t1.actor, 'product' as dimension
- from zt_action t1
- WHERE
- (
- (t1.objectType = 'product' AND t1.action in('opened','edited') and (select deleted from zt_product where id = t1.objectID) = '0')
- OR (t1.objectType = 'story' AND t1.action in('opened','reviewed','closed') and (select deleted from zt_story where id = t1.objectID) = '0')
- OR (t1.objectType = 'productplan' AND t1.action in('opened') and (select deleted from zt_productplan where id = t1.objectID) = '0')
- OR (t1.objectType = 'release' AND t1.action in('opened') and (select deleted from zt_release where id = t1.objectID) = '0')
- )
- union all
- SELECT YEAR(t1.date) as `year`, t1.actor, 'execution' as dimension
- from zt_action t1
- WHERE
- (
- (t1.objectType = 'execution' AND t1.action in('opened','edited','started','closed') and (select deleted from zt_project where id = t1.objectID) = '0')
- OR (t1.objectType = 'build' AND t1.action in('opened') and (select deleted from zt_build where id = t1.objectID) = '0')
- OR (t1.objectType = 'task' AND t1.action in('opened','closed','activated','assigned') and (select deleted from zt_task where id = t1.objectID) = '0')
- )
- union all
- SELECT YEAR(t1.date) as `year`, t1.actor, 'devel' as dimension
- from zt_action t1
- WHERE
- (
- (t1.objectType = 'execution' AND t1.action in('opened','edited','started','closed') and (select deleted from zt_project where id = t1.objectID) = '0')
- OR (t1.objectType = 'build' AND t1.action in('opened') and (select deleted from zt_build where id = t1.objectID) = '0')
- OR (t1.objectType = 'task' AND t1.action in('opened','closed','assigned') and (select deleted from zt_task where id = t1.objectID) = '0')
- OR (t1.objectType = 'task' and t1.action in ('gitcommited', 'svncommited'))
- OR (t1.objectType = 'bug' AND t1.action in('resolved') and (select deleted from zt_bug where id = t1.objectID) = '0')
- )
- union all
- SELECT YEAR(t1.date) as `year`, t1.actor, 'qa' as dimension
- from zt_action t1
- WHERE
- (
- (t1.objectType = 'bug' AND t1.action in('opened','closed','activated') and (select deleted from zt_bug where id = t1.objectID) = '0')
- OR (t1.objectType = 'case' AND t1.action in('opened','run') and (select deleted from zt_case where id = t1.objectID) = '0')
- OR (t1.objectType = 'testtask' AND t1.action in('opened','edited') and (select deleted from zt_testtask where id = t1.objectID) = '0')
- )
- ) tt WHERE tt.year != '0000'
- GROUP BY tt.year, tt.dimension
- EOT
- ,
- 'settings' => array
- (
- 'group' => array
- (
- array('field' => 'dimension', 'name' => '维度')
- ),
- 'metric' => array
- (
- array('type' => 'value', 'field' => 'num', 'agg' => 'value', 'name' => '产品管理', 'key' => 'product', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'num', 'agg' => 'value', 'name' => '项目管理', 'key' => 'project', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'num', 'agg' => 'value', 'name' => '研发', 'key' => 'dev', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'num', 'agg' => 'value', 'name' => '测试', 'key' => 'qa', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'num', 'agg' => 'value', 'name' => '其他', 'key' => 'other', 'valOrAgg' => 'value')
- )
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1008,
- 'name' => '年度总结-迭代数据',
- 'code' => 'annualSummary_executions',
- 'dimension' => '1',
- 'type' => 'table',
- 'group' => '0',
- 'sql' => <<<EOT
- SELECT
- tt.id,
- tt.name,
- tt.year,
- tt.account,
- tt.finishedStory,
- tt.finishedTask,
- count(t3.id) as resolvedBug
- from (
- SELECT
- tt.id,
- t2.name,
- tt.year,
- tt.account,
- SUM(if((t1.story != 0), 1 , 0)) as finishedStory,
- count(t1.id) as finishedTask
- from (
- SELECT
- *
- from (
- SELECT id, YEAR(begin) as `year`, openedBy as account from zt_project
- WHERE deleted = '0' AND type = 'sprint' and multiple = '1' and YEAR(begin) != '0000' AND isTpl = '0'
- union all
- SELECT id, YEAR(begin) as `year`, PO as account from zt_project
- WHERE deleted = '0' AND type = 'sprint' and multiple = '1' and YEAR(begin) != '0000' AND isTpl = '0'
- union all
- SELECT id, YEAR(begin) as `year`, PM as account from zt_project
- WHERE deleted = '0' AND type = 'sprint' and multiple = '1' and YEAR(begin) != '0000' AND isTpl = '0'
- union all
- SELECT id, YEAR(begin) as `year`, QD as account from zt_project
- WHERE deleted = '0' AND type = 'sprint' and multiple = '1' and YEAR(begin) != '0000' AND isTpl = '0'
- union all
- SELECT id, YEAR(begin) as `year`, RD as account from zt_project
- WHERE deleted = '0' AND type = 'sprint' and multiple = '1' and YEAR(begin) != '0000' AND isTpl = '0'
- union all
- SELECT id, YEAR(end) as `year`, openedBy as account from zt_project
- WHERE deleted = '0' AND type = 'sprint' and multiple = '1' and YEAR(end) != '0000' AND isTpl = '0'
- union all
- SELECT id, YEAR(end) as `year`, PO as account from zt_project
- WHERE deleted = '0' AND type = 'sprint' and multiple = '1' and YEAR(end) != '0000' AND isTpl = '0'
- union all
- SELECT id, YEAR(end) as `year`, PM as account from zt_project
- WHERE deleted = '0' AND type = 'sprint' and multiple = '1' and YEAR(end) != '0000' AND isTpl = '0'
- union all
- SELECT id, YEAR(end) as `year`, QD as account from zt_project
- WHERE deleted = '0' AND type = 'sprint' and multiple = '1' and YEAR(end) != '0000' AND isTpl = '0'
- union all
- SELECT id, YEAR(end) as `year`, RD as account from zt_project
- WHERE deleted = '0' AND type = 'sprint' and multiple = '1' and YEAR(end) != '0000' AND isTpl = '0'
- union all
- SELECT t1.root as id, YEAR(t1.`join`) as `year`, t1.account from zt_team t1
- RIGHT JOIN zt_project t2 on t2.id = t1.root and t2.deleted = '0' and t2.type = 'sprint' AND t2.isTpl = '0'
- WHERE t1.type = 'execution' and YEAR(t1.`join`) != '0000'
- union all
- SELECT t1.execution as id, YEAR(t1.finishedDate) as `year`, t1.finishedBy as account from zt_task t1
- RIGHT JOIN zt_project t2 on t2.id = t1.execution and t2.deleted = '0' and t2.type = 'sprint' AND t2.isTpl = '0'
- WHERE t1.deleted = '0' and YEAR(t1.finishedDate) != '0000'
- ) tt
- where tt.account != ''
- GROUP BY tt.id, tt.`year`, tt.account
- ) tt
- LEFT JOIN zt_task t1 on t1.execution = tt.id and YEAR(t1.finishedDate) = tt.year and t1.deleted = '0' and t1.finishedBy = tt.account
- LEFT JOIN zt_project t2 on t2.id = tt.id AND t2.isTpl = '0'
- GROUP BY tt.id, tt.`year`, tt.account
- ) tt
- LEFT JOIN zt_bug t2 on t2.resolvedBy = tt.account and YEAR(t2.resolvedDate) = tt.year
- left join zt_build t3 on t2.resolvedBuild = t3.id and t3.execution = tt.id
- WHERE t2.deleted = '0'
- GROUP BY tt.account, tt.`year`, tt.id
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'name', 'valOrAgg' => 'value', 'name' => '迭代名称'),
- array('field' => 'finishedStory', 'valOrAgg' => 'value', 'name' => '完成需求数'),
- array('field' => 'finishedTask', 'valOrAgg' => 'value', 'name' => '完成任务数'),
- array('field' => 'resolvedBug', 'valOrAgg' => 'value', 'name' => '解决Bug数')
- ),
- 'filter' => array()
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1009,
- 'name' => '年度总结-产品数据',
- 'code' => 'annualSummary_products',
- 'dimension' => '1',
- 'type' => 'table',
- 'group' => '0',
- 'sql' => <<<EOT
- select * from (
- select tt.id, t2.name, tt.year, tt.account, tt.plans, tt.requirement, tt.story, count(t1.id) as closedStory
- from(
- select tt.id, tt.year, tt.account, tt.plans,
- sum(if((type = 'requirement'), 1, 0)) as requirement,
- sum(if((type = 'story'), 1, 0)) as story
- from (
- select tt.id, tt.year, tt.account,
- count(t2.id) as plans
- from (
- select * from (
- select id, YEAR(createdDate) as `year`, createdBy as account from zt_product
- where deleted = '0' and shadow = '0'
- union all
- select id, YEAR(createdDate) as `year`, PO as account from zt_product
- where deleted = '0' and shadow = '0'
- union all
- select id, YEAR(createdDate) as `year`, QD as account from zt_product
- where deleted = '0' and shadow = '0'
- union all
- select id, YEAR(createdDate) as `year`, RD as account from zt_product
- where deleted = '0' and shadow = '0'
- ) tt
- WHERE tt.account != '' and tt.year != '0000'
- GROUP BY tt.account, tt.year, tt.id
- ) tt
- LEFT JOIN zt_productplan t1 on t1.product = tt.id
- LEFT JOIN zt_action t2 on t1.id = t2.objectID and YEAR(t2.date) = tt.year
- and t2.objectType = 'productplan'
- and t1.deleted = '0'
- and t2.actor = tt.account
- and t2.action = 'opened'
- GROUP BY tt.account, tt.year, tt.id) tt
- LEFT JOIN zt_story t1 on t1.product = tt.id and YEAR(t1.openedDate) = tt.year and t1.openedBy = tt.account and t1.deleted = '0'
- GROUP BY tt.account, tt.year, tt.id) tt
- LEFT JOIN zt_story t1 on t1.product = tt.id and YEAR(t1.closedDate) = tt.year and t1.closedBy = tt.account and t1.deleted = '0'
- LEFT JOIN zt_product t2 on t2.id = tt.id
- GROUP BY tt.account, tt.year, tt.id) tt
- WHERE tt.account = 'zhangpeng'
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'name', 'valOrAgg' => 'value', 'name' => '产品名称'),
- array('field' => 'plan', 'valOrAgg' => 'value', 'name' => '计划数'),
- array('field' => 'requirement', 'valOrAgg' => 'value', 'name' => '创建用户需求数'),
- array('field' => 'story', 'valOrAgg' => 'value', 'name' => '创建需求数'),
- array('field' => 'closedStory', 'valOrAgg' => 'value', 'name' => '关闭需求数')
- ),
- 'filter' => array()
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1010,
- 'name' => '年度总结-任务状态分布',
- 'code' => 'annualSummary_taskStatus',
- 'dimension' => '1',
- 'type' => 'pie',
- 'group' => '0',
- 'sql' => <<<EOT
- SELECT
- YEAR(t1.date) AS `year`,
- t3.account,
- t3.realname,
- CASE t2.status
- WHEN 'wait' THEN '未开始'
- WHEN 'doing' THEN '进行中'
- WHEN 'done' THEN '已完成'
- WHEN 'closed' THEN '已关闭'
- ELSE '未设置' END status,
- t1.id
- FROM zt_action t1
- LEFT JOIN zt_task t2 on t1.objectID=t2.id RIGHT JOIN zt_user t3 on t1.actor=t3.account
- WHERE t1.objectType = 'task'
- and t2.deleted = '0'
- EOT
- ,
- 'settings' => array
- (
- 'group' => array
- (
- array('field' => 'status', 'name' => '状态')
- ),
- 'metric' => array
- (
- array('type' => 'agg', 'field' => 'id', 'agg' => 'count', 'name' => '任务数', 'valOrAgg' => 'count')
- )
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1011,
- 'name' => '年度总结-每月任务操作情况',
- 'code' => 'annualSummary_monthlyTaskAction',
- 'dimension' => '1',
- 'type' => 'bar',
- 'group' => '0',
- 'sql' => <<<EOT
- 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
- LEFT JOIN (
- SELECT t21.actor,LEFT(t21.`date`,7) AS actionDate,
- SUM(if(t21.action = 'opened', 1, 0)) as opened,
- SUM(if(t21.action = 'started', 1, 0)) as started,
- SUM(if(t21.action = 'finished', 1, 0)) as finished,
- SUM(if(t21.action = 'paused', 1, 0)) as paused,
- SUM(if(t21.action = 'activated', 1, 0)) as activated,
- SUM(if(t21.action = 'canceled', 1, 0)) as canceled,
- SUM(if(t21.action = 'closed', 1, 0)) as closed FROM zt_action AS t21
- LEFT JOIN zt_story AS t22 ON t21.objectID=t22.id
- WHERE t21.objectType='bug'
- AND t22.deleted='0'
- GROUP BY t21.actor,actionDate
- ) AS t2 ON t1.account=t2.actor
- LEFT JOIN zt_dept AS t3 ON t1.dept=t3.id
- WHERE t1.deleted='0'
- AND t2.actor IS NOT NULL
- GROUP BY t2.actionDate,deptName,t1.account,realname
- EOT
- ,
- 'settings' => array
- (
- 'xaxis' => array
- (
- array('field' => 'actionDate', 'name' => '日期', 'group' => 'value')
- ),
- 'yaxis' => array
- (
- array('type' => 'agg', 'field' => 'opened', 'agg' => 'sum', 'name' => '创建', 'valOrAgg' => 'sum'),
- array('type' => 'agg', 'field' => 'started', 'agg' => 'sum', 'name' => '开始', 'valOrAgg' => 'sum'),
- array('type' => 'agg', 'field' => 'finished', 'agg' => 'sum', 'name' => '完成', 'valOrAgg' => 'sum'),
- array('type' => 'agg', 'field' => 'paused', 'agg' => 'sum', 'name' => '暂停', 'valOrAgg' => 'sum'),
- array('type' => 'agg', 'field' => 'activated', 'agg' => 'sum', 'name' => '激活', 'valOrAgg' => 'sum'),
- array('type' => 'agg', 'field' => 'canceled', 'agg' => 'sum', 'name' => '取消', 'valOrAgg' => 'sum'),
- array('type' => 'agg', 'field' => 'closed', 'agg' => 'sum', 'name' => '关闭', 'valOrAgg' => 'sum')
- )
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1012,
- 'name' => '年度总结-需求状态分布',
- 'code' => 'annualSummary_storyStatus',
- 'dimension' => '1',
- 'type' => 'pie',
- 'group' => '0',
- 'sql' => <<<EOT
- SELECT
- YEAR(t1.date) AS `year`,
- t3.account,
- t3.realname,
- CASE t2.status
- WHEN 'wait' THEN '未开始'
- WHEN 'doing' THEN '进行中'
- WHEN 'done' THEN '已完成'
- WHEN 'colsed' THEN '已关闭'
- ELSE '未设置'
- END status,
- t1.id
- FROM zt_action t1
- LEFT JOIN zt_task t2 on t1.objectID=t2.id RIGHT JOIN zt_user t3 on t1.actor=t3.account
- WHERE t1.objectType = 'story'
- and t2.deleted = '0'
- EOT
- ,
- 'settings' => array
- (
- 'group' => array
- (
- array('field' => 'status', 'name' => '状态')
- ),
- 'metric' => array
- (
- array('type' => 'agg', 'field' => 'id', 'agg' => 'count', 'name' => '需求数', 'valOrAgg' => 'count')
- )
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1013,
- 'name' => '年度总结-每月需求操作情况',
- 'code' => 'annualSummary_monthlyStoryAction',
- 'dimension' => '1',
- 'type' => 'bar',
- 'group' => '0',
- 'sql' => <<<EOT
- 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
- LEFT JOIN (
- SELECT t21.actor,LEFT(t21.`date`, 7) AS actionDate,
- SUM(IF(t21.action='opened',1,0)) AS opened,
- SUM(IF(t21.action='activated',1,0)) AS activated,
- SUM(IF(t21.action='closed',1,0)) AS closed,
- SUM(IF(t21.action='changed',1,0)) AS `changed` FROM zt_action AS t21
- LEFT JOIN zt_story AS t22 ON t21.objectID=t22.id
- WHERE t21.objectType='story'
- AND t22.deleted='0'
- GROUP BY t21.actor,actionDate
- ) AS t2 ON t1.account=t2.actor
- LEFT JOIN zt_dept AS t3 ON t1.dept=t3.id
- WHERE t1.deleted='0'
- AND t2.actor IS NOT NULL
- GROUP BY t2.actionDate,deptName,t1.account,realname
- EOT
- ,
- 'settings' => array
- (
- 'xaxis' => array
- (
- array('field' => 'actionDate', 'name' => '日期', 'group' => 'value')
- ),
- 'yaxis' => array
- (
- array('type' => 'value', 'field' => 'opened', 'agg' => 'value', 'name' => '创建', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'activated', 'agg' => 'value', 'name' => '激活', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'changed', 'agg' => 'value', 'name' => '变更', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'closed', 'agg' => 'value', 'name' => '关闭', 'valOrAgg' => 'value')
- )
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1014,
- 'name' => '年度总结-Bug状态分布',
- 'code' => 'annualSummary_bugStatus',
- 'dimension' => '1',
- 'type' => 'pie',
- 'group' => '0',
- 'sql' => <<<EOT
- SELECT
- YEAR(t1.date) AS `year`, t3.account,
- t3.realname,
- CASE t2.status
- WHEN 'wait' THEN '未开始'
- WHEN 'doing' THEN '进行中'
- WHEN 'done' THEN '已完成'
- WHEN 'closed' THEN '已关闭'
- ELSE '未设置'
- END status,
- t1.id
- FROM zt_action t1
- LEFT JOIN zt_task t2 on t1.objectID=t2.id RIGHT JOIN zt_user t3 on t1.actor=t3.account
- WHERE t1.objectType = 'bug'
- and t2.deleted = '0'
- EOT
- ,
- 'settings' => array
- (
- 'group' => array
- (
- array('field' => 'status', 'name' => '状态')
- ),
- 'metric' => array
- (
- array('type' => 'agg', 'field' => 'id', 'agg' => 'count', 'name' => 'Bug数', 'valOrAgg' => 'count')
- )
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1015,
- 'name' => '年度总结-每月Bug操作情况',
- 'code' => 'annualSummary_monthlyBugAction',
- 'dimension' => '1',
- 'type' => 'bar',
- 'group' => '0',
- 'sql' => <<<EOT
- SELECT t2.opened,t2.bugconfirmed,t2.activated,t2.resolved,t2.closed,t1.account,t2.actionDate,YEAR(CONCAT(t2.actionDate, '-01')) AS
- `year`,realname,t3.`name` AS deptName FROM zt_user AS t1
- LEFT JOIN (
- SELECT t21.actor,LEFT(t21.`date`, 7) AS actionDate,
- SUM(IF(t21.action='opened',1,0)) AS opened,
- SUM(IF(t21.action='bugconfirmed',1,0)) AS bugconfirmed,
- SUM(IF(t21.action='activated',1,0)) AS activated,
- SUM(IF(t21.action='resolved',1,0)) AS resolved,
- SUM(IF(t21.action='closed',1,0)) AS closed FROM zt_action AS t21
- LEFT JOIN zt_story AS t22 ON t21.objectID=t22.id
- WHERE t21.objectType='bug'
- AND t22.deleted='0'
- GROUP BY t21.actor,actionDate
- ) AS t2 ON t1.account=t2.actor
- LEFT JOIN zt_dept AS t3 ON t1.dept=t3.id
- WHERE t1.deleted='0'
- AND t2.actor IS NOT NULL
- GROUP BY t2.actionDate,deptName,t1.account,realname
- EOT
- ,
- 'settings' => array
- (
- 'xaxis' => array
- (
- array('field' => 'actionDate', 'name' => '日期', 'group' => 'value')
- ),
- 'yaxis' => array
- (
- array('type' => 'value', 'field' => 'opened', 'agg' => 'value', 'name' => '创建', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'bugconfirmed', 'agg' => 'value', 'name' => '确认', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'activated', 'agg' => 'value', 'name' => '激活', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'resolved', 'agg' => 'value', 'name' => '解决', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'closed', 'agg' => 'value', 'name' => '关闭', 'valOrAgg' => 'value')
- )
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1016,
- 'name' => '年度总结-用例结果分布',
- 'code' => 'annualSummary_caseResult',
- 'dimension' => '1',
- 'type' => 'pie',
- 'group' => '0',
- 'sql' => <<<EOT
- SELECT count ,t2.caseResult as status,t2.`year`, t1.account, realname, dept
- FROM zt_user t1
- LEFT JOIN (
- SELECT t21.lastRunner, YEAR(t21.`date`) as `year`, t21.caseResult, count(distinct t21.`id`) as count
- FROM zt_testresult t21
- LEFT JOIN zt_case t22 on t21.case = t22.id
- WHERE t22.deleted = '0'
- GROUP BY t21.lastRunner, `year`, t21.caseResult
- ) t2 on t1.account = t2.lastRunner
- WHERE t1.deleted = '0'
- GROUP BY t2.caseResult,t2.`year`, t1.account, realname, dept
- EOT
- ,
- 'settings' => array
- (
- 'group' => array
- (
- array('field' => 'status', 'name' => '状态')
- ),
- 'metric' => array
- (
- array('type' => 'agg', 'field' => 'id', 'agg' => 'count', 'name' => '个数', 'valOrAgg' => 'count')
- )
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1017,
- 'name' => '年度总结-每月用例操作情况',
- 'code' => 'annualSummary_monthlyCaseAction',
- 'dimension' => '1',
- 'type' => 'bar',
- 'group' => '0',
- 'sql' => <<<EOT
- SELECT SUM(createdCases) AS createdCases, SUM(toBugCases) AS toBugCases, SUM(runCases) AS runCases, YEAR(CONCAT(t2.actionDate, '-01')) AS `year`, t1.account, realname, dept
- FROM zt_user t1
- LEFT JOIN (
- SELECT t21.actor, LEFT(t21.`date`, 7) as actionDate,
- SUM(IF((t22.id IS NOT NULL AND t23.id IS NULL), 1, 0)) AS createdCases,
- SUM(IF((t22.id IS NOT NULL AND t23.id IS NOT NULL), 1, 0)) AS toBugCases,
- SUM(IF((t24.lastRunner = t21.actor AND t21.action = 'run' AND t21.`date` = t24.`date`), 1, 0)) AS runCases
- FROM zt_action t21
- LEFT JOIN zt_case t22 on t21.objectID = t22.id
- LEFT JOIN zt_bug t23 on t22.id = t23.case
- LEFT JOIN zt_testresult t24 on t22.id = t24.`case` AND t24.lastRunner = t21.actor AND t21.action = 'run' AND t21.`date` = t24.`date`
- WHERE t21.objectType = 'case'
- AND t21.action in ('opened', 'run')
- AND t22.deleted = '0'
- AND (t23.deleted = '0' OR t23.id IS NULL)
- GROUP BY t21.actor, actionDate
- ) t2 on t1.account = t2.actor
- WHERE t1.deleted = '0'
- AND t2.actor is not null
- GROUP BY t2.actionDate, t1.account, realname, dept
- EOT
- ,
- 'settings' => array
- (
- 'xaxis' => array
- (
- array('field' => 'actionDate', 'name' => '日期', 'group' => 'value')
- ),
- 'yaxis' => array
- (
- array('type' => 'value', 'field' => 'createdCases', 'agg' => 'value', 'name' => '创建', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'toBugCases', 'agg' => 'value', 'name' => '转Bug', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'runCases', 'agg' => 'value', 'name' => '执行', 'valOrAgg' => 'value')
- )
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1018,
- 'name' => '宏观数据-一级项目集个数',
- 'code' => 'macro_countTopProgram',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '45',
- 'sql' => <<<EOT
- SELECT id,name FROM zt_project WHERE type='program' AND parent=0 AND deleted='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'fields' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1019,
- 'name' => '宏观数据-项目个数',
- 'code' => 'macro_countProject',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '46',
- 'sql' => <<<EOT
- SELECT id FROM zt_project WHERE type='project' AND deleted='0' AND market = 0 AND isTpl = '0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1020,
- 'name' => '宏观数据-产品个数',
- 'code' => 'macro_countProduct',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '47',
- 'sql' => <<<EOT
- SELECT id FROM zt_product WHERE deleted='0' AND shadow = '0' AND vision = 'rnd'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1021,
- 'name' => '宏观数据-计划个数',
- 'code' => 'macro_countPlan',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '48',
- 'sql' => <<<EOT
- SELECT id FROM zt_productplan WHERE deleted='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1022,
- 'name' => '宏观数据-执行个数',
- 'code' => 'macro_countExecution',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '49',
- 'sql' => <<<EOT
- SELECT id FROM zt_project WHERE type IN ('sprint','stage','kanban') AND deleted='0' AND multiple = '1' AND market = 0 AND isTpl = '0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1023,
- 'name' => '宏观数据-发布个数',
- 'code' => 'macro_countRelease',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '50',
- 'sql' => <<<EOT
- SELECT id FROM zt_release WHERE deleted='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1024,
- 'name' => '宏观数据-需求个数',
- 'code' => 'macro_countStory',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '51',
- 'sql' => <<<EOT
- SELECT id FROM zt_story WHERE deleted='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1025,
- 'name' => '宏观数据-任务个数',
- 'code' => 'macro_countTask',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '52',
- 'sql' => <<<EOT
- SELECT id FROM zt_task WHERE deleted='0' AND type != 'research' AND isTpl = '0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1026,
- 'name' => '宏观数据-缺陷个数',
- 'code' => 'macro_countBug',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '53',
- 'sql' => <<<EOT
- SELECT id FROM zt_bug WHERE deleted='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1027,
- 'name' => '宏观数据-文档个数',
- 'code' => 'macro_countDoc',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '54',
- 'sql' => <<<EOT
- SELECT id FROM zt_doc WHERE deleted='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1028,
- 'name' => '宏观数据-现有人员个数',
- 'code' => 'macro_activeAccounts',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '55',
- 'sql' => <<<EOT
- SELECT id FROM zt_user WHERE deleted='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1029,
- 'name' => '宏观数据-累计消耗工时',
- 'code' => 'macro_consumed',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '55',
- 'sql' => <<<EOT
- SELECT consumed FROM zt_effort WHERE deleted='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'consumed', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1030,
- 'name' => '宏观数据-禅道使用时长',
- 'code' => 'macro_useZentao',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '58',
- 'sql' => <<<EOT
- SELECT
- CASE WHEN years > 0
- THEN CONCAT(years, '年', days, '天')
- ELSE CONCAT(days, '天')
- END AS period
- from (
- SELECT
- firstDay,
- CURRENT_DATE AS today,
- CAST(EXTRACT(YEAR FROM CURRENT_DATE) - EXTRACT(YEAR FROM firstDay) AS DECIMAL) AS years,
- MOD(
- CAST(
- (EXTRACT(MONTH FROM CURRENT_DATE) - EXTRACT(MONTH FROM firstDay)) * 30 +
- (EXTRACT(DAY FROM CURRENT_DATE) - EXTRACT(DAY FROM firstDay)) + 365
- AS DECIMAL
- ),
- 365
- ) days
- FROM (SELECT cast(`value` as DATE) AS firstDay FROM zt_config WHERE `owner` = 'system' AND `key` = 'installedDate') AS subquery
- ) data
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'value', 'field' => 'period', 'agg' => 'value'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1031,
- 'name' => '宏观数据-需求完成率',
- 'code' => 'macro_storyFinishedRate',
- 'dimension' => '1',
- 'type' => 'waterpolo',
- 'group' => '36',
- 'sql' => <<<EOT
- SELECT id, IF(closedReason='done', 'done', 'undone') AS bugstatus FROM zt_story WHERE deleted='0' AND (status != 'closed' OR closedReason='done')
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'waterpolo',
- 'calc' => 'count',
- 'goal' => 'id',
- 'conditions' => array
- (
- array('field' => 'bugstatus', 'condition' => 'eq', 'value' => 'done')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'id' => array('name' => '编号', 'object' => 'story', 'field' => 'id', 'type' => 'number'),
- 'bugstatus' => array('name' => 'bugstatus', 'object' => 'story', 'field' => 'bugstatus', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => '编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'bugstatus' => array('zh-cn' => 'Bug状态', 'zh-tw' => '', 'en' => 'bugstatus', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1032,
- 'name' => '宏观数据-Bug修复率',
- 'code' => 'macro_bugFixedRate',
- 'dimension' => '1',
- 'type' => 'waterpolo',
- 'group' => '44',
- 'sql' => <<<EOT
- SELECT id, IF(`status`='closed' AND resolution='fixed', 'done', 'undone') AS bugstatus FROM zt_bug WHERE deleted='0' AND (status = 'active' OR resolution in ('fixed', 'postponed'))
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'waterpolo',
- 'calc' => 'count',
- 'goal' => 'id',
- 'conditions' => array
- (
- array('field' => 'bugstatus', 'condition' => 'eq', 'value' => 'done')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'id' => array('name' => 'Bug编号', 'object' => 'bug', 'field' => 'id', 'type' => 'number'),
- 'bugstatus' => array('name' => 'bugstatus', 'object' => 'bug', 'field' => 'bugstatus', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => 'Bug编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'bugstatus' => array('zh-cn' => 'Bug状态', 'zh-tw' => '', 'en' => 'bugstatus', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1033,
- 'name' => '宏观数据-未完成的一级项目集个数',
- 'code' => 'macro_countTopProgram_undone',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '45',
- 'sql' => <<<EOT
- SELECT id FROM zt_project WHERE type='program' AND `status`!='closed' AND deleted='0' AND grade='1'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1034,
- 'name' => '宏观数据-未完成的需求',
- 'code' => 'macro_countStory_undone',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '51',
- 'sql' => <<<EOT
- SELECT id FROM zt_story WHERE `status`!='closed' AND deleted='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1035,
- 'name' => '宏观数据-未完成的产品',
- 'code' => 'macro_countProduct_undone',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '47',
- 'sql' => <<<EOT
- SELECT id FROM zt_product WHERE `status`!='closed' AND deleted='0' AND shadow='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1036,
- 'name' => '宏观数据-未完成的项目',
- 'code' => 'macro_countProject_undone',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '46',
- 'sql' => <<<EOT
- SELECT id FROM zt_project WHERE type='project' AND `status`!='closed' AND deleted='0' AND isTpl = '0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1037,
- 'name' => '宏观数据-未完成的计划',
- 'code' => 'macro_countPlan_undone',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '48',
- 'sql' => <<<EOT
- 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'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1038,
- 'name' => '宏观数据-未完成的执行',
- 'code' => 'macro_countExecution_undone',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '49',
- 'sql' => <<<EOT
- SELECT id FROM zt_project WHERE type IN ('sprint','stage','kanban') AND `status`!='closed' AND deleted='0' AND multiple = '1' AND isTpl = '0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1039,
- 'name' => '宏观数据-未完成的缺陷',
- 'code' => 'macro_countBug_undone',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '53',
- 'sql' => <<<EOT
- SELECT id FROM zt_bug WHERE `status`!='closed' AND deleted='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1040,
- 'name' => '宏观数据-未完成的任务',
- 'code' => 'macro_countTask_undone',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '52',
- 'sql' => <<<EOT
- SELECT id FROM (SELECT id,deleted FROM zt_task WHERE `status` NOT IN ('closed','cancel','done') AND isTpl = '0') AS task WHERE task.deleted='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1041,
- 'name' => '宏观数据-项目集数据概览',
- 'code' => 'macro_programOverview',
- 'dimension' => '1',
- 'type' => 'table',
- 'group' => '64',
- 'sql' => <<<EOT
- SELECT
- t1.name AS topProgram,
- COALESCE(t2.subProgram, 0) AS subProgram,
- COUNT(DISTINCT t3.id) AS product,
- SUM(COALESCE(t4.story, 0)) AS story,
- SUM(COALESCE(t5.`release`, 0)) AS `release`,
- SUM(COALESCE(t6.bug, 0)) AS bug,
- COALESCE(t7.project, 0) AS project,
- COALESCE(t7.execution, 0) AS execution,
- COALESCE(t7.task, 0) AS task
- FROM zt_project AS t1
- LEFT JOIN (
- SELECT
- CAST(SUBSTRING(path FROM 2 FOR (POSITION(',' IN SUBSTRING(path FROM 2)) - 1)) AS DECIMAL) 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
- LEFT JOIN zt_product AS t3
- ON t1.id = t3.program
- AND t3.deleted = '0'
- AND t3.shadow = '0'
- AND t3.vision = 'rnd'
- LEFT JOIN (
- SELECT
- product,
- COUNT(1) AS story,
- COUNT(CASE WHEN status = 'done' THEN 1 END) AS finishedStory
- FROM zt_story
- WHERE deleted = '0' AND type = 'story'
- GROUP BY product
- ) AS t4 ON t3.id = t4.product
- LEFT JOIN (
- SELECT product, COUNT(1) AS `release`
- FROM zt_release
- WHERE deleted = '0'
- GROUP BY product
- ) AS t5 ON t3.id = t5.product
- LEFT JOIN (
- SELECT
- product,
- COUNT(1) AS bug,
- COUNT(CASE WHEN status = 'fixed' THEN 1 END) AS fixedBug
- FROM zt_bug
- WHERE deleted = '0'
- GROUP BY product
- ) AS t6 ON t3.id = t6.product
- LEFT JOIN (
- SELECT
- t1.topProgram,
- COUNT(DISTINCT t1.project) AS project,
- SUM(COALESCE(t2.task, 0)) AS task,
- SUM(COALESCE(t3.execution, 0)) AS execution
- FROM (
- SELECT
- CAST(SUBSTRING(path FROM 2 FOR (POSITION(',' IN SUBSTRING(path FROM 2)) - 1)) AS DECIMAL) AS topProgram,
- id AS project
- FROM zt_project
- WHERE deleted = '0' AND type = 'project'
- ) AS t1
- LEFT JOIN (
- SELECT COUNT(1) AS task, project
- FROM zt_task
- WHERE deleted = '0'
- GROUP BY project
- ) AS t2 ON t1.project = t2.project
- LEFT JOIN (
- SELECT COUNT(1) AS execution, project
- FROM zt_project
- WHERE deleted = '0'
- AND type IN ('sprint', 'stage', 'kanban')
- AND multiple = '1'
- GROUP BY project
- ) AS t3 ON t1.project = t3.project
- GROUP BY t1.topProgram
- ) AS t7 ON t1.id = t7.topProgram
- WHERE t1.deleted = '0' AND t1.type = 'program' AND t1.grade = 1
- GROUP BY t1.name
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'topProgram', 'valOrAgg' => 'value', 'name' => '一级项目集'),
- array('field' => 'subProgram', 'valOrAgg' => 'value', 'name' => '子项目集数'),
- array('field' => 'product', 'valOrAgg' => 'value', 'name' => '产品数'),
- array('field' => 'story', 'valOrAgg' => 'value', 'name' => '研发需求数'),
- array('field' => 'bug', 'valOrAgg' => 'value', 'name' => 'Bug数'),
- array('field' => 'release', 'valOrAgg' => 'value', 'name' => '发布数'),
- array('field' => 'project', 'valOrAgg' => 'value', 'name' => '项目数'),
- array('field' => 'execution', 'valOrAgg' => 'value', 'name' => '执行数'),
- array('field' => 'task', 'valOrAgg' => 'value', 'name' => '任务数')
- ),
- 'filter' => array()
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1042,
- 'name' => '宏观数据-项目集需求完成率与Bug修复率',
- 'code' => 'macro_programStoryFinishedRateAndBugFixedRate',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '45',
- 'sql' => <<<EOT
- SELECT
- t1.name AS topProgram,
- SUM(IFNULL(t3.doneStory, 0)) AS doneStory,
- SUM(IFNULL(t4.allStory, 0)) AS allStory,
- CASE
- WHEN SUM(IFNULL(t4.allStory, 0)) <= 0 THEN CAST(0.00 AS DECIMAL(10,2))
- ELSE CAST((SUM(IFNULL(t3.doneStory, 0)) / SUM(IFNULL(t4.allStory, 0)) * 100) AS DECIMAL(10,2))
- END AS storyDoneRate,
- SUM(IFNULL(t5.solvedBug, 0)) AS solvedBug,
- SUM(IFNULL(t6.allBug, 0)) AS allBug,
- CASE
- WHEN SUM(IFNULL(t6.allBug, 0)) <= 0 THEN CAST(0.00 AS DECIMAL(10,2))
- ELSE CAST((SUM(IFNULL(t5.solvedBug, 0)) / SUM(IFNULL(t6.allBug, 0)) * 100) AS DECIMAL(10,2))
- END AS bugSolvedRate
- FROM zt_project AS t1
- LEFT JOIN zt_product AS t2 ON t1.id = t2.program
- LEFT 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
- LEFT 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
- LEFT 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
- LEFT 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
- WHERE t1.type = 'program' AND t1.grade = 1 AND t1.deleted = '0'
- AND t2.deleted = '0'
- GROUP BY t1.name, t1.`order`
- ORDER BY t1.`order` DESC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'topProgram', 'name' => 'topProgram', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'storyDoneRate', 'name' => 'storyDoneRate', 'valOrAgg' => 'sum'),
- array('field' => 'bugSolvedRate', 'name' => 'bugSolvedRate', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'topProgram' => array('name' => 'topProgram', 'object' => 'bug', 'field' => 'topProgram', 'type' => 'string'),
- 'doneStory' => array('name' => 'doneStory', 'object' => 'bug', 'field' => 'doneStory', 'type' => 'number'),
- 'allStory' => array('name' => 'allStory', 'object' => 'bug', 'field' => 'allStory', 'type' => 'number'),
- 'storyDoneRate' => array('name' => 'storyDoneRate', 'object' => 'bug', 'field' => 'storyDoneRate', 'type' => 'number'),
- 'solvedBug' => array('name' => 'solvedBug', 'object' => 'bug', 'field' => 'solvedBug', 'type' => 'number'),
- 'allBug' => array('name' => 'allBug', 'object' => 'bug', 'field' => 'allBug', 'type' => 'number'),
- 'bugSolvedRate' => array('name' => 'bugSolvedRate', 'object' => 'bug', 'field' => 'bugSolvedRate', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'topProgram' => array('zh-cn' => '一级项目集', 'zh-tw' => '', 'en' => 'topProgram', 'de' => '', 'fr' => ''),
- 'doneStory' => array('zh-cn' => '完成需求数', 'zh-tw' => '', 'en' => 'doneStory', 'de' => '', 'fr' => ''),
- 'allStory' => array('zh-cn' => '需求数', 'zh-tw' => '', 'en' => 'allStory', 'de' => '', 'fr' => ''),
- 'storyDoneRate' => array('zh-cn' => '需求完成率', 'zh-tw' => '', 'en' => 'storyDoneRate', 'de' => '', 'fr' => ''),
- 'solvedBug' => array('zh-cn' => '解决bug数', 'zh-tw' => '', 'en' => 'solvedBug', 'de' => '', 'fr' => ''),
- 'allBug' => array('zh-cn' => 'bug数', 'zh-tw' => '', 'en' => 'allBug', 'de' => '', 'fr' => ''),
- 'bugSolvedRate' => array('zh-cn' => 'bug修复率', 'zh-tw' => '', 'en' => 'bugSolvedRate', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1043,
- 'name' => '宏观数据-公司项目集状态分布',
- 'code' => 'macro_programStatus',
- 'dimension' => '1',
- 'type' => 'pie',
- 'group' => '45',
- 'sql' => <<<EOT
- 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'
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'pie',
- 'group' => array
- (
- array('field' => 'status', 'name' => '状态', 'group' => '')
- ),
- 'metric' => array
- (
- array('field' => 'id', 'name' => '项目ID', 'valOrAgg' => 'count')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'id' => array('name' => '项目ID', 'object' => 'project', 'field' => 'id', 'type' => 'number'),
- 'status' => array('name' => '状态', 'object' => 'project', 'field' => 'status', 'type' => 'option')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'status' => array('zh-cn' => '状态', 'zh-tw' => '', 'en' => 'status', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1044,
- 'name' => '宏观数据-公司项目状态分布',
- 'code' => 'macro_projectStatus',
- 'dimension' => '1',
- 'type' => 'pie',
- 'group' => '38',
- 'sql' => <<<EOT
- 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' AND isTpl = '0'
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'pie',
- 'group' => array
- (
- array('field' => 'status', 'name' => '状态', 'group' => '')
- ),
- 'metric' => array
- (
- array('field' => 'id', 'name' => '项目ID', 'valOrAgg' => 'count')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'id' => array('name' => '项目ID', 'object' => 'project', 'field' => 'id', 'type' => 'number'),
- 'status' => array('name' => '状态', 'object' => 'project', 'field' => 'status', 'type' => 'option')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'status' => array('zh-cn' => '状态', 'zh-tw' => '', 'en' => 'status', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1045,
- 'name' => '宏观数据-产品数据概览',
- 'code' => 'macro_productOverview',
- 'dimension' => '1',
- 'type' => 'table',
- 'group' => '63',
- 'sql' => <<<EOT
- SELECT
- t1.name AS product,
- COALESCE(t2.name, '/') AS program,
- COALESCE(t3.name, '/') AS productLine,
- COALESCE(t4.plan, 0) AS plan,
- COALESCE(t5.release, 0) AS `release`,
- COALESCE(t6.story, 0) AS story,
- COALESCE(t7.bug, 0) AS bug
- FROM
- zt_product AS t1
- LEFT JOIN zt_project AS t2 ON t1.program = t2.id AND t2.type = 'program' AND t2.grade = 1
- LEFT JOIN zt_module AS t3 ON t1.line = t3.id AND t3.type = 'line'
- LEFT JOIN (SELECT product, COUNT(1) AS plan FROM zt_productplan WHERE deleted = '0' GROUP BY product) AS t4 ON t1.id = t4.product
- LEFT JOIN (SELECT product, COUNT(1) AS `release` FROM zt_release WHERE deleted = '0' GROUP BY product) AS t5 ON t1.id = t5.product
- LEFT JOIN (SELECT product, COUNT(1) AS story FROM zt_story WHERE deleted = '0' GROUP BY product) AS t6 ON t1.id = t6.product
- LEFT JOIN (SELECT product, COUNT(1) AS bug FROM zt_bug WHERE deleted = '0' GROUP BY product) AS t7 ON t1.id = t7.product
- WHERE t1.deleted = '0' AND t1.status != 'closed' AND t1.shadow = '0' AND t1.vision = 'rnd'
- ORDER BY t1.`order` LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'program', 'valOrAgg' => 'value', 'name' => '一级项目集'),
- array('field' => 'productLine', 'valOrAgg' => 'value', 'name' => '产品线'),
- array('field' => 'product', 'valOrAgg' => 'value', 'name' => '产品'),
- array('field' => 'story', 'valOrAgg' => 'value', 'name' => '需求数'),
- array('field' => 'bug', 'valOrAgg' => 'value', 'name' => 'Bug数'),
- array('field' => 'plan', 'valOrAgg' => 'value', 'name' => '计划数'),
- array('field' => 'release', 'valOrAgg' => 'value', 'name' => '发布数')
- ),
- 'filter' => array()
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1046,
- 'name' => '宏观数据-产品需求完成率',
- 'code' => 'macro_productStoryFinishedRate',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '36',
- 'sql' => <<<EOT
- SELECT
- t1.name AS product,
- IFNULL(t2.name, '/') AS program,
- IFNULL(t3.name, '/') AS productLine,
- IFNULL(t4.story, 0) AS closedStory,
- t5.story AS totalStory,
- ROUND(IFNULL(t4.story, 0) / t5.story * 100, 2) AS closedRate
- FROM zt_product AS t1
- LEFT JOIN zt_project AS t2 ON t1.program = t2.id AND t2.type = 'program' AND t2.grade = 1
- LEFT JOIN zt_module AS t3 ON t1.line = t3.id AND t3.type = 'line'
- LEFT 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
- LEFT 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
- WHERE t1.deleted = '0' AND t1.status != 'closed' AND t1.shadow = '0' AND t1.vision = 'rnd' AND t5.story IS NOT NULL
- ORDER BY t1.order DESC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'product', 'name' => '所属产品', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'closedRate', 'name' => 'closedRate', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'product' => array('name' => '所属产品', 'object' => 'story', 'field' => 'product', 'type' => 'string'),
- 'program' => array('name' => 'program', 'object' => 'story', 'field' => 'program', 'type' => 'string'),
- 'productLine' => array('name' => 'productLine', 'object' => 'story', 'field' => 'productLine', 'type' => 'string'),
- 'closedStory' => array('name' => '需求:%s 已关闭,将不会被关闭。', 'object' => 'story', 'field' => 'closedStory', 'type' => 'string'),
- 'totalStory' => array('name' => 'totalStory', 'object' => 'story', 'field' => 'totalStory', 'type' => 'string'),
- 'closedRate' => array('name' => 'closedRate', 'object' => 'story', 'field' => 'closedRate', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'product' => array('zh-cn' => '所属产品', 'zh-tw' => '', 'en' => 'product', 'de' => '', 'fr' => ''),
- 'program' => array('zh-cn' => '项目集', 'zh-tw' => '', 'en' => 'program', 'de' => '', 'fr' => ''),
- 'productLine' => array('zh-cn' => '产品线', 'zh-tw' => '', 'en' => 'productLine', 'de' => '', 'fr' => ''),
- 'closedStory' => array('zh-cn' => '完成需求数', 'zh-tw' => '', 'en' => 'closedStory', 'de' => '', 'fr' => ''),
- 'totalStory' => array('zh-cn' => '需求数', 'zh-tw' => '', 'en' => 'totalStory', 'de' => '', 'fr' => ''),
- 'closedRate' => array('zh-cn' => '需求完成率', 'zh-tw' => '', 'en' => 'closedRate', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1047,
- 'name' => '宏观数据-产品Bug修复率',
- 'code' => 'macro_productBugFixedRate',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '44',
- 'sql' => <<<EOT
- SELECT
- t1.name AS product,
- IFNULL(t2.name, '/') AS program,
- IFNULL(t3.name, '/') AS productLine,
- IFNULL(t4.bug, 0) AS fixedBug,
- t5.bug AS totalBug,
- ROUND(IFNULL(t4.bug, 0) / t5.bug * 100, 2) AS fixedRate
- FROM zt_product AS t1
- LEFT JOIN zt_project AS t2 ON t1.program = t2.id AND t2.type = 'program' AND t2.grade = 1
- LEFT JOIN zt_module AS t3 ON t1.line = t3.id AND t3.type = 'line'
- LEFT 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
- LEFT 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
- WHERE t1.deleted = '0' AND t1.status != 'closed' AND t1.shadow = '0' AND t1.vision = 'rnd' AND t5.bug IS NOT NULL
- ORDER BY t1.order DESC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'product', 'name' => '所属产品', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'fixedRate', 'name' => '修复率', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'product' => array('name' => '所属产品', 'object' => 'bug', 'field' => 'product', 'type' => 'string'),
- 'program' => array('name' => 'program', 'object' => 'bug', 'field' => 'program', 'type' => 'string'),
- 'productLine' => array('name' => 'productLine', 'object' => 'bug', 'field' => 'productLine', 'type' => 'string'),
- 'fixedBug' => array('name' => 'fixedBug', 'object' => 'bug', 'field' => 'fixedBug', 'type' => 'string'),
- 'totalBug' => array('name' => 'totalBug', 'object' => 'bug', 'field' => 'totalBug', 'type' => 'string'),
- 'fixedRate' => array('name' => '修复率', 'object' => 'bug', 'field' => 'fixedRate', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'product' => array('zh-cn' => '所属产品', 'zh-tw' => '', 'en' => 'product', 'de' => '', 'fr' => ''),
- 'program' => array('zh-cn' => '项目集', 'zh-tw' => '', 'en' => 'program', 'de' => '', 'fr' => ''),
- 'productLine' => array('zh-cn' => '产品线', 'zh-tw' => '', 'en' => 'productLine', 'de' => '', 'fr' => ''),
- 'fixedBug' => array('zh-cn' => '修复bug数', 'zh-tw' => '', 'en' => 'fixedBug', 'de' => '', 'fr' => ''),
- 'totalBug' => array('zh-cn' => 'bug数', 'zh-tw' => '', 'en' => 'totalBug', 'de' => '', 'fr' => ''),
- 'fixedRate' => array('zh-cn' => 'bug修复率', 'zh-tw' => '', 'en' => 'fixedRate', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1049,
- 'name' => '宏观数据-部门人员分布图',
- 'code' => 'macro_deptAccountStatus',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '56',
- 'sql' => <<<EOT
- SELECT IF(t3.id IS NOT NULL, t3.`name`, '空') AS deptName,count(1) as count,
- IF(t3.id IS NOT NULL, t3.`order`, 9999) AS deptOrder
- FROM zt_user AS t1
- LEFT JOIN zt_dept AS t2 ON t1.dept = t2.id
- LEFT JOIN zt_dept AS t3 ON FIND_IN_SET(TRIM(',' FROM t3.path), TRIM(',' FROM t2.path)) AND t3.grade = '1'
- WHERE t1.deleted = '0'
- GROUP BY deptName, deptOrder
- ORDER BY deptOrder ASC
- LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'deptName', 'name' => 'deptName', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'count', 'name' => 'count', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'deptName' => array('name' => 'deptName', 'object' => 'false', 'field' => 'deptName', 'type' => 'object'),
- 'count' => array('name' => 'count', 'object' => 'false', 'field' => 'count', 'type' => 'object'),
- 'deptOrder' => array('name' => 'deptOrder', 'object' => 'false', 'field' => 'deptOrder', 'type' => 'object')
- ),
- 'langs' => array
- (
- 'deptName' => array('zh-cn' => '部门', 'zh-tw' => '', 'en' => 'deptName', 'de' => '', 'fr' => ''),
- 'count' => array('zh-cn' => '人数', 'zh-tw' => '', 'en' => 'count', 'de' => '', 'fr' => ''),
- 'deptOrder' => array('zh-cn' => '顺序', 'zh-tw' => '', 'en' => 'deptOrder', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1050,
- 'name' => '宏观数据-公司角色分布图',
- 'code' => 'macro_roleStatus',
- 'dimension' => '1',
- 'type' => 'pie',
- 'group' => '56',
- 'sql' => <<<EOT
- SELECT
- account,
- CASE
- ROLE
- WHEN 'dev' THEN
- '研发'
- WHEN 'qa' THEN
- '测试'
- WHEN 'pm' THEN
- '项目经理'
- WHEN 'others' THEN
- '其他'
- WHEN 'td' THEN
- '研发主管'
- WHEN 'pd' THEN
- '产品主管'
- WHEN 'po' THEN
- '产品经理'
- WHEN 'qd' THEN
- '测试主管'
- WHEN 'top' THEN
- '高层管理' ELSE '未知'
- END `role`
- FROM
- zt_user
- WHERE
- deleted = '0'
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'pie',
- 'group' => array
- (
- array('field' => 'role', 'name' => '职位', 'group' => '')
- ),
- 'metric' => array
- (
- array('field' => 'account', 'name' => '用户名', 'valOrAgg' => 'count')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'account' => array('name' => '用户名', 'object' => 'user', 'field' => 'account', 'type' => 'string'),
- 'role' => array('name' => '职位', 'object' => 'user', 'field' => 'role', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'account' => array('zh-cn' => '用户名', 'zh-tw' => '', 'en' => 'account', 'de' => '', 'fr' => ''),
- 'role' => array('zh-cn' => '职位', 'zh-tw' => '', 'en' => 'role', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1051,
- 'name' => '宏观数据-人员工龄分布图',
- 'code' => 'macro_workingStatus',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '56',
- 'sql' => <<<EOT
- SELECT count(1) as count, '0-1年' as joinDate FROM zt_user WHERE deleted = '0' AND `join` > DATE_SUB(NOW(), INTERVAL 1 YEAR)
- union
- SELECT count(1) as count, '1-3年' as joinDate FROM zt_user WHERE deleted = '0' AND `join` > DATE_SUB(NOW(), INTERVAL 3 YEAR) AND `join` <= DATE_SUB(NOW(), INTERVAL 1 YEAR)
- union
- SELECT count(1) as count, '3-5年' as joinDate FROM zt_user WHERE deleted = '0' AND `join` > DATE_SUB(NOW(), INTERVAL 5 YEAR) AND `join` <= DATE_SUB(NOW(), INTERVAL 3 YEAR)
- union
- SELECT count(1) as count, '5-10年' as joinDate FROM zt_user WHERE deleted = '0' AND `join` > DATE_SUB(NOW(), INTERVAL 10 YEAR) AND `join` <= DATE_SUB(NOW(), INTERVAL 5 YEAR)
- union
- SELECT count(1) as count, '10年以上' as joinDate FROM zt_user WHERE deleted = '0' AND `join` < DATE_SUB(NOW(), INTERVAL 10 YEAR) AND LEFT(`join`, 4) != '0000'
- union
- SELECT count(1) as count, '未知' as joinDate FROM zt_user WHERE deleted = '0' AND LEFT(`join`, 4) = '0000'
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'joinDate', 'name' => 'joinDate', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'count', 'name' => 'count', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'count' => array('name' => 'count', 'object' => 'user', 'field' => 'count', 'type' => 'string'),
- 'joinDate' => array('name' => 'joinDate', 'object' => 'user', 'field' => 'joinDate', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'count' => array('zh-cn' => '人数', 'zh-tw' => '', 'en' => 'count', 'de' => '', 'fr' => ''),
- 'joinDate' => array('zh-cn' => '工龄', 'zh-tw' => '', 'en' => 'joinDate', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1055,
- 'name' => '年度新增-一级项目集个数',
- 'code' => 'annualCreated_countTopProgram',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '45',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.id,
- t2.name
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN (
- SELECT
- id, name,
- YEAR ( `openedDate` ) AS `year`
- FROM
- zt_project
- WHERE
- `type` = 'program'
- AND deleted = '0'
- AND grade = '1'
- ) t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1056,
- 'name' => '年度新增-产品个数',
- 'code' => 'annualCreated_countProduct',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '47',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.id,
- t2.name
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN (
- SELECT
- id, name,
- YEAR ( createdDate ) AS `year`
- FROM
- zt_product
- WHERE
- deleted = '0'
- AND shadow = '0'
- ) t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1057,
- 'name' => '年度新增-需求个数',
- 'code' => 'annualCreated_countStory',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '51',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.id,
- t2.title
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN ( SELECT id, title, YEAR ( `openedDate` ) AS `year` FROM zt_story WHERE deleted = '0' ) AS t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1058,
- 'name' => '年度新增-Bug个数',
- 'code' => 'annualCreated_countBug',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '53',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.id,
- t2.title
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN ( SELECT id, title, YEAR ( `openedDate` ) AS `year` FROM zt_bug WHERE deleted = '0' ) AS t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1059,
- 'name' => '年度新增-计划个数',
- 'code' => 'annualCreated_countPlan',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '48',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.id,
- t2.title
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN ( SELECT id, title, YEAR ( createdDate ) AS `year` FROM zt_productplan WHERE deleted = '0') AS t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1060,
- 'name' => '年度新增-项目个数',
- 'code' => 'annualCreated_countProject',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '46',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.id,
- t2.name
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN (
- SELECT
- id, name,
- YEAR ( `openedDate` ) AS `year`
- FROM
- zt_project
- WHERE
- `type` = 'project'
- AND deleted = '0'
- AND market = 0
- ) t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1061,
- 'name' => '年度新增-执行个数',
- 'code' => 'annualCreated_countExecution',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '49',
- 'sql' => <<<EOT
- SELECT t1.`year`, t2.id, t2.name
- FROM (SELECT DISTINCT YEAR(`date`) AS `year` FROM zt_action) AS t1
- LEFT JOIN (SELECT id,name, YEAR(openedDate) AS `year` FROM zt_project WHERE `type` IN ( 'sprint', 'stage', 'kanban' ) AND deleted = '0' AND multiple = '1' AND market = 0) AS t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1062,
- 'name' => '年度新增-任务数',
- 'code' => 'annualCreated_countTask',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '52',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.id,
- t2.name
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN ( SELECT id, name, YEAR ( `openedDate` ) AS `year` FROM zt_task WHERE deleted = '0' AND type != 'research') AS t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1063,
- 'name' => '年度新增-文档个数',
- 'code' => 'annualCreated_countDoc',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '54',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.id,
- t2.title
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN ( SELECT id, title, YEAR ( addedDate ) AS `year` FROM zt_doc WHERE deleted = '0') AS t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1064,
- 'name' => '年度新增-发布个数',
- 'code' => 'annualCreated_countRelease',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '50',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.id,
- t2.name
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN ( SELECT id, name, YEAR ( `date` ) AS `year` FROM zt_release WHERE deleted = '0') AS t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1065,
- 'name' => '年度新增-人员个数',
- 'code' => 'annualCreated_countAccount',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '56',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.account,
- t2.realname
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN (
- SELECT
- account, realname,
- YEAR ( t112.`date` ) AS `year`
- FROM
- zt_user AS t111
- LEFT JOIN zt_action t112 ON t111.id = t112.objectID
- AND t112.objectType = 'user'
- WHERE
- t111.deleted = '0'
- AND t112.action = 'created'
- ) AS t2 ON t1.`year` = t2.`year`
- WHERE t2.account IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'account', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'realname' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1066,
- 'name' => '年度新增-完成项目数',
- 'code' => 'annualCreated_countPorject_finished',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '46',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.id,
- t2.name
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN (
- SELECT
- id, name,
- YEAR ( closedDate ) AS `year`
- FROM
- zt_project
- WHERE
- `type` = 'project'
- AND deleted = '0'
- AND isTpl = '0'
- ) t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1067,
- 'name' => '年度新增-完成执行数',
- 'code' => 'annualCreated_countExecution_finished',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '49',
- 'sql' => <<<EOT
- SELECT t1.`year`, t2.id, t2.name
- FROM (SELECT DISTINCT YEAR(date) AS `year` FROM zt_action) AS t1
- LEFT 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' AND isTpl = '0') AS t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1068,
- 'name' => '年度新增-完成发布数',
- 'code' => 'annualCreated_countRelease_finished',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '50',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.id,
- t2.name
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN ( SELECT id, name, YEAR ( `date` ) AS `year` FROM zt_release WHERE deleted = '0') AS t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1069,
- 'name' => '年度新增-完成需求数',
- 'code' => 'annualCreated_countStory_finished',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '51',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.id,
- t2.title
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN (
- SELECT
- id, title,
- YEAR ( closedDate ) AS `year`
- FROM
- zt_story
- WHERE
- deleted = '0'
- AND closedReason = 'done'
- AND STATUS = 'closed'
- ) AS t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1070,
- 'name' => '年度新增-解决Bug数',
- 'code' => 'annualCreated_countBug_fixed',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '53',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.id,
- t2.title
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN (
- SELECT
- id, title,
- YEAR ( closedDate ) AS `year`
- FROM
- zt_bug
- WHERE
- deleted = '0'
- AND resolution = 'fixed'
- AND STATUS = 'closed'
- ) AS t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1071,
- 'name' => '年度新增-完成任务数',
- 'code' => 'annualCreated_countTask_finished',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '52',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- t2.id,
- t2.name
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- LEFT JOIN (
- SELECT
- id, name,
- YEAR ( finishedDate ) AS `year`
- FROM
- zt_task
- WHERE
- deleted = '0'
- AND STATUS = 'closed'
- AND closedReason = 'done'
- AND isTpl = '0'
- ) AS t2 ON t1.`year` = t2.`year`
- WHERE t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1072,
- 'name' => '年度新增-投入工时数',
- 'code' => 'annualCreated_consumed',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '57',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- IFNULL( t2.consumed, 0 ) AS consumed
- FROM
- ( SELECT DISTINCT YEAR ( `date` ) AS `year` FROM zt_action ) AS t1
- 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`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'value', 'field' => 'consumed', 'agg' => 'value'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1073,
- 'name' => '年度新增-项目集年度新增数据汇总表',
- 'code' => 'annualCreated_programOverview_created',
- 'dimension' => '1',
- 'type' => 'table',
- 'group' => '64',
- 'sql' => <<<EOT
- select tt.topProgram,tt.programID as id,tt.`year`,sum(tt.product) as product,sum(tt.plan) as plan,sum(tt.`release`) as `release`,sum(tt.story) as story,sum(tt.bug) as bug,sum(tt.doc) as doc
- from (
- select t2.name as topProgram,t2.id as programID,t0.`year`,count(1) as product,0 as plan,0 as story,0 as bug,0 as `release`, 0 as doc
- from zt_product t1
- left join (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) t0 on YEAR(t1.createdDate) = t0.`year`
- left join zt_project t2 on t1.program = t2.id
- where t1.deleted = '0' and t1.shadow = '0'
- and t2.type = 'program' and t2.grade = 1 and t2.deleted = '0'
- group by t2.id, t0.`year`
- union all
- select t3.name as topProgram,t3.id as programID,t0.`year`,0 as product,count(1) as plan,0 as story,0 as bug,0 as `release`, 0 as doc
- from zt_productplan t1
- left join (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) t0 on YEAR(t1.createdDate) = t0.`year`
- left join zt_product t2 on t2.id = t1.product
- left join zt_project t3 on t2.program = t3.id
- where t1.deleted = '0'
- and t2.deleted = '0'
- and t3.type = 'program' and t3.grade = 1 and t3.deleted = '0'
- group by t3.id, t0.`year`
- union all
- select t3.name as topProgram,t3.id as programID,t0.`year`,0 as product,0 as plan,0 as story,0 as bug,0 as `release`, count(1) as doc
- from zt_doc t1
- left join (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) t0 on YEAR(t1.addedDate) = t0.`year`
- left join zt_product t2 on t2.id = t1.product
- left join zt_project t3 on t2.program = t3.id
- where t1.deleted = '0'
- and t2.deleted = '0'
- and t3.type = 'program' and t3.grade = 1 and t3.deleted = '0'
- group by t3.id, t0.`year`
- union all
- select t3.name as topProgram,t3.id as programID,t0.`year`,0 as product,0 as plan,0 as story,0 as bug,0 as `release`, count(distinct t1.id) as doc
- from zt_doc t1
- left join (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) t0 on YEAR(t1.addedDate) = t0.`year`
- left join zt_projectproduct t4 on t1.project = t4.project
- left join zt_product t2 on t2.id = t4.product
- left join zt_project t3 on t2.program = t3.id
- where t1.deleted = '0'
- and t2.deleted = '0'
- and t3.type = 'program' and t3.grade = 1 and t3.deleted = '0'
- group by t3.id, t0.`year`
- union all
- select t3.name as topProgram,t3.id as programID,t0.`year`,0 as product,0 as plan,0 as story,0 as bug,count(1) as `release`, 0 as doc
- from zt_release t1
- left join (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) t0 on YEAR(t1.date) = t0.`year`
- left join zt_product t2 on t2.id = t1.product
- left join zt_project t3 on t2.program = t3.id
- where t1.deleted = '0'
- and t2.deleted = '0'
- and t3.type = 'program' and t3.grade = 1 and t3.deleted = '0'
- group by t3.id, t0.`year`
- union all
- select t3.name as topProgram,t3.id as programID,t0.`year`,0 as product,0 as plan,count(1) as story,0 as bug,0 as `release`, 0 as doc
- from zt_story t1
- left join (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) t0 on YEAR(t1.openedDate) = t0.`year`
- left join zt_product t2 on t2.id = t1.product
- left join zt_project t3 on t2.program = t3.id
- where t1.deleted = '0'
- and t2.deleted = '0'
- and t3.type = 'program' and t3.grade = 1 and t3.deleted = '0'
- group by t3.id, t0.`year`
- union all
- select t3.name as topProgram,t3.id as programID,t0.`year`,0 as product,0 as plan,0 as story,count(1) as bug,0 as `release`, 0 as doc
- from zt_bug t1
- left join (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) t0 on YEAR(t1.openedDate) = t0.`year`
- left join zt_product t2 on t2.id = t1.product
- left join zt_project t3 on t2.program = t3.id
- where t1.deleted = '0'
- and t2.deleted = '0'
- and t3.type = 'program' and t3.grade = 1 and t3.deleted = '0'
- group by t3.id, t0.`year`
- ) tt
- group by tt.programID, tt.`year`
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'topProgram', 'valOrAgg' => 'value', 'name' => '一级项目集'),
- array('field' => 'product', 'valOrAgg' => 'value', 'name' => '产品数'),
- array('field' => 'plan', 'valOrAgg' => 'value', 'name' => '计划数'),
- array('field' => 'story', 'valOrAgg' => 'value', 'name' => '需求数'),
- array('field' => 'bug', 'valOrAgg' => 'value', 'name' => 'Bug数'),
- array('field' => 'release', 'valOrAgg' => 'value', 'name' => '发布数'),
- array('field' => 'doc', 'valOrAgg' => 'value', 'name' => '文档数')
- ),
- 'filter' => array()
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1074,
- 'name' => '年度新增-项目集年度完成数据概览',
- 'code' => 'annualCreated_programOverview_finished',
- 'dimension' => '1',
- 'type' => 'table',
- 'group' => '64',
- 'sql' => <<<EOT
- select tt.topProgram,tt.programID as id,tt.`year`,sum(tt.projectA) as projectA,sum(tt.executionA) as executionA,sum(tt.releaseA) as `release`,sum(tt.storyA) as story,sum(tt.bugA) as bug
- from (
- select t2.name as topProgram,t2.id as programID,t0.`year`,count(1) as projectA,0 as executionA,0 as releaseA,0 as storyA,0 as bugA
- from zt_project t1
- left join (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) t0 on YEAR(t1.closedDate) = t0.`year`
- left join zt_project t2 on FIND_IN_SET(t2.id, t1.path)
- where t1.type = 'project' and t1.deleted = '0'
- and t2.type = 'program' and t2.grade = 1 and t2.deleted = '0'
- and t1.`status` = 'closed'
- group by t2.id, t0.`year`
- union all
- select t3.name as topProgram, t3.id as programID,t0.`year`,0 as projectA,count(1) as executionA,0 as releaseA,0 as storyA,0 as bugA
- from zt_project t1
- left join (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) t0 on YEAR(t1.closedDate) = t0.`year`
- left join zt_project t2 on t1.parent = t2.id
- left join zt_project t3 on FIND_IN_SET(t3.id, t2.path)
- where t1.type in ('sprint', 'stage', 'kanban') and t1.deleted = '0'
- and t2.type = 'project' and t2.deleted = '0'
- and t3.type = 'program' and t3.grade = 1 and t3.deleted = '0'
- and t1.`status` = 'closed'
- group by t3.id, t0.`year`
- union all
- select t3.name as topProgram,t3.id as programID,t0.`year`,0 as projectA,0 as executionA,count(1) as releaseA,0 as storyA,0 as bugA
- from zt_release t1
- left join (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) t0 on YEAR(t1.date) = t0.`year`
- left join zt_product t2 on t2.id = t1.product
- left join zt_project t3 on t2.program = t3.id
- where t1.deleted = '0'
- and t2.deleted = '0'
- and t3.type = 'program' and t3.grade = 1 and t3.deleted = '0'
- group by t3.id, t0.`year`
- union all
- select t3.name as topProgram,t3.id as programID,t0.`year`,0 as projectA,0 as executionA,0 as releaseA,count(1) as storyA,0 as bugA
- from zt_story t1
- left join (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) t0 on YEAR(t1.closedDate) = t0.`year`
- left join zt_product t2 on t2.id = t1.product
- left join zt_project t3 on t2.program = t3.id
- where t1.deleted = '0' and t1.closedReason = 'done' and t1.status = 'closed'
- and t2.deleted = '0'
- and t3.type = 'program' and t3.grade = 1 and t3.deleted = '0'
- group by t3.id, t0.`year`
- union all
- select t3.name as topProgram,t3.id as programID,t0.`year`,0 as projectA,0 as executionA,0 as releaseA,0 as storyA,count(1) as bugA
- from zt_bug t1
- left join (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) t0 on YEAR(t1.resolvedDate) = t0.`year`
- left join zt_product t2 on t2.id = t1.product
- left join zt_project t3 on t2.program = t3.id
- where t1.deleted = '0' and t1.resolution = 'fixed' and t1.status = 'closed'
- and t2.deleted = '0'
- and t3.type = 'program' and t3.grade = 1 and t3.deleted = '0'
- group by t3.id, t0.`year`
- ) tt
- group by tt.programID, tt.`year`
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'topProgram', 'valOrAgg' => 'value', 'name' => '一级项目集'),
- array('field' => 'projectA', 'valOrAgg' => 'value', 'name' => '项目数'),
- array('field' => 'executionA', 'valOrAgg' => 'value', 'name' => '执行数'),
- array('field' => 'release', 'valOrAgg' => 'value', 'name' => '发布数'),
- array('field' => 'story', 'valOrAgg' => 'value', 'name' => '需求数'),
- array('field' => 'bug', 'valOrAgg' => 'value', 'name' => 'Bug数')
- ),
- 'filter' => array()
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1075,
- 'name' => '年度新增-产品年度新增数据汇总表',
- 'code' => 'annualCreated_productOverview_created',
- 'dimension' => '1',
- 'type' => 'table',
- 'group' => '63',
- 'sql' => <<<EOT
- SELECT
- t1.name,t1.id,t2.`year`,IF(YEAR(t1.createdDate) = t2.`year`, 1, 0) as newProduct,
- SUM(IFNULL(t3.story, 0)) AS story,
- SUM(IFNULL(t4.bug, 0)) AS bug,
- SUM(IFNULL(t5.`plan`, 0)) AS `plan`,
- SUM(IFNULL(t6.`release`, 0)) AS `release`
- FROM zt_product AS t1
- LEFT JOIN (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) as t2 ON 1 = 1
- LEFT JOIN (SELECT COUNT(1) as `story`, product, YEAR(openedDate) as `year` FROM zt_story WHERE deleted = '0' GROUP BY product, `year`) AS t3 on t1.id = t3.product AND t3.`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 t4 on t1.id = t4.product AND t4.`year` = t2.`year`
- LEFT 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`
- LEFT 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`
- WHERE t1.deleted = '0' AND t1.status != 'closed' AND t1.shadow = '0'
- GROUP BY t1.name,t1.id,t2.`year`,newProduct
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'name', 'valOrAgg' => 'value', 'name' => '产品'),
- array('field' => 'story', 'valOrAgg' => 'value', 'name' => '需求数'),
- array('field' => 'bug', 'valOrAgg' => 'value', 'name' => 'Bug数'),
- array('field' => 'plan', 'valOrAgg' => 'value', 'name' => '计划数'),
- array('field' => 'release', 'valOrAgg' => 'value', 'name' => '发布数')
- ),
- 'filter' => array()
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1076,
- 'name' => '年度新增-产品年度完成数据汇总表',
- 'code' => 'annualCreated_productOverview_finished',
- 'dimension' => '1',
- 'type' => 'table',
- 'group' => '63',
- 'sql' => <<<EOT
- SELECT
- t1.name,t1.id,t2.`year`,IF(YEAR(t1.createdDate) = t2.`year`, 1, 0) as newProduct,
- SUM(IFNULL(t3.story, 0)) AS story,
- SUM(IFNULL(t4.bug, 0)) AS bug,
- SUM(IFNULL(t5.`plan`, 0)) AS `plan`,
- SUM(IFNULL(t6.`release`, 0)) AS `release`
- FROM zt_product AS t1
- LEFT JOIN (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) as t2 ON 1 = 1
- LEFT 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`
- LEFT 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`
- LEFT JOIN (
- SELECT COUNT(DISTINCT t51.id) as `plan`, t51.product, YEAR(t52.`date`) AS `year`
- FROM zt_productplan AS t51
- 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'
- WHERE t51.deleted = '0' AND t51.closedReason = 'done' AND t51.status = 'closed'
- AND t52.action = 'closed'
- GROUP BY t51.product,`year`
- ) AS t5 on t1.id = t5.product AND t5.`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 t6 ON t1.id = t6.product AND t6.`year` = t2.`year`
- WHERE t1.deleted = '0' AND t1.status != 'closed' AND t1.shadow = '0'
- GROUP BY t1.name,t1.id,t2.`year`,newProduct
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'name', 'valOrAgg' => 'value', 'name' => '产品'),
- array('field' => 'story', 'valOrAgg' => 'value', 'name' => '需求数'),
- array('field' => 'bug', 'valOrAgg' => 'value', 'name' => 'Bug数'),
- array('field' => 'plan', 'valOrAgg' => 'value', 'name' => '计划数'),
- array('field' => 'release', 'valOrAgg' => 'value', 'name' => '发布数')
- ),
- 'filter' => array()
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1077,
- 'name' => '年度新增-需求年度新增和完成趋势图',
- 'code' => 'annualCreated_storyTendency',
- 'dimension' => '1',
- 'type' => 'line',
- 'group' => '36',
- 'sql' => <<<EOT
- SELECT t1.YEARMONTH, t1.year, t1.month AS `month`, IFNULL(t2.story, 0) AS newStory, IFNULL(t3.story, 0) AS closedStory
- FROM (SELECT DISTINCT DATE_FORMAT(date, '%Y-%m') YEARMONTH, Year(date) AS `year`, MONTH(date) AS `month` FROM zt_action) AS t1
- LEFT 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
- LEFT 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
- ORDER BY `year`, t1.month LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'line',
- 'xaxis' => array
- (
- array('field' => 'YEARMONTH', 'name' => 'YEARMONTH', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'newStory', 'name' => '继续添加研发需求', 'valOrAgg' => 'sum'),
- array('field' => 'closedStory', 'name' => '需求:%s 已关闭,将不会被关闭。', 'valOrAgg' => 'sum')
- ),
- 'rotateX' => 'notuse'
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年度')
- ),
- 'fields' => array
- (
- 'YEARMONTH' => array('name' => 'YEARMONTH', 'object' => 'story', 'field' => 'YEARMONTH', 'type' => 'string'),
- 'year' => array('name' => 'year', 'object' => 'story', 'field' => 'year', 'type' => 'number'),
- 'month' => array('name' => 'month', 'object' => 'story', 'field' => 'month', 'type' => 'number'),
- 'newStory' => array('name' => '继续添加研发需求', 'object' => 'story', 'field' => 'newStory', 'type' => 'string'),
- 'closedStory' => array('name' => '需求:%s 已关闭,将不会被关闭。', 'object' => 'story', 'field' => 'closedStory', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'YEARMONTH' => array('zh-cn' => 'YEARMONTH', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'year' => array('zh-cn' => '年度', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'month' => array('zh-cn' => '月份', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'newStory' => array('zh-cn' => '新增需求数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'closedStory' => array('zh-cn' => '完成需求数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1078,
- 'name' => '年度新增-Bug年度新增和解决趋势图',
- 'code' => 'annualCreated_bugTendency',
- 'dimension' => '1',
- 'type' => 'line',
- 'group' => '44',
- 'sql' => <<<EOT
- SELECT YEARMONTH, t1.year, t1.month AS `month`, IFNULL(t2.bug, 0) AS newBug, IFNULL(t3.bug, 0) AS fixedBug
- FROM (SELECT DISTINCT DATE_FORMAT(date, '%Y-%m') YEARMONTH, Year(date) AS `year`, MONTH(date) AS `month` FROM zt_action) AS t1
- LEFT 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
- LEFT 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
- ORDER BY `year`, t1.month LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'line',
- 'xaxis' => array
- (
- array('field' => 'YEARMONTH', 'name' => 'YEARMONTH', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'newBug', 'name' => 'newBug', 'valOrAgg' => 'sum'),
- array('field' => 'fixedBug', 'name' => 'fixedBug', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年度')
- ),
- 'fields' => array
- (
- 'YEARMONTH' => array('name' => 'YEARMONTH', 'object' => 'bug', 'field' => 'YEARMONTH', 'type' => 'string'),
- 'year' => array('name' => 'year', 'object' => 'bug', 'field' => 'year', 'type' => 'number'),
- 'month' => array('name' => 'month', 'object' => 'bug', 'field' => 'month', 'type' => 'number'),
- 'newBug' => array('name' => 'newBug', 'object' => 'bug', 'field' => 'newBug', 'type' => 'string'),
- 'fixedBug' => array('name' => 'fixedBug', 'object' => 'bug', 'field' => 'fixedBug', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'YEARMONTH' => array('zh-cn' => '', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'year' => array('zh-cn' => '年度', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'month' => array('zh-cn' => '月份', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'newBug' => array('zh-cn' => '新增Bug数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'fixedBug' => array('zh-cn' => '解决Bug数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1079,
- 'name' => '年度新增-任务年度新增和完成趋势图',
- 'code' => 'annualCreated_taskTendency',
- 'dimension' => '1',
- 'type' => 'line',
- 'group' => '39',
- 'sql' => <<<EOT
- SELECT YEARMONTH, t1.year, CONCAT(t1.month, '月') AS `month`, IFNULL(t2.task, 0) AS newTask, IFNULL(t3.task, 0) AS closedTask
- FROM (SELECT DISTINCT DATE_FORMAT(date, '%Y-%m') YEARMONTH, Year(date) AS `year`, MONTH(date) AS `month` FROM zt_action) AS t1
- LEFT JOIN (SELECT YEAR(openedDate) AS `year`, MONTH(openedDate) AS `month`, COUNT(1) AS task FROM zt_task WHERE deleted = '0' AND isTpl = '0' GROUP BY `year`, `month`) AS t2 ON t1.year = t2.year AND t1.month = t2.month
- LEFT JOIN (SELECT YEAR(closedDate) AS `year`, MONTH(closedDate) AS `month`, COUNT(1) AS task FROM zt_task WHERE deleted = '0' AND status = 'closed' AND isTpl = '0' GROUP BY `year`, `month`) AS t3 ON t1.year = t3.year AND t1.month = t3.month
- ORDER BY `year`, t1.month LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'line',
- 'xaxis' => array
- (
- array('field' => 'YEARMONTH', 'name' => 'YEARMONTH', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'newTask', 'name' => 'newTask', 'valOrAgg' => 'sum'),
- array('field' => 'closedTask', 'name' => 'closedTask', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年度')
- ),
- 'fields' => array
- (
- 'YEARMONTH' => array('name' => 'YEARMONTH', 'object' => 'task', 'field' => 'YEARMONTH', 'type' => 'string'),
- 'year' => array('name' => 'year', 'object' => 'task', 'field' => 'year', 'type' => 'number'),
- 'month' => array('name' => 'month', 'object' => 'task', 'field' => 'month', 'type' => 'string'),
- 'newTask' => array('name' => 'newTask', 'object' => 'task', 'field' => 'newTask', 'type' => 'string'),
- 'closedTask' => array('name' => 'closedTask', 'object' => 'task', 'field' => 'closedTask', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'YEARMONTH' => array('zh-cn' => 'YEARMONTH', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'year' => array('zh-cn' => '年度', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'month' => array('zh-cn' => '月份', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'newTask' => array('zh-cn' => '新增任务数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'closedTask' => array('zh-cn' => '完成任务数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1080,
- 'name' => '年度新增-项目年度新增和完成趋势图',
- 'code' => 'annualCreated_projectTendency',
- 'dimension' => '1',
- 'type' => 'line',
- 'group' => '38',
- 'sql' => <<<EOT
- SELECT YEARMONTH, t1.year, CONCAT(t1.month, '月') AS `month`, IFNULL(t2.project, 0) AS newProject, IFNULL(t3.project, 0) AS closedProject
- FROM (SELECT DISTINCT DATE_FORMAT(date, '%Y-%m') YEARMONTH, Year(date) AS `year`, MONTH(date) AS `month` FROM zt_action) AS t1
- LEFT 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
- LEFT 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
- ORDER BY `year`, t1.month LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'line',
- 'xaxis' => array
- (
- array('field' => 'YEARMONTH', 'name' => 'YEARMONTH', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'newProject', 'name' => 'newProject', 'valOrAgg' => 'sum'),
- array('field' => 'closedProject', 'name' => '已关闭的项目', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年度')
- ),
- 'fields' => array
- (
- 'YEARMONTH' => array('name' => 'YEARMONTH', 'object' => 'project', 'field' => 'YEARMONTH', 'type' => 'string'),
- 'year' => array('name' => 'year', 'object' => 'project', 'field' => 'year', 'type' => 'number'),
- 'month' => array('name' => 'month', 'object' => 'project', 'field' => 'month', 'type' => 'string'),
- 'newProject' => array('name' => 'newProject', 'object' => 'project', 'field' => 'newProject', 'type' => 'string'),
- 'closedProject' => array('name' => '已关闭的项目', 'object' => 'project', 'field' => 'closedProject', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'YEARMONTH' => array('zh-cn' => 'YEARMONTH', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'year' => array('zh-cn' => '年度', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'month' => array('zh-cn' => '月份', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'newProject' => array('zh-cn' => '新增项目数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'closedProject' => array('zh-cn' => '完成项目数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1081,
- 'name' => '年度新增-执行年度新增和完成趋势图',
- 'code' => 'annualCreated_executionTendency',
- 'dimension' => '1',
- 'type' => 'line',
- 'group' => '40',
- 'sql' => <<<EOT
- SELECT YEARMONTH, t1.year, CONCAT(t1.month, '月') AS `month`, IFNULL(t2.execution, 0) AS newExecution, IFNULL(t3.execution, 0) AS closedExecution
- FROM (SELECT DISTINCT DATE_FORMAT(date, '%Y-%m') YEARMONTH,YEAR(date) AS `year`, MONTH(date) AS `month` FROM zt_action) AS t1
- LEFT 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
- LEFT 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
- ORDER BY `year`, t1.month LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'line',
- 'xaxis' => array
- (
- array('field' => 'YEARMONTH', 'name' => 'YEARMONTH', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'newExecution', 'name' => 'newExecution', 'valOrAgg' => 'sum'),
- array('field' => 'closedExecution', 'name' => 'closedExecution', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年度')
- ),
- 'fields' => array
- (
- 'YEARMONTH' => array('name' => 'YEARMONTH', 'object' => 'project', 'field' => 'YEARMONTH', 'type' => 'string'),
- 'year' => array('name' => 'year', 'object' => 'project', 'field' => 'year', 'type' => 'number'),
- 'month' => array('name' => 'month', 'object' => 'project', 'field' => 'month', 'type' => 'string'),
- 'newExecution' => array('name' => 'newExecution', 'object' => 'project', 'field' => 'newExecution', 'type' => 'string'),
- 'closedExecution' => array('name' => 'closedExecution', 'object' => 'project', 'field' => 'closedExecution', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'YEARMONTH' => array('zh-cn' => 'YEARMONTH', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'year' => array('zh-cn' => '年度', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'month' => array('zh-cn' => '月份', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'newExecution' => array('zh-cn' => '新增执行数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'closedExecution' => array('zh-cn' => '完成执行数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1082,
- 'name' => '年度新增-产品发布次数年度趋势图',
- 'code' => 'annualCreated_releaseTendency',
- 'dimension' => '1',
- 'type' => 'line',
- 'group' => '37',
- 'sql' => <<<EOT
- SELECT YEARMONTH, t1.year, CONCAT(t1.month, '月') AS `month`, IFNULL(t2.release, 0) AS `release`
- FROM (SELECT DISTINCT DATE_FORMAT(date, '%Y-%m') YEARMONTH,Year(date) AS `year`, MONTH(date) AS `month` FROM zt_action) AS t1
- LEFT 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
- ORDER BY `year`, t1.month LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'line',
- 'xaxis' => array
- (
- array('field' => 'YEARMONTH', 'name' => 'YEARMONTH', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'release', 'name' => 'release', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年度')
- ),
- 'fields' => array
- (
- 'YEARMONTH' => array('name' => 'YEARMONTH', 'object' => 'release', 'field' => 'YEARMONTH', 'type' => 'string'),
- 'year' => array('name' => 'year', 'object' => 'release', 'field' => 'year', 'type' => 'number'),
- 'month' => array('name' => 'month', 'object' => 'release', 'field' => 'month', 'type' => 'string'),
- 'release' => array('name' => 'release', 'object' => 'release', 'field' => 'release', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'YEARMONTH' => array('zh-cn' => 'YEARMONTH', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'year' => array('zh-cn' => '年度', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'month' => array('zh-cn' => '月份', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'release' => array('zh-cn' => '发布次数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1083,
- 'name' => '年度新增-年度投入产出比',
- 'code' => 'annualCreated_IORatio',
- 'dimension' => '1',
- 'type' => 'line',
- 'group' => '45',
- 'sql' => <<<EOT
- SELECT
- t1.`year`,
- CONCAT(t1.`month`, '月') AS `month`,
- IFNULL(t2.story, 0) AS story,
- IFNULL(t3.consumed, 0) AS consumed,
- ROUND(
- CASE
- WHEN IFNULL(t3.consumed, 0) = 0 THEN 0
- ELSE IFNULL(t2.story, 0) / IFNULL(t3.consumed, 0)
- END,
- 2
- ) AS ratio
- FROM (
- SELECT YEAR(`date`) AS `year`, MONTH(`date`) AS `month`
- FROM zt_action
- GROUP BY `year`, `month`
- ) AS t1
- LEFT 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'
- AND isParent = '0'
- GROUP BY `year`, `month`
- ) AS t2 ON t1.`year` = t2.`year` AND t1.`month` = t2.`month`
- LEFT 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`;
- EOT
- ,
- 'settings' => array
- (
- 'xaxis' => array
- (
- array('field' => 'month', 'name' => '月份', 'group' => 'value')
- ),
- 'yaxis' => array
- (
- array('type' => 'value', 'field' => 'ratio', 'agg' => 'value', 'name' => '投入产出比', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'story', 'agg' => 'value', 'name' => '需求交付', 'valOrAgg' => 'value'),
- array('type' => 'value', 'field' => 'consumed', 'agg' => 'value', 'name' => '工时消耗', 'valOrAgg' => 'value')
- )
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1085,
- 'name' => '年度排行-项目集-预算投入榜',
- 'code' => 'annualRank_programBudget',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '41',
- 'sql' => <<<EOT
- SELECT
- YEAR(t2.openedDate) AS `year`,
- t1.id,
- t1.name AS program,
- ROUND(
- SUM(
- IFNULL(t2.budget, '0')
- ) / 10000,
- 2
- ) AS budget
- FROM
- zt_project AS t1
- LEFT JOIN zt_project AS t2 ON FIND_IN_SET(t1.id, t2.path)
- AND t2.deleted = '0'
- AND t2.type = 'project'
- WHERE
- t1.deleted = '0'
- AND t1.type = 'program'
- AND t1.grade = 1
- GROUP BY
- `year`,
- t1.id,
- program
- ORDER BY
- `year`,
- budget DESC
- LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'program', 'name' => 'program', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'budget', 'name' => '预算', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'project', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => 'id', 'object' => 'zt_project', 'field' => 'id', 'type' => 'number'),
- 'program' => array('name' => 'program', 'object' => 'zt_project', 'field' => 'program', 'type' => 'string'),
- 'budget' => array('name' => '预算', 'object' => 'project', 'field' => 'budget', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '项目集编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'program' => array('zh-cn' => '项目集名称', 'zh-tw' => '', 'en' => 'program', 'de' => '', 'fr' => ''),
- 'budget' => array('zh-cn' => '项目集预算', 'zh-tw' => '', 'en' => 'budget', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1086,
- 'name' => '年度排行-项目集-人员投入榜',
- 'code' => 'annualRank_programPersonnel',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '41',
- 'sql' => <<<EOT
- SELECT tt.join as `year`, count(1) as number, tt.setName from (
- select
- YEAR(t1.join) as `join`, t4.name as setName
- from zt_team t1
- RIGHT JOIN zt_project t2 on t2.id = t1.root
- LEFT JOIN zt_project t4 on FIND_IN_SET(t4.id,t2.path) and t4.grade = 1
- RIGHT JOIN zt_user t3 on t3.account = t1.account
- WHERE t1.type = 'project'
- AND t2.deleted = '0'
- AND t3.deleted = '0'
- ) tt
- GROUP BY tt.setName, tt.join
- ORDER BY tt.join, number desc, tt.setName LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'setName', 'name' => 'setName', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'number', 'name' => 'number', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'user', 'field' => 'year', 'type' => 'number'),
- 'number' => array('name' => 'number', 'object' => 'user', 'field' => 'number', 'type' => 'string'),
- 'setName' => array('name' => 'setName', 'object' => 'user', 'field' => 'setName', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'number' => array('zh-cn' => '人员数量', 'zh-tw' => '', 'en' => 'number', 'de' => '', 'fr' => ''),
- 'setName' => array('zh-cn' => '项目集名称', 'zh-tw' => '', 'en' => 'setName', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1087,
- 'name' => '年度排行-项目集-工时消耗榜',
- 'code' => 'annualRank_programConsumed',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '41',
- 'sql' => <<<EOT
- SELECT
- YEAR(t5.date) AS `year`,
- t1.id,
- t1.name AS program,
- ROUND(SUM(t5.consumed), 2) AS consumed
- FROM zt_project AS t1
- LEFT JOIN zt_project AS t2 ON FIND_IN_SET(t1.id, t2.path) AND t2.deleted = '0' AND t2.type = 'project'
- LEFT JOIN zt_project AS t3 ON t2.id = t3.project AND t3.deleted = '0' AND t3.type IN ('sprint', 'stage', 'kanban')
- LEFT JOIN zt_task AS t4 ON t3.id = t4.execution AND t4.deleted = '0' AND t4.status != 'cancel'
- LEFT JOIN zt_effort AS t5 ON t4.id = t5.objectID AND t5.deleted = '0' AND t5.objectType = 'task'
- WHERE
- t1.deleted = '0'
- AND t1.type = 'program'
- AND t1.grade = 1
- AND t5.id IS NOT NULL
- GROUP BY
- `year`,
- t1.id,
- program
- ORDER BY
- `year`,
- consumed DESC
- LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'program', 'name' => 'program', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'consumed', 'name' => '总计消耗', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'effort', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => 'id', 'object' => 'zt_project', 'field' => 'id', 'type' => 'number'),
- 'program' => array('name' => 'program', 'object' => 'zt_project', 'field' => 'program', 'type' => 'string'),
- 'consumed' => array('name' => '总计消耗', 'object' => 'task', 'field' => 'consumed', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '项目集编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'program' => array('zh-cn' => '项目集名称', 'zh-tw' => '', 'en' => 'program', 'de' => '', 'fr' => ''),
- 'consumed' => array('zh-cn' => '项目集总计消耗', 'zh-tw' => '', 'en' => 'program', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1088,
- 'name' => '年度排行-项目集-新增需求条目榜',
- 'code' => 'annualRank_programStoryCount_created',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '36',
- 'sql' => <<<EOT
- SELECT
- YEAR(t3.openedDate) AS `year`,
- t1.id,
- t1.name AS program,
- COUNT(1) AS story
- FROM
- zt_project AS t1
- LEFT JOIN zt_product AS t2 ON t1.id = t2.program
- AND t2.deleted = '0'
- LEFT JOIN zt_story AS t3 ON t2.id = t3.product
- AND t3.deleted = '0'
- WHERE
- t1.deleted = '0'
- AND t1.type = 'program'
- AND t1.grade = 1
- AND t3.type = 'story'
- AND t3.id IS NOT NULL
- GROUP BY
- `year`,
- t1.id,
- program
- ORDER BY
- `year`,
- story DESC
- LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'program', 'name' => 'program', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'story', 'name' => '研发需求', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'story', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => 'id', 'object' => 'zt_project', 'field' => 'id', 'type' => 'number'),
- 'program' => array('name' => 'program', 'object' => 'zt_project', 'field' => 'program', 'type' => 'string'),
- 'story' => array('name' => '研发需求', 'object' => 'story', 'field' => 'story', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '项目集编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'program' => array('zh-cn' => '项目集名称', 'zh-tw' => '', 'en' => 'program', 'de' => '', 'fr' => ''),
- 'story' => array('zh-cn' => '新增研发需求计数', 'zh-tw' => '', 'en' => 'story', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1089,
- 'name' => '年度排行-项目集-新增需求规模榜',
- 'code' => 'annualRank_programStoryEstimate_created',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '36',
- 'sql' => <<<EOT
- SELECT
- YEAR(t3.openedDate) AS `year`,
- t1.id,
- t1.name AS program,
- ROUND(
- SUM(t3.estimate),
- 2
- ) AS story
- FROM
- zt_project AS t1
- LEFT JOIN zt_product AS t2 ON t1.id = t2.program
- AND t2.deleted = '0'
- LEFT JOIN zt_story AS t3 ON t2.id = t3.product
- AND t3.deleted = '0'
- WHERE
- t1.deleted = '0'
- AND t1.type = 'program'
- AND t1.grade = 1
- AND t3.type = 'story'
- AND t3.id IS NOT NULL
- GROUP BY
- `year`,
- t1.id,
- program
- ORDER BY
- `year`,
- story DESC
- LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'program', 'name' => 'program', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'story', 'name' => '研发需求', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'story', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => 'id', 'object' => 'zt_project', 'field' => 'id', 'type' => 'number'),
- 'program' => array('name' => 'program', 'object' => 'zt_project', 'field' => 'program', 'type' => 'string'),
- 'story' => array('name' => '研发需求', 'object' => 'story', 'field' => 'story', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '项目集编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'program' => array('zh-cn' => '项目集名称', 'zh-tw' => '', 'en' => 'program', 'de' => '', 'fr' => ''),
- 'story' => array('zh-cn' => '新增研发需求规模', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1090,
- 'name' => '年度排行-项目集-新增Bug条目榜',
- 'code' => 'annualRank_programBug_created',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '44',
- 'sql' => <<<EOT
- SELECT
- YEAR(t3.openedDate) AS `year`,
- t1.id,
- t1.name AS program,
- COUNT(1) AS bug
- FROM
- zt_project AS t1
- LEFT JOIN zt_product AS t2 ON t1.id = t2.program
- AND t2.deleted = '0'
- LEFT JOIN zt_bug AS t3 ON t2.id = t3.product
- AND t3.deleted = '0'
- WHERE
- t1.deleted = '0'
- AND t1.type = 'program'
- AND t1.grade = 1
- AND t3.id IS NOT NULL
- GROUP BY
- `year`,
- t1.id,
- program
- ORDER BY
- `year`,
- bug DESC
- LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'program', 'name' => 'program', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'bug', 'name' => 'Bug列表', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'bug', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => 'id', 'object' => 'zt_project', 'field' => 'id', 'type' => 'number'),
- 'program' => array('name' => 'program', 'object' => 'zt_project', 'field' => 'program', 'type' => 'string'),
- 'bug' => array('name' => 'Bug列表', 'object' => 'project', 'field' => 'bug', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '项目集编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'program' => array('zh-cn' => '项目集名称', 'zh-tw' => '', 'en' => 'program', 'de' => '', 'fr' => ''),
- 'bug' => array('zh-cn' => '新增Bug计数', 'zh-tw' => '', 'en' => 'bug', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1091,
- 'name' => '年度排行-项目集-完成需求条目榜',
- 'code' => 'annualRank_programStoryCount_finished',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '43',
- 'sql' => <<<EOT
- SELECT
- YEAR(t3.closedDate) AS `year`,
- t1.id,
- t1.name AS program,
- COUNT(1) AS story
- FROM
- zt_project AS t1
- LEFT JOIN zt_product AS t2 ON t1.id = t2.program
- AND t2.deleted = '0'
- LEFT JOIN zt_story AS t3 ON t2.id = t3.product
- AND t3.deleted = '0'
- AND t3.closedReason = 'done'
- WHERE
- t1.deleted = '0'
- AND t1.type = 'program'
- AND t1.grade = 1
- AND t3.type = 'story'
- AND t3.id IS NOT NULL
- GROUP BY
- `year`,
- t1.id,
- program
- ORDER BY
- `year`,
- story DESC
- LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'program', 'name' => 'program', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'story', 'name' => '研发需求', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'story', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => 'id', 'object' => 'zt_project', 'field' => 'id', 'type' => 'number'),
- 'program' => array('name' => 'program', 'object' => 'zt_project', 'field' => 'program', 'type' => 'string'),
- 'story' => array('name' => '研发需求', 'object' => 'story', 'field' => 'story', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '项目集编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'program' => array('zh-cn' => '项目集名称', 'zh-tw' => '', 'en' => 'program', 'de' => '', 'fr' => ''),
- 'story' => array('zh-cn' => '完成研发需求求和', 'zh-tw' => '', 'en' => 'story', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1092,
- 'name' => '年度排行-项目集-完成需求规模榜',
- 'code' => 'annualRank_programStoryEstimate_finished',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '36',
- 'sql' => <<<EOT
- SELECT
- YEAR(t3.closedDate) AS `year`,
- t1.id,
- t1.name AS program,
- ROUND(
- SUM(t3.estimate),
- 2
- ) AS story
- FROM
- zt_project AS t1
- LEFT JOIN zt_product AS t2 ON t1.id = t2.program
- AND t2.deleted = '0'
- LEFT JOIN zt_story AS t3 ON t2.id = t3.product
- AND t3.deleted = '0'
- AND t3.closedReason = 'done'
- WHERE
- t1.deleted = '0'
- AND t1.type = 'program'
- AND t1.grade = 1
- AND t3.type = 'story'
- AND t3.id IS NOT NULL
- GROUP BY
- `year`,
- t1.id,
- program
- ORDER BY
- `year`,
- story DESC
- LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'program', 'name' => 'program', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'story', 'name' => '研发需求', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'story', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => 'id', 'object' => 'zt_project', 'field' => 'id', 'type' => 'number'),
- 'program' => array('name' => 'program', 'object' => 'zt_project', 'field' => 'program', 'type' => 'string'),
- 'story' => array('name' => '研发需求', 'object' => 'story', 'field' => 'story', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'program' => array('zh-cn' => '项目集名称', 'zh-tw' => '', 'en' => 'program', 'de' => '', 'fr' => ''),
- 'story' => array('zh-cn' => '研发需求预计工时求和', 'zh-tw' => '', 'en' => 'story', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1093,
- 'name' => '年度排行-项目集-修复Bug条目榜',
- 'code' => 'annualRank_programBug_fixed',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '44',
- 'sql' => <<<EOT
- SELECT
- YEAR(t3.closedDate) AS `year`,
- t1.id,
- t1.name AS program,
- COUNT(1) AS bug
- FROM
- zt_project AS t1
- LEFT JOIN zt_product AS t2 ON t1.id = t2.program
- AND t2.deleted = '0'
- LEFT JOIN zt_bug AS t3 ON t2.id = t3.product
- AND t3.deleted = '0'
- AND t3.resolution = 'fixed'
- AND t3.status = 'closed'
- WHERE
- t1.deleted = '0'
- AND t1.type = 'program'
- AND t1.grade = 1
- AND t3.id IS NOT NULL
- GROUP BY
- `year`,
- t1.id,
- program
- ORDER BY
- `year`,
- bug DESC
- LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'program', 'name' => 'program', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'bug', 'name' => 'Bug列表', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'bug', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => 'id', 'object' => 'zt_project', 'field' => 'id', 'type' => 'number'),
- 'program' => array('name' => 'program', 'object' => 'zt_project', 'field' => 'program', 'type' => 'string'),
- 'bug' => array('name' => 'Bug列表', 'object' => 'project', 'field' => 'bug', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'program' => array('zh-cn' => '项目集名称', 'zh-tw' => '', 'en' => 'program', 'de' => '', 'fr' => ''),
- 'bug' => array('zh-cn' => 'Bug计数', 'zh-tw' => '', 'en' => 'bug', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1094,
- 'name' => '年度排行-项目-工期榜',
- 'code' => 'annualRank_projectDuration',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '42',
- 'sql' => <<<EOT
- SELECT `year`, id,name,status,realBegan,realEnd,IF(status = 'closed', DATEDIFF(realEnd, realBegan), DATEDIFF(NOW(),realBegan)) as duration
- FROM (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) AS t1
- LEFT 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`)) ORDER BY `year`, duration desc LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'name', 'name' => '项目名称', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'duration', 'name' => 'duration', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'project', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => '编号', 'object' => 'project', 'field' => 'id', 'type' => 'number'),
- 'name' => array('name' => '项目名称', 'object' => 'project', 'field' => 'name', 'type' => 'string'),
- 'status' => array('name' => '状态', 'object' => 'project', 'field' => 'status', 'type' => 'option'),
- 'realBegan' => array('name' => '实际开始日期', 'object' => 'project', 'field' => 'realBegan', 'type' => 'date'),
- 'realEnd' => array('name' => '实际完成日期', 'object' => 'project', 'field' => 'realEnd', 'type' => 'date'),
- 'duration' => array('name' => 'duration', 'object' => 'project', 'field' => 'duration', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '项目编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'name' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => 'name', 'de' => '', 'fr' => ''),
- 'status' => array('zh-cn' => '状态', 'zh-tw' => '', 'en' => 'status', 'de' => '', 'fr' => ''),
- 'realBegan' => array('zh-cn' => '实际开始日期', 'zh-tw' => '', 'en' => 'realBegan', 'de' => '', 'fr' => ''),
- 'realEnd' => array('zh-cn' => '实际完成日期', 'zh-tw' => '', 'en' => 'realEnd', 'de' => '', 'fr' => ''),
- 'duration' => array('zh-cn' => '工期', 'zh-tw' => '', 'en' => 'duration', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1096,
- 'name' => '年度排行-项目-工期偏差榜',
- 'code' => 'annualRank_projectDurationDeviation',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '42',
- 'sql' => <<<EOT
- SELECT `year`, id,name,status,`begin`,`end`,realBegan,realEnd,
- ROUND((IF(LEFT(realEnd,4) != '0000', DATEDIFF(realEnd, realBegan), DATEDIFF(NOW(),realBegan)) - DATEDIFF(`end`, `begin`)) / DATEDIFF(`end`,`begin`) * 100) as duration
- FROM (SELECT DISTINCT YEAR(`date`) as `year` FROM zt_action) AS t1
- LEFT JOIN zt_project AS t2 ON 1 = 1
- WHERE deleted = '0' AND type = 'project'
- AND YEAR(realBegan) <= `year` AND LEFT(realBegan, 4) != '0000'
- AND (YEAR(realEnd) >= `year` OR LEFT(realEnd, 4) = '0000') AND YEAR(`end`) != '2059'
- ORDER BY duration ASC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'name', 'name' => '项目名称', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'duration', 'name' => 'duration', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'project', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => '编号', 'object' => 'action', 'field' => 'id', 'type' => 'number'),
- 'name' => array('name' => '项目名称', 'object' => 'project', 'field' => 'name', 'type' => 'string'),
- 'status' => array('name' => '状态', 'object' => 'project', 'field' => 'status', 'type' => 'option'),
- 'begin' => array('name' => '计划开始', 'object' => 'project', 'field' => 'begin', 'type' => 'date'),
- 'end' => array('name' => '计划完成', 'object' => 'project', 'field' => 'end', 'type' => 'date'),
- 'realBegan' => array('name' => '实际开始日期', 'object' => 'project', 'field' => 'realBegan', 'type' => 'date'),
- 'realEnd' => array('name' => '实际完成日期', 'object' => 'project', 'field' => 'realEnd', 'type' => 'date'),
- 'duration' => array('name' => 'duration', 'object' => 'project', 'field' => 'duration', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '项目编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'name' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => 'name', 'de' => '', 'fr' => ''),
- 'status' => array('zh-cn' => '状态', 'zh-tw' => '', 'en' => 'status', 'de' => '', 'fr' => ''),
- 'begin' => array('zh-cn' => '计划开始', 'zh-tw' => '', 'en' => 'begin', 'de' => '', 'fr' => ''),
- 'end' => array('zh-cn' => '计划完成', 'zh-tw' => '', 'en' => 'end', 'de' => '', 'fr' => ''),
- 'realBegan' => array('zh-cn' => '实际开始日期', 'zh-tw' => '', 'en' => 'realBegan', 'de' => '', 'fr' => ''),
- 'realEnd' => array('zh-cn' => '实际完成日期', 'zh-tw' => '', 'en' => 'realEnd', 'de' => '', 'fr' => ''),
- 'duration' => array('zh-cn' => '工期偏差', 'zh-tw' => '', 'en' => 'duration', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1097,
- 'name' => '年度排行-项目-人员投入榜',
- 'code' => 'annualRank_projectPersonnel',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '41',
- 'sql' => <<<EOT
- SELECT tt.join as `year`, count(1) as number, tt.name from (
- select
- t2.name, YEAR(t1.join) as `join`
- from zt_team t1
- RIGHT JOIN zt_project t2 on t2.id = t1.root
- RIGHT JOIN zt_user t3 on t3.account = t1.account
- WHERE t1.type = 'project'
- AND t2.deleted = '0'
- ) tt
- GROUP BY tt.`name`, tt.join
- ORDER BY tt.join, number desc, tt.name LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'name', 'name' => '项目名称', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'number', 'name' => 'number', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'user', 'field' => 'year', 'type' => 'number'),
- 'number' => array('name' => 'number', 'object' => 'user', 'field' => 'number', 'type' => 'string'),
- 'name' => array('name' => '项目名称', 'object' => 'project', 'field' => 'name', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'number' => array('zh-cn' => '人员个数', 'zh-tw' => '', 'en' => 'number', 'de' => '', 'fr' => ''),
- 'name' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => 'name', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1098,
- 'name' => '年度排行-项目-工时消耗榜',
- 'code' => 'annualRank_projectConsumed',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '41',
- 'sql' => <<<EOT
- SELECT
- YEAR(t4.date) AS `year`,
- t1.id,
- t1.name AS project,
- ROUND(SUM(t4.consumed), 2) AS consumed
- FROM zt_project AS t1
- LEFT JOIN zt_project AS t2 ON t1.id = t2.project AND t2.deleted = '0' AND t2.type IN ('sprint', 'stage', 'kanban')
- LEFT JOIN zt_task AS t3 ON t2.id = t3.execution AND t3.deleted = '0' AND t3.status != 'cancel'
- LEFT JOIN zt_effort AS t4 ON t3.id = t4.objectID AND t4.deleted = '0' AND t4.objectType = 'task'
- WHERE
- t1.deleted = '0'
- AND t1.type = 'project'
- AND t4.id IS NOT NULL
- GROUP BY
- `year`,
- t1.id,
- t1.name
- ORDER BY
- `year`,
- consumed DESC
- LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'project', 'name' => 'project', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'consumed', 'name' => '总计消耗', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'effort', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => 'id', 'object' => 'zt_project', 'field' => 'id', 'type' => 'number'),
- 'project' => array('name' => 'project', 'object' => 'zt_project', 'field' => 'project', 'type' => 'string'),
- 'consumed' => array('name' => '总计消耗', 'object' => 'task', 'field' => 'consumed', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '项目编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'project' => array('zh-cn' => '项目', 'zh-tw' => '', 'en' => 'project', 'de' => '', 'fr' => ''),
- 'consumed' => array('zh-cn' => '任务总计消耗', 'zh-tw' => '', 'en' => 'consumed', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1099,
- 'name' => '年度排行-项目-完成需求条目榜',
- 'code' => 'annualRank_projectStoryCount_finished',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '36',
- 'sql' => <<<EOT
- SELECT
- YEAR(t1.closedDate) AS `year`,
- t1.id,
- t1.project,
- COUNT(1) AS story
- FROM
- (
- SELECT
- DISTINCT t1.id,
- t1.name AS project,
- t5.id AS story,
- t5.closedDate
- FROM
- zt_project AS t1
- LEFT JOIN zt_project AS t2 ON t1.id = t2.parent
- AND t2.deleted = '0'
- AND t2.type IN ('sprint', 'stage', 'kanban')
- LEFT JOIN zt_projectstory AS t3 ON t1.id = t3.project
- LEFT JOIN zt_projectstory AS t4 ON t2.id = t4.project
- LEFT JOIN zt_story AS t5 ON t3.story = t5.id
- AND t5.deleted = '0'
- AND t5.closedReason = 'done'
- WHERE
- t1.deleted = '0'
- AND t1.type = 'project'
- AND t5.type = 'story'
- AND t5.id IS NOT NULL
- ) AS t1
- GROUP BY
- `year`,
- t1.id,
- project
- ORDER BY
- `year`,
- story DESC
- LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'project', 'name' => '所属项目', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'story', 'name' => '研发需求列表', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'story', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => '项目ID', 'object' => 'project', 'field' => 'id', 'type' => 'number'),
- 'project' => array('name' => '所属项目', 'object' => 'project', 'field' => 'project', 'type' => 'string'),
- 'story' => array('name' => '研发需求列表', 'object' => 'projectstory', 'field' => 'story', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '项目编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'project' => array('zh-cn' => '所属项目', 'zh-tw' => '', 'en' => 'project', 'de' => '', 'fr' => ''),
- 'story' => array('zh-cn' => '研发需求计数', 'zh-tw' => '', 'en' => 'story', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1100,
- 'name' => '年度排行-项目-完成需求规模榜',
- 'code' => 'annualRank_projectStoryEstimate_finished',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '43',
- 'sql' => <<<EOT
- SELECT
- YEAR(t1.closedDate) AS `year`,
- t1.id,
- t1.project,
- ROUND(
- SUM(t1.estimate),
- 2
- ) AS story
- FROM
- (
- SELECT
- DISTINCT t1.id,
- t1.name AS project,
- t5.id AS story,
- t5.estimate,
- t5.closedDate
- FROM
- zt_project AS t1
- LEFT JOIN zt_project AS t2 ON t1.id = t2.parent
- AND t2.deleted = '0'
- AND t2.type IN ('sprint', 'stage', 'kanban')
- LEFT JOIN zt_projectstory AS t3 ON t1.id = t3.project
- LEFT JOIN zt_projectstory AS t4 ON t2.id = t4.project
- LEFT JOIN zt_story AS t5 ON t3.story = t5.id
- AND t5.deleted = '0'
- AND t5.closedReason = 'done'
- WHERE
- t1.deleted = '0'
- AND t1.type = 'project'
- AND t5.type = 'story'
- AND t5.id IS NOT NULL
- ) AS t1
- GROUP BY
- `year`,
- t1.id,
- project
- ORDER BY
- `year`,
- story DESC
- LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'project', 'name' => '所属项目', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'story', 'name' => '研发需求列表', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'story', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => '项目ID', 'object' => 'project', 'field' => 'id', 'type' => 'number'),
- 'project' => array('name' => '所属项目', 'object' => 'project', 'field' => 'project', 'type' => 'string'),
- 'story' => array('name' => '研发需求列表', 'object' => 'projectstory', 'field' => 'story', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '项目编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'project' => array('zh-cn' => '所属项目', 'zh-tw' => '', 'en' => 'project', 'de' => '', 'fr' => ''),
- 'story' => array('zh-cn' => '需求预计工时', 'zh-tw' => '', 'en' => 'story', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1101,
- 'name' => '年度排行-产品-新增需求条目榜',
- 'code' => 'annualRank_productStoryCount_created',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '36',
- 'sql' => <<<EOT
- SELECT YEAR(t2.openedDate) AS `year`, t1.id, t1.name AS product, COUNT(1) AS story
- FROM zt_product AS t1
- LEFT JOIN zt_story AS t2 ON t1.id = t2.product AND t2.deleted = '0'
- WHERE t1.deleted = '0' AND t1.shadow = '0' AND t1.vision = 'rnd' AND t2.type = 'story' AND t2.id IS NOT NULL
- GROUP BY `year`, t1.id, product
- ORDER BY `year`, story DESC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'product', 'name' => 'product', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'story', 'name' => '研发需求', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'story', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => 'id', 'object' => 'zt_product', 'field' => 'id', 'type' => 'number'),
- 'product' => array('name' => 'product', 'object' => 'zt_product', 'field' => 'product', 'type' => 'string'),
- 'story' => array('name' => '研发需求', 'object' => 'story', 'field' => 'story', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '产品编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'product' => array('zh-cn' => '产品', 'zh-tw' => '', 'en' => 'product', 'de' => '', 'fr' => ''),
- 'story' => array('zh-cn' => '研发需求计数', 'zh-tw' => '', 'en' => 'story', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1102,
- 'name' => '年度排行-产品-完成需求规模榜',
- 'code' => 'annualRank_productStoryEstimate_finished',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '36',
- 'sql' => <<<EOT
- SELECT YEAR(t2.closedDate) AS `year`, t1.id, t1.name AS product, ROUND(SUM(t2.estimate), 1) AS story
- FROM zt_product AS t1
- LEFT JOIN zt_story AS t2 ON t1.id = t2.product AND t2.deleted = '0' AND t2.`closedReason` = 'done'
- WHERE t1.deleted = '0' AND t1.shadow = '0' AND t1.vision = 'rnd' AND t2.type = 'story' AND t2.id IS NOT NULL
- GROUP BY `year`, t1.id, product
- ORDER BY `year`, story DESC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'product', 'name' => 'product', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'story', 'name' => '研发需求', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'story', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => 'id', 'object' => 'zt_product', 'field' => 'id', 'type' => 'number'),
- 'product' => array('name' => 'product', 'object' => 'zt_product', 'field' => 'product', 'type' => 'string'),
- 'story' => array('name' => '研发需求', 'object' => 'story', 'field' => 'story', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '产品编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'product' => array('zh-cn' => '产品', 'zh-tw' => '', 'en' => 'product', 'de' => '', 'fr' => ''),
- 'story' => array('zh-cn' => '研发需求预计工时求和', 'zh-tw' => '', 'en' => 'story', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1103,
- 'name' => '年度排行-产品-新增Bug条目榜',
- 'code' => 'annualRank_productBug_created',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '44',
- 'sql' => <<<EOT
- SELECT YEAR(t2.openedDate) AS `year`, t1.id, t1.name AS product, COUNT(1) AS bug
- FROM zt_product AS t1
- LEFT JOIN zt_bug AS t2 ON t1.id = t2.product AND t2.deleted = '0'
- WHERE t1.deleted = '0' AND t1.shadow = '0' AND t1.vision = 'rnd' AND t2.id IS NOT NULL
- GROUP BY `year`, t1.id, product
- ORDER BY `year`, bug DESC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'product', 'name' => 'product', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'bug', 'name' => 'bug', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'bug', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => 'id', 'object' => 'zt_product', 'field' => 'id', 'type' => 'number'),
- 'product' => array('name' => 'product', 'object' => 'zt_product', 'field' => 'product', 'type' => 'string'),
- 'bug' => array('name' => 'bug', 'object' => 'bug', 'field' => 'bug', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '产品编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'product' => array('zh-cn' => '产品', 'zh-tw' => '', 'en' => 'product', 'de' => '', 'fr' => ''),
- 'bug' => array('zh-cn' => 'Bug计数', 'zh-tw' => '', 'en' => 'bug', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1104,
- 'name' => '年度排行-产品-修复Bug条目榜',
- 'code' => 'annualRank_productBug_fixed',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '44',
- 'sql' => <<<EOT
- SELECT YEAR(t2.closedDate) AS `year`, t1.id, t1.name AS product, COUNT(1) AS bug
- FROM zt_product AS t1
- LEFT JOIN zt_bug AS t2 ON t1.id = t2.product AND t2.deleted = '0' AND t2.resolution = 'fixed' AND t2.status = 'closed'
- WHERE t1.deleted = '0' AND t1.shadow = '0' AND t1.vision = 'rnd' AND t2.id IS NOT NULL
- GROUP BY `year`, t1.id, product
- ORDER BY `year`, bug DESC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'product', 'name' => 'product', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'bug', 'name' => 'bug', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'bug', 'field' => 'year', 'type' => 'number'),
- 'id' => array('name' => 'id', 'object' => 'zt_product', 'field' => 'id', 'type' => 'number'),
- 'product' => array('name' => 'product', 'object' => 'zt_product', 'field' => 'product', 'type' => 'string'),
- 'bug' => array('name' => 'bug', 'object' => 'bug', 'field' => 'bug', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '产品编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'product' => array('zh-cn' => '产品', 'zh-tw' => '', 'en' => 'product', 'de' => '', 'fr' => ''),
- 'bug' => array('zh-cn' => 'Bug计数', 'zh-tw' => '', 'en' => 'bug', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1105,
- 'name' => '年度排行-个人-创建需求条目榜',
- 'code' => 'annualRank_personalStoryCount_created',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '56',
- 'sql' => <<<EOT
- SELECT
- YEAR(t3.openedDate) AS `year`,t2.realname,count(1) AS count
- FROM 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
- WHERE t1.objectType='story' AND t1.action='opened' AND t3.deleted='0'
- GROUP BY `year`,t2.account ORDER BY `year`,count DESC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'realname', 'name' => 'realname', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'count', 'name' => 'count', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'story', 'field' => 'year', 'type' => 'number'),
- 'realname' => array('name' => 'realname', 'object' => 'zt_user', 'field' => 'realname', 'type' => 'string'),
- 'count' => array('name' => 'count', 'object' => 'story', 'field' => 'count', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'realname' => array('zh-cn' => '姓名', 'zh-tw' => '', 'en' => 'realname', 'de' => '', 'fr' => ''),
- 'count' => array('zh-cn' => '计数', 'zh-tw' => '', 'en' => 'count', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1106,
- 'name' => '年度排行-个人-创建用例条目榜',
- 'code' => 'annualRank_personalCaseCount_created',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '56',
- 'sql' => <<<EOT
- SELECT
- YEAR(t3.openedDate) AS `year`,t2.realname,count(1) AS count
- FROM 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
- WHERE t1.objectType='case' AND t1.action='opened' AND t3.deleted='0'
- GROUP BY `year`,t2.account ORDER BY `year`,count DESC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'realname', 'name' => 'realname', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'count', 'name' => 'count', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'testcase', 'field' => 'year', 'type' => 'number'),
- 'realname' => array('name' => 'realname', 'object' => 'zt_user', 'field' => 'realname', 'type' => 'string'),
- 'count' => array('name' => 'count', 'object' => 'testcase', 'field' => 'count', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'realname' => array('zh-cn' => '姓名', 'zh-tw' => '', 'en' => 'realname', 'de' => '', 'fr' => ''),
- 'count' => array('zh-cn' => '计数', 'zh-tw' => '', 'en' => 'count', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1107,
- 'name' => '年度排行-个人-创建Bug条目榜',
- 'code' => 'annualRank_personalBug_created',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '56',
- 'sql' => <<<EOT
- SELECT
- YEAR(t3.openedDate) AS `year`,t2.realname,count(1) AS count
- FROM 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
- WHERE t1.objectType='bug' AND t1.action='opened' AND t3.deleted='0'
- GROUP BY `year`,t2.account ORDER BY `year`,count DESC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'realname', 'name' => 'realname', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'count', 'name' => 'count', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'bug', 'field' => 'year', 'type' => 'number'),
- 'realname' => array('name' => 'realname', 'object' => 'zt_user', 'field' => 'realname', 'type' => 'string'),
- 'count' => array('name' => 'count', 'object' => 'bug', 'field' => 'count', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'realname' => array('zh-cn' => '姓名', 'zh-tw' => '', 'en' => 'realname', 'de' => '', 'fr' => ''),
- 'count' => array('zh-cn' => '计数', 'zh-tw' => '', 'en' => 'count', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1108,
- 'name' => '年度排行-个人-修复Bug条目榜',
- 'code' => 'annualRank_personalBug_Fixed',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '56',
- 'sql' => <<<EOT
- SELECT
- YEAR(t3.openedDate) AS `year`,t2.realname,count(DISTINCT t3.id) AS count
- FROM 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
- WHERE t1.objectType='bug' AND t1.action='resolved' AND t3.deleted='0'
- GROUP BY `year`,t2.account ORDER BY `year`,count DESC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'realname', 'name' => 'realname', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'count', 'name' => 'count', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'bug', 'field' => 'year', 'type' => 'number'),
- 'realname' => array('name' => 'realname', 'object' => 'zt_user', 'field' => 'realname', 'type' => 'string'),
- 'count' => array('name' => 'count', 'object' => 'bug', 'field' => 'count', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'realname' => array('zh-cn' => '姓名', 'zh-tw' => '', 'en' => 'realname', 'de' => '', 'fr' => ''),
- 'count' => array('zh-cn' => '计数', 'zh-tw' => '', 'en' => 'count', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1109,
- 'name' => '年度排行-个人-工时消耗榜',
- 'code' => 'annualRank_personalConsumed',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '56',
- 'sql' => <<<EOT
- SELECT YEAR(t1.date) AS `year`, t2.realname, ROUND(SUM(t1.consumed),1) AS consumed
- FROM zt_effort AS t1 LEFT JOIN zt_user AS t2 ON t1.account = t2.account
- WHERE t1.deleted = '0' AND t2.deleted = '0'
- GROUP BY `year`, realname
- ORDER BY `year`, consumed DESC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'realname', 'name' => 'realname', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'consumed', 'name' => '耗时', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'user', 'field' => 'year', 'type' => 'number'),
- 'realname' => array('name' => 'realname', 'object' => 'zt_user', 'field' => 'realname', 'type' => 'string'),
- 'consumed' => array('name' => '耗时', 'object' => 'effort', 'field' => 'consumed', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'realname' => array('zh-cn' => '姓名', 'zh-tw' => '', 'en' => 'realname', 'de' => '', 'fr' => ''),
- 'consumed' => array('zh-cn' => '耗时', 'zh-tw' => '', 'en' => 'consumed', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 1110,
- 'name' => '年度排行-个人-禅道操作次数榜',
- 'code' => 'annualRank_personalAction',
- 'dimension' => '1',
- 'type' => 'cluBarY',
- 'group' => '56',
- 'sql' => <<<EOT
- SELECT YEAR(t1.date) AS `year`,IFNULL(t2.realname,t1.actor) AS realname,count(1) AS count FROM zt_action t1 LEFT JOIN zt_user AS t2 ON t1.actor=t2.account where t1.actor is not null and t1.actor not in('', 'system') GROUP BY `year`,t1.actor ORDER BY `year`, `count` DESC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'realname', 'name' => 'realname', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'count', 'name' => 'count', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'user', 'field' => 'year', 'type' => 'number'),
- 'realname' => array('name' => 'realname', 'object' => 'zt_action', 'field' => 'realname', 'type' => 'string'),
- 'count' => array('name' => 'count', 'object' => 'user', 'field' => 'count', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => ''),
- 'realname' => array('zh-cn' => '姓名', 'zh-tw' => '', 'en' => 'realname', 'de' => '', 'fr' => ''),
- 'count' => array('zh-cn' => '计数', 'zh-tw' => '', 'en' => 'count', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10000,
- 'name' => '年度完成项目-完成项目数',
- 'code' => 'annualFinishedProject_countProject',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '72',
- 'sql' => <<<EOT
- SELECT COUNT(1) AS number,YEAR(`closedDate`) AS `year` FROM zt_project WHERE type='project' AND status='closed' AND deleted='0' GROUP BY `year`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10001,
- 'name' => '年度完成项目-按时完成项目数',
- 'code' => 'annualFinishedProject_countProject_finished_ontime',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '72',
- 'sql' => <<<EOT
- 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<=t1.`end` GROUP BY `year`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10002,
- 'name' => '年度完成项目-延期完成项目数',
- 'code' => 'annualFinishedProject_countProject_finished_delay',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '72',
- 'sql' => <<<EOT
- 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>t1.`end` GROUP BY `year`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10003,
- 'name' => '年度完成项目-完成需求条目数',
- 'code' => 'annualFinishedProject_storyCount_finished',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '75',
- 'sql' => <<<EOT
- SELECT COUNT(1) AS number,YEAR(`closedDate`) AS `year` FROM zt_story WHERE deleted='0' AND status='closed' AND closedReason='done' GROUP BY `year`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10004,
- 'name' => '年度完成项目-完成需求规模数',
- 'code' => 'annualFinishedProject_storyEstimate_finished',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '75',
- 'sql' => <<<EOT
- 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`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10005,
- 'name' => '年度完成项目-完成发布数',
- 'code' => 'annualFinishedProject_release_finished',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '74',
- 'sql' => <<<EOT
- SELECT COUNT(1) AS number,YEAR(`date`) AS `year` FROM zt_release WHERE deleted='0' GROUP BY `year`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10006,
- 'name' => '年度完成项目-解决bug数',
- 'code' => 'annualFinishedProject_bug_fixed',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '77',
- 'sql' => <<<EOT
- 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`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10007,
- 'name' => '年度完成项目-完成执行数',
- 'code' => 'annualFinishedProject_execution_finished',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '73',
- 'sql' => <<<EOT
- SELECT COUNT(1) AS number,YEAR(`closedDate`) AS `year` FROM zt_project WHERE type='sprint' AND status='closed' AND deleted='0' GROUP BY `year`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10008,
- 'name' => '年度完成项目-按时完成执行数',
- 'code' => 'annualFinishedProject_execution_finished_ontime',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '73',
- 'sql' => <<<EOT
- 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<=t1.`end` GROUP BY `year`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10009,
- 'name' => '年度完成项目-延期完成执行数',
- 'code' => 'annualFinishedProject_execution_finished_delay',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '73',
- 'sql' => <<<EOT
- 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>t1.`end` GROUP BY `year`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10010,
- 'name' => '年度完成项目-完成任务条目数',
- 'code' => 'annualFinishedProject_taskCount_finished',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '76',
- 'sql' => <<<EOT
- SELECT COUNT(1) AS number,YEAR(`closedDate`) AS `year` FROM zt_task WHERE deleted='0' AND status='closed' AND closedReason='done' GROUP BY `year`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10011,
- 'name' => '年度完成项目-完成任务预计工时数',
- 'code' => 'annualFinishedProject_taskEstimate_finished',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '78',
- 'sql' => <<<EOT
- 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`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10012,
- 'name' => '年度完成项目-完成任务消耗工时数',
- 'code' => 'annualFinishedProject_taskConsumed_finished',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '78',
- 'sql' => <<<EOT
- 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`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10013,
- 'name' => '年度完成项目-投入的总人天',
- 'code' => 'annualFinishedProject_workingDayConsumed',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '78',
- 'sql' => <<<EOT
- SELECT SUM(t2.people*DATEDIFF(t1.realEnd,t1.realBegan)) AS number,YEAR(`closedDate`) AS `year` FROM (SELECT id, realBegan, IF(LEFT(realEnd, 4) = '0000', CAST(closedDate AS DATE), 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`
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10014,
- 'name' => '年度完成项目-项目按期完成率',
- 'code' => 'annualFinishedProject_projectFinishedRatio',
- 'dimension' => '2',
- 'type' => 'waterpolo',
- 'group' => '71',
- 'sql' => <<<EOT
- SELECT t1.id,IF(t1.realEnd<=t1.`end`,'done','undone') AS `projectstatus`, 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
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'waterpolo',
- 'calc' => 'count',
- 'goal' => 'id',
- 'conditions' => array
- (
- array('field' => 'projectstatus', 'condition' => 'eq', 'value' => 'done')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'id' => array('name' => '项目ID', 'object' => 'project', 'field' => 'id', 'type' => 'number'),
- 'projectstatus' => array('name' => 'projectstatus', 'object' => 'project', 'field' => 'projectstatus', 'type' => 'string'),
- 'year' => array('name' => 'year', 'object' => 'project', 'field' => 'year', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'projectstatus' => array('zh-cn' => '项目状态', 'zh-tw' => '', 'en' => 'projectstatus', 'de' => '', 'fr' => ''),
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10015,
- 'name' => '年度完成项目-执行按期完成率',
- 'code' => 'annualFinishedProject_executionFinishedRatio',
- 'dimension' => '2',
- 'type' => 'waterpolo',
- 'group' => '71',
- 'sql' => <<<EOT
- SELECT t1.id,IF(t1.realEnd<=t1.`end`,'done','undone') AS `projectstatus`, 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
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'waterpolo',
- 'calc' => 'count',
- 'goal' => 'id',
- 'conditions' => array
- (
- array('field' => 'projectstatus', 'condition' => 'eq', 'value' => 'done')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'id' => array('name' => '项目ID', 'object' => 'project', 'field' => 'id', 'type' => 'number'),
- 'projectstatus' => array('name' => 'projectstatus', 'object' => 'project', 'field' => 'projectstatus', 'type' => 'string'),
- 'year' => array('name' => 'year', 'object' => 'project', 'field' => 'year', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'projectstatus' => array('zh-cn' => '执行状态', 'zh-tw' => '', 'en' => 'projectstatus', 'de' => '', 'fr' => ''),
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10016,
- 'name' => '年度完成项目-项目延期率',
- 'code' => 'annualFinishedProject_projectDelayRatio',
- 'dimension' => '2',
- 'type' => 'waterpolo',
- 'group' => '71',
- 'sql' => <<<EOT
- SELECT t1.id,IF(t1.realEnd>t1.`end` ,'done','undone') AS `projectstatus`, 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
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'waterpolo',
- 'calc' => 'count',
- 'goal' => 'id',
- 'conditions' => array
- (
- array('field' => 'projectstatus', 'condition' => 'eq', 'value' => 'done')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'id' => array('name' => '项目ID', 'object' => 'project', 'field' => 'id', 'type' => 'number'),
- 'projectstatus' => array('name' => 'projectstatus', 'object' => 'project', 'field' => 'projectstatus', 'type' => 'string'),
- 'year' => array('name' => 'year', 'object' => 'project', 'field' => 'year', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'projectstatus' => array('zh-cn' => '项目状态', 'zh-tw' => '', 'en' => 'projectstatus', 'de' => '', 'fr' => ''),
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10017,
- 'name' => '年度完成项目-执行延期率',
- 'code' => 'annualFinishedProject_executionDelayRatio',
- 'dimension' => '2',
- 'type' => 'waterpolo',
- 'group' => '71',
- 'sql' => <<<EOT
- SELECT t1.id,IF(t1.realEnd>t1.`end`,'done','undone') AS `projectstatus`, 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
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'waterpolo',
- 'calc' => 'count',
- 'goal' => 'id',
- 'conditions' => array
- (
- array('field' => 'projectstatus', 'condition' => 'eq', 'value' => 'done')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'id' => array('name' => '项目ID', 'object' => 'project', 'field' => 'id', 'type' => 'number'),
- 'projectstatus' => array('name' => 'projectstatus', 'object' => 'project', 'field' => 'projectstatus', 'type' => 'string'),
- 'year' => array('name' => 'year', 'object' => 'project', 'field' => 'year', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'projectstatus' => array('zh-cn' => '执行状态', 'zh-tw' => '', 'en' => 'projectstatus', 'de' => '', 'fr' => ''),
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'year', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10018,
- 'name' => '年度完成项目-完成项目工期偏差条形图',
- 'code' => 'annualFinishedProject_projectFinishedDurationDeviation',
- 'dimension' => '2',
- 'type' => 'cluBarY',
- 'group' => '71',
- 'sql' => <<<EOT
- select
- t1.name,
- t1.closedDate,
- round(t1.realduration-t1.planduration)/t1.planduration as daterate
- from(
- select
- name,
- id,
- closedDate,
- begin,
- `end`,
- datediff(`end`,`begin`) planduration,
- realBegan,
- realEnd,
- ifnull(if(left(realEnd,4) != '0000',datediff(`realEnd`,`realBegan`),datediff(`closedDate`,`realBegan`)),0) realduration
- from
- zt_project
- where deleted='0'
- and status='closed'
- and type='project'
- ) t1
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'name', 'name' => '项目名称', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'daterate', 'name' => 'daterate', 'valOrAgg' => 'max')
- )
- )
- ),
- 'filters' => array
- (
- array
- (
- 'field' => 'closedDate',
- 'type' => 'date',
- 'name' => '关闭日期',
- 'default' => array('begin' => '', 'end' => '')
- )
- ),
- 'fields' => array
- (
- 'name' => array('name' => '项目名称', 'object' => 'project', 'field' => 'name', 'type' => 'string'),
- 'closedDate' => array('name' => '关闭日期', 'object' => 'project', 'field' => 'closedDate', 'type' => 'date'),
- 'daterate' => array('name' => 'daterate', 'object' => 'project', 'field' => 'daterate', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'name' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => 'name', 'de' => '', 'fr' => ''),
- 'closedDate' => array('zh-cn' => '关闭日期', 'zh-tw' => '', 'en' => 'closedDate', 'de' => '', 'fr' => ''),
- 'daterate' => array('zh-cn' => '工期偏差率', 'zh-tw' => '', 'en' => 'daterate', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10019,
- 'name' => '年度完成项目-单位工时交付需求规模数对比图',
- 'code' => 'annualFinishedProject_storyEstimatePerHour',
- 'dimension' => '2',
- 'type' => 'pie',
- 'group' => '71',
- 'sql' => <<<EOT
- select tt.*,
- tt.`故事点` / tt.`工时` as `单位时间交付需求规模数`
- from (
- select
- t1.name as project,
- (
- select round(sum(t3.estimate), 1) from zt_projectstory t2
- left join zt_story t3 on t3.id= t2.story and t3.status='closed' and t3.closedReason = 'done'
- where t2.project = t1.id
- ) as `故事点`,
- (
- select round(sum(t5.consumed), 1) from zt_project t4
- left join zt_task t5 on t5.execution = t4.id and t5.deleted = '0' and t5.parent in (0, -1)
- where t4.project = t1.id and t4.type = 'sprint'
- ) as `工时`
- from zt_project t1
- where t1.status = 'closed'
- and t1.deleted = '0'
- and t1.type = 'project'
- group by t1.id) tt
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarX',
- 'xaxis' => array
- (
- array('field' => 'project', 'name' => '所属项目', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => '单位时间交付需求规模数', 'name' => '单位时间交付需求规模数', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'project', 'type' => 'input', 'name' => '所属项目', 'default' => '')
- ),
- 'fields' => array
- (
- 'project' => array('name' => '所属项目', 'object' => 'project', 'field' => 'project', 'type' => 'string'),
- '故事点' => array('name' => '故事点', 'object' => 'project', 'field' => '故事点', 'type' => 'number'),
- '工时' => array('name' => '工时', 'object' => 'project', 'field' => '工时', 'type' => 'number'),
- '单位时间交付需求规模数' => array('name' => '单位时间交付需求规模数', 'object' => 'project', 'field' => '单位时间交付需求规模数', 'type' => 'number')
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10020,
- 'name' => '年度完成项目-项目完成分布图',
- 'code' => 'annualFinishedProject_projectStatus_finished',
- 'dimension' => '2',
- 'type' => 'pie',
- 'group' => '71',
- 'sql' => <<<EOT
- select
- t1.id,
- (case when t1.realEnd<t1.end then '提前完成项目' when t1.realEnd=t1.end then '正常完成项目' else '延期完成项目' end) `completeStatus`,
- t1.closedDate
- from(
- select
- id,
- closedDate,
- `end`,
- if(left(realEnd, 4) = '0000', closedDate, realEnd) as realEnd
- from
- zt_project
- where deleted='0'
- and status='closed'
- and type='project') t1
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'pie',
- 'group' => array
- (
- array('field' => 'completeStatus', 'name' => 'completeStatus', 'group' => '')
- ),
- 'metric' => array
- (
- array('field' => 'id', 'name' => '项目ID', 'valOrAgg' => 'count')
- )
- )
- ),
- 'filters' => array
- (
- array
- (
- 'field' => 'closedDate',
- 'type' => 'date',
- 'name' => '关闭日期',
- 'default' => array('begin' => '', 'end' => '')
- )
- ),
- 'fields' => array
- (
- 'id' => array('name' => '项目ID', 'object' => 'project', 'field' => 'id', 'type' => 'number'),
- 'completeStatus' => array('name' => 'completeStatus', 'object' => 'project', 'field' => 'completeStatus', 'type' => 'string'),
- 'closedDate' => array('name' => '关闭日期', 'object' => 'project', 'field' => 'closedDate', 'type' => 'date')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'completeStatus' => array('zh-cn' => '项目完成情况', 'zh-tw' => '', 'en' => 'completeStatus', 'de' => '', 'fr' => ''),
- 'closedDate' => array('zh-cn' => '关闭日期', 'zh-tw' => '', 'en' => 'closedDate', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10021,
- 'name' => '年度完成项目-执行完成分布图',
- 'code' => 'annualFinishedProject_executionStatus_finished',
- 'dimension' => '2',
- 'type' => 'pie',
- 'group' => '71',
- 'sql' => <<<EOT
- select
- t1.id,
- (case when t1.realEnd<t1.end then '提前完成执行' when t1.realEnd=t1.end then '正常完成执行' else '延期完成执行' end) `completeStatus`,
- t1.closedDate
- from(
- select
- id,
- closedDate,
- `end`,
- if(left(realEnd, 4) = '0000', closedDate, realEnd) as realEnd
- from
- zt_project
- where deleted='0'
- and status='closed'
- and type='sprint') t1
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'pie',
- 'group' => array
- (
- array('field' => 'completeStatus', 'name' => 'completeStatus', 'group' => '')
- ),
- 'metric' => array
- (
- array('field' => 'id', 'name' => '项目ID', 'valOrAgg' => 'count')
- )
- )
- ),
- 'filters' => array
- (
- array
- (
- 'field' => 'closedDate',
- 'type' => 'date',
- 'name' => '关闭日期',
- 'default' => array('begin' => '', 'end' => '')
- )
- ),
- 'fields' => array
- (
- 'id' => array('name' => '项目ID', 'object' => 'project', 'field' => 'id', 'type' => 'number'),
- 'completeStatus' => array('name' => 'completeStatus', 'object' => 'project', 'field' => 'completeStatus', 'type' => 'string'),
- 'closedDate' => array('name' => '关闭日期', 'object' => 'project', 'field' => 'closedDate', 'type' => 'date')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'completeStatus' => array('zh-cn' => '完成情况', 'zh-tw' => '', 'en' => 'completeStatus', 'de' => '', 'fr' => ''),
- 'closedDate' => array('zh-cn' => '关闭日期', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10022,
- 'name' => '年度完成项目-完成项目工时偏差条形图',
- 'code' => 'annualFinishedProject_projectHourDeviation_finished',
- 'dimension' => '2',
- 'type' => 'cluBarY',
- 'group' => '70',
- 'sql' => <<<EOT
- select
- *,
- round(tt.deviation/tt.estimate,3) rate
- from(
- select
- t1.name,
- t1.id,
- t1.closedDate,
- t2.estimate estimate,
- t2.consumed consumed,
- t2.`left`,
- t2.consumed-t2.estimate deviation
- from
- zt_project t1
- left join
- (select
- project,
- sum(estimate) estimate,
- sum(consumed) consumed,
- sum(`left`) `left`
- from
- zt_task
- group by project) t2
- on t1.id=t2.project
- where t1.deleted='0'
- and t1.status='closed'
- and t1.type='project') tt
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'name', 'name' => '任务名称', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'rate', 'name' => 'rate', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array
- (
- 'field' => 'closedDate',
- 'type' => 'date',
- 'name' => '关闭时间',
- 'default' => array('begin' => '', 'end' => '')
- )
- ),
- 'fields' => array
- (
- 'name' => array('name' => '任务名称', 'object' => 'project', 'field' => 'name', 'type' => 'string'),
- 'id' => array('name' => '编号', 'object' => 'project', 'field' => 'id', 'type' => 'number'),
- 'closedDate' => array('name' => '关闭时间', 'object' => 'task', 'field' => 'closedDate', 'type' => 'date'),
- 'estimate' => array('name' => '最初预计', 'object' => 'task', 'field' => 'estimate', 'type' => 'string'),
- 'consumed' => array('name' => '总计消耗', 'object' => 'task', 'field' => 'consumed', 'type' => 'string'),
- 'left' => array('name' => '预计剩余', 'object' => 'task', 'field' => 'left', 'type' => 'string'),
- 'deviation' => array('name' => 'deviation', 'object' => 'task', 'field' => 'deviation', 'type' => 'number'),
- 'rate' => array('name' => 'rate', 'object' => 'task', 'field' => 'rate', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'name' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => 'name', 'de' => '', 'fr' => ''),
- 'id' => array('zh-cn' => '项目编号', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'closedDate' => array('zh-cn' => '关闭时间', 'zh-tw' => '', 'en' => 'closedDate', 'de' => '', 'fr' => ''),
- 'estimate' => array('zh-cn' => '最初预计', 'zh-tw' => '', 'en' => 'estimate', 'de' => '', 'fr' => ''),
- 'consumed' => array('zh-cn' => '总计消耗', 'zh-tw' => '', 'en' => 'consumed', 'de' => '', 'fr' => ''),
- 'left' => array('zh-cn' => '预计剩余', 'zh-tw' => '', 'en' => 'left', 'de' => '', 'fr' => ''),
- 'deviation' => array('zh-cn' => '偏差', 'zh-tw' => '', 'en' => 'deviation', 'de' => '', 'fr' => ''),
- 'rate' => array('zh-cn' => '偏差比率', 'zh-tw' => '', 'en' => 'rate', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10101,
- 'name' => '年度进行中项目-进行中的项目数',
- 'code' => 'annualDoingProject_countProject',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '72',
- 'sql' => <<<EOT
- SELECT id FROM zt_project WHERE deleted = '0' AND status = 'doing' AND type = 'project'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10102,
- 'name' => '年度进行中项目-进行中的迭代数',
- 'code' => 'annualDoingProject_countExecution',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '73',
- 'sql' => <<<EOT
- SELECT id,type FROM zt_project WHERE deleted = '0' AND status = 'doing' AND type IN ('sprint', 'stage', 'kanban') AND multiple = '1'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10103,
- 'name' => '年度进行中项目-进展顺利项目数',
- 'code' => 'annualDoingProject_countProject_good',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '72',
- 'sql' => <<<EOT
- 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
- FROM zt_project AS t1
- LEFT JOIN (
- SELECT t22.project,
- ROUND(IF(SUM(t22.consumed) + SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0)) > 0, SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0))), 0) * 100, 2) AS prograss
- FROM zt_project AS t21
- LEFT JOIN zt_task AS t22 ON t21.id = t22.execution
- WHERE t21.deleted = '0' AND t21.type IN ('sprint', 'kanban')
- AND t22.deleted = '0' AND t22.parent < 1
- GROUP BY t22.project
- UNION
- SELECT t.project, ROUND(SUM(t.prograss * (t.percent / 100)), 2) as prograss
- FROM (
- SELECT t21.id,t21.percent, t22.project,
- IF(SUM(t22.consumed) + SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0)) > 0, ROUND(SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0))) * 1000 / 1000 * 100, 2), 0) AS prograss
- FROM zt_project AS t21
- LEFT JOIN zt_task AS t22 ON t21.id = t22.execution
- WHERE t21.deleted = '0' AND t21.type = 'stage'
- AND t22.deleted = '0' AND t22.parent < 1
- AND t22.id IS NOT NULL
- GROUP BY t21.id, t21.percent, t22.project
- ) t
- GROUP BY t.project
- ) AS t2 ON t1.id = t2.project
- WHERE t1.deleted = '0'
- AND t1.status = 'doing'
- AND t1.type = 'project'
- AND ((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' )
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10104,
- 'name' => '年度进行中项目-进展顺利迭代数',
- 'code' => 'annualDoingProject_countExecution_good',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '73',
- 'sql' => <<<EOT
- SELECT id, prograss, planPrograss, `end`
- FROM (
- SELECT t1.id,ROUND(DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100, 2) AS planPrograss,t1.`end`,
- ROUND(IF(SUM(t2.consumed) + SUM(IF(t2.status != 'closed' AND t2.status != 'cancel', t2.`left`, 0)) > 0, SUM(t2.consumed) / (SUM(t2.consumed) + SUM(IF(t2.status != 'closed' AND t2.status != 'cancel', t2.`left`, 0))), 0) * 100, 2) AS prograss
- FROM zt_project AS t1
- LEFT JOIN zt_task AS t2 ON t1.id = t2.execution
- WHERE t1.deleted = '0' AND t1.type IN ('sprint', 'stage', 'kanban') AND t1.status = 'doing' AND t1.multiple = '1'
- AND t2.deleted = '0' AND t2.parent < 1
- GROUP BY t1.id
- ) AS t
- WHERE prograss >= planPrograss AND DATEDIFF(`end`, NOW()) >= 0
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10105,
- 'name' => '年度进行中项目-进度滞后项目数',
- 'code' => 'annualDoingProject_countProject_bad',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '72',
- 'sql' => <<<EOT
- 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
- FROM zt_project AS t1
- LEFT JOIN (
- SELECT t22.project,
- ROUND(IF(SUM(t22.consumed) + SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0)) > 0, SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0))), 0) * 100, 2) AS prograss
- FROM zt_project AS t21
- LEFT JOIN zt_task AS t22 ON t21.id = t22.execution
- WHERE t21.deleted = '0' AND t21.type IN ('sprint', 'kanban')
- AND t22.deleted = '0' AND t22.parent < 1
- GROUP BY t22.project
- UNION
- SELECT t.project, ROUND(SUM(t.prograss * (t.percent / 100)), 2) as prograss
- FROM (
- SELECT t21.id,t21.percent, t22.project,
- IF(SUM(t22.consumed) + SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0)) > 0, ROUND(SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0))) * 1000 / 1000 * 100, 2), 0) AS prograss
- FROM zt_project AS t21
- LEFT JOIN zt_task AS t22 ON t21.id = t22.execution
- WHERE t21.deleted = '0' AND t21.type = 'stage'
- AND t22.deleted = '0' AND t22.parent < 1
- AND t22.id IS NOT NULL
- GROUP BY t21.id, t21.percent, t22.project
- ) t
- GROUP BY t.project
- ) AS t2 ON t1.id = t2.project
- WHERE t1.deleted = '0'
- AND t1.status = 'doing'
- AND t1.type = 'project'
- AND LEFT(t1.`end`, 4) != '2059'
- AND IFNULL(prograss, 0) < (DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100) AND DATEDIFF(`end`, NOW()) >= 0
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10106,
- 'name' => '年度进行中项目-进度滞后迭代数',
- 'code' => 'annualDoingProject_countExecution_bad',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '73',
- 'sql' => <<<EOT
- SELECT id, prograss, planPrograss
- FROM (
- SELECT t1.id,ROUND(DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100, 2) AS planPrograss,
- ROUND(IF(SUM(t2.consumed) + SUM(IF(t2.status != 'closed' AND t2.status != 'cancel', t2.`left`, 0)) > 0, SUM(t2.consumed) / (SUM(t2.consumed) + SUM(IF(t2.status != 'closed' AND t2.status != 'cancel', t2.`left`, 0))), 0) * 100, 2) AS prograss
- FROM zt_project AS t1
- LEFT JOIN zt_task AS t2 ON t1.id = t2.execution
- WHERE t1.deleted = '0' AND t1.type IN ('sprint', 'stage', 'kanban') AND t1.status = 'doing' AND t1.multiple = '1' AND DATEDIFF(t1.`end`, NOW()) >= 0
- AND t2.deleted = '0' AND t2.parent < 1
- GROUP BY t1.id
- ) AS t
- WHERE prograss < planPrograss
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10107,
- 'name' => '年度进行中项目-已延期项目数',
- 'code' => 'annualDoingProject_countPorject_delay',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '72',
- 'sql' => <<<EOT
- 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
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10108,
- 'name' => '年度进行中项目-已延期迭代数',
- 'code' => 'annualDoingProject_countExecution_delay',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '73',
- 'sql' => <<<EOT
- 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'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10109,
- 'name' => '年度进行中项目-未完成需求条目数',
- 'code' => 'annualDoingProject_storyCount_undone',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '75',
- 'sql' => <<<EOT
- SELECT DISTINCT t3.id, t3.estimate
- FROM zt_project AS t1
- LEFT JOIN zt_projectstory AS t2 ON t1.id = t2.project
- LEFT JOIN zt_story AS t3 ON t2.story = t3.id
- WHERE t1.deleted = '0' AND t1.status = 'doing' AND t1.type = 'project'
- AND t3.deleted = '0' AND t3.stage NOT IN ('verified', 'released', 'closed')
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10110,
- 'name' => '年度进行中项目-未完成任务数',
- 'code' => 'annualDoingProject_countTask_undone',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '76',
- 'sql' => <<<EOT
- SELECT DISTINCT t2.id
- FROM zt_project AS t1
- LEFT JOIN zt_task AS t2 ON t1.id = t2.execution
- WHERE t1.deleted = '0' AND t1.status = 'doing' AND t1.type IN ('sprint', 'stage', 'kanban')
- AND t2.deleted = '0' AND t2.status IN ('wait', 'doing', 'pause') AND t2.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10111,
- 'name' => '年度进行中项目-未完成需求规模数',
- 'code' => 'annualDoingProject_storyEstimate_undone',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '75',
- 'sql' => <<<EOT
- SELECT DISTINCT t3.id, t3.estimate
- FROM zt_project AS t1
- LEFT JOIN zt_projectstory AS t2 ON t1.id = t2.project
- LEFT JOIN zt_story AS t3 ON t2.story = t3.id
- WHERE t1.deleted = '0' AND t1.status = 'doing' AND t1.type = 'project'
- AND t3.deleted = '0' AND t3.stage NOT IN ('verified', 'released', 'closed')
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'estimate', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10112,
- 'name' => '年度进行中项目-剩余工时数',
- 'code' => 'annualDoingProject_leftEffort',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '78',
- 'sql' => <<<EOT
- SELECT t1.id, t1.name, `taskleft`
- FROM zt_project AS t1
- LEFT JOIN (
- SELECT t22.project,
- ROUND(SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0)), 2) AS `taskleft`
- FROM zt_project AS t21
- LEFT JOIN zt_task AS t22 ON t21.id = t22.execution
- WHERE t21.deleted = '0' AND t21.type IN ('sprint', 'stage', 'kanban')
- AND t22.deleted = '0' AND t22.parent < 1
- GROUP BY t22.project
- ) AS t2 ON t1.id = t2.project
- WHERE t1.deleted = '0'
- AND t1.status = 'doing'
- AND t1.type = 'project'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'taskleft', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10113,
- 'name' => '年度进行中项目-投入总人次',
- 'code' => 'annualDoingProject_investedPeople',
- 'dimension' => '2',
- 'type' => 'card',
- 'group' => '78',
- 'sql' => <<<EOT
- SELECT t1.id,t1.type,t1.account
- FROM zt_team AS t1
- LEFT JOIN zt_user AS t2 on t1.account = t2.account
- WHERE t1.type = 'project' AND t2.deleted = '0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'id', 'agg' => 'count'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10114,
- 'name' => '年度进行中项目-项目进度分布图',
- 'code' => 'annualDoingProject_projectProgressChart',
- 'dimension' => '2',
- 'type' => 'pie',
- 'group' => '69',
- 'sql' => <<<EOT
- SELECT t1.id, t1.name,
- IF(
- DATEDIFF(t1.`end`, NOW()) < 0,
- '延期',
- (IF(
- (IFNULL(prograss, 0) >= (DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100) AND LEFT(t1.`end`, 4) != '2059')
- OR LEFT(t1.`end`, 4) = '2059' ,
- '顺利',
- '滞后'
- ))) AS `status`,
- 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
- FROM zt_project AS t1
- LEFT JOIN (
- SELECT t22.project,
- ROUND(IF(SUM(t22.consumed) + SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0)) > 0, SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0))), 0) * 100, 2) AS prograss
- FROM zt_project AS t21
- LEFT JOIN zt_task AS t22 ON t21.id = t22.execution
- WHERE t21.deleted = '0' AND t21.type IN ('sprint', 'kanban')
- AND t22.deleted = '0' AND t22.parent < 1
- GROUP BY t22.project
- UNION
- SELECT t.project, ROUND(SUM(t.prograss * (t.percent / 100)), 2) as prograss
- FROM (
- SELECT t21.id,t21.percent, t22.project,
- IF(SUM(t22.consumed) + SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0)) > 0, ROUND(SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0))) * 1000 / 1000 * 100, 2), 0) AS prograss
- FROM zt_project AS t21
- LEFT JOIN zt_task AS t22 ON t21.id = t22.execution
- WHERE t21.deleted = '0' AND t21.type = 'stage'
- AND t22.deleted = '0' AND t22.parent < 1
- AND t22.id IS NOT NULL
- GROUP BY t21.id, t21.percent, t22.project
- ) t
- GROUP BY t.project
- ) AS t2 ON t1.id = t2.project
- WHERE t1.deleted = '0'
- AND t1.status = 'doing'
- AND t1.type = 'project'
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'pie',
- 'group' => array
- (
- array('field' => 'status', 'name' => '状态', 'group' => '')
- ),
- 'metric' => array
- (
- array('field' => 'id', 'name' => 'id', 'valOrAgg' => 'count')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'id' => array('name' => 'id', 'object' => 'zt_project', 'field' => 'id', 'type' => 'number'),
- 'name' => array('name' => 'name', 'object' => 'zt_project', 'field' => 'name', 'type' => 'string'),
- 'status' => array('name' => '状态', 'object' => 'project', 'field' => 'status', 'type' => 'option'),
- 'prograss' => array('name' => 'prograss', 'object' => 'task', 'field' => 'prograss', 'type' => 'number'),
- 'planPrograss' => array('name' => 'planPrograss', 'object' => 'task', 'field' => 'planPrograss', 'type' => 'number'),
- 'endYear' => array('name' => 'endYear', 'object' => 'task', 'field' => 'endYear', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'name' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => 'name', 'de' => '', 'fr' => ''),
- 'status' => array('zh-cn' => '状态', 'zh-tw' => '', 'en' => 'status', 'de' => '', 'fr' => ''),
- 'prograss' => array('zh-cn' => '项目进度', 'zh-tw' => '', 'en' => 'prograss', 'de' => '', 'fr' => ''),
- 'planPrograss' => array('zh-cn' => '计划进度', 'zh-tw' => '', 'en' => 'planPrograss', 'de' => '', 'fr' => ''),
- 'endYear' => array('zh-cn' => '结束年份', 'zh-tw' => '', 'en' => 'endYear', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10115,
- 'name' => '年度进行中项目-迭代进度分布图',
- 'code' => 'annualDoingProject_executionProgressChart',
- 'dimension' => '2',
- 'type' => 'pie',
- 'group' => '69',
- 'sql' => <<<EOT
- SELECT id, name,IF(
- DATEDIFF(`end`, NOW()) < 0,
- '延期',
- (IF(
- prograss >= planPrograss,
- '顺利',
- '滞后'
- ))
- ) AS status,
- prograss, planPrograss, `end`
- FROM (
- SELECT t1.id,t1.name,ROUND(DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100, 2) AS planPrograss,t1.`end`,
- ROUND(IF(SUM(t2.consumed) + SUM(IF(t2.status != 'closed' AND t2.status != 'cancel', t2.`left`, 0)) > 0, SUM(t2.consumed) / (SUM(t2.consumed) + SUM(IF(t2.status != 'closed' AND t2.status != 'cancel', t2.`left`, 0))), 0) * 100, 2) AS prograss
- FROM zt_project AS t1
- LEFT JOIN zt_task AS t2 ON t1.id = t2.execution
- WHERE t1.deleted = '0' AND t1.type IN ('sprint', 'stage', 'kanban') AND t1.status = 'doing' AND t1.multiple = '1'
- AND ((t2.deleted = '0' AND t2.parent < 1) OR t2.id IS NULL)
- GROUP BY t1.id
- ) AS t
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'pie',
- 'group' => array
- (
- array('field' => 'status', 'name' => '状态', 'group' => '')
- ),
- 'metric' => array
- (
- array('field' => 'id', 'name' => '项目ID', 'valOrAgg' => 'count')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'id' => array('name' => '项目ID', 'object' => 'project', 'field' => 'id', 'type' => 'number'),
- 'name' => array('name' => '项目名称', 'object' => 'project', 'field' => 'name', 'type' => 'string'),
- 'status' => array('name' => '状态', 'object' => 'project', 'field' => 'status', 'type' => 'option'),
- 'prograss' => array('name' => 'prograss', 'object' => 'task', 'field' => 'prograss', 'type' => 'number'),
- 'planPrograss' => array('name' => 'planPrograss', 'object' => 'task', 'field' => 'planPrograss', 'type' => 'number'),
- 'end' => array('name' => '计划完成', 'object' => 'project', 'field' => 'end', 'type' => 'date')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => 'id', 'de' => '', 'fr' => ''),
- 'name' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => 'name', 'de' => '', 'fr' => ''),
- 'status' => array('zh-cn' => '状态', 'zh-tw' => '', 'en' => 'status', 'de' => '', 'fr' => ''),
- 'prograss' => array('zh-cn' => '项目进度', 'zh-tw' => '', 'en' => 'prograss', 'de' => '', 'fr' => ''),
- 'planPrograss' => array('zh-cn' => '计划进度', 'zh-tw' => '', 'en' => 'planPrograss', 'de' => '', 'fr' => ''),
- 'end' => array('zh-cn' => '计划完成', 'zh-tw' => '', 'en' => 'end', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10116,
- 'name' => '年度进行中项目-项目进度透视表',
- 'code' => 'annualDoingProject_projectProgressPivot',
- 'dimension' => '2',
- 'type' => 'table',
- 'group' => '84',
- 'sql' => <<<EOT
- SELECT t1.id, t1.name, IFNULL(t3.name, '/') AS program,t1.`begin`, IF(YEAR(t1.`end`) = '2059', '长期', CAST(t1.`end` AS CHAR)) AS `end`,
- IF(YEAR(t1.`end`) = '2059', '长期', CAST((DATEDIFF(t1.`end`, t1.`begin`) + 1) AS CHAR)) AS planDuration,
- IF(LEFT(t1.realBegan, 4) = '0000', '/', CAST(t1.realBegan AS CHAR)) AS realBegan,
- IF(
- YEAR(t1.`end`) = '2059',
- '长期',
- IF(
- DATEDIFF(t1.`end`, NOW()) >= 0,
- CAST((DATEDIFF(t1.`end`, NOW()) + 1) AS CHAR),
- '0'
- )
- ) AS realDuration,
- IF(
- DATEDIFF(t1.`end`, NOW()) < 0,
- '延期',
- (IF(
- (IFNULL(prograss, 0) >= (DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100) AND LEFT(t1.`end`, 4) != '2059')
- OR LEFT(t1.`end`, 4) = '2059' ,
- '顺利',
- '滞后'
- ))) AS `status`,
- CONCAT(IFNULL(prograss, 0), '%') AS prograss
- FROM zt_project AS t1
- LEFT JOIN (
- SELECT t22.project,
- ROUND(IF(SUM(t22.consumed) + SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0)) > 0, SUM(t22.consumed) / (SUM(t22.consumed) + SUM(IF(t22.status != 'closed' AND t22.status != 'cancel', t22.`left`, 0))), 0) * 100, 2) AS prograss
- FROM zt_project AS t21
- LEFT JOIN zt_task AS t22 ON t21.id = t22.execution
- WHERE t21.deleted = '0' AND t21.type IN ('sprint', 'kanban', 'stage')
- AND t22.deleted = '0' AND t22.parent < 1
- GROUP BY t22.project
- ) AS t2 ON t1.id = t2.project
- LEFT JOIN zt_project AS t3 ON SUBSTR(t1.path, 2, POSITION(',' IN SUBSTR(t1.path, 2)) -1) = CAST(t3.id AS CHAR) AND t3.type = 'program' AND t3.deleted = '0'
- WHERE t1.deleted = '0'
- AND t1.status = 'doing'
- AND t1.type = 'project'
- AND FIND_IN_SET('rnd', t1.vision)
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'program', 'valOrAgg' => 'value', 'name' => '一级项目集'),
- array('field' => 'name', 'valOrAgg' => 'value', 'name' => '项目'),
- array('field' => 'begin', 'valOrAgg' => 'value', 'name' => '计划开始日期'),
- array('field' => 'end', 'valOrAgg' => 'value', 'name' => '计划完成日期'),
- array('field' => 'planDuration', 'valOrAgg' => 'value', 'name' => '计划工期'),
- array('field' => 'realBegan', 'valOrAgg' => 'value', 'name' => '实际开始日期'),
- array('field' => 'realDuration', 'valOrAgg' => 'value', 'name' => '剩余工期天数'),
- array('field' => 'prograss', 'valOrAgg' => 'value', 'name' => '工期进度'),
- array('field' => 'status', 'valOrAgg' => 'value', 'name' => '进度状态')
- ),
- 'filter' => array()
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10117,
- 'name' => '年度进行中项目-迭代进度透视表',
- 'code' => 'annualDoingProject_executionProgressPivot',
- 'dimension' => '2',
- 'type' => 'table',
- 'group' => '84',
- 'sql' => <<<EOT
- SELECT id, name,project,`begin`, `end`, planDuration, IF(LEFT(realBegan, 4) = '0000', '/', realBegan) as realBegan, realDuration, CONCAT(prograss, '%') as prograss,
- IF(
- DATEDIFF(`end`, NOW()) < 0,
- '延期',
- (IF(
- prograss >= planPrograss,
- '顺利',
- '滞后'
- ))
- ) AS status
- FROM (
- SELECT t1.id,t1.name,t1.`begin`,t1.`end`,t1.`realBegan`,IFNULL(t3.name, '/') AS project,t3.id AS projectID,
- DATEDIFF(t1.`end`, t1.`begin`) + 1 AS planDuration, IF(DATEDIFF(t1.`end`, NOW()) >= 0, DATEDIFF(t1.`end`, NOW()) + 1, 0) AS realDuration,
- ROUND(DATEDIFF(NOW(), t1.`begin`) / DATEDIFF(t1.`end`, t1.`begin`) * 100, 2) AS planPrograss,
- ROUND(IF(SUM(t2.consumed) + SUM(IF(t2.status != 'closed' AND t2.status != 'cancel', t2.`left`, 0)) > 0, SUM(t2.consumed) / (SUM(t2.consumed) + SUM(IF(t2.status != 'closed' AND t2.status != 'cancel', t2.`left`, 0))), 0) * 100, 2) AS prograss
- FROM zt_project AS t1
- LEFT JOIN zt_task AS t2 ON t1.id = t2.execution
- LEFT JOIN zt_project AS t3 on t1.project = t3.id AND t3.type = 'project' AND t3.deleted = '0'
- WHERE t1.deleted = '0' AND t1.type IN ('sprint', 'stage', 'kanban') AND t1.status = 'doing' AND t1.multiple = '1'
- AND t2.deleted = '0' AND t2.parent < 1
- GROUP BY t1.id
- ) AS t
- ORDER BY projectID ASC, id ASC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'project', 'valOrAgg' => 'value', 'name' => '项目'),
- array('field' => 'name', 'valOrAgg' => 'value', 'name' => '迭代'),
- array('field' => 'begin', 'valOrAgg' => 'value', 'name' => '计划开始日期'),
- array('field' => 'end', 'valOrAgg' => 'value', 'name' => '计划完成日期'),
- array('field' => 'planDuration', 'valOrAgg' => 'value', 'name' => '计划工期'),
- array('field' => 'realBegan', 'valOrAgg' => 'value', 'name' => '实际开始日期'),
- array('field' => 'realDuration', 'valOrAgg' => 'value', 'name' => '剩余工期天数'),
- array('field' => 'prograss', 'valOrAgg' => 'value', 'name' => '工期进度'),
- array('field' => 'status', 'valOrAgg' => 'value', 'name' => '进度状态')
- ),
- 'filter' => array()
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10118,
- 'name' => '年度进行中项目-项目剩余工作量透视表',
- 'code' => 'annualDoingProject_porjectLeftPivot',
- 'dimension' => '2',
- 'type' => 'table',
- 'group' => '83',
- 'sql' => <<<EOT
- SELECT t1.id, t1.NAME AS project, IFNULL( t2.NAME, '/') AS program, IFNULL( t3.story, 0 ) AS story, IFNULL( t3.estimate, 0 ) AS estimate, IFNULL( t4.execution, 0 ) AS execution, IFNULL( t5.workhour, 0 ) AS workhour FROM zt_project AS t1 LEFT 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 LEFT JOIN( SELECT t1.parent AS project, COUNT( 1 ) AS story, ROUND( SUM( t1.estimate ), 1 ) AS estimate FROM ( SELECT DISTINCT t1.parent, t3.id, t3.estimate FROM zt_project AS t1 LEFT JOIN zt_projectstory AS t2 ON t1.id = t2.project LEFT JOIN zt_story AS t3 ON t2.story = t3.id AND t3.deleted = '0' AND t3.stage NOT IN ( 'verified', 'released', 'closed' ) WHERE t1.deleted = '0' AND t1.type IN ( 'sprint', 'stage', 'kanban' ) AND t3.id IS NOT NULL ) AS t1 GROUP BY project ) AS t3 ON t1.id = t3.project LEFT JOIN ( SELECT parent AS project, COUNT( 1 ) AS execution FROM zt_project WHERE deleted = '0' AND type IN ( 'sprint', 'stage', 'kanban' ) AND multiple = '1' AND STATUS NOT IN ( 'done', 'closed' ) GROUP BY parent ) AS t4 ON t1.id = t4.project LEFT JOIN ( SELECT t1.parent AS project, ROUND( SUM( t2.LEFT ), 1 ) AS workhour FROM zt_project AS t1 LEFT JOIN zt_task AS t2 ON t1.id = t2.execution AND t2.deleted = '0' AND t2.parent < 1 WHERE t1.deleted = '0' AND t1.type IN ( 'sprint', 'stage', 'kanban' ) AND t1.STATUS NOT IN ( 'done', 'closed' ) AND t2.id IS NOT NULL GROUP BY t1.parent ) AS t5 ON t1.id = t5.project WHERE t1.deleted = '0' AND t1.type = 'project' AND t1.STATUS = 'doing'
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'program', 'valOrAgg' => 'value', 'name' => '一级项目集'),
- array('field' => 'project', 'valOrAgg' => 'value', 'name' => '项目'),
- array('field' => 'story', 'valOrAgg' => 'value', 'name' => '剩余需求数'),
- array('field' => 'estimate', 'valOrAgg' => 'value', 'name' => '剩余需求规模数'),
- array('field' => 'execution', 'valOrAgg' => 'value', 'name' => '剩余执行数'),
- array('field' => 'workhour', 'valOrAgg' => 'value', 'name' => '剩余工时')
- ),
- 'filter' => array()
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10119,
- 'name' => '年度进行中项目-迭代剩余工作量透视表',
- 'code' => 'annualDoingProject_executionLeftPivot',
- 'dimension' => '2',
- 'type' => 'table',
- 'group' => '83',
- 'sql' => <<<EOT
- SELECT
- t1.id,
- t1.name AS execution,
- IFNULL(t2.name, '/') AS project,
- IFNULL(t3.story, 0) AS story,
- IFNULL(t3.estimate, 0) AS estimate,
- IFNULL(t4.task, 0) AS task,
- IFNULL(t4.workhour, 0) AS workhour
- FROM zt_project AS t1
- LEFT JOIN zt_project AS t2 ON t1.project = t2.id AND t2.type = 'project'
- LEFT JOIN (
- SELECT t1.id AS execution, COUNT(t3.id) AS story, ROUND(SUM(t3.estimate), 1) AS estimate
- FROM zt_project AS t1
- LEFT JOIN zt_projectstory AS t2 ON t1.id = t2.project
- LEFT JOIN zt_story AS t3 ON t2.story = t3.id AND t3.deleted = '0' AND t3.stage NOT IN ('verified', 'released', 'closed')
- WHERE t1.deleted = '0' AND t1.type IN ('sprint', 'stage', 'kanban') AND t1.status = 'doing' AND t1.multiple = '1'
- GROUP BY execution
- ) AS t3 ON t1.id = t3.execution
- LEFT JOIN (
- 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
- FROM zt_project AS t1
- LEFT JOIN zt_task AS t2 ON t1.id = t2.execution AND t2.deleted = '0' AND t2.parent < 1
- WHERE t1.deleted = '0' AND t1.type IN ('sprint', 'stage', 'kanban') AND t1.status = 'doing' AND t1.multiple = '1'
- GROUP BY execution
- ) AS t4 ON t1.id = t4.execution
- WHERE t1.deleted = '0' AND t1.type IN ('sprint', 'stage', 'kanban') AND t1.status = 'doing' AND t1.multiple = '1'
- ORDER BY t2.id ASC, t1.id ASC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'project', 'valOrAgg' => 'value', 'name' => '项目'),
- array('field' => 'execution', 'valOrAgg' => 'value', 'name' => '迭代'),
- array('field' => 'story', 'valOrAgg' => 'value', 'name' => '剩余需求数'),
- array('field' => 'estimate', 'valOrAgg' => 'value', 'name' => '剩余需求规模数'),
- array('field' => 'task', 'valOrAgg' => 'value', 'name' => '剩余任务数'),
- array('field' => 'workhour', 'valOrAgg' => 'value', 'name' => '剩余工时')
- ),
- 'filter' => array()
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10201,
- 'name' => '质量数据-研发完成需求数',
- 'code' => 'quality_storyCount_finished',
- 'dimension' => '3',
- 'type' => 'card',
- 'group' => '93',
- 'sql' => <<<EOT
- SELECT COUNT(id) AS number FROM zt_story WHERE deleted='0' AND (stage IN ('developed','testing','verified','released') OR (status='closed' AND closedReason='done'))
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10202,
- 'name' => '质量数据-研发完成需求规模数',
- 'code' => 'quality_storyEstimate_finished',
- 'dimension' => '3',
- 'type' => 'card',
- 'group' => '93',
- 'sql' => <<<EOT
- SELECT ROUND(SUM(estimate),2) AS number FROM zt_story WHERE deleted='0' AND (stage IN ('developed','testing','verified','released') OR (status='closed' AND closedReason='done'))
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10203,
- 'name' => '质量数据-研发完成需求用例数',
- 'code' => 'quality_storyCaseCount_finished',
- 'dimension' => '3',
- 'type' => 'card',
- 'group' => '95',
- 'sql' => <<<EOT
- 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','verified','released') OR (t3.status='closed' AND t3.closedReason='done'))
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10204,
- 'name' => '质量数据-Bug总数',
- 'code' => 'quality_bugCount',
- 'dimension' => '3',
- 'type' => 'card',
- 'group' => '94',
- 'sql' => <<<EOT
- SELECT COUNT(id) AS number FROM zt_bug WHERE deleted='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10205,
- 'name' => '质量数据-有效Bug数',
- 'code' => 'quality_bugCount_valid',
- 'dimension' => '3',
- 'type' => 'card',
- 'group' => '94',
- 'sql' => <<<EOT
- SELECT SUM(CASE WHEN resolution IN ('fixed','postponed') OR status='active' THEN 1 ELSE 0 END) AS number FROM zt_bug WHERE deleted='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10206,
- 'name' => '质量数据-修复Bug数',
- 'code' => 'quality_bugCount_fixed',
- 'dimension' => '3',
- 'type' => 'card',
- 'group' => '94',
- 'sql' => <<<EOT
- SELECT SUM(CASE WHEN resolution='fixed' AND status='closed' THEN 1 ELSE 0 END) AS number FROM zt_bug WHERE deleted='0'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'agg', 'field' => 'number', 'agg' => 'sum'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10207,
- 'name' => '质量数据-研发完成需求用例覆盖率',
- 'code' => 'quality_storyCaseCoverage_finished',
- 'dimension' => '3',
- 'type' => 'waterpolo',
- 'group' => '92',
- 'sql' => <<<EOT
- SELECT ROUND(SUM(t3.havecasefixstory)/COUNT(t3.fixstory),4) AS fixpercent, 'havecase' as havecase 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','verified','released') OR (zt_story.status='closed' AND zt_story.closedReason='done'))) t1 GROUP BY t1.storyid ORDER BY cases DESC LIMIT 999999) t2) t3
- union
- SELECT ROUND(1-SUM(t3.havecasefixstory)/COUNT(t3.fixstory),4) AS fixpercent, 'nocase' as havecase 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','verified','released') OR (zt_story.status='closed' AND zt_story.closedReason='done'))) t1 GROUP BY t1.storyid ORDER BY cases DESC LIMIT 999999) t2) t3
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'waterpolo',
- 'calc' => 'sum',
- 'goal' => 'fixpercent',
- 'conditions' => array
- (
- array('field' => 'havecase', 'condition' => 'eq', 'value' => 'havecase')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'fixpercent' => array('name' => 'fixpercent', 'object' => 'testcase', 'field' => 'fixpercent', 'type' => 'number'),
- 'havecase' => array('name' => 'havecase', 'object' => 'testcase', 'field' => 'havecase', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'fixpercent' => array('zh-cn' => '用例覆盖率', 'zh-tw' => '', 'en' => 'fixpercent', 'de' => '', 'fr' => ''),
- 'havecase' => array('zh-cn' => '是否有用例', 'zh-tw' => '', 'en' => 'havecase', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10208,
- 'name' => '质量数据-研发完成需求用例密度',
- 'code' => 'quality_storyCaseDensity_finished',
- 'dimension' => '3',
- 'type' => 'waterpolo',
- 'group' => '92',
- 'sql' => <<<EOT
- SELECT ROUND(SUM(t2.cases)/SUM(t2.estimate),4) AS casedensity, 'havecase' as havecase 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','verified','released') OR (zt_story.status='closed' AND zt_story.closedReason='done'))) t1 GROUP BY t1.storyid, t1.estimate ORDER BY cases DESC LIMIT 999999) t2
- union
- SELECT ROUND(1-SUM(t2.cases)/SUM(t2.estimate),4) AS casedensity, 'nocase' as havecase 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','verified','released') OR (zt_story.status='closed' AND zt_story.closedReason='done'))) t1 GROUP BY t1.storyid, t1.estimate ORDER BY cases DESC LIMIT 999999) t2
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'waterpolo',
- 'calc' => 'sum',
- 'goal' => 'casedensity',
- 'conditions' => array
- (
- array('field' => 'havecase', 'condition' => 'eq', 'value' => 'havecase')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'casedensity' => array('name' => 'casedensity', 'object' => 'testcase', 'field' => 'casedensity', 'type' => 'number'),
- 'havecase' => array('name' => 'havecase', 'object' => 'testcase', 'field' => 'havecase', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'casedensity' => array('zh-cn' => '用例密度', 'zh-tw' => '', 'en' => 'casedensity', 'de' => '', 'fr' => ''),
- 'havecase' => array('zh-cn' => '是否有用例', 'zh-tw' => '', 'en' => 'havecase', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10209,
- 'name' => '质量数据-Bug密度',
- 'code' => 'quality_bugDensity',
- 'dimension' => '3',
- 'type' => 'waterpolo',
- 'group' => '91',
- 'sql' => <<<EOT
- SELECT ROUND(SUM(t3.bug)/SUM(t3.estimate), 4) AS bugdensity, 'havebug' as havebug 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','verified','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
- union
- SELECT ROUND(1-SUM(t3.bug)/SUM(t3.estimate), 4) AS bugdensity, 'nobug' as havebug 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','verified','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
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'waterpolo',
- 'calc' => 'sum',
- 'goal' => 'bugdensity',
- 'conditions' => array
- (
- array('field' => 'havebug', 'condition' => 'eq', 'value' => 'havebug')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'bugdensity' => array('name' => 'bugdensity', 'object' => 'bug', 'field' => 'bugdensity', 'type' => 'number'),
- 'havebug' => array('name' => 'havebug', 'object' => 'bug', 'field' => 'havebug', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'bugdensity' => array('zh-cn' => 'Bug密度', 'zh-tw' => '', 'en' => 'bugdensity', 'de' => '', 'fr' => ''),
- 'havebug' => array('zh-cn' => '是否有Bug', 'zh-tw' => '', 'en' => 'havebug', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10210,
- 'name' => '质量数据-Bug修复率',
- 'code' => 'quality_bugFixedRatio',
- 'dimension' => '3',
- 'type' => 'waterpolo',
- 'group' => '91',
- 'sql' => <<<EOT
- SELECT ROUND(SUM(CASE WHEN resolution='fixed' AND status = 'closed' THEN 1 ELSE 0 END)/COUNT(id),4) AS fixpercent, 'havebug' as havebug FROM zt_bug WHERE deleted = '0'
- union
- SELECT ROUND(1-SUM(CASE WHEN resolution='fixed' AND status = 'closed' THEN 1 ELSE 0 END)/COUNT(id),4) AS fixpercent, 'nobug' as havebug FROM zt_bug WHERE deleted = '0'
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'waterpolo',
- 'calc' => 'sum',
- 'goal' => 'fixpercent',
- 'conditions' => array
- (
- array('field' => 'havebug', 'condition' => 'eq', 'value' => 'havebug')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'fixpercent' => array('name' => 'fixpercent', 'object' => 'bug', 'field' => 'fixpercent', 'type' => 'number'),
- 'havebug' => array('name' => 'havebug', 'object' => 'bug', 'field' => 'havebug', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'fixpercent' => array('zh-cn' => 'Bug修复率', 'zh-tw' => '', 'en' => 'fixpercent', 'de' => '', 'fr' => ''),
- 'havebug' => array('zh-cn' => '是否有Bug', 'zh-tw' => '', 'en' => 'havebug', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10211,
- 'name' => '质量数据-Bug总数、有效Bug与解决Bug数近30天统计柱形图',
- 'code' => 'quality_bugDailyChart',
- 'dimension' => '3',
- 'type' => 'cluBarX',
- 'group' => '91',
- 'sql' => <<<EOT
- select
- id `Bug总数`,
- (case when resolution in ('fixed','postponed') or status='active' then 1 else 0 end) `有效Bug`,
- (case when resolution='fixed' then 1 else 0 end) `已解决Bug`,
- openedDate `日期`
- from zt_bug
- where CAST(left(openedDate,10) AS DATE) > (select DATE_sub(MAX(NOW()), INTERVAL '30' DAY))
- and CAST(left(openedDate, 10) AS DATE) < NOW()
- and deleted='0'
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarX',
- 'xaxis' => array
- (
- array('field' => '日期', 'name' => '日期', 'group' => 'day')
- ),
- 'yaxis' => array
- (
- array('field' => 'Bug总数', 'name' => 'Bug总数', 'valOrAgg' => 'count'),
- array('field' => '有效Bug', 'name' => '有效Bug', 'valOrAgg' => 'sum'),
- array('field' => '已解决Bug', 'name' => '已解决Bug', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array(),
- 'fields' => array
- (
- 'Bug总数' => array('name' => 'Bug总数', 'object' => 'bug', 'field' => 'Bug总数', 'type' => 'number'),
- '有效Bug' => array('name' => '有效Bug', 'object' => 'bug', 'field' => '有效Bug', 'type' => 'string'),
- '已解决Bug' => array('name' => '已解决Bug', 'object' => 'bug', 'field' => '已解决Bug', 'type' => 'string'),
- '日期' => array('name' => '日期', 'object' => 'bug', 'field' => '日期', 'type' => 'date')
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10212,
- 'name' => '质量数据-有效Bug率年度趋势图',
- 'code' => 'quality_validBugTendency',
- 'dimension' => '3',
- 'type' => 'line',
- 'group' => '91',
- 'sql' => <<<EOT
- select
- year,
- count(a.id) as totalBugCount,
- sum(a.effectivebug) as effectiveBugCount,
- sum(a.effectivebug)/count(a.id) effectiveBugRate
- from(
- select
- left(openedDate,4) `year`,
- id,
- (case when resolution in ('fixed','postponed') or status='active' then 1 else 0 end) effectivebug,
- (case when resolution='fixed' then 1 else 0 end) fixedBug
- from zt_bug
- where zt_bug.deleted='0'
- ) a
- group by a.`year`
- order by a.`year`
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'line',
- 'xaxis' => array
- (
- array('field' => 'year', 'name' => 'year', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'effectiveBugRate', 'name' => 'effectiveBugRate', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'bug', 'field' => 'year', 'type' => 'string'),
- 'totalBugCount' => array('name' => 'totalBugCount', 'object' => 'bug', 'field' => 'totalBugCount', 'type' => 'string'),
- 'effectiveBugCount' => array('name' => 'effectiveBugCount', 'object' => 'bug', 'field' => 'effectiveBugCount', 'type' => 'number'),
- 'effectiveBugRate' => array('name' => 'effectiveBugRate', 'object' => 'bug', 'field' => 'effectiveBugRate', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'Year', 'de' => '', 'fr' => ''),
- 'totalBugCount' => array('zh-cn' => 'Bug总数', 'zh-tw' => '', 'en' => 'Total Bug Count', 'de' => '', 'fr' => ''),
- 'effectiveBugCount' => array('zh-cn' => '有效Bug数', 'zh-tw' => '', 'en' => 'Effective Bug Count', 'de' => '', 'fr' => ''),
- 'effectiveBugRate' => array('zh-cn' => '有效Bug率', 'zh-tw' => '', 'en' => 'Effective Bug Rate', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10213,
- 'name' => '质量数据-Bug密度年度趋势图',
- 'code' => 'quality_bugDensityTendency',
- 'dimension' => '3',
- 'type' => 'line',
- 'group' => '91',
- 'sql' => <<<EOT
- select
- bug.`year` as `year`,
- createdBugs,
- exfixedstoryestimate,
- round(createdBugs/exfixedstoryestimate,2) as bugCount
- from
- (select
- left(openedDate,4) `year`,
- count(id) createdBugs
- from zt_bug
- where zt_bug.deleted='0'
- group by `year`
- ) bug
- left join
- (select
- sum(estimate) exfixedstoryestimate,
- left(closedDate,4) `year`
- from
- zt_story
- where zt_story.deleted='0' and zt_story.status='closed' and zt_story.closedReason='done'
- group by `year`
- ) story
- on story.`year`=bug.`year`
- order by bug.`year`
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'line',
- 'xaxis' => array
- (
- array('field' => 'year', 'name' => 'year', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'bugCount', 'name' => 'Bug数', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'year', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- 'year' => array('name' => 'year', 'object' => 'story', 'field' => 'year', 'type' => 'string'),
- 'createdBugs' => array('name' => 'createdBugs', 'object' => 'story', 'field' => 'createdBugs', 'type' => 'string'),
- 'exfixedstoryestimate' => array('name' => 'exfixedstoryestimate', 'object' => 'story', 'field' => 'exfixedstoryestimate', 'type' => 'number'),
- 'bugCount' => array('name' => 'Bug数', 'object' => 'story', 'field' => 'bugCount', 'type' => 'number')
- ),
- 'langs' => array
- (
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => 'Year', 'de' => '', 'fr' => ''),
- 'createdBugs' => array('zh-cn' => '产生Bug', 'zh-tw' => '', 'en' => 'Created Bug', 'de' => '', 'fr' => ''),
- 'exfixedstoryestimate' => array('zh-cn' => '完成需求数', 'zh-tw' => '', 'en' => 'Finished Story', 'de' => '', 'fr' => ''),
- 'bugCount' => array('zh-cn' => '单位完成需求规模产生的Bug数', 'zh-tw' => '', 'en' => 'Bug Density', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10214,
- 'name' => '质量数据-Bug严重程度年度堆积柱状图',
- 'code' => 'quality_bugAnnualSeverityChart',
- 'dimension' => '3',
- 'type' => 'stackedBar',
- 'group' => '91',
- 'sql' => <<<EOT
- select
- count(id) `所有Bug数`,
- sum(case when severity=1 then 1 else 0 end) `严重程度为1级的Bug`,
- sum(case when severity=2 then 1 else 0 end) `严重程度为2级的Bug`,
- sum(case when severity not in (1,2) then 1 else 0 end) `严重程度低于2级的Bug`,
- left(openedDate,4) `年份`
- from
- zt_bug
- where deleted='0'
- group by left(openedDate,4)
- order by left(openedDate,4)
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'stackedBar',
- 'xaxis' => array
- (
- array('field' => '年份', 'name' => '年份', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => '严重程度为1级的Bug', 'name' => '严重程度为1级的Bug', 'valOrAgg' => 'sum'),
- array('field' => '严重程度为2级的Bug', 'name' => '严重程度为2级的Bug', 'valOrAgg' => 'sum'),
- array('field' => '严重程度低于2级的Bug', 'name' => '严重程度低于2级的Bug', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => '年份', 'type' => 'select', 'name' => '年份')
- ),
- 'fields' => array
- (
- '所有Bug数' => array('name' => '所有Bug数', 'object' => 'bug', 'field' => '所有Bug数', 'type' => 'string'),
- '严重程度为1级的Bug' => array('name' => '严重程度为1级的Bug', 'object' => 'bug', 'field' => '严重程度为1级的Bug', 'type' => 'number'),
- '严重程度为2级的Bug' => array('name' => '严重程度为2级的Bug', 'object' => 'bug', 'field' => '严重程度为2级的Bug', 'type' => 'number'),
- '严重程度低于2级的Bug' => array('name' => '严重程度低于2级的Bug', 'object' => 'bug', 'field' => '严重程度低于2级的Bug', 'type' => 'number'),
- '年份' => array('name' => '年份', 'object' => 'bug', 'field' => '年份', 'type' => 'string')
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10215,
- 'name' => '质量数据-产品用例数量统计条形图',
- 'code' => 'quality_productCaseCountChart',
- 'dimension' => '3',
- 'type' => 'cluBarY',
- 'group' => '91',
- 'sql' => <<<EOT
- select
- t1.name,
- ifnull(t2.cases,0) as count
- from
- zt_product t1
- left join
- (
- select
- product,
- count(id) cases
- from
- zt_case
- where deleted='0'
- group by product )
- t2 on t1.id=t2.product
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'name', 'name' => 'name', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'count', 'name' => 'count', 'valOrAgg' => 'sum')
- )
- )
- ),
- 'filters' => array
- (
- array('field' => 'name', 'type' => 'select', 'name' => '产品')
- ),
- 'fields' => array
- (
- 'name' => array('name' => 'name', 'object' => 'product', 'field' => 'name', 'type' => 'string'),
- 'count' => array('name' => 'count', 'object' => 'testcase', 'field' => 'id', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'name' => array('zh-cn' => '产品名称', 'zh-tw' => '', 'en' => 'Product', 'de' => '', 'fr' => ''),
- 'count' => array('zh-cn' => '用例计数', 'zh-tw' => '', 'en' => 'Case Count', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10216,
- 'name' => '质量数据-产品Bug数量统计条形图',
- 'code' => 'quality_productBugCountChart',
- 'dimension' => '3',
- 'type' => 'cluBarY',
- 'group' => '91',
- 'sql' => <<<EOT
- select
- t1.name,
- ifnull(t2.bugs,0) bug
- from
- zt_product t1
- left join
- (
- select
- product,
- count(id) bugs
- from
- zt_bug
- where zt_bug.deleted='0'
- group by product )
- t2 on t1.id=t2.product
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'cluBarY',
- 'xaxis' => array
- (
- array('field' => 'name', 'name' => 'name', 'group' => '')
- ),
- 'yaxis' => array
- (
- array('field' => 'bug', 'name' => 'bug', 'valOrAgg' => 'sum')
- ),
- 'rotateX' => 'notuse'
- )
- ),
- 'filters' => array
- (
- array('field' => 'name', 'type' => 'select', 'name' => '产品')
- ),
- 'fields' => array
- (
- 'name' => array('name' => 'name', 'object' => 'product', 'field' => 'name', 'type' => 'string'),
- 'bug' => array('name' => 'bug', 'object' => 'bug', 'field' => 'id', 'type' => 'string')
- ),
- 'langs' => array
- (
- 'name' => array('zh-cn' => '产品名称', 'zh-tw' => '', 'en' => 'Product', 'de' => '', 'fr' => ''),
- 'bug' => array('zh-cn' => 'Bug计数', 'zh-tw' => '', 'en' => 'Bug Count', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10217,
- 'name' => '质量数据-Bug状态分布图',
- 'code' => 'quality_bugStatus',
- 'dimension' => '3',
- 'type' => 'pie',
- 'group' => '91',
- 'sql' => <<<EOT
- select
- id,status,openedDate
- from zt_bug
- where deleted='0'
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'pie',
- 'group' => array
- (
- array('field' => 'status', 'name' => 'Bug状态', 'group' => '')
- ),
- 'metric' => array
- (
- array('field' => 'id', 'name' => 'Bug编号', 'valOrAgg' => 'count')
- )
- )
- ),
- 'filters' => array
- (
- array
- (
- 'field' => 'openedDate',
- 'type' => 'date',
- 'name' => '创建日期',
- 'default' => array('begin' => '', 'end' => '')
- )
- ),
- 'fields' => array
- (
- 'id' => array('name' => 'Bug编号', 'object' => 'bug', 'field' => 'id', 'type' => 'number'),
- 'status' => array('name' => 'Bug状态', 'object' => 'bug', 'field' => 'status', 'type' => 'option'),
- 'openedDate' => array('name' => '创建日期', 'object' => 'bug', 'field' => 'openedDate', 'type' => 'date')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => 'Bug编号', 'zh-tw' => '', 'en' => 'Bug ID', 'de' => '', 'fr' => ''),
- 'status' => array('zh-cn' => 'Bug状态', 'zh-tw' => '', 'en' => 'Status', 'de' => '', 'fr' => ''),
- 'openedDate' => array('zh-cn' => '创建日期', 'zh-tw' => '', 'en' => 'Opened Date', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10218,
- 'name' => '质量数据-Bug类型分布',
- 'code' => 'quality_bugType',
- 'dimension' => '3',
- 'type' => 'pie',
- 'group' => '91',
- 'sql' => <<<EOT
- select
- id,type,openedDate
- from
- zt_bug
- where deleted='0'
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'pie',
- 'group' => array
- (
- array('field' => 'type', 'name' => 'Bug类型', 'group' => '')
- ),
- 'metric' => array
- (
- array('field' => 'id', 'name' => 'Bug编号', 'valOrAgg' => 'count')
- )
- )
- ),
- 'filters' => array
- (
- array
- (
- 'field' => 'openedDate',
- 'type' => 'date',
- 'name' => '创建日期',
- 'default' => array('begin' => '', 'end' => '')
- )
- ),
- 'fields' => array
- (
- 'id' => array('name' => 'Bug编号', 'object' => 'bug', 'field' => 'id', 'type' => 'number'),
- 'type' => array('name' => 'Bug类型', 'object' => 'bug', 'field' => 'type', 'type' => 'option'),
- 'openedDate' => array('name' => '创建日期', 'object' => 'bug', 'field' => 'openedDate', 'type' => 'date')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => 'Bug编号', 'zh-tw' => '', 'en' => 'Bug ID', 'de' => '', 'fr' => ''),
- 'type' => array('zh-cn' => 'Bug类型', 'zh-tw' => '', 'en' => 'Type', 'de' => '', 'fr' => ''),
- 'openedDate' => array('zh-cn' => '创建日期', 'zh-tw' => '', 'en' => 'Opened Date', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10219,
- 'name' => '质量数据-Bug严重程度分布',
- 'code' => 'quality_bugSeverity',
- 'dimension' => '3',
- 'type' => 'pie',
- 'group' => '91',
- 'sql' => <<<EOT
- select
- id,severity,openedDate
- from
- zt_bug
- where deleted='0'
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'pie',
- 'group' => array
- (
- array('field' => 'severity', 'name' => '严重程度', 'group' => '')
- ),
- 'metric' => array
- (
- array('field' => 'id', 'name' => 'Bug编号', 'valOrAgg' => 'count')
- )
- )
- ),
- 'filters' => array
- (
- array
- (
- 'field' => 'openedDate',
- 'type' => 'date',
- 'name' => '创建日期',
- 'default' => array('begin' => '', 'end' => '')
- )
- ),
- 'fields' => array
- (
- 'id' => array('name' => 'Bug编号', 'object' => 'bug', 'field' => 'id', 'type' => 'number'),
- 'severity' => array('name' => '严重程度', 'object' => 'bug', 'field' => 'severity', 'type' => 'option'),
- 'openedDate' => array('name' => '创建日期', 'object' => 'bug', 'field' => 'openedDate', 'type' => 'date')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => 'Bug编号', 'zh-tw' => '', 'en' => 'Bug ID', 'de' => '', 'fr' => ''),
- 'severity' => array('zh-cn' => '严重程度', 'zh-tw' => '', 'en' => 'Severity', 'de' => '', 'fr' => ''),
- 'openedDate' => array('zh-cn' => '创建日期', 'zh-tw' => '', 'en' => 'Opened Date', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 10220,
- 'name' => '质量数据-Bug解决方案分布',
- 'code' => 'quality_bugResolution',
- 'dimension' => '3',
- 'type' => 'pie',
- 'group' => '91',
- 'sql' => <<<EOT
- select id,resolution,resolvedDate from zt_bug
- where deleted='0' and resolution!=' '
- EOT
- ,
- 'settings' => array
- (
- array
- (
- 'type' => 'pie',
- 'group' => array
- (
- array('field' => 'resolution', 'name' => '解决方案', 'group' => '')
- ),
- 'metric' => array
- (
- array('field' => 'id', 'name' => 'Bug编号', 'valOrAgg' => 'count')
- )
- )
- ),
- 'filters' => array
- (
- array
- (
- 'field' => 'resolvedDate',
- 'type' => 'date',
- 'name' => '解决日期',
- 'default' => array('begin' => '', 'end' => '')
- )
- ),
- 'fields' => array
- (
- 'id' => array('name' => 'Bug编号', 'object' => 'bug', 'field' => 'id', 'type' => 'number'),
- 'resolution' => array('name' => '解决方案', 'object' => 'bug', 'field' => 'resolution', 'type' => 'option'),
- 'resolvedDate' => array('name' => '解决日期', 'object' => 'bug', 'field' => 'resolvedDate', 'type' => 'date')
- ),
- 'langs' => array
- (
- 'id' => array('zh-cn' => 'Bug编号', 'zh-tw' => '', 'en' => 'Bug ID', 'de' => '', 'fr' => ''),
- 'resolution' => array('zh-cn' => '解决方案', 'zh-tw' => '', 'en' => 'Resolution', 'de' => '', 'fr' => ''),
- 'resolvedDate' => array('zh-cn' => '解决日期', 'zh-tw' => '', 'en' => 'Resolved Date', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 20002,
- 'name' => '活跃账号情况-活跃账号数项目间对比',
- 'code' => 'activeAccount_projectCompare',
- 'dimension' => '1',
- 'type' => 'table',
- 'group' => '62',
- 'sql' => <<<EOT
- SELECT t1.id, t1.name, t1.year, t1.month, t1.totalAccount, ifnull(t2.activeAccount,0) as activeAccount, ifnull(concat(truncate(t2.activeAccount/t1.totalAccount*100,2),'%'), 0) as ratio
- FROM (
- select t1.id, t1.name, t3.year, t3.month, count(distinct t2.`account`) as totalAccount
- from zt_project as t1
- left join zt_team as t2 on t1.id = t2.root
- left join (
- SELECT DISTINCT YEAR(`date`) AS `year`, MONTH(`date`) AS `month`, cast(`date` as DATE) as date
- FROM zt_action
- ) as t3 on t2.`join` <= t3.date
- left join zt_user as t4 on t2.account = t4.account
- where t1.type = 'project'
- and t4.deleted = '0'
- group by t1.id, t3.year, t3.month
- ) AS t1 LEFT JOIN (
- SELECT t1.id, t1.name, t4.year,t4.month, COUNT(DISTINCT t3.id) AS activeAccount
- FROM
- zt_project AS t1
- LEFT JOIN zt_team AS t2 ON t1.id = t2.root
- LEFT JOIN zt_user AS t3 ON t2.account = t3.account
- LEFT JOIN (
- SELECT objectID, YEAR(date) AS `year`, MONTH(date) AS month, cast(`date` as DATE) as date
- FROM zt_action
- WHERE objectType = 'user' AND action = 'login'
- ) AS t4 ON t3.id = t4.objectID and t2.`join` <= t4.date
- WHERE
- t3.deleted = '0' AND t1.type = 'project'
- GROUP BY t1.id, t4.year, t4.month
- ) AS t2 ON t1.year = t2.year AND t1.month = t2.month AND t1.id = t2.id
- ORDER BY t2.activeAccount DESC LIMIT 999999
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'name', 'valOrAgg' => 'value', 'name' => '项目'),
- array('field' => 'activeAccount', 'valOrAgg' => 'value', 'name' => '活跃账号数'),
- array('field' => 'totalAccount', 'valOrAgg' => 'value', 'name' => '团队账号数'),
- array('field' => 'ratio', 'valOrAgg' => 'value', 'name' => '活跃账号比')
- ),
- 'filter' => array()
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 20003,
- 'name' => '活跃账号情况-公司账号日活跃度趋势',
- 'code' => 'activeAccount_activeTendency',
- 'dimension' => '1',
- 'type' => 'line',
- 'group' => '56',
- 'sql' => <<<EOT
- SELECT YEAR(t2.date) AS `year`, MONTH(t2.date) AS month, DAY(t2.date) AS day, COUNT(DISTINCT t1.account) AS count FROM zt_user AS t1
- LEFT JOIN zt_action AS t2 ON t1.account = t2.actor
- WHERE t2.objectType = 'user' AND t2.action = 'login'
- GROUP BY YEAR(t2.date), MONTH(t2.date), DAY(t2.date)
- EOT
- ,
- 'settings' => array
- (
- 'xaxis' => array
- (
- array('field' => 'day', 'name' => '日期', 'group' => 'value')
- ),
- 'yaxis' => array
- (
- array('type' => 'value', 'field' => 'count', 'agg' => 'value', 'name' => '数量', 'valOrAgg' => 'value')
- )
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 20004,
- 'name' => '应用数据-活跃产品数',
- 'code' => 'appData_activeProduct',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '47',
- 'sql' => <<<EOT
- select count(distinct REPLACE(product, ',', '')) as count, year(date) as `year`, month(date) as month
- from zt_action
- where objectType not in ('project','execution','task')
- and product != ',0,'
- and product != ','
- and product != ''
- group by year(date), month(date)
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'value', 'field' => 'count', 'agg' => 'value'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 20005,
- 'name' => '应用数据-本月新增产品数',
- 'code' => 'appData_createdProductCount',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '47',
- 'sql' => <<<EOT
- SELECT DISTINCT YEAR(createdDate) AS `year`, MONTH(createdDate) AS month, count(id) as count FROM zt_product
- WHERE deleted = '0' AND shadow = '0'
- GROUP BY YEAR(createdDate), MONTH(createdDate)
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'value', 'field' => 'count', 'agg' => 'value'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 20006,
- 'name' => '应用数据-本月新增产品名',
- 'code' => 'appData_createdProductName',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '47',
- 'sql' => <<<EOT
- SELECT DISTINCT GROUP_CONCAT(name) AS name, YEAR(createdDate) AS `year`, MONTH(createdDate) AS month FROM zt_product
- WHERE deleted = '0' AND shadow = '0'
- GROUP BY YEAR(createdDate), MONTH(createdDate)
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'text', 'field' => 'name', 'agg' => 'value'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 20007,
- 'name' => '应用数据-活跃项目数',
- 'code' => 'appData_activeProject',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '46',
- 'sql' => <<<EOT
- select year(date) as `year`, month(date) as month, count(distinct project) as count
- from zt_action
- where project != 0
- group by year(date), month(date)
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'value', 'field' => 'count', 'agg' => 'value'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 20008,
- 'name' => '应用数据-本月新增项目数',
- 'code' => 'appData_createdProjectCount',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '46',
- 'sql' => <<<EOT
- SELECT COUNT(id) as count, YEAR(openedDate) AS `year`, MONTH(openedDate) AS month FROM zt_project
- WHERE deleted = '0' AND type = 'project'
- GROUP BY YEAR(openedDate), MONTH(openedDate)
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'value', 'field' => 'count', 'agg' => 'value'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 20009,
- 'name' => '应用数据-本月新增项目名 ',
- 'code' => 'appData_createdProjectName',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '46',
- 'sql' => <<<EOT
- SELECT DISTINCT GROUP_CONCAT(name) AS name, YEAR(openedDate) AS `year`, MONTH(openedDate) AS month FROM zt_project
- WHERE deleted = '0' AND type = 'project'
- GROUP BY YEAR(openedDate), MONTH(openedDate)
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'text', 'field' => 'name', 'agg' => 'value'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 20010,
- 'name' => '应用数据-项目任务概况表',
- 'code' => 'appData_projectTaskOverview',
- 'dimension' => '1',
- 'type' => 'table',
- 'group' => '60',
- 'sql' => <<<EOT
- SELECT
- t1.name,
- t4.year,
- t4.month,
- t1.createdTasks,
- t2.finishedTasks,
- t3.contributors
- FROM
- (
- select distinct year(date) as `year`, month(date) as month
- from zt_action
- ) as t4
- left join
- (
- SELECT
- t1.id,
- t1.NAME,
- YEAR ( t2.openedDate ) AS YEAR,
- MONTH ( t2.openedDate ) AS MONTH,
- COUNT( t2.id ) AS createdTasks
- FROM
- zt_project AS t1
- LEFT JOIN zt_task AS t2 ON t1.id = t2.project
- WHERE
- t1.type = 'project'
- GROUP BY
- t1.id,
- YEAR ( t2.openedDate ),
- MONTH ( t2.openedDate )
- ) AS t1 on t4.year = t1.year and t4.month = t1.month
- LEFT JOIN (
- SELECT
- t1.id,
- t1.NAME,
- YEAR ( t2.finishedDate ) AS YEAR,
- MONTH ( t2.finishedDate ) AS MONTH,
- COUNT( t2.id ) AS finishedTasks
- FROM
- zt_project AS t1
- LEFT JOIN zt_task AS t2 ON t1.id = t2.project
- WHERE
- t1.type = 'project'
- AND t2.finishedDate IS NOT NULL
- GROUP BY
- t1.id,
- YEAR ( t2.finishedDate ),
- MONTH ( t2.finishedDate )
- ) AS t2 ON t1.id = t2.id
- AND t4.YEAR = t2.YEAR
- AND t4.MONTH = t2.
- MONTH LEFT JOIN (
- SELECT
- t1.id,
- t1.NAME,
- YEAR ( t3.date ) AS YEAR,
- MONTH ( t3.date ) AS MONTH,
- COUNT( DISTINCT t3.actor ) AS CONTRIBUTORS
- FROM
- zt_project AS t1
- LEFT JOIN zt_task AS t2 ON t1.id = t2.project
- LEFT JOIN zt_action AS t3 ON t2.id = t3.objectID
- WHERE
- t1.type = 'project'
- AND t3.objectType = 'task'
- AND t3.action IN ( 'opened', 'closed', 'finished', 'canceled', 'assigned' )
- GROUP BY
- t1.id,
- YEAR ( t3.date ),
- MONTH ( t3.date )
- ) AS t3 ON t1.id = t3.id
- AND t4.YEAR = t3.YEAR
- AND t4.MONTH = t3.MONTH
- order by t1.id,t4.year
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'name', 'valOrAgg' => 'value', 'name' => '项目'),
- array('field' => 'createdTasks', 'valOrAgg' => 'value', 'name' => '新增任务数'),
- array('field' => 'contributors', 'valOrAgg' => 'value', 'name' => '新增任务人数'),
- array('field' => 'finishedTasks', 'valOrAgg' => 'value', 'name' => '完成任务数')
- ),
- 'filter' => array()
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 20011,
- 'name' => '应用数据-产品测试表',
- 'code' => 'appData_productTest',
- 'dimension' => '1',
- 'type' => 'table',
- 'group' => '63',
- 'sql' => <<<EOT
- SELECT * FROM
- (
- SELECT
- t1.name,
- t6.year,
- t6.month,
- IFNULL(t5.createdCases, 0) AS createdCases,
- IFNULL(t4.relativedBugs / t5.createdCases, 0) AS avgBugsOfCase,
- IFNULL(t1.createdBugs, 0) AS createdBugs,
- IFNULL(t2.fixedBugs, 0) AS fixedBugs,
- IFNULL(t3.fixedCycle / t2.fixedBugs, 0) AS avgFixedCycle
- FROM
- (
- select distinct year(date) as `year`, month(date) as month
- from zt_action
- ) AS t6 left join
- (
- SELECT
- t1.id,
- t1.NAME,
- YEAR ( t2.openedDate ) AS YEAR,
- MONTH ( t2.openedDate ) AS MONTH,
- COUNT( t2.id ) AS createdBugs
- FROM
- zt_product AS t1
- LEFT JOIN zt_bug AS t2 ON t1.id = t2.product
- WHERE
- t1.deleted = '0'
- AND t2.deleted = '0'
- GROUP BY
- t1.id,
- YEAR ( t2.openedDate ),
- MONTH ( t2.openedDate )
- ) AS t1 on t1.year = t6.year AND t1.month = t6.month
- LEFT JOIN (
- SELECT
- t1.id,
- t1.NAME,
- YEAR ( t2.resolvedDate ) AS YEAR,
- MONTH ( t2.resolvedDate ) AS MONTH,
- COUNT( t2.id ) AS fixedBugs
- FROM
- zt_product AS t1
- LEFT JOIN zt_bug AS t2 ON t1.id = t2.product
- WHERE
- t1.deleted = '0'
- AND t2.deleted = '0'
- AND t2.`status` = 'closed'
- AND t2.resolution = 'fixed'
- GROUP BY
- t1.id,
- YEAR ( t2.resolvedDate ),
- MONTH ( t2.resolvedDate )
- ) AS t2 ON t1.id = t2.id
- AND t6.YEAR = t2.YEAR
- AND t6.MONTH = t2.MONTH
- LEFT JOIN (
- SELECT
- t1.id,
- t1.NAME,
- YEAR ( t2.resolvedDate ) AS YEAR,
- MONTH ( t2.resolvedDate ) AS MONTH,
- SUM( DATEDIFF( t2.resolvedDate, t2.openedDate ) ) AS fixedCycle
- FROM
- zt_product AS t1
- LEFT JOIN zt_bug AS t2 ON t1.id = t2.product
- WHERE
- t1.deleted = '0'
- AND t2.deleted = '0'
- AND t2.`status` = 'closed'
- AND t2.resolution = 'fixed'
- GROUP BY
- t1.id,
- YEAR ( t2.resolvedDate ),
- MONTH ( t2.resolvedDate )
- ) AS t3 ON t1.id = t3.id
- AND t6.YEAR = t3.YEAR
- AND t6.MONTH = t3.
- MONTH LEFT JOIN (
- SELECT
- t1.id,
- t1.NAME,
- YEAR ( t2.openedDate ) AS YEAR,
- MONTH ( t2.openedDate ) AS MONTH,
- COUNT( t3.id ) AS relativedBugs
- FROM
- zt_product AS t1
- LEFT JOIN zt_case AS t2 ON t1.id = t2.product
- LEFT JOIN zt_bug AS t3 ON t2.id = t3.`case`
- WHERE
- t2.id IS NOT NULL
- AND t3.id IS NOT NULL
- AND t1.deleted = '0'
- AND t2.deleted = '0'
- AND t3.deleted = '0'
- GROUP BY
- t1.id,
- YEAR ( t2.openedDate ),
- MONTH ( t2.openedDate )
- ) AS t4 ON t1.id = t4.id
- AND t6.YEAR = t4.YEAR
- AND t6.MONTH = t4.
- MONTH LEFT JOIN (
- SELECT
- t1.id,
- t1.NAME,
- YEAR ( t2.openedDate ) AS `YEAR`,
- MONTH ( t2.openedDate ) AS MONTH,
- COUNT( t2.id ) AS createdCases
- FROM
- zt_product AS t1
- LEFT JOIN zt_case AS t2 ON t1.id = t2.product
- WHERE
- t1.deleted = '0'
- AND t2.deleted = '0'
- GROUP BY
- t1.id,
- YEAR ( t2.openedDate ),
- MONTH ( t2.openedDate )
- ) AS t5 ON t1.id = t5.id
- AND t6.YEAR = t5.YEAR
- AND t6.MONTH = t5.MONTH
- ) AS t WHERE t.name IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'name', 'valOrAgg' => 'value', 'name' => '产品'),
- array('field' => 'createdCases', 'valOrAgg' => 'value', 'name' => '新增用例数'),
- array('field' => 'avgBugsOfCase', 'valOrAgg' => 'value', 'name' => '用例平均Bug数'),
- array('field' => 'createdBugs', 'valOrAgg' => 'value', 'name' => '新增Bug数'),
- array('field' => 'fixedBugs', 'valOrAgg' => 'value', 'name' => '修复Bug数'),
- array('field' => 'avgFixedCycle', 'valOrAgg' => 'value', 'name' => 'Bug平均修复周期')
- ),
- 'filter' => array()
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 20012,
- 'name' => '应用数据-产品需求概况表',
- 'code' => 'appData_productStoryOverview',
- 'dimension' => '1',
- 'type' => 'table',
- 'group' => '63',
- 'sql' => <<<EOT
- SELECT * FROM
- (
- SELECT
- t1.id,
- t1.name,
- t3.year,
- t3.month,
- IFNULL(t1.count, 0) AS createdStories,
- IFNULL(t2.count, 0) AS deliveredStories
- FROM
- (
- select distinct year(date) as `year`, month(date) as month
- from zt_action
- )
- as t3 left join
- (
- SELECT
- t2.id,
- t2.NAME,
- YEAR ( t1.openedDate ) AS YEAR,
- MONTH ( t1.openedDate ) AS MONTH,
- COUNT( t1.id ) AS count
- FROM
- zt_story AS t1
- LEFT JOIN zt_product AS t2 ON t1.product = t2.id
- WHERE
- t2.deleted = '0'
- AND t1.deleted = '0'
- AND t1.type = 'story'
- GROUP BY
- t2.id,
- YEAR,
- MONTH
- ) AS t1 on t3.year = t1.year and t3.month = t1.month
- LEFT JOIN (
- SELECT
- t1.id,
- t1.NAME,
- t1.YEAR,
- t1.MONTH,
- COUNT( distinct t1.story ) AS count
- FROM
- (
- SELECT
- t2.id,
- t2.NAME,
- YEAR ( t3.date ) AS YEAR,
- MONTH ( t3.date ) AS MONTH,
- t1.id AS story
- FROM
- zt_story AS t1
- LEFT JOIN zt_product AS t2 ON t1.product = t2.id
- LEFT JOIN ( SELECT objectID, MAX( date ) AS date FROM zt_action WHERE objectType = 'story' AND action = 'linked2release' GROUP BY objectID ) AS t3 ON t1.id = t3.objectID
- WHERE
- t1.deleted = '0'
- AND t2.deleted = '0'
- AND EXISTS ( SELECT 1 FROM zt_action WHERE objectID = t1.id AND objectType = 'story' AND action = 'linked2release' )
- UNION
- SELECT
- t2.id,
- t2.NAME,
- YEAR ( t1.closedDate ) AS YEAR,
- MONTH ( t1.closedDate ) AS MONTH,
- t1.id AS story
- FROM
- zt_story AS t1
- LEFT JOIN zt_product AS t2 ON t1.product = t2.id
- WHERE
- t1.deleted = '0'
- AND t2.deleted = '0'
- AND t1.status = 'closed'
- AND t1.closedReason = 'done'
- ) AS t1
- GROUP BY
- t1.id,
- t1.name,
- t1.YEAR,
- t1.MONTH order by id asc
- ) AS t2 ON t1.id = t2.id
- AND t3.YEAR = t2.YEAR
- AND t3.MONTH = t2.MONTH
- ) AS t
- WHERE t.name IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'name', 'valOrAgg' => 'value', 'name' => '产品'),
- array('field' => 'createdStories', 'valOrAgg' => 'value', 'name' => '新增研发需求数'),
- array('field' => 'deliveredStories', 'valOrAgg' => 'value', 'name' => '交付需求数')
- ),
- 'filter' => array()
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 20013,
- 'name' => '应用数据-项目需求概况表',
- 'code' => 'appData_projectStoryOverview',
- 'dimension' => '1',
- 'type' => 'table',
- 'group' => '60',
- 'sql' => <<<EOT
- SELECT * FROM (
- SELECT
- t1.id,
- t1.name,
- t3.year,
- t3.month,
- IFNULL(t1.count, 0) AS createdStories,
- IFNULL(t2.count, 0) AS deliveredStories
- FROM
- (
- select distinct year(date) as `year`, month(date) as month
- from zt_action
- )
- as t3 left join
- (
- SELECT
- t3.id,
- t3.NAME,
- YEAR ( t1.openedDate ) AS YEAR,
- MONTH ( t1.openedDate ) AS MONTH,
- COUNT( t1.id ) AS count
- FROM
- zt_story AS t1
- LEFT JOIN zt_projectstory AS t2 ON t1.id = t2.story
- LEFT JOIN zt_project AS t3 ON t2.project = t3.id
- WHERE
- t3.type = 'project'
- AND t1.deleted = '0'
- AND t3.deleted = '0'
- GROUP BY
- t3.id,
- YEAR,
- MONTH
- ) AS t1 on t1.year = t3.year and t1.month = t3.month
- LEFT JOIN (
- SELECT
- t1.id,
- t1.NAME,
- t1.YEAR,
- t1.MONTH,
- COUNT( t1.story ) AS count
- FROM
- (
- SELECT
- t3.id,
- t3.NAME,
- YEAR ( t4.date ) AS YEAR,
- MONTH ( t4.date ) AS MONTH,
- t1.id AS story
- FROM
- zt_story AS t1
- LEFT JOIN zt_projectstory AS t2 ON t1.id = t2.story
- LEFT JOIN zt_project AS t3 ON t2.project = t3.id
- LEFT JOIN ( SELECT objectID, MAX( date ) AS date FROM zt_action WHERE objectType = 'story' AND action = 'linked2release' GROUP BY objectID ) AS t4 ON t1.id = t4.objectID
- WHERE
- t3.type = 'project'
- AND t1.deleted = '0'
- AND t3.deleted = '0'
- AND EXISTS ( SELECT 1 FROM zt_action WHERE objectID = t1.id AND objectType = 'story' AND action = 'linked2release' ) UNION
- SELECT
- t3.id,
- t3.NAME,
- YEAR ( t1.closedDate ) AS YEAR,
- MONTH ( t1.closedDate ) AS MONTH,
- t1.id AS story
- FROM
- zt_story AS t1
- LEFT JOIN zt_projectstory AS t2 ON t1.id = t2.story
- LEFT JOIN zt_project AS t3 ON t2.project = t3.id
- WHERE
- t3.type = 'project'
- AND t1.STATUS = 'closed'
- AND t1.closedReason = 'done'
- AND t1.deleted = '0'
- AND t3.deleted = '0'
- ) AS t1
- GROUP BY
- t1.id,
- t1.name,
- t1.YEAR,
- t1.MONTH
- ) AS t2 ON t1.id = t2.id
- AND t3.YEAR = t2.YEAR
- AND t3.MONTH = t2.MONTH
- ) AS t WHERE t.id IS NOT NULL
- EOT
- ,
- 'settings' => array
- (
- 'group' => array(),
- 'column' => array
- (
- array('field' => 'name', 'valOrAgg' => 'value', 'name' => '项目'),
- array('field' => 'createdStories', 'valOrAgg' => 'value', 'name' => '新增研发需求数'),
- array('field' => 'deliveredStories', 'valOrAgg' => 'value', 'name' => '交付需求数')
- ),
- 'filter' => array()
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 20014,
- 'name' => '使用数据分析-当前版本',
- 'code' => 'appData_currentVersion',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '58',
- 'sql' => <<<EOT
- SELECT REPLACE(REPLACE(REPLACE(value, 'max', '旗舰版'), 'biz', '企业版'), 'pro', '专业版') as version FROM zt_config WHERE owner = 'system' AND module = 'common' AND section = 'global' AND `key` = 'version'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'value', 'field' => 'version', 'agg' => 'value'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 20015,
- 'name' => '使用数据分析-上线时间',
- 'code' => 'appData_onlineDate',
- 'dimension' => '1',
- 'type' => 'card',
- 'group' => '58',
- 'sql' => <<<EOT
- select `value` as date from zt_config where `owner` = 'system' and `key` = 'installedDate'
- EOT
- ,
- 'settings' => array
- (
- 'value' => array('type' => 'value', 'field' => 'date', 'agg' => 'value'),
- 'title' => array('type' => 'text', 'name' => ''),
- 'type' => 'value'
- ),
- 'filters' => array(),
- 'stage' => 'published',
- 'builtin' => '1'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 30000,
- 'name' => '流水线执行趋势图',
- 'code' => 'pipelineExecTrend',
- 'dimension' => '1',
- 'type' => 'line',
- 'group' => '103',
- 'sql' => <<<EOT
- SELECT
- base.YEARMONTH,
- base.`year`,
- CONCAT(base.`month`, '月') as `month`,
- CONCAT(base.`day`, '日') as `day`,
- IFNULL(compile_stats.execNum, 0) as execNum,
- IFNULL(compile_stats.successNum, 0) as successNum
- FROM (
- SELECT DISTINCT
- DATE_FORMAT(date, '%Y-%m-%d') as YEARMONTH,
- YEAR(date) as `year`,
- MONTH(date) as `month`,
- DAY(date) as `day`
- FROM zt_action
- WHERE date IS NOT NULL
- ) base
- LEFT JOIN (
- SELECT
- DATE_FORMAT(createdDate, '%Y-%m-%d') as YEARMONTH,
- YEAR(createdDate) as `year`,
- MONTH(createdDate) as `month`,
- DAY(createdDate) as `day`,
- COUNT(1) as execNum,
- SUM(CASE WHEN status = 'success' THEN 1 ELSE 0 END) as successNum
- FROM zt_compile
- WHERE deleted = '0'
- GROUP BY
- DATE_FORMAT(createdDate, '%Y-%m-%d'),
- YEAR(createdDate),
- MONTH(createdDate),
- DAY(createdDate)
- ) compile_stats ON base.YEARMONTH = compile_stats.YEARMONTH
- WHERE base.year > 0
- ORDER BY base.`year`, base.`month`, base.`day` LIMIT 999999;
- EOT
- ,
- 'settings' => array(
- array(
- 'type' => 'line',
- 'xaxis' => array(
- array('field' => 'YEARMONTH', 'name' => 'YEARMONTH', 'group' => '')
- ),
- 'yaxis' => array(
- array('field' => 'execNum', 'name' => 'execNum', 'valOrAgg' => 'sum'),
- array('field' => 'successNum', 'name' => 'successNum', 'valOrAgg' => 'sum')
- )
- ),
- ),
- 'filters' => array(),
- 'fields' => array(
- 'YEARMONTH' => array('name' => 'YEARMONTH', 'object' => 'compile', 'field' => 'YEARMONTH', 'type' => 'string'),
- 'year' => array('name' => 'year', 'object' => 'compile', 'field' => 'year', 'type' => 'number'),
- 'month' => array('name' => 'month', 'object' => 'compile', 'field' => 'month', 'type' => 'string'),
- 'day' => array('name' => 'day', 'object' => 'compile', 'field' => 'day', 'type' => 'string'),
- 'execNum' => array('name' => 'execNum', 'object' => 'compile', 'field' => 'execNum', 'type' => 'string'),
- 'successNum' => array('name' => 'successNum', 'object' => 'compile', 'field' => 'successNum', 'type' => 'number')
- ),
- 'langs' => array(
- 'YEARMONTH' => array('zh-cn' => '日期', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'month' => array('zh-cn' => '月份', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'day' => array('zh-cn' => '天', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'execNum' => array('zh-cn' => '执行总数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'successNum' => array('zh-cn' => '成功数量', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
- $config->bi->builtin->charts[] = array
- (
- 'id' => 30001,
- 'name' => '代码问题趋势图',
- 'code' => 'repoIssueTrend',
- 'dimension' => '1',
- 'type' => 'line',
- 'group' => '103',
- 'sql' => <<<EOT
- SELECT
- DATE_FORMAT(base_dates.date, '%Y-%m-%d') as YEARMONTH,
- YEAR(base_dates.date) as `year`,
- CONCAT(MONTH(base_dates.date), '月') as `month`,
- CONCAT(DAY(base_dates.date), '日') as `day`,
- IFNULL(new_bugs.bug_count, 0) as newIssue,
- IFNULL(resolved_bugs.bug_count, 0) as resolvedIssue
- FROM (
- SELECT DISTINCT DATE(date) as date
- FROM zt_action
- WHERE date IS NOT NULL
- ) base_dates
- LEFT JOIN (
- SELECT
- DATE(openedDate) as bug_date,
- COUNT(1) as bug_count
- FROM zt_bug
- WHERE repo > 0
- AND deleted = '0'
- GROUP BY DATE(openedDate)
- ) new_bugs ON base_dates.date = new_bugs.bug_date
- LEFT JOIN (
- SELECT
- DATE(resolvedDate) as bug_date,
- COUNT(1) as bug_count
- FROM zt_bug
- WHERE repo > 0
- AND deleted = '0'
- GROUP BY DATE(resolvedDate)
- ) resolved_bugs ON base_dates.date = resolved_bugs.bug_date
- WHERE YEAR(base_dates.date) > 0
- ORDER BY base_dates.date LIMIT 999999
- EOT
- ,
- 'settings' => array(
- array(
- 'type' => 'line',
- 'xaxis' => array(
- array('field' => 'YEARMONTH', 'name' => 'YEARMONTH', 'group' => '')
- ),
- 'yaxis' => array(
- array('field' => 'newIssue', 'name' => 'newIssue', 'valOrAgg' => 'sum'),
- array('field' => 'resolvedIssue', 'name' => 'resolvedIssue', 'valOrAgg' => 'sum')
- )
- ),
- ),
- 'filters' => array(),
- 'fields' => array (
- 'YEARMONTH' => array ('name' => 'YEARMONTH', 'object' => 'bug', 'field' => 'YEARMONTH', 'type' => 'string'),
- 'year' => array ('name' => 'year', 'object' => 'bug', 'field' => 'year', 'type' => 'number'),
- 'month' => array ('name' => 'month', 'object' => 'bug', 'field' => 'month', 'type' => 'string'),
- 'day' => array ('name' => 'day', 'object' => 'bug', 'field' => 'day', 'type' => 'string'),
- 'newIssue' => array ('name' => 'newIssue', 'object' => 'bug', 'field' => 'newIssue', 'type' => 'string'),
- 'resolvedIssue' => array ('name' => 'resolvedIssue', 'object' => 'bug', 'field' => 'resolvedIssue', 'type' => 'string')
- ),
- 'langs' => array(
- 'YEARMONTH' => array('zh-cn' => '日期', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'year' => array('zh-cn' => '年份', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'month' => array('zh-cn' => '月份', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'day' => array('zh-cn' => '天', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'newIssue' => array('zh-cn' => '新增问题数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
- 'resolvedIssue' => array('zh-cn' => '解决问题数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
- ),
- 'stage' => 'published',
- 'builtin' => '0'
- );
|