Commit 16b1e5c8 authored by neo's avatar neo

[bugfix] fixed datasource query xml join two table with projecti d

parent 832950c9
......@@ -24,28 +24,30 @@
</resultMap>
<select id="getFormulaDataSource" parameterType="java.lang.Long" resultMap="DataSourceExtendDtoMap">
SELECT
DS.*,
CDS.OPERATION_TYPE AS OPERATION_TYPE,
CD.CELL_TEMPLATE_ID AS CELL_TEMPLATE_ID,
CD.ID AS CELL_DATA_ID,
RPT.TEMPLATE_ID AS REPORT_TEMPLATE_ID
FROM
PERIOD_DATA_SOURCE DS
JOIN
PERIOD_CELL_DATA_SOURCE CDS
ON
DS.ID = CDS.DATA_SOURCE_ID
JOIN
PERIOD_CELL_DATA CD
ON
CDS.CELL_DATA_ID = CD.ID
JOIN
PERIOD_REPORT RPT
ON
CD.REPORT_ID= RPT.ID
WHERE
CD.REPORT_ID = #{reportID,jdbcType=BIGINT}
SELECT
DS.*,
CDS.OPERATION_TYPE AS OPERATION_TYPE,
CD.CELL_TEMPLATE_ID AS CELL_TEMPLATE_ID,
CD.ID AS CELL_DATA_ID,
RPT.TEMPLATE_ID AS REPORT_TEMPLATE_ID
FROM
PERIOD_DATA_SOURCE DS
JOIN
PERIOD_CELL_DATA_SOURCE CDS
ON
DS.ID = CDS.DATA_SOURCE_ID AND DS.PROJECT_ID=CDS.PROJECT_ID
JOIN
PERIOD_CELL_DATA CD
ON
CDS.CELL_DATA_ID = CD.ID
AND CDS.PROJECT_ID=CD.PROJECT_ID
JOIN
PERIOD_REPORT RPT
ON
CD.REPORT_ID= RPT.ID
AND CD.PROJECT_ID=RPT.PROJECT_ID
WHERE
CD.REPORT_ID = #{reportID,jdbcType=BIGINT}
<!--AND <![CDATA[ ds.type <> 1]]>-->
</select>
......@@ -75,7 +77,7 @@
JOIN
PERIOD_DATA_SOURCE DS
ON
CDS.DATA_SOURCE_ID = DS.ID
CDS.DATA_SOURCE_ID = DS.ID AND CDS.PROJECT_ID = DS.PROJECT_ID
WHERE
DS.TYPE = 10
AND CDS.CELL_DATA_ID = #{cellDataID,jdbcType=BIGINT}
......@@ -109,7 +111,7 @@
JOIN
PERIOD_CELL_DATA_SOURCE CELLDATASOURCE
ON
CELLDATA.ID = CELLDATASOURCE.CELL_DATA_ID
CELLDATA.ID = CELLDATASOURCE.CELL_DATA_ID AND CELLDATA.PROJECT_ID = CELLDATASOURCE.PROJECT_ID
WHERE
CELLDATASOURCE.DATA_SOURCE_ID = #{dataSourceID,jdbcType=BIGINT} LIMIT 1
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment