Skip to content

Commit 2164b45

Browse files
committed
Fix upper case column issues in merged code
1 parent 84a22ab commit 2164b45

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

src/main/resources/org/cbioportal/legacy/persistence/mybatis/InfoMapper.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
<mapper namespace="org.cbioportal.legacy.persistence.mybatis.InfoMapper">
55

66
<resultMap id="InfoDbResult" type="org.cbioportal.legacy.model.InfoDb">
7-
<result column="DB_SCHEMA_VERSION" property="dbSchemaVersion"/>
8-
<result column="GENESET_VERSION" property="genesetVersion"/>
9-
<result column="DERIVED_TABLE_SCHEMA_VERSION" property="derivedTableSchemaVersion"/>
10-
<result column="GENE_TABLE_VERSION" property="geneTableVersion"/>
7+
<result column="db_schema_version" property="dbSchemaVersion"/>
8+
<result column="geneset_version" property="genesetVersion"/>
9+
<result column="derived_table_schema_version" property="derivedTableSchemaVersion"/>
10+
<result column="gene_table_version" property="geneTableVersion"/>
1111
</resultMap>
1212

1313
<select id="getInfo" resultMap="InfoDbResult">
14-
SELECT DB_SCHEMA_VERSION, GENESET_VERSION, DERIVED_TABLE_SCHEMA_VERSION, GENE_TABLE_VERSION
14+
SELECT db_schema_version, geneset_version, derived_table_schema_version, gene_table_version
1515
FROM info
1616
LIMIT 1
1717
</select>

src/main/resources/org/cbioportal/legacy/persistence/mybatis/StudyMapper.xml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -97,43 +97,43 @@
9797
</sql>
9898

9999
<sql id="selectResource">
100-
DISPLAY_NAME AS displayName,
101-
rd.DESCRIPTION AS description,
102-
rd.RESOURCE_TYPE AS resourceType,
103-
rd.PRIORITY AS priority,
104-
rd.OPEN_BY_DEFAULT AS openByDefault,
105-
CANCER_STUDY_IDENTIFIER as cancerStudyIdentifier,
106-
rd.CUSTOM_METADATA AS customMetaData
100+
display_name AS displayName,
101+
rd.description AS description,
102+
rd.resource_type AS resourceType,
103+
rd.priority AS priority,
104+
rd.open_by_default AS openByDefault,
105+
cancer_study_identifier as cancerStudyIdentifier,
106+
rd.custom_metadata AS customMetaData
107107
</sql>
108108

109109
<sql id="selectSampleResourceCounts">
110110
<include refid="selectResource"/>,
111-
rs.RESOURCE_ID AS resourceId,
112-
COUNT(DISTINCT rs.INTERNAL_ID) AS sampleCount,
113-
COUNT(DISTINCT p.INTERNAL_ID) AS patientCount
111+
rs.resource_id AS resourceId,
112+
COUNT(DISTINCT rs.internal_id) AS sampleCount,
113+
COUNT(DISTINCT p.internal_id) AS patientCount
114114
</sql>
115115

116116
<sql id="fromResourceSample">
117117
FROM resource_sample AS rs
118-
INNER JOIN resource_definition rd ON rd.RESOURCE_ID = rs.RESOURCE_ID
119-
INNER JOIN sample s ON s.INTERNAL_ID = rs.INTERNAL_ID
120-
INNER JOIN patient p ON p.INTERNAL_ID = s.PATIENT_ID
121-
INNER JOIN cancer_study cs ON cs.CANCER_STUDY_ID = p.CANCER_STUDY_ID
118+
INNER JOIN resource_definition rd ON rd.resource_id = rs.resource_id
119+
INNER JOIN sample s ON s.internal_id = rs.internal_id
120+
INNER JOIN patient p ON p.internal_id = s.patient_id
121+
INNER JOIN cancer_study cs ON cs.cancer_study_id = p.cancer_study_id
122122
</sql>
123123

124124
<sql id="selectPatientResourceCounts">
125125
<include refid="selectResource"/>,
126-
rp.RESOURCE_ID AS resourceId,
127-
COUNT(DISTINCT s.INTERNAL_ID) AS sampleCount,
128-
COUNT(DISTINCT rp.INTERNAL_ID) AS patientCount
126+
rp.resource_id AS resourceId,
127+
COUNT(DISTINCT s.internal_id) AS sampleCount,
128+
COUNT(DISTINCT rp.internal_id) AS patientCount
129129
</sql>
130130

131131
<sql id="fromResourcePatient">
132132
FROM cancer_study cs
133-
INNER JOIN patient p ON cs.CANCER_STUDY_ID = p.CANCER_STUDY_ID
134-
LEFT JOIN sample s ON p.INTERNAL_ID = s.PATIENT_ID
135-
INNER JOIN resource_patient rp ON rp.INTERNAL_ID = s.PATIENT_ID
136-
INNER JOIN resource_definition rd ON rd.RESOURCE_ID = rp.RESOURCE_ID
133+
INNER JOIN patient p ON cs.cancer_study_id = p.cancer_study_id
134+
LEFT JOIN sample s ON p.internal_id = s.patient_id
135+
INNER JOIN resource_patient rp ON rp.internal_id = s.patient_id
136+
INNER JOIN resource_definition rd ON rd.resource_id = rp.resource_id
137137
</sql>
138138

139139
<select id="getStudies" resultType="org.cbioportal.legacy.model.CancerStudy">
@@ -240,7 +240,7 @@
240240
<include refid="fromResourceSample"/>
241241
<where>
242242
<if test="studyIds != null and !studyIds.isEmpty()">
243-
cs.CANCER_STUDY_IDENTIFIER IN
243+
cs.cancer_study_identifier IN
244244
<foreach item="item" collection="studyIds" open="(" separator="," close=")">
245245
#{item}
246246
</foreach>
@@ -253,7 +253,7 @@
253253
<include refid="fromResourcePatient"/>
254254
<where>
255255
<if test="studyIds != null and !studyIds.isEmpty()">
256-
cs.CANCER_STUDY_IDENTIFIER IN
256+
cs.cancer_study_identifier IN
257257
<foreach item="item" collection="studyIds" open="(" separator="," close=")">
258258
#{item}
259259
</foreach>

0 commit comments

Comments
 (0)