Commit 5a356442 authored by neo's avatar neo

[dev] add append period to should benin period table in xml

parent 480112ff
......@@ -108,30 +108,6 @@ public interface PeriodDataSourceMapper extends MyVatMapper {
*/
int updateByPrimaryKey(PeriodDataSource record);
void clearFormulaBlockWithPeriod(@Param("period") Integer period);
void clearTaxRuleSettingWithPeriod(@Param("period") Integer period);
void clearCellTemplateWithPeriod(@Param("period") Integer period, @Param("exceptReportTemplateIDs") String exceptReportTemplateIDs);
void clearCellTemplateConfigWithPeriod(@Param("period") Integer period, @Param("exceptReportTemplateIDs") String exceptReportTemplateIDs);
void clearTemplateWithPeriod(@Param("period") Integer period, @Param("exceptReportTemplateIDs") String exceptReportTemplateIDs);
void clearTaxPayerReportWithPeriod(@Param("period") Integer period);
void clearDataSourceWithPeriod(@Param("period") Integer period);
void clearDataSourceDetailWithPeriod(@Param("period") Integer period);
void clearCellDataSourceDataWithPeriod(@Param("period") Integer period);
void clearCellDataWithPeriod(@Param("exceptReportTemplateIDs") String exceptReportTemplateIDs, @Param("period") Integer period);
void clearReportWithPeriod(Integer period);
void clearDataWithPeriod(@Param("exceptReportTemplateIDs") String exceptReportTemplateIDs, @Param("period") Integer period);
List<DataSourceExtendDto> getFormulaDataSource(Long reportID);
List<DataSourceExtendDto> getManualDataSource(Long cellDataID);
......
......@@ -5,20 +5,10 @@
<select id="getSumOfBalance" resultType="java.math.BigDecimal">
SELECT
IFNULL (
SUM (
(
IFNULL (
a.DEBIT_NET,
0
)
-IFNULL (
a.CREDIT_NET,
0
)
)
* #{direction,,jdbcType=INTEGER}
)
,
SUM(
( IFNULL ( a.DEBIT_NET, 0 ) - IFNULL ( a.CREDIT_NET, 0 ) ) * #{ direction,,
jdbcType = INTEGER }
),
0
)
FROM
......@@ -34,19 +24,9 @@
SELECT
IFNULL (
(
(
IFNULL (
a.DEBIT_NET,
0
)
-IFNULL (
a.CREDIT_NET,
0
)
)
* #{direction,,jdbcType=INTEGER}
)
,
( IFNULL ( a.DEBIT_NET, 0 ) - IFNULL ( a.CREDIT_NET, 0 ) ) * #{ direction,,
jdbcType = INTEGER }
),
0
)
FROM
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.PeriodDataSourceMapper">
<delete id="clearFormulaBlockWithPeriod">
DELETE FROM
PERIOD_FORMULA_BLOCK
WHERE
PERIOD= #{period,jdbcType=INTEGER} ;
</delete>
<delete id="clearTaxRuleSettingWithPeriod">
DELETE FROM
PERIOD_TAX_RULE_SETTING
WHERE
PERIOD= #{period,jdbcType=INTEGER} ;
</delete>
<delete id="clearCellTemplateWithPeriod">
DELETE FROM
PERIOD_CELL_TEMPLATE
WHERE
PERIOD= #{period,jdbcType=INTEGER}
<if test="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''">
AND REPORT_TEMPLATE_ID NOT IN (
${exceptReportTemplateIDs}
)
;
</if>
</delete>
<delete id="clearCellTemplateConfigWithPeriod">
DELETE FROM
PERIOD_CELL_TEMPLATE_CONFIG
WHERE
PERIOD= #{period,jdbcType=INTEGER}
<if test="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''">
AND REPORT_TEMPLATE_ID NOT IN (
${exceptReportTemplateIDs}
)
;
</if>
</delete>
<delete id="clearTemplateWithPeriod">
DELETE FROM
PERIOD_TEMPLATE
WHERE
PERIOD= #{period,jdbcType=INTEGER}
<if test="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''">
AND TEMPLATE_ID NOT IN (
${exceptReportTemplateIDs}
)
;
</if>
</delete>
<delete id="clearTaxPayerReportWithPeriod">
DELETE FROM
PERIOD_TAX_PAYER_REPORT_RULE
WHERE
PERIOD= #{period,jdbcType=INTEGER} ;
</delete>
<delete id="clearDataSourceWithPeriod">
DELETE
D FROM
DATA_SOURCE D
WHERE
D.PERIOD = #{period,jdbcType=INTEGER} ;
</delete>
<delete id="clearDataSourceDetailWithPeriod">
DELETE
D FROM
DATA_SOURCE_DETAIL D
JOIN
DATA_SOURCE F
ON
D.DATA_SOURCE_ID = F.ID
WHERE
F.PERIOD = #{period,jdbcType=INTEGER} ;
</delete>
<delete id="clearCellDataSourceDataWithPeriod">
DELETE
D FROM
CELL_DATA_SOURCE D
JOIN
DATA_SOURCE F
ON
D.DATA_SOURCE_ID = F.ID
WHERE
F.PERIOD = #{period,jdbcType=INTEGER} ;
</delete>
<delete id="clearCellDataWithPeriod">
DELETE
C FROM
CELL_DATA C
JOIN
REPORT R
ON
C.REPORT_ID=R.ID
WHERE
R.PERIOD = #{period,jdbcType=INTEGER} ;
<!--&amp;lt;if test="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''"&amp;gt;-->
<!--WHERE report_id not in (${exceptReportTemplateIDs});-->
<!--&amp;lt;/if&amp;gt;-->
</delete>
<delete id="clearReportWithPeriod">
DELETE FROM
REPORT
WHERE
period= #{period,jdbcType=INTEGER} ;
</delete>
<delete id="clearDataWithPeriod">
DELETE FROM
PERIOD_FORMULA_BLOCK
WHERE
PERIOD= #{period,jdbcType=INTEGER} ;
DELETE FROM
PERIOD_TAX_RULE_SETTING
WHERE
PERIOD= #{period,jdbcType=INTEGER} ;
DELETE FROM
PERIOD_CELL_TEMPLATE
WHERE
PERIOD= #{period,jdbcType=INTEGER}
AND REPORT_TEMPLATE_ID NOT IN (
${exceptReportTemplateIDs}
)
;
DELETE FROM
PERIOD_CELL_TEMPLATE_CONFIG
WHERE
PERIOD= #{period,jdbcType=INTEGER}
AND REPORT_TEMPLATE_ID NOT IN (
${exceptReportTemplateIDs}
)
;
DELETE FROM
PERIOD_TEMPLATE
WHERE
PERIOD= #{period,jdbcType=INTEGER}
AND TEMPLATE_ID NOT IN (
${exceptReportTemplateIDs}
)
;
DELETE FROM
PERIOD_TAX_PAYER_REPORT_RULE
WHERE
PERIOD= #{period,jdbcType=INTEGER} ;
DELETE
D FROM
DATA_SOURCE_DETAIL D
JOIN
DATA_SOURCE F
ON
D.DATA_SOURCE_ID = F.ID
WHERE
F.PERIOD = #{period,jdbcType=INTEGER} ;
DELETE
D FROM
CELL_DATA_SOURCE D
JOIN
DATA_SOURCE F
ON
D.DATA_SOURCE_ID = F.ID
WHERE
F.PERIOD = #{period,jdbcType=INTEGER} ;
DELETE
D FROM
DATA_SOURCE D
WHERE
D.PERIOD = #{period,jdbcType=INTEGER} ;
DELETE
C FROM
CELL_DATA C
JOIN
REPORT R
ON
C.REPORT_ID=R.ID
WHERE
R.PERIOD = #{period,jdbcType=INTEGER} ;
DELETE FROM
REPORT
WHERE
PERIOD= #{period,jdbcType=INTEGER} ;
</delete>
<resultMap id="DataSourceExtendDtoMap" type="pwc.taxtech.atms.vat.dpo.DataSourceExtendDto">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="TYPE" jdbcType="INTEGER" property="type"/>
......@@ -223,17 +31,17 @@
CD.ID AS CELL_DATA_ID,
RPT.TEMPLATE_ID AS REPORT_TEMPLATE_ID
FROM
DATA_SOURCE DS
PERIOD_DATA_SOURCE DS
JOIN
CELL_DATA_SOURCE CDS
PERIOD_CELL_DATA_SOURCE CDS
ON
DS.ID = CDS.DATA_SOURCE_ID
JOIN
CELL_DATA CD
PERIOD_CELL_DATA CD
ON
CDS.CELL_DATA_ID = CD.ID
JOIN
REPORT RPT
PERIOD_REPORT RPT
ON
CD.REPORT_ID= RPT.ID
WHERE
......@@ -263,9 +71,9 @@
DS.CELL_TEMPLATE_ID,
DS.PERIOD
FROM
CELL_DATA_SOURCE CDS
PERIOD_CELL_DATA_SOURCE CDS
JOIN
DATA_SOURCE DS
PERIOD_DATA_SOURCE DS
ON
CDS.DATA_SOURCE_ID = DS.ID
WHERE
......@@ -297,26 +105,12 @@
CELLDATASOURCE.ID AS CELL_DATA_SOURCE_ID,
CELLDATASOURCE.OPERATION_TYPE AS CELL_DATA_SOURCE_OPERATION_TYPE
FROM
CELL_DATA CELLDATA
PERIOD_CELL_DATA CELLDATA
JOIN
CELL_DATA_SOURCE CELLDATASOURCE
PERIOD_CELL_DATA_SOURCE CELLDATASOURCE
ON
CELLDATA.ID = CELLDATASOURCE.CELL_DATA_ID
WHERE
CELLDATASOURCE.DATA_SOURCE_ID = #{dataSourceID,jdbcType=BIGINT} LIMIT 1
</select>
<!--DELETE FROM period_tax_rule_setting WHERE period=#{period,jdbcType=INTEGER};-->
<!--DELETE FROM period_cell_template WHERE period=#{period,jdbcType=INTEGER} and report_template_id not in (${exceptReportTemplateIDs});-->
<!--DELETE FROM period_cell_template_config WHERE period=#{period,jdbcType=INTEGER} and report_template_id not in (${exceptReportTemplateIDs});-->
<!--DELETE FROM period_template WHERE period=#{period,jdbcType=INTEGER} and id not in (${exceptReportTemplateIDs});-->
<!--DELETE FROM period_tax_payer_report_rule WHERE period=#{period,jdbcType=INTEGER};-->
<!--DELETE d FROM data_source d JOIN period_formula_block f ON d.key_value_data_id = f.id WHERE f.Period = #{period,jdbcType=INTEGER};-->
<!--&amp;amp;lt;/delete&amp;amp;gt;-->
</mapper>
\ No newline at end of file
......@@ -4,7 +4,7 @@
<update id="updateReportId">
UPDATE
PERIOD_FORMULA_BLOCK
PERIOD_PERIOD_FORMULA_BLOCK
SET
REPORT_ID= #{reportId,jdbcType=BIGINT}
WHERE
......
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