From 4282725162674ad994b84448f81b3e77015bd330 Mon Sep 17 00:00:00 2001 From: Alberto Nardella Date: Thu, 8 Oct 2020 16:22:53 +0200 Subject: [PATCH] Adding a new endpoint for experiment statistics --- .../2020_10_08_experiment_statistics_view.sql | 37 +++++++++++++++++++ ispyb-ejb/pom.xml | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 ispyb-ejb/db/scripts/ahead/2020_10_08_experiment_statistics_view.sql diff --git a/ispyb-ejb/db/scripts/ahead/2020_10_08_experiment_statistics_view.sql b/ispyb-ejb/db/scripts/ahead/2020_10_08_experiment_statistics_view.sql new file mode 100644 index 000000000..ba71584f6 --- /dev/null +++ b/ispyb-ejb/db/scripts/ahead/2020_10_08_experiment_statistics_view.sql @@ -0,0 +1,37 @@ +INSERT IGNORE INTO SchemaStatus (scriptName, schemaStatus) VALUES ('2020_10_08_experiment_statistics_view.sql', 'ONGOING'); + +CREATE + ALGORITHM = UNDEFINED + DEFINER = `pxadmin`@`%` + SQL SECURITY DEFINER +VIEW `v_mx_experiment_stats` AS + SELECT + `DC`.`startTime` AS `startTime`, + `DC`.`numberOfImages` AS `Images`, + `DC`.`transmission` AS `Transmission`, + `DC`.`resolution` AS `Res. (corner)`, + `DC`.`wavelength` AS `En. (Wave.)`, + `DC`.`omegaStart` AS `Omega start (total)`, + `DC`.`exposureTime` AS `Exposure Time`, + `DC`.`flux` AS `Flux`, + `DC`.`flux_end` AS `Flux End`, + `DC`.`detectorDistance` AS `Detector Distance`, + `DC`.`xBeam` AS `X Beam`, + `DC`.`yBeam` AS `Y Beam`, + `DC`.`kappaStart` AS `Kappa`, + `DC`.`phiStart` AS `Phi`, + `DC`.`axisStart` AS `Axis Start`, + `DC`.`axisEnd` AS `Axis End`, + `DC`.`axisRange` AS `Axis Range`, + `DC`.`beamSizeAtSampleX` AS `Beam Size X`, + `DC`.`beamSizeAtSampleY` AS `Beam Size Y`, + `BLS`.`beamLineName` AS `beamLineName`, + `DCG`.`comments` AS `comments`, + `P`.`proposalNumber` AS `proposalNumber` + FROM + (((`DataCollection` `DC` + JOIN `DataCollectionGroup` `DCG` ON ((`DCG`.`dataCollectionGroupId` = `DC`.`dataCollectionGroupId`))) + JOIN `BLSession` `BLS` ON ((`BLS`.`sessionId` = `DCG`.`sessionId`))) + JOIN `Proposal` `P` ON ((`P`.`proposalId` = `BLS`.`proposalId`))) + +UPDATE SchemaStatus SET schemaStatus = 'DONE' WHERE scriptName = '2020_10_08_experiment_statistics_view.sql'; \ No newline at end of file diff --git a/ispyb-ejb/pom.xml b/ispyb-ejb/pom.xml index ac08cda2b..031e1be72 100644 --- a/ispyb-ejb/pom.xml +++ b/ispyb-ejb/pom.xml @@ -479,7 +479,7 @@ LDAP database - ldaps://srv-ad-2.maxiv.lu.se/ + ldaps://adauth.maxiv.lu.se/ dc=maxlab,dc=lu,dc=se dc=maxlab,dc=lu,dc=se samaccountname