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 { ...@@ -108,30 +108,6 @@ public interface PeriodDataSourceMapper extends MyVatMapper {
*/ */
int updateByPrimaryKey(PeriodDataSource record); 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> getFormulaDataSource(Long reportID);
List<DataSourceExtendDto> getManualDataSource(Long cellDataID); List<DataSourceExtendDto> getManualDataSource(Long cellDataID);
......
...@@ -5,20 +5,10 @@ ...@@ -5,20 +5,10 @@
<select id="getSumOfBalance" resultType="java.math.BigDecimal"> <select id="getSumOfBalance" resultType="java.math.BigDecimal">
SELECT SELECT
IFNULL ( IFNULL (
SUM ( SUM(
( ( IFNULL ( a.DEBIT_NET, 0 ) - IFNULL ( a.CREDIT_NET, 0 ) ) * #{ direction,,
IFNULL ( jdbcType = INTEGER }
a.DEBIT_NET, ),
0
)
-IFNULL (
a.CREDIT_NET,
0
)
)
* #{direction,,jdbcType=INTEGER}
)
,
0 0
) )
FROM FROM
...@@ -34,19 +24,9 @@ ...@@ -34,19 +24,9 @@
SELECT SELECT
IFNULL ( IFNULL (
( (
( ( IFNULL ( a.DEBIT_NET, 0 ) - IFNULL ( a.CREDIT_NET, 0 ) ) * #{ direction,,
IFNULL ( jdbcType = INTEGER }
a.DEBIT_NET, ),
0
)
-IFNULL (
a.CREDIT_NET,
0
)
)
* #{direction,,jdbcType=INTEGER}
)
,
0 0
) )
FROM FROM
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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"> <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"> <resultMap id="DataSourceExtendDtoMap" type="pwc.taxtech.atms.vat.dpo.DataSourceExtendDto">
<id column="id" jdbcType="BIGINT" property="id"/> <id column="id" jdbcType="BIGINT" property="id"/>
<result column="TYPE" jdbcType="INTEGER" property="type"/> <result column="TYPE" jdbcType="INTEGER" property="type"/>
...@@ -223,17 +31,17 @@ ...@@ -223,17 +31,17 @@
CD.ID AS CELL_DATA_ID, CD.ID AS CELL_DATA_ID,
RPT.TEMPLATE_ID AS REPORT_TEMPLATE_ID RPT.TEMPLATE_ID AS REPORT_TEMPLATE_ID
FROM FROM
DATA_SOURCE DS PERIOD_DATA_SOURCE DS
JOIN JOIN
CELL_DATA_SOURCE CDS PERIOD_CELL_DATA_SOURCE CDS
ON ON
DS.ID = CDS.DATA_SOURCE_ID DS.ID = CDS.DATA_SOURCE_ID
JOIN JOIN
CELL_DATA CD PERIOD_CELL_DATA CD
ON ON
CDS.CELL_DATA_ID = CD.ID CDS.CELL_DATA_ID = CD.ID
JOIN JOIN
REPORT RPT PERIOD_REPORT RPT
ON ON
CD.REPORT_ID= RPT.ID CD.REPORT_ID= RPT.ID
WHERE WHERE
...@@ -263,9 +71,9 @@ ...@@ -263,9 +71,9 @@
DS.CELL_TEMPLATE_ID, DS.CELL_TEMPLATE_ID,
DS.PERIOD DS.PERIOD
FROM FROM
CELL_DATA_SOURCE CDS PERIOD_CELL_DATA_SOURCE CDS
JOIN JOIN
DATA_SOURCE DS PERIOD_DATA_SOURCE DS
ON ON
CDS.DATA_SOURCE_ID = DS.ID CDS.DATA_SOURCE_ID = DS.ID
WHERE WHERE
...@@ -297,26 +105,12 @@ ...@@ -297,26 +105,12 @@
CELLDATASOURCE.ID AS CELL_DATA_SOURCE_ID, CELLDATASOURCE.ID AS CELL_DATA_SOURCE_ID,
CELLDATASOURCE.OPERATION_TYPE AS CELL_DATA_SOURCE_OPERATION_TYPE CELLDATASOURCE.OPERATION_TYPE AS CELL_DATA_SOURCE_OPERATION_TYPE
FROM FROM
CELL_DATA CELLDATA PERIOD_CELL_DATA CELLDATA
JOIN JOIN
CELL_DATA_SOURCE CELLDATASOURCE PERIOD_CELL_DATA_SOURCE CELLDATASOURCE
ON ON
CELLDATA.ID = CELLDATASOURCE.CELL_DATA_ID CELLDATA.ID = CELLDATASOURCE.CELL_DATA_ID
WHERE WHERE
CELLDATASOURCE.DATA_SOURCE_ID = #{dataSourceID,jdbcType=BIGINT} LIMIT 1 CELLDATASOURCE.DATA_SOURCE_ID = #{dataSourceID,jdbcType=BIGINT} LIMIT 1
</select> </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> </mapper>
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<update id="updateReportId"> <update id="updateReportId">
UPDATE UPDATE
PERIOD_FORMULA_BLOCK PERIOD_PERIOD_FORMULA_BLOCK
SET SET
REPORT_ID= #{reportId,jdbcType=BIGINT} REPORT_ID= #{reportId,jdbcType=BIGINT}
WHERE 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