Commit 4c9a1e33 authored by PECQUOT's avatar PECQUOT

[enh] New extraction perform service using xmlQuery (version 1.1+) (Mantis #49970)

[enh] Pmfmu labels are transcribed with specific label for extraction, if exists, or with "screen" label (Mantis #50725)
Signed-off-by: PECQUOT's avatarlp1ee9d <ludovic.pecquot@e-is.pro>
parent e7166511
## Sprint 83 - v3.9.2
- Pas de mise à jour de modèle
- Une nouvelle option a été ajoutée pour gérer les transcodages des référentiels suivant :
reefdb.transcribingItemType.label.pmfmExtraction
Sa valeur par défaut est `REEFDB-PMFM.PMFM_EXTRACTION`. Couplée avec l'option `reefdb.transcribingItemType.label.pmfmNm`, elle permet de transcoder les libellé des PSFMU lors des extractions avec la priorité suivante:
1- libellé transcodé pour extraction
2- libellé transcodé pour écran de saisie
3- libellé interne du psfmu (issu du transcodage pour écran de saisie)
4- libellé du paramètre
- Pour simplifier la configuration du serveur de synchronisation, l'option `quadrige3.synchro.import.referential.transcribingItemType.label.includes`
qui doit contenir tous les libellés des types de transcodage à importer, accepte désormais le caractère '%'.
quadrige3.synchro.import.referential.transcribingItemType.label.includes=REEFDB% (tous les types de transcodage commençant par REEFDB seront importés)
## Sprint 82 - v3.9.1
- Pas de mise à jour de modèle
## Sprint 81 - v3.9.0
- Pas de mise à jour de modèle
......
......@@ -10,7 +10,7 @@
<groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId>
<version>3.9.1</version>
<version>3.9.2-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Reef DB</name>
......@@ -171,8 +171,8 @@
<maven.compiler.debug>true</maven.compiler.debug>
<!-- Quadrige3 Core version -->
<quadrige3-core.version>3.6.5</quadrige3-core.version>
<!-- <quadrige3-core.version>3.6.6-SNAPSHOT</quadrige3-core.version>-->
<!-- <quadrige3-core.version>3.6.5</quadrige3-core.version>-->
<quadrige3-core.version>3.6.6-SNAPSHOT</quadrige3-core.version>
<!-- Last ReefDb launcher version -->
<launcherVersion>3.0.3</launcherVersion>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId>
<version>3.9.1</version>
<version>3.9.2-SNAPSHOT</version>
</parent>
<artifactId>reefdb-core</artifactId>
......
......@@ -967,6 +967,10 @@ public final class ReefDbConfiguration extends QuadrigeCoreConfiguration {
return applicationConfig.getOption(ReefDbConfigurationOption.TRANSCRIBING_ITEM_TYPE_LB_PMFM_NM.getKey());
}
public String getTranscribingItemTypeLbForPmfmExtraction() {
return applicationConfig.getOption(ReefDbConfigurationOption.TRANSCRIBING_ITEM_TYPE_LB_PMFM_EXTRACTION.getKey());
}
/**
* <p>getAlternativeTaxonOriginTaxRef.</p>
*
......
......@@ -24,7 +24,6 @@ package fr.ifremer.reefdb.config;
*/
import fr.ifremer.quadrige3.core.dao.referential.UnitId;
import fr.ifremer.quadrige3.core.dao.referential.transcribing.TranscribingItemTypeLb;
import fr.ifremer.quadrige3.core.dao.technical.QuadrigeEnumerationDef;
import org.nuiton.config.ConfigOptionDef;
import org.nuiton.version.Version;
......@@ -303,7 +302,13 @@ public enum ReefDbConfigurationOption implements ConfigOptionDef {
TRANSCRIBING_ITEM_TYPE_LB_PMFM_NM(
"reefdb.transcribingItemType.label.pmfmNm",
n("reefdb.config.option.transcribingItemType.label.pmfmNm.description"),
String.format("${%s}", TranscribingItemTypeLb.REEFDB_PMFM_NM.getKey()), // 1
String.format("${%s%s}", QuadrigeEnumerationDef.CONFIG_OPTION_PREFIX, "TranscribingItemTypeLb.REEFDB_PMFM_NM"),
String.class,
false),
TRANSCRIBING_ITEM_TYPE_LB_PMFM_EXTRACTION(
"reefdb.transcribingItemType.label.pmfmExtraction",
n("reefdb.config.option.transcribingItemType.label.pmfmExtraction.description"),
String.format("${%s%s}", QuadrigeEnumerationDef.CONFIG_OPTION_PREFIX, "TranscribingItemTypeLb.REEFDB_PMFM_EXTRACTION"),
String.class,
false),
/* constants used to calculate transition length */
......
......@@ -24,6 +24,7 @@ package fr.ifremer.reefdb.dao.system.extraction;
*/
import fr.ifremer.quadrige3.core.dao.technical.csv.CSVDao;
import fr.ifremer.reefdb.dto.referential.pmfm.PmfmDTO;
import org.springframework.jdbc.core.RowMapper;
import java.util.List;
......@@ -91,4 +92,10 @@ public interface ReefDbExtractionResultDao extends CSVDao {
* @return a int.
*/
int queryUpdate(String query, Map<String, Object> queryBindings);
String getPmfmNameForExtraction(PmfmDTO pmfm);
String getPmfmUnitNameForExtraction(PmfmDTO pmfm);
}
......@@ -23,7 +23,11 @@ package fr.ifremer.reefdb.dao.system.extraction;
* #L%
*/
import fr.ifremer.quadrige3.core.dao.referential.transcribing.TranscribingItemExtendDao;
import fr.ifremer.quadrige3.core.dao.technical.Assert;
import fr.ifremer.quadrige3.core.dao.technical.csv.CSVDaoImpl;
import fr.ifremer.reefdb.config.ReefDbConfiguration;
import fr.ifremer.reefdb.dto.referential.pmfm.PmfmDTO;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -32,9 +36,11 @@ import org.springframework.dao.DataRetrievalFailureException;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import javax.sql.DataSource;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Properties;
/**
......@@ -50,6 +56,12 @@ public class ReefDbExtractionResultDaoImpl extends CSVDaoImpl implements ReefDbE
protected final Properties connectionProperties;
@Resource
protected ReefDbConfiguration config;
@Resource(name = "transcribingItemDao")
private TranscribingItemExtendDao transcribingItemDao;
/**
* <p>Constructor for ReefDbExtractionResultDaoImpl.</p>
*
......@@ -114,6 +126,25 @@ public class ReefDbExtractionResultDaoImpl extends CSVDaoImpl implements ReefDbE
return queryUpdate(connectionProperties, query, paramMap);
}
@Override
public String getPmfmNameForExtraction(PmfmDTO pmfm) {
Assert.notNull(pmfm);
return Optional
.ofNullable(transcribingItemDao.getTranscribingItemById(config.getTranscribingItemTypeLbForPmfmExtraction(), pmfm.getId()))
.orElse(
Optional.ofNullable(transcribingItemDao.getTranscribingItemById(config.getTranscribingItemTypeLbForPmfmNm(), pmfm.getId()))
.orElse(
Optional.ofNullable(pmfm.getName())
.orElse(pmfm.getParameter().getName())
)
); }
@Override
public String getPmfmUnitNameForExtraction(PmfmDTO pmfm) {
Assert.notNull(pmfm);
return pmfm.getUnit() == null || config.getExtractionUnitIdsToIgnore().contains(pmfm.getUnit().getId()) ? "" : pmfm.getUnit().getName();
}
/**
* {@inheritDoc}
*/
......
......@@ -287,6 +287,7 @@ public class DecoratorServiceImpl extends fr.ifremer.quadrige3.core.service.deco
}
}
@Deprecated
private class PMFMExtractionDecorator extends PMFMNameDecorator {
static final String SEPARATOR = "-";
......
......@@ -291,6 +291,7 @@ reefdb.service.common.progression=%s \: traitement de %s/%s
reefdb.service.control=Contrôle
reefdb.service.controlRule.invalid.message=La règle de contrôle '%s' n'est pas respectée
reefdb.service.extraction.error=Une erreur s'est produite lors de l'extration.
reefdb.service.extraction.fieldName.CAMPAIGN_NM=${reefdb.service.extraction.fieldNamePrefix.SURVEY}_Campagne
reefdb.service.extraction.fieldName.INPUT_TAXON_NAME_ID=
reefdb.service.extraction.fieldName.INPUT_TAXON_NAME_NM=
reefdb.service.extraction.fieldName.MEAS_ANALYST_NM=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Organisme_analyste
......@@ -298,6 +299,9 @@ reefdb.service.extraction.fieldName.MEAS_CM=${reefdb.service.extraction.fieldNam
reefdb.service.extraction.fieldName.MEAS_DEP_NM=
reefdb.service.extraction.fieldName.MEAS_IDS=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Identifiants_interne_MEAS_ID
reefdb.service.extraction.fieldName.MEAS_INDIV_ID=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Numero_individu
reefdb.service.extraction.fieldName.MEAS_QUALIF_CM=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Commentaire_Qualif
reefdb.service.extraction.fieldName.MEAS_QUALIF_DT=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Date_Qualif
reefdb.service.extraction.fieldName.MEAS_QUAL_FLAG_NM=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Niveau_qualite
reefdb.service.extraction.fieldName.MON_LOC_ID=${reefdb.service.extraction.fieldNamePrefix.MON_LOC}_Identifiant
reefdb.service.extraction.fieldName.MON_LOC_LB=${reefdb.service.extraction.fieldNamePrefix.MON_LOC}_Mnemonique
reefdb.service.extraction.fieldName.MON_LOC_NM=Station
......@@ -334,6 +338,7 @@ reefdb.service.extraction.fieldName.SAMPLING_OPER_SIZE_UNIT_SYMBOL=${reefdb.serv
reefdb.service.extraction.fieldName.SAMPLING_OPER_TIME=${reefdb.service.extraction.fieldNamePrefix.SAMPLING_OPER}_Heure
reefdb.service.extraction.fieldName.SAMPLING_OPER_VALID_DT=${reefdb.service.extraction.fieldNamePrefix.SAMPLING_OPER}_Date_validation
reefdb.service.extraction.fieldName.SURVEY_BOTTOM_DEPTH=${reefdb.service.extraction.fieldNamePrefix.SURVEY}_Profondeur_precise
reefdb.service.extraction.fieldName.SURVEY_BOTTOM_DEPTH_UNIT_SYMBOL=${reefdb.service.extraction.fieldNamePrefix.SURVEY}_Profondeur_precise_Symbole_unite
reefdb.service.extraction.fieldName.SURVEY_CM=${reefdb.service.extraction.fieldNamePrefix.SURVEY}_Commentaire
reefdb.service.extraction.fieldName.SURVEY_CONTROL_DT=${reefdb.service.extraction.fieldNamePrefix.SURVEY}_Date_controle
reefdb.service.extraction.fieldName.SURVEY_DT=Date
......
......@@ -43,6 +43,7 @@ pmfmId.PIT_ORIGIN=2326
UnitId.NO_UNIT=99
TranscribingItemTypeLb.REEFDB_PMFM_NM=REEFDB-PMFM.PMFM_NM
TranscribingItemTypeLb.REEFDB_PMFM_EXTRACTION=REEFDB-PMFM.PMFM_EXTRACTION
############################################
# Alternative Taxon Code #
......
......@@ -58,13 +58,14 @@
<select alias="SURVEY_QUSERS" type="text" group="simple,complete,sinp">GROUP_CONCAT(Q.QUSER_FIRST_NM || ' ' || Q.QUSER_LAST_NM || ' - ' || QD.DEP_NM SEPARATOR '|')</select>
<select alias="SURVEY_QUSERS" type="text" group="pampa">GROUP_CONCAT(Q.QUSER_FIRST_NM || ' ' || Q.QUSER_LAST_NM separator '|')</select>
<select alias="SAMPLING_OPER_SIZE" type="number">SO.SAMPLING_OPER_SIZE</select>
<select alias="SAMPLING_OPER_SIZE_UNIT_SYMBOL" type="text">SOU.UNIT_SYMBOL</select>
<select alias="SAMPLING_OPER_SIZE_UNIT_SYMBOL" type="text">SOSU.UNIT_SYMBOL</select>
<select alias="SAMPLING_EQUIPMENT_NM" type="text">SE.SAMPLING_EQUIPMENT_NM</select>
<select alias="SAMPLING_OPER_DEP_NM" type="text">SOD.DEP_NM</select>
<!-- Complete only part-->
<select alias="ORDER_ITEM_TYPE_NM" type="text" group="complete">MLOI.ORDER_ITEM_TYPE_NM</select>
<select alias="ORDER_ITEM_CD" type="text" group="complete">MLOI.ORDER_ITEM_CD</select>
<select alias="MON_LOC_ORDER_ITEM_NUMBER" type="number" group="complete">MLOI.MON_LOC_ORDER_ITEM_NUMBER</select>
<!-- todo check this format <select alias="SURVEY_TIME" type="text">TO_CHAR(DATEADD('second', S.SURVEY_TIME, TIMESTAMP '2000-01-01 00:00:00'), 'HH24:MI')</select>-->
<select alias="SURVEY_TIME" type="text" group="complete">S.SURVEY_TIME</select>
<select alias="SURVEY_CM" type="text" group="complete">S.SURVEY_CM</select>
<select alias="SURVEY_CONTROL_DT" type="date" group="complete">S.SURVEY_CONTROL_DT</select>
......@@ -73,15 +74,16 @@
<select alias="SURVEY_QUALIF_DT" type="date" group="complete">S.SURVEY_QUALIF_DT</select>
<select alias="SURVEY_QUALIF_CM" type="text" group="complete">S.SURVEY_QUALIF_CM</select>
<select alias="SURVEY_INHERITED_POSITION" type="text" group="complete">CASEWHEN(IFNULL(S.SURVEY_ACTUAL_POSITION,'0')='0','1','0')</select>
<!-- todo check format <select alias="SAMPLING_OPER_TIME" type="number">TO_CHAR(DATEADD('second', SO.SAMPLING_OPER_TIME, TIMESTAMP '2000-01-01 00:00:00'), 'HH24:MI')</select>-->
<select alias="SURVEY_BOTTOM_DEPTH" type="number" group="complete">S.SURVEY_BOTTOM_DEPTH</select>
<select alias="SURVEY_BOTTOM_DEPTH_UNIT_SYMBOL" type="number" group="complete">SBDU.UNIT_SYMBOL</select>
<select alias="SAMPLING_OPER_TIME" type="number" group="complete,pampa">SO.SAMPLING_OPER_TIME</select>
<select alias="SURVEY_BOTTOM_DEPTH" type="number" group="pampa">S.SURVEY_BOTTOM_DEPTH</select>
<select alias="SAMPLING_OPER_DEPTH" type="number" group="complete">SO.SAMPLING_OPER_DEPTH</select>
<select alias="SAMPLING_OPER_MIN_DEPTH" type="number" group="complete">SO.SAMPLING_OPER_MIN_DEPTH</select>
<select alias="SAMPLING_OPER_MAX_DEPTH" type="number" group="complete">SO.SAMPLING_OPER_MAX_DEPTH</select>
<select alias="SAMPLING_OPER_INHERITED_POSITION" type="text" group="complete">CASEWHEN(IFNULL(SO.SAMPLING_OPER_ACTUAL_POSITION,'0')='0','1','0')</select>
<select alias="SAMPLING_OPER_DEPTH_UNIT_SYMBOL" type="text" group="complete">DU.UNIT_SYMBOL</select>
<select alias="SAMPLING_OPER_DEPTH_UNIT" type="text" group="complete">DU.UNIT_NM</select>
<select alias="SAMPLING_OPER_DEPTH_UNIT_SYMBOL" type="text" group="complete">SODU.UNIT_SYMBOL</select>
<select alias="SAMPLING_OPER_DEPTH_UNIT" type="text" group="complete">SODU.UNIT_NM</select>
<select alias="SAMPLING_OPER_CM" type="text" group="complete">SO.SAMPLING_OPER_CM</select>
<select alias="SAMPLING_EQUIPMENT_SIZE" type="number" group="complete">SE.SAMPLING_EQUIPMENT_SIZE</select>
<select alias="SAMPLING_EQUIPMENT_SIZE_UNIT_SYMBOL" type="text" group="complete">SEU.UNIT_SYMBOL</select>
......@@ -107,10 +109,11 @@
<from join="true">LEFT OUTER JOIN SURVEY_QUSER SQ ON SQ.SURVEY_ID = S.SURVEY_ID</from>
<from join="true">LEFT OUTER JOIN QUSER Q ON Q.QUSER_ID = SQ.QUSER_ID</from>
<from join="true">LEFT OUTER JOIN DEPARTMENT QD ON QD.DEP_ID = Q.DEP_ID</from>
<from join="true">LEFT OUTER JOIN UNIT SOU ON SOU.UNIT_ID = SO.SAMPLING_OPER_SIZE_UNIT_ID</from>
<from join="true">LEFT OUTER JOIN UNIT SOSU ON SOSU.UNIT_ID = SO.SAMPLING_OPER_SIZE_UNIT_ID</from>
<from join="true" group="complete">LEFT OUTER JOIN QUALITY_FLAG SOQF ON SOQF.QUAL_FLAG_CD = SO.QUAL_FLAG_CD</from>
<from join="true" group="complete">LEFT OUTER JOIN UNIT SEU ON SE.UNIT_ID = SEU.UNIT_ID</from>
<from join="true" group="complete">LEFT OUTER JOIN UNIT DU ON DU.UNIT_ID = SO.SAMPLING_OPER_DEPTH_UNIT_ID</from>
<from join="true" group="complete">LEFT OUTER JOIN UNIT SODU ON SODU.UNIT_ID = SO.SAMPLING_OPER_DEPTH_UNIT_ID</from>
<from join="true" group="complete">LEFT OUTER JOIN UNIT SBDU ON SBDU.UNIT_ID = S.SURVEY_BOTTOM_DEPTH_UNIT_ID</from>
<from join="true" group="complete">LEFT OUTER JOIN SAMPLING_OPER_POINT SOP ON SOP.SAMPLING_OPER_ID = SO.SAMPLING_OPER_ID</from>
<where group="periodFilter"/>
......@@ -164,10 +167,9 @@
<groupby>MLOI.ORDER_ITEM_NM</groupby>
<groupby>SO.SAMPLING_OPER_ID</groupby>
<groupby>SO.SAMPLING_OPER_LB</groupby>
<groupby>TRIM(REGEXP_SUBSTRING(SP.SURVEY_POSITION, '[0-9.-]+'))</groupby>
<groupby>TRIM(TRIM(TRAILING ')' FROM REGEXP_SUBSTRING(SP.SURVEY_POSITION, '[0-9.-]+\)$')))</groupby>
<groupby>SP.SURVEY_POSITION</groupby>
<groupby>SO.SAMPLING_OPER_SIZE</groupby>
<groupby>SOU.UNIT_SYMBOL</groupby>
<groupby>SOSU.UNIT_SYMBOL</groupby>
<groupby>SE.SAMPLING_EQUIPMENT_NM</groupby>
<groupby>SOD.DEP_NM</groupby>
<groupby group="complete">MLOI.ORDER_ITEM_TYPE_NM</groupby>
......@@ -180,15 +182,17 @@
<groupby group="complete">SQF.QUAL_FLAG_NM</groupby>
<groupby group="complete">S.SURVEY_QUALIF_DT</groupby>
<groupby group="complete">S.SURVEY_QUALIF_CM</groupby>
<groupby group="complete">CASEWHEN(IFNULL(S.SURVEY_ACTUAL_POSITION,'0')='0','1','0')</groupby>
<groupby group="complete">S.SURVEY_ACTUAL_POSITION</groupby>
<groupby group="complete">S.SURVEY_BOTTOM_DEPTH</groupby>
<groupby group="complete">SBDU.UNIT_SYMBOL</groupby>
<groupby group="complete,pampa">SO.SAMPLING_OPER_TIME</groupby>
<groupby group="pampa">S.SURVEY_BOTTOM_DEPTH</groupby>
<groupby group="complete">SO.SAMPLING_OPER_DEPTH</groupby>
<groupby group="complete">SO.SAMPLING_OPER_MIN_DEPTH</groupby>
<groupby group="complete">SO.SAMPLING_OPER_MAX_DEPTH</groupby>
<groupby group="complete">CASEWHEN(IFNULL(SO.SAMPLING_OPER_ACTUAL_POSITION,'0')='0','1','0')</groupby>
<groupby group="complete">DU.UNIT_SYMBOL</groupby>
<groupby group="complete">DU.UNIT_NM</groupby>
<groupby group="complete">SO.SAMPLING_OPER_ACTUAL_POSITION</groupby>
<groupby group="complete">SODU.UNIT_SYMBOL</groupby>
<groupby group="complete">SODU.UNIT_NM</groupby>
<groupby group="complete">SO.SAMPLING_OPER_CM</groupby>
<groupby group="complete">SE.SAMPLING_EQUIPMENT_SIZE</groupby>
<groupby group="complete">SEU.UNIT_SYMBOL</groupby>
......@@ -198,8 +202,7 @@
<groupby group="complete">SOQF.QUAL_FLAG_NM</groupby>
<groupby group="complete">SO.SAMPLING_OPER_QUALIF_DT</groupby>
<groupby group="complete">SO.SAMPLING_OPER_QUALIF_CM</groupby>
<groupby group="complete">TRIM(REGEXP_SUBSTRING(SOP.SAMPLING_OPER_POSITION, '[0-9.-]+'))</groupby>
<groupby group="complete">TRIM(TRIM(TRAILING ')' FROM REGEXP_SUBSTRING(SOP.SAMPLING_OPER_POSITION, '[0-9.-]+\)$')))</groupby>
<groupby group="complete">SOP.SAMPLING_OPER_POSITION</groupby>
<orderby direction="ASC">S.SURVEY_ID</orderby>
......
......@@ -28,8 +28,9 @@
<select alias="SAMPLING_OPER_ID" type="number">RAW.SAMPLING_OPER_ID</select>
<select alias="MEAS_INDIV_ID" type="number">RAW.MEAS_INDIV_ID</select>
<select alias="REF_TAXON_NM" type="text">RAW.REF_TAXON_NM</select>
<select alias="TAXON_NAME_ID" type="number">RAW.TAXON_NAME_ID</select>
<select alias="TAXON_NAME_NM" type="text">RAW.TAXON_NAME_NM</select>
<select alias="TAXON_NAME_ID" type="number" group="simple,complete,sinp">RAW.TAXON_NAME_ID</select>
<select alias="TAXON_NAME_NM" type="text" group="simple,complete,sinp">RAW.TAXON_NAME_NM</select>
<select alias="TAXON_PAMPA" type="text" group="pampa">RAW.TAXON_PAMPA</select>
<select alias="TAXON_GROUP_NM" type="text">RAW.TAXON_GROUP_NM</select>
<from alias="RAW"><![CDATA[&rawTableName]]></from>
<where><![CDATA[RAW.MEAS_INDIV_ID IS NOT NULL]]></where>
......@@ -40,14 +41,15 @@
<subselect alias="SAMPLING_OPER_ID" type="number">RAW.SAMPLING_OPER_ID</subselect>
<subselect alias="MEAS_INDIV_ID" type="number">RAW.MEAS_INDIV_ID</subselect>
<subselect alias="REF_TAXON_NM" type="text">RAW.REF_TAXON_NM</subselect>
<subselect alias="TAXON_NAME_ID" type="number">RAW.TAXON_NAME_ID</subselect>
<subselect alias="TAXON_NAME_NM" type="text">RAW.TAXON_NAME_NM</subselect>
<subselect alias="TAXON_NAME_ID" type="number" group="simple,complete,sinp">RAW.TAXON_NAME_ID</subselect>
<subselect alias="TAXON_NAME_NM" type="text" group="simple,complete,sinp">RAW.TAXON_NAME_NM</subselect>
<subselect alias="TAXON_PAMPA" type="text" group="pampa">RAW.TAXON_PAMPA</subselect>
<subselect alias="TAXON_GROUP_NM" type="text">RAW.TAXON_GROUP_NM</subselect>
<from alias="RAW"><![CDATA[&rawTableName]]></from>
<where><![CDATA[RAW.MEAS_INDIV_ID IS NULL]]></where>
<where operator="AND"><![CDATA[NOT EXISTS (SELECT RAW2.SURVEY_ID FROM &rawTableName RAW2
WHERE RAW.SURVEY_ID = RAW2.SURVEY_ID
AND ((RAW.SAMPLING_OPER_ID IS NULL AND RAW2.SAMPLING_OPER_ID IS NULL) OR RAW.SAMPLING_OPER_ID = RAW2.SAMPLING_OPER_ID)
AND (RAW.SAMPLING_OPER_ID IS NULL OR RAW.SAMPLING_OPER_ID = RAW2.SAMPLING_OPER_ID)
AND RAW2.MEAS_INDIV_ID IS NOT NULL)]]></where>
</subquery>
</union>
......
......@@ -36,7 +36,7 @@
<select alias="MEAS_ID" type="number">MEAS_ID</select>
<select alias="TAXON_MEAS_ID" type="number">TAXON_MEAS_ID</select>
<select alias="MEAS_QUAL_FLAG_NM" type="text">MEAS_QUAL_FLAG_NM</select>
<select alias="MEAS_QUALIF_DT" type="date">MEAS_QUALIF_DT</select>
<select alias="MEAS_QUALIF_DT" type="text">TO_CHAR(MEAS_QUALIF_DT, 'DD/MM/YYYY')</select>
<select alias="MEAS_QUALIF_CM" type="text">MEAS_QUALIF_CM</select>
<from><![CDATA[&rawTableName]]></from>
......
......@@ -24,6 +24,15 @@
<query type="create" temp="false" table="&amp;rawTableName">
<with alias="ALT" group="pampa">
<subquery>
<subselect alias="TAXON_NAME_ID" type="number">TAXON_NAME_ID</subselect>
<subselect alias="ALTERN_TAXON_CD" type="number">ALTERN_TAXON_CD</subselect>
<from>ALTERNATIVE_TAXON</from>
<where><![CDATA[ALTERN_TAXON_ORIGIN_CD = '&alternativeTaxonOriginPampa']]></where>
</subquery>
</with>
<!-- BASE SELECT + SURVEY MEASUREMENTS-->
<select alias="SURVEY_ID" type="number">BASE.SURVEY_ID</select>
<select alias="SAMPLING_OPER_ID" type="number">NULL</select>
......@@ -33,8 +42,9 @@
<select alias="MEAS_INDIV_ID" type="number">SM.MEAS_INDIV_ID</select>
<select alias="REF_TAXON_ID" type="number">NULL</select>
<select alias="REF_TAXON_NM" type="text">NULL</select>
<select alias="TAXON_NAME_ID" type="number">NULL</select>
<select alias="TAXON_NAME_NM" type="text">NULL</select>
<select alias="TAXON_NAME_ID" type="number" group="simple,complete,sinp">NULL</select>
<select alias="TAXON_NAME_NM" type="text" group="simple,complete,sinp">NULL</select>
<select alias="TAXON_PAMPA" type="text" group="pampa">NULL</select>
<select alias="TAXON_GROUP_ID" type="number">NULL</select>
<select alias="TAXON_GROUP_NM" type="text">NULL</select>
<select alias="PMFM_ID" type="number">SM.PMFM_ID</select>
......@@ -64,8 +74,9 @@
<subselect alias="MEAS_INDIV_ID" type="number">STM.TAXON_MEAS_INDIV_ID</subselect>
<subselect alias="REF_TAXON_ID" type="number">TN.TAXON_NAME_ID</subselect>
<subselect alias="REF_TAXON_NM" type="text">TN.TAXON_NAME_COMPLETE_NM</subselect>
<subselect alias="TAXON_NAME_ID" type="number">STM.TAXON_NAME_ID</subselect> <!-- = INPUT_TAXON_ID -->
<subselect alias="TAXON_NAME_NM" type="text">STM.TAXON_NAME_NM</subselect> <!-- = INPUT_TAXON_NM -->
<subselect alias="TAXON_NAME_ID" type="number" group="simple,complete,sinp">STM.TAXON_NAME_ID</subselect> <!-- = INPUT_TAXON_ID -->
<subselect alias="TAXON_NAME_NM" type="text" group="simple,complete,sinp">STM.TAXON_NAME_NM</subselect> <!-- = INPUT_TAXON_NM -->
<subselect alias="TAXON_PAMPA" type="text" group="pampa">ALT.ALTERN_TAXON_CD</subselect>
<subselect alias="TAXON_GROUP_ID" type="number">TG.TAXON_GROUP_ID</subselect>
<subselect alias="TAXON_GROUP_NM" type="text">TG.TAXON_GROUP_NM</subselect>
<subselect alias="PMFM_ID" type="number">STM.PMFM_ID</subselect>
......@@ -85,6 +96,7 @@
<from join="true">LEFT OUTER JOIN TAXON_GROUP TG ON STM.TAXON_GROUP_ID = TG.TAXON_GROUP_ID</from>
<from join="true">LEFT OUTER JOIN TAXON_NAME TN ON STM.REF_TAXON_ID = TN.REF_TAXON_ID AND TN.TAXON_NAME_IS_REFER = 1</from>
<from join="true">LEFT OUTER JOIN QUALITY_FLAG QF ON QF.QUAL_FLAG_CD = STM.QUAL_FLAG_CD</from>
<from join="true" group="pampa">LEFT OUTER JOIN ALT ON ALT.TAXON_NAME_ID = TN.TAXON_NAME_ID</from>
</subquery>
</union>
......@@ -99,8 +111,9 @@
<subselect alias="MEAS_INDIV_ID" type="number">SOM.MEAS_INDIV_ID</subselect>
<subselect alias="REF_TAXON_ID" type="number">NULL</subselect>
<subselect alias="REF_TAXON_NM" type="text">NULL</subselect>
<subselect alias="TAXON_NAME_ID" type="number">NULL</subselect>
<subselect alias="TAXON_NAME_NM" type="text">NULL</subselect>
<subselect alias="TAXON_NAME_ID" type="number" group="simple,complete,sinp">NULL</subselect>
<subselect alias="TAXON_NAME_NM" type="text" group="simple,complete,sinp">NULL</subselect>
<subselect alias="TAXON_PAMPA" type="text" group="pampa">NULL</subselect>
<subselect alias="TAXON_GROUP_ID" type="number">NULL</subselect>
<subselect alias="TAXON_GROUP_NM" type="text">NULL</subselect>
<subselect alias="PMFM_ID" type="number">SOM.PMFM_ID</subselect>
......@@ -133,8 +146,9 @@
<subselect alias="MEAS_INDIV_ID" type="number">SOTM.TAXON_MEAS_INDIV_ID</subselect>
<subselect alias="REF_TAXON_ID" type="number">TN.TAXON_NAME_ID</subselect>
<subselect alias="REF_TAXON_NM" type="text">TN.TAXON_NAME_COMPLETE_NM</subselect>
<subselect alias="TAXON_NAME_ID" type="number">SOTM.TAXON_NAME_ID</subselect> <!-- = INPUT_TAXON_ID -->
<subselect alias="TAXON_NAME_NM" type="text">SOTM.TAXON_NAME_NM</subselect> <!-- = INPUT_TAXON_NM -->
<subselect alias="TAXON_NAME_ID" type="number" group="simple,complete,sinp">SOTM.TAXON_NAME_ID</subselect> <!-- = INPUT_TAXON_ID -->
<subselect alias="TAXON_NAME_NM" type="text" group="simple,complete,sinp">SOTM.TAXON_NAME_NM</subselect> <!-- = INPUT_TAXON_NM -->
<subselect alias="TAXON_PAMPA" type="text" group="pampa">ALT.ALTERN_TAXON_CD</subselect>
<subselect alias="TAXON_GROUP_ID" type="number">TG.TAXON_GROUP_ID</subselect>
<subselect alias="TAXON_GROUP_NM" type="text">TG.TAXON_GROUP_NM</subselect>
<subselect alias="PMFM_ID" type="number">SOTM.PMFM_ID</subselect>
......@@ -154,6 +168,7 @@
<from join="true">LEFT OUTER JOIN TAXON_GROUP TG ON SOTM.TAXON_GROUP_ID = TG.TAXON_GROUP_ID</from>
<from join="true">LEFT OUTER JOIN TAXON_NAME TN ON SOTM.REF_TAXON_ID = TN.REF_TAXON_ID AND TN.TAXON_NAME_IS_REFER = 1</from>
<from join="true">LEFT OUTER JOIN QUALITY_FLAG QF ON QF.QUAL_FLAG_CD = SOTM.QUAL_FLAG_CD</from>
<from join="true" group="pampa">LEFT OUTER JOIN ALT ON ALT.TAXON_NAME_ID = TN.TAXON_NAME_ID</from>
</subquery>
</union>
......
......@@ -22,33 +22,31 @@
<queries name="extractionCreateResultTable">
<query type="create" temp="false" table="&amp;resultTableName">
<query type="create" temp="false" table="&amp;resultTableName" option="DISTINCT">
<!-- <select alias="SURVEY_ID" type="number">S.SURVEY_ID</select>-->
<!-- <select alias="SAMPLING_OPER_ID" type="number">SO.SAMPLING_OPER_ID</select>-->
<select alias="SURVEY_PROG_CD" type="text">S.SURVEY_PROG_CD</select>
<select alias="MON_LOC_NM" type="text">S.MON_LOC_NM</select>
<select alias="SURVEY_DT" type="date">S.SURVEY_DT</select>
<select alias="SAMPLING_OPER_LB" type="text">SO.SAMPLING_OPER_LB</select>
<select alias="REF_TAXON_NM" type="text">C.REF_TAXON_NM</select>
<select alias="TAXON_GROUP_NM" type="text">C.TAXON_GROUP_NM</select>
<select alias="MEAS_INDIV_ID" type="number">C.MEAS_INDIV_ID</select>
<injection name="surveyIndividualMeasurements" type="select" group="surveyIndividualMeasurements"/>
<injection name="samplingIndividualMeasurements" type="select" group="samplingIndividualMeasurements"/>
<injection name="samplingMeasurements" type="select" group="samplingMeasurements"/>
<injection name="surveyMeasurements" type="select" group="surveyMeasurements"/>
<injection name="analysts" type="select" group="analysts"/>
<!-- <select alias="MEAS_ANALYST_NM" type="text">MEAS_ANALYST_NM</select>-->
<select alias="MEAS_ANALYST_NM" type="text"><![CDATA[CONCAT_DISTINCT_STRING(ARRAY[&depNmFields],',')]]></select>
<select alias="CAMPAIGN_NM" type="text">S.CAMPAIGN_NM</select>
<select alias="MON_LOC_ID" type="number">S.MON_LOC_ID</select>
<select alias="MON_LOC_LB" type="text">S.MON_LOC_LB</select>
<select alias="ORDER_ITEM_NM" type="text">S.ORDER_ITEM_NM</select>
<select alias="SURVEY_POSITION_LONG_MIN" type="text">S.SURVEY_POSITION_LONG</select>
<select alias="SURVEY_POSITION_LONG_MAX" type="text">S.SURVEY_POSITION_LONG</select>
<select alias="SURVEY_POSITION_LAT_MIN" type="text">S.SURVEY_POSITION_LAT</select>
<select alias="SURVEY_POSITION_LAT_MAX" type="text">S.SURVEY_POSITION_LAT</select>
<select alias="SURVEY_POSITION_LONG_MIN" type="number">CONVERT(S.SURVEY_POSITION_LONG, DECIMAL(12,8))</select>
<select alias="SURVEY_POSITION_LONG_MAX" type="number">CONVERT(S.SURVEY_POSITION_LONG, DECIMAL(12,8))</select>
<select alias="SURVEY_POSITION_LAT_MIN" type="number">CONVERT(S.SURVEY_POSITION_LAT, DECIMAL(12,8))</select>
<select alias="SURVEY_POSITION_LAT_MAX" type="number">CONVERT(S.SURVEY_POSITION_LAT, DECIMAL(12,8))</select>
<select alias="SAMPLING_EQUIPMENT_NM" type="text">SO.SAMPLING_EQUIPMENT_NM</select>
<select alias="SAMPLING_OPER_DEP_NM" type="text">SO.SAMPLING_OPER_DEP_NM</select>
<select alias="SURVEY_QUSERS" type="text" group="simple,complete,sinp">S.SURVEY_QUSERS</select>
......@@ -56,8 +54,7 @@
<select alias="SAMPLING_OPER_SIZE" type="number">SO.SAMPLING_OPER_SIZE</select>
<select alias="SAMPLING_OPER_SIZE_UNIT_SYMBOL" type="text">SO.SAMPLING_OPER_SIZE_UNIT_SYMBOL</select>
<injection name="comments" type="select" group="comments"/>
<!-- <select alias="MEAS_CM" type="text">MEAS_CM</select>-->
<select alias="MEAS_CM" type="text"><![CDATA[CONCAT_DISTINCT_STRING(ARRAY[&measCmFields],' - ')]]></select>
<select alias="SAMPLING_OPER_ID" type="number" group="pampa">SO.SAMPLING_OPER_ID</select>
<select alias="SAMPLING_OPER_TIME" type="text" group="pampa">TO_CHAR(TIMESTAMP(SO.SAMPLING_OPER_TIME), 'HH24:MI:SS')</select>
......@@ -67,17 +64,14 @@
<select alias="TAXON_NAME_NM" type="text" group="simple,complete,sinp">C.TAXON_NAME_NM</select>
<!-- todo MEAS_QUAL_FLAG_NM, MEAS_QUALIF_DT, MEAS_QUALIF_CM-->
<injection name="measQualFlags" type="select" group="measQualFlags"/>
<injection name="measQualifDt" type="select" group="measQualifDt"/>
<injection name="measQualifCm" type="select" group="measQualifCm"/>
<select alias="MEAS_QUAL_FLAG_NM" type="text"><![CDATA[CONCAT_DISTINCT_STRING(ARRAY[&measQualFlagFields],',')]]></select>
<select alias="MEAS_QUALIF_DT" type="text"><![CDATA[CONCAT_DISTINCT_STRING(ARRAY[&measQualifDtFields],',')]]></select>
<select alias="MEAS_QUALIF_CM" type="text"><![CDATA[CONCAT_DISTINCT_STRING(ARRAY[&measQualifCmFields],' - ')]]></select>
<select alias="TAXON_NAME_ID" type="number" group="simple,complete,sinp">C.TAXON_NAME_ID</select>
<injection name="measIds" type="select" group="measIds"/>
<!-- <select alias="MEAS_IDS" type="text" group="simple,complete,sinp">MEAS_IDS</select>-->
<injection name="taxonMeasIds" type="select" group="taxonMeasIds"/>
<!-- <select alias="TAXON_MEAS_IDS" type="text" group="simple,complete,sinp">TAXON_MEAS_IDS</select>-->
<select alias="MEAS_IDS" type="text" group="simple,complete,sinp"><![CDATA[CONCAT_DISTINCT_INTEGER(ARRAY[&measIdFields],'|')]]></select>
<select alias="TAXON_MEAS_IDS" type="text" group="simple,complete,sinp"><![CDATA[CONCAT_DISTINCT_INTEGER(ARRAY[&taxonMeasIdFields],'|')]]></select>
<select alias="ORDER_ITEM_TYPE_NM" type="text" group="complete">S.ORDER_ITEM_TYPE_NM</select>
<select alias="ORDER_ITEM_CD" type="text" group="complete">S.ORDER_ITEM_CD</select>
......@@ -90,6 +84,8 @@
<select alias="SURVEY_QUALIF_DT" type="date" group="complete">S.SURVEY_QUALIF_DT</select>
<select alias="SURVEY_QUALIF_CM" type="text" group="complete">S.SURVEY_QUALIF_CM</select>
<select alias="SURVEY_INHERITED_POSITION" type="text" group="complete">S.SURVEY_INHERITED_POSITION</select>
<select alias="SURVEY_BOTTOM_DEPTH" type="number" group="complete">S.SURVEY_BOTTOM_DEPTH</select>
<select alias="SURVEY_BOTTOM_DEPTH_UNIT_SYMBOL" type="number" group="complete">S.SURVEY_BOTTOM_DEPTH_UNIT_SYMBOL</select>
<select alias="SAMPLING_OPER_TIME" type="text" group="complete">TO_CHAR(TIMESTAMP(SO.SAMPLING_OPER_TIME), 'HH24:MI:SS')</select>
<select alias="SAMPLING_OPER_DEPTH" type="number" group="complete">SO.SAMPLING_OPER_DEPTH</select>
<select alias="SAMPLING_OPER_MIN_DEPTH" type="number" group="complete">SO.SAMPLING_OPER_MIN_DEPTH</select>
......@@ -106,16 +102,14 @@
<select alias="SAMPLING_OPER_QUAL_FLAG_NM" type="text" group="complete">SO.SAMPLING_OPER_QUAL_FLAG_NM</select>
<select alias="SAMPLING_OPER_QUALIF_DT" type="date" group="complete">SO.SAMPLING_OPER_QUALIF_DT</select>
<select alias="SAMPLING_OPER_QUALIF_CM" type="text" group="complete">SO.SAMPLING_OPER_QUALIF_CM</select>
<select alias="SAMPLING_OPER_POSITION_LONG_MIN" type="text" group="complete">SO.SAMPLING_OPER_POSITION_LONG</select>
<select alias="SAMPLING_OPER_POSITION_LONG_MAX" type="text" group="complete">SO.SAMPLING_OPER_POSITION_LONG</select>
<select alias="SAMPLING_OPER_POSITION_LAT_MIN" type="text" group="complete">SO.SAMPLING_OPER_POSITION_LAT</select>
<select alias="SAMPLING_OPER_POSITION_LAT_MAX" type="text" group="complete">SO.SAMPLING_OPER_POSITION_LAT</select>
<select alias="MEAS_INDIV_ID" type="number" group="complete">C.MEAS_INDIV_ID</select>
<select alias="SAMPLING_OPER_POSITION_LONG_MIN" type="number" group="complete">CONVERT(SO.SAMPLING_OPER_POSITION_LONG, DECIMAL(12,8))</select>
<select alias="SAMPLING_OPER_POSITION_LONG_MAX" type="number" group="complete">CONVERT(SO.SAMPLING_OPER_POSITION_LONG, DECIMAL(12,8))</select>
<select alias="SAMPLING_OPER_POSITION_LAT_MIN" type="number" group="complete">CONVERT(SO.SAMPLING_OPER_POSITION_LAT, DECIMAL(12,8))</select>
<select alias="SAMPLING_OPER_POSITION_LAT_MAX" type="number" group="complete">CONVERT(SO.SAMPLING_OPER_POSITION_LAT, DECIMAL(12,8))</select>
<from alias="C"><![CDATA[&commonTableName]]></from>
<from join="true"><![CDATA[INNER JOIN &baseTableName S ON S.SURVEY_ID = C.SURVEY_ID]]></from>
<from join="true"><![CDATA[LEFT OUTER JOIN &baseTableName SO ON SO.SURVEY_ID = C.SURVEY_ID AND SO.SAMPLING_OPER_ID = C.SAMPLING_OPER_ID]]></from>
<from join="true"><![CDATA[INNER JOIN &baseTableName S ON S.SURVEY_ID = C.SURVEY_ID]]></from>
<from join="true"><![CDATA[LEFT OUTER JOIN &baseTableName SO ON SO.SURVEY_ID = C.SURVEY_ID AND SO.SAMPLING_OPER_ID = C.SAMPLING_OPER_ID]]></from>
</query>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
Dali :: Core
%%
Copyright (C) 2017 Ifremer
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
#L%
-->
<query type="select">
<!-- <select alias="SURVEY_ANALYST_NM" type="text" group="survey"><![CDATA[CONCAT_DISTINCT_DEP_NM(ARRAY[&depNmFields],',')]]></select>-->
<select alias="MEAS_ANALYST_NM" type="text" group="samplingOperation"><![CDATA[CONCAT_DISTINCT_DEP_NM(ARRAY[&depNmFields],',')]]></select>
</query>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
Dali :: Core
%%
Copyright (C) 2017 Ifremer
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
#L%
-->
<query type="select">
<select alias="MEAS_CM" type="text" group="individual"><![CDATA[CONCAT_DISTINCT_MEAS_CM(ARRAY[&measCmFields],' - ')]]></select>
</query>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
Dali :: Core
%%
Copyright (C) 2017 Ifremer
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
#L%
-->
<query type="select">
<select alias="MEAS_IDS" type="text"><![CDATA[CONCAT_DISTINCT_MEAS_ID(ARRAY[&measIdFields],'|')]]></select>
<select alias="TAXON_MEAS_IDS" type="text"><![CDATA[CONCAT_DISTINCT_MEAS_ID(ARRAY[&taxonMeasIdFields],'|')]]></select>
</query>
\ No newline at end of file
......@@ -28,16 +28,16 @@
<select alias="PMFM_ALIAS" type="text" group="PMFM_ALIAS_qualitative"><![CDATA[PMFM_ALIAS.QUAL_VALUE_NM]]></select>
<from join="true" group="PMFM_ALIAS_surveyJoin">
<![CDATA[LEFT OUTER JOIN &PMFM_ALIAS_pmfmTableName PMFM_ALIAS ON PMFM_ALIAS.PARENT_ID = SOURCE