Commit 4c9a1e33 authored by PECQUOT's avatar PECQUOT
Browse files

[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 ## Sprint 81 - v3.9.0
- Pas de mise à jour de modèle - Pas de mise à jour de modèle
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<groupId>fr.ifremer.reefdb</groupId> <groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId> <artifactId>reefdb</artifactId>
<version>3.9.1</version> <version>3.9.2-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Reef DB</name> <name>Reef DB</name>
...@@ -171,8 +171,8 @@ ...@@ -171,8 +171,8 @@
<maven.compiler.debug>true</maven.compiler.debug> <maven.compiler.debug>true</maven.compiler.debug>
<!-- Quadrige3 Core version --> <!-- Quadrige3 Core version -->
<quadrige3-core.version>3.6.5</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.6-SNAPSHOT</quadrige3-core.version>
<!-- Last ReefDb launcher version --> <!-- Last ReefDb launcher version -->
<launcherVersion>3.0.3</launcherVersion> <launcherVersion>3.0.3</launcherVersion>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>fr.ifremer.reefdb</groupId> <groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId> <artifactId>reefdb</artifactId>
<version>3.9.1</version> <version>3.9.2-SNAPSHOT</version>
</parent> </parent>
<artifactId>reefdb-core</artifactId> <artifactId>reefdb-core</artifactId>
......
...@@ -967,6 +967,10 @@ public final class ReefDbConfiguration extends QuadrigeCoreConfiguration { ...@@ -967,6 +967,10 @@ public final class ReefDbConfiguration extends QuadrigeCoreConfiguration {
return applicationConfig.getOption(ReefDbConfigurationOption.TRANSCRIBING_ITEM_TYPE_LB_PMFM_NM.getKey()); 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> * <p>getAlternativeTaxonOriginTaxRef.</p>
* *
......
...@@ -24,7 +24,6 @@ package fr.ifremer.reefdb.config; ...@@ -24,7 +24,6 @@ package fr.ifremer.reefdb.config;
*/ */
import fr.ifremer.quadrige3.core.dao.referential.UnitId; 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 fr.ifremer.quadrige3.core.dao.technical.QuadrigeEnumerationDef;
import org.nuiton.config.ConfigOptionDef; import org.nuiton.config.ConfigOptionDef;
import org.nuiton.version.Version; import org.nuiton.version.Version;
...@@ -303,7 +302,13 @@ public enum ReefDbConfigurationOption implements ConfigOptionDef { ...@@ -303,7 +302,13 @@ public enum ReefDbConfigurationOption implements ConfigOptionDef {
TRANSCRIBING_ITEM_TYPE_LB_PMFM_NM( TRANSCRIBING_ITEM_TYPE_LB_PMFM_NM(
"reefdb.transcribingItemType.label.pmfmNm", "reefdb.transcribingItemType.label.pmfmNm",
n("reefdb.config.option.transcribingItemType.label.pmfmNm.description"), 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, String.class,
false), false),
/* constants used to calculate transition length */ /* constants used to calculate transition length */
......
...@@ -24,6 +24,7 @@ package fr.ifremer.reefdb.dao.system.extraction; ...@@ -24,6 +24,7 @@ package fr.ifremer.reefdb.dao.system.extraction;
*/ */
import fr.ifremer.quadrige3.core.dao.technical.csv.CSVDao; import fr.ifremer.quadrige3.core.dao.technical.csv.CSVDao;
import fr.ifremer.reefdb.dto.referential.pmfm.PmfmDTO;
import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.RowMapper;
import java.util.List; import java.util.List;
...@@ -91,4 +92,10 @@ public interface ReefDbExtractionResultDao extends CSVDao { ...@@ -91,4 +92,10 @@ public interface ReefDbExtractionResultDao extends CSVDao {
* @return a int. * @return a int.
*/ */
int queryUpdate(String query, Map<String, Object> queryBindings); 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; ...@@ -23,7 +23,11 @@ package fr.ifremer.reefdb.dao.system.extraction;
* #L% * #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.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.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -32,9 +36,11 @@ import org.springframework.dao.DataRetrievalFailureException; ...@@ -32,9 +36,11 @@ import org.springframework.dao.DataRetrievalFailureException;
import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional;
import java.util.Properties; import java.util.Properties;
/** /**
...@@ -50,6 +56,12 @@ public class ReefDbExtractionResultDaoImpl extends CSVDaoImpl implements ReefDbE ...@@ -50,6 +56,12 @@ public class ReefDbExtractionResultDaoImpl extends CSVDaoImpl implements ReefDbE
protected final Properties connectionProperties; protected final Properties connectionProperties;
@Resource
protected ReefDbConfiguration config;
@Resource(name = "transcribingItemDao")
private TranscribingItemExtendDao transcribingItemDao;
/** /**
* <p>Constructor for ReefDbExtractionResultDaoImpl.</p> * <p>Constructor for ReefDbExtractionResultDaoImpl.</p>
* *
...@@ -114,6 +126,25 @@ public class ReefDbExtractionResultDaoImpl extends CSVDaoImpl implements ReefDbE ...@@ -114,6 +126,25 @@ public class ReefDbExtractionResultDaoImpl extends CSVDaoImpl implements ReefDbE
return queryUpdate(connectionProperties, query, paramMap); 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} * {@inheritDoc}
*/ */
......
...@@ -287,6 +287,7 @@ public class DecoratorServiceImpl extends fr.ifremer.quadrige3.core.service.deco ...@@ -287,6 +287,7 @@ public class DecoratorServiceImpl extends fr.ifremer.quadrige3.core.service.deco
} }
} }
@Deprecated
private class PMFMExtractionDecorator extends PMFMNameDecorator { private class PMFMExtractionDecorator extends PMFMNameDecorator {
static final String SEPARATOR = "-"; static final String SEPARATOR = "-";
......
...@@ -291,6 +291,7 @@ reefdb.service.common.progression=%s \: traitement de %s/%s ...@@ -291,6 +291,7 @@ reefdb.service.common.progression=%s \: traitement de %s/%s
reefdb.service.control=Contrôle reefdb.service.control=Contrôle
reefdb.service.controlRule.invalid.message=La règle de contrôle '%s' n'est pas respectée 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.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_ID=
reefdb.service.extraction.fieldName.INPUT_TAXON_NAME_NM= reefdb.service.extraction.fieldName.INPUT_TAXON_NAME_NM=
reefdb.service.extraction.fieldName.MEAS_ANALYST_NM=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Organisme_analyste 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 ...@@ -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_DEP_NM=
reefdb.service.extraction.fieldName.MEAS_IDS=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Identifiants_interne_MEAS_ID 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_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_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_LB=${reefdb.service.extraction.fieldNamePrefix.MON_LOC}_Mnemonique
reefdb.service.extraction.fieldName.MON_LOC_NM=Station reefdb.service.extraction.fieldName.MON_LOC_NM=Station
...@@ -334,6 +338,7 @@ reefdb.service.extraction.fieldName.SAMPLING_OPER_SIZE_UNIT_SYMBOL=${reefdb.serv ...@@ -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_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.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=${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_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_CONTROL_DT=${reefdb.service.extraction.fieldNamePrefix.SURVEY}_Date_controle
reefdb.service.extraction.fieldName.SURVEY_DT=Date reefdb.service.extraction.fieldName.SURVEY_DT=Date
......
...@@ -43,6 +43,7 @@ pmfmId.PIT_ORIGIN=2326 ...@@ -43,6 +43,7 @@ pmfmId.PIT_ORIGIN=2326
UnitId.NO_UNIT=99 UnitId.NO_UNIT=99
TranscribingItemTypeLb.REEFDB_PMFM_NM=REEFDB-PMFM.PMFM_NM TranscribingItemTypeLb.REEFDB_PMFM_NM=REEFDB-PMFM.PMFM_NM
TranscribingItemTypeLb.REEFDB_PMFM_EXTRACTION=REEFDB-PMFM.PMFM_EXTRACTION
############################################ ############################################
# Alternative Taxon Code # # Alternative Taxon Code #
......
...@@ -58,13 +58,14 @@ ...@@ -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="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="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" 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_EQUIPMENT_NM" type="text">SE.SAMPLING_EQUIPMENT_NM</select>
<select alias="SAMPLING_OPER_DEP_NM" type="text">SOD.DEP_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_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="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> <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_TIME" type="text" group="complete">S.SURVEY_TIME</select>
<select alias="SURVEY_CM" type="text" group="complete">S.SURVEY_CM</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> <select alias="SURVEY_CONTROL_DT" type="date" group="complete">S.SURVEY_CONTROL_DT</select>
...@@ -73,15 +74,16 @@ ...@@ -73,15 +74,16 @@
<select alias="SURVEY_QUALIF_DT" type="date" group="complete">S.SURVEY_QUALIF_DT</select> <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_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> <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="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="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_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_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_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_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_SYMBOL" type="text" group="complete">SODU.UNIT_SYMBOL</select>
<select alias="SAMPLING_OPER_DEPTH_UNIT" type="text" group="complete">DU.UNIT_NM</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_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" type="number" group="complete">SE.SAMPLING_EQUIPMENT_SIZE</select>
<select alias="SAMPLING_EQUIPMENT_SIZE_UNIT_SYMBOL" type="text" group="complete">SEU.UNIT_SYMBOL</select> <select alias="SAMPLING_EQUIPMENT_SIZE_UNIT_SYMBOL" type="text" group="complete">SEU.UNIT_SYMBOL</select>
...@@ -107,10 +109,11 @@ ...@@ -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 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 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 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 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 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> <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"/> <where group="periodFilter"/>
...@@ -164,10 +167,9 @@ ...@@ -164,10 +167,9 @@
<groupby>MLOI.ORDER_ITEM_NM</groupby> <groupby>MLOI.ORDER_ITEM_NM</groupby>
<groupby>SO.SAMPLING_OPER_ID</groupby> <groupby>SO.SAMPLING_OPER_ID</groupby>
<groupby>SO.SAMPLING_OPER_LB</groupby> <groupby>SO.SAMPLING_OPER_LB</groupby>
<groupby>TRIM(REGEXP_SUBSTRING(SP.SURVEY_POSITION, '[0-9.-]+'))</groupby> <groupby>SP.SURVEY_POSITION</groupby>
<groupby>TRIM(TRIM(TRAILING ')' FROM REGEXP_SUBSTRING(SP.SURVEY_POSITION, '[0-9.-]+\)$')))</groupby>
<groupby>SO.SAMPLING_OPER_SIZE</groupby> <groupby>SO.SAMPLING_OPER_SIZE</groupby>
<groupby>SOU.UNIT_SYMBOL</groupby> <groupby>SOSU.UNIT_SYMBOL</groupby>
<groupby>SE.SAMPLING_EQUIPMENT_NM</groupby> <groupby>SE.SAMPLING_EQUIPMENT_NM</groupby>
<groupby>SOD.DEP_NM</groupby> <groupby>SOD.DEP_NM</groupby>
<groupby group="complete">MLOI.ORDER_ITEM_TYPE_NM</groupby> <groupby group="complete">MLOI.ORDER_ITEM_TYPE_NM</groupby>
...@@ -180,15 +182,17 @@ ...@@ -180,15 +182,17 @@
<groupby group="complete">SQF.QUAL_FLAG_NM</groupby> <groupby group="complete">SQF.QUAL_FLAG_NM</groupby>
<groupby group="complete">S.SURVEY_QUALIF_DT</groupby> <groupby group="complete">S.SURVEY_QUALIF_DT</groupby>
<groupby group="complete">S.SURVEY_QUALIF_CM</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="complete,pampa">SO.SAMPLING_OPER_TIME</groupby>
<groupby group="pampa">S.SURVEY_BOTTOM_DEPTH</groupby> <groupby group="pampa">S.SURVEY_BOTTOM_DEPTH</groupby>
<groupby group="complete">SO.SAMPLING_OPER_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_MIN_DEPTH</groupby>
<groupby group="complete">SO.SAMPLING_OPER_MAX_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">SO.SAMPLING_OPER_ACTUAL_POSITION</groupby>
<groupby group="complete">DU.UNIT_SYMBOL</groupby> <groupby group="complete">SODU.UNIT_SYMBOL</groupby>
<groupby group="complete">DU.UNIT_NM</groupby> <groupby group="complete">SODU.UNIT_NM</groupby>
<groupby group="complete">SO.SAMPLING_OPER_CM</groupby> <groupby group="complete">SO.SAMPLING_OPER_CM</groupby>
<groupby group="complete">SE.SAMPLING_EQUIPMENT_SIZE</groupby> <groupby group="complete">SE.SAMPLING_EQUIPMENT_SIZE</groupby>
<groupby group="complete">SEU.UNIT_SYMBOL</groupby> <groupby group="complete">SEU.UNIT_SYMBOL</groupby>
...@@ -198,8 +202,7 @@ ...@@ -198,8 +202,7 @@
<groupby group="complete">SOQF.QUAL_FLAG_NM</groupby> <groupby group="complete">SOQF.QUAL_FLAG_NM</groupby>
<groupby group="complete">SO.SAMPLING_OPER_QUALIF_DT</groupby> <groupby group="complete">SO.SAMPLING_OPER_QUALIF_DT</groupby>
<groupby group="complete">SO.SAMPLING_OPER_QUALIF_CM</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">SOP.SAMPLING_OPER_POSITION</groupby>
<groupby group="complete">TRIM(TRIM(TRAILING ')' FROM REGEXP_SUBSTRING(SOP.SAMPLING_OPER_POSITION, '[0-9.-]+\)$')))</groupby>
<orderby direction="ASC">S.SURVEY_ID</orderby> <orderby direction="ASC">S.SURVEY_ID</orderby>
......
...@@ -28,8 +28,9 @@ ...@@ -28,8 +28,9 @@
<select alias="SAMPLING_OPER_ID" type="number">RAW.SAMPLING_OPER_ID</select> <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="MEAS_INDIV_ID" type="number">RAW.MEAS_INDIV_ID</select>
<select alias="REF_TAXON_NM" type="text">RAW.REF_TAXON_NM</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_ID" type="number" group="simple,complete,sinp">RAW.TAXON_NAME_ID</select>
<select alias="TAXON_NAME_NM" type="text">RAW.TAXON_NAME_NM</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> <select alias="TAXON_GROUP_NM" type="text">RAW.TAXON_GROUP_NM</select>
<from alias="RAW"><![CDATA[&rawTableName]]></from> <from alias="RAW"><![CDATA[&rawTableName]]></from>
<where><![CDATA[RAW.MEAS_INDIV_ID IS NOT NULL]]></where> <where><![CDATA[RAW.MEAS_INDIV_ID IS NOT NULL]]></where>
...@@ -40,14 +41,15 @@ ...@@ -40,14 +41,15 @@
<subselect alias="SAMPLING_OPER_ID" type="number">RAW.SAMPLING_OPER_ID</subselect> <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="MEAS_INDIV_ID" type="number">RAW.MEAS_INDIV_ID</subselect>
<subselect alias="REF_TAXON_NM" type="text">RAW.REF_TAXON_NM</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_ID" type="number" group="simple,complete,sinp">RAW.TAXON_NAME_ID</subselect>
<subselect alias="TAXON_NAME_NM" type="text">RAW.TAXON_NAME_NM</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> <subselect alias="TAXON_GROUP_NM" type="text">RAW.TAXON_GROUP_NM</subselect>
<from alias="RAW"><![CDATA[&rawTableName]]></from> <from alias="RAW"><![CDATA[&rawTableName]]></from>
<where><![CDATA[RAW.MEAS_INDIV_ID IS NULL]]></where> <where><![CDATA[RAW.MEAS_INDIV_ID IS NULL]]></where>
<where operator="AND"><![CDATA[NOT EXISTS (SELECT RAW2.SURVEY_ID FROM &rawTableName RAW2 <where operator="AND"><![CDATA[NOT EXISTS (SELECT RAW2.SURVEY_ID FROM &rawTableName RAW2
WHERE RAW.SURVEY_ID = RAW2.SURVEY_ID 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> AND RAW2.MEAS_INDIV_ID IS NOT NULL)]]></where>
</subquery> </subquery>
</union> </union>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<select alias="MEAS_ID" type="number">MEAS_ID</select> <select alias="MEAS_ID" type="number">MEAS_ID</select>
<select alias="TAXON_MEAS_ID" type="number">TAXON_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_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> <select alias="MEAS_QUALIF_CM" type="text">MEAS_QUALIF_CM</select>
<from><![CDATA[&rawTableName]]></from> <from><![CDATA[&rawTableName]]></from>
......
...@@ -24,6 +24,15 @@ ...@@ -24,6 +24,15 @@
<query type="create" temp="false" table="&amp;rawTableName"> <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--> <!-- BASE SELECT + SURVEY MEASUREMENTS-->
<select alias="SURVEY_ID" type="number">BASE.SURVEY_ID</select> <select alias="SURVEY_ID" type="number">BASE.SURVEY_ID</select>
<select alias="SAMPLING_OPER_ID" type="number">NULL</select> <select alias="SAMPLING_OPER_ID" type="number">NULL</select>
...@@ -33,8 +42,9 @@ ...@@ -33,8 +42,9 @@
<select alias="MEAS_INDIV_ID" type="number">SM.MEAS_INDIV_ID</select> <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_ID" type="number">NULL</select>
<select alias="REF_TAXON_NM" type="text">NULL</select> <select alias="REF_TAXON_NM" type="text">NULL</select>
<select alias="TAXON_NAME_ID" type="number">NULL</select> <select alias="TAXON_NAME_ID" type="number" group="simple,complete,sinp">NULL</select>
<select alias="TAXON_NAME_NM" type="text">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_ID" type="number">NULL</select>
<select alias="TAXON_GROUP_NM" type="text">NULL</select> <select alias="TAXON_GROUP_NM" type="text">NULL</select>
<select alias="PMFM_ID" type="number">SM.PMFM_ID</select> <select alias="PMFM_ID" type="number">SM.PMFM_ID</select>
...@@ -64,8 +74,9 @@ ...@@ -64,8 +74,9 @@
<subselect alias="MEAS_INDIV_ID" type="number">STM.TAXON_MEAS_INDIV_ID</subselect> <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_ID" type="number">TN.TAXON_NAME_ID</subselect>
<subselect alias="REF_TAXON_NM" type="text">TN.TAXON_NAME_COMPLETE_NM</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_ID" type="number" group="simple,complete,sinp">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_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_ID" type="number">TG.TAXON_GROUP_ID</subselect>
<subselect alias="TAXON_GROUP_NM" type="text">TG.TAXON_GROUP_NM</subselect> <subselect alias="TAXON_GROUP_NM" type="text">TG.TAXON_GROUP_NM</subselect>
<subselect alias="PMFM_ID" type="number">STM.PMFM_ID</subselect> <subselect alias="PMFM_ID" type="number">STM.PMFM_ID</subselect>
...@@ -85,6 +96,7 @@ ...@@ -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_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 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">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> </subquery>
</union> </union>
...@@ -99,8 +111,9 @@ ...@@ -99,8 +111,9 @@
<subselect alias="MEAS_INDIV_ID" type="number">SOM.MEAS_INDIV_ID</subselect>