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};
delete from period_formula_block where period=#{period,jdbcType=INTEGER};
delete from period_tax_payer_report_rule 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,jdbcType=VARCHAR});
delete from period_cell_template_config where period=#{period,jdbcType=INTEGER} and report_template_id not in (#{exceptReportTemplateIDs,jdbcType=VARCHAR});
delete from period_template where period=#{period,jdbcType=INTEGER} and id not in (#{exceptReportTemplateIDs,jdbcType=VARCHAR});
<deleteid="clearFormulaBlockWithPeriod">
DELETE FROM period_formula_block WHERE period=#{period,jdbcType=INTEGER};
</delete>
<deleteid="clearTaxRuleSettingWithPeriod">
DELETE FROM period_tax_rule_setting WHERE period=#{period,jdbcType=INTEGER};
</delete>
<deleteid="clearCellTemplateWithPeriod">
DELETE FROM period_cell_template WHERE period=#{period,jdbcType=INTEGER}
<iftest="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''">
and id not in (${exceptReportTemplateIDs});
</if>
</delete>
<deleteid="clearCellTemplateConfigWithPeriod">
DELETE FROM period_cell_template_config WHERE period=#{period,jdbcType=INTEGER}
<iftest="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''">
and id not in (${exceptReportTemplateIDs});
</if>
</delete>
<deleteid="clearTemplateWithPeriod">
DELETE FROM period_template WHERE period=#{period,jdbcType=INTEGER}
<iftest="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''">
and id not in (${exceptReportTemplateIDs});
</if>
</delete>
<deleteid="clearTaxPayerReportWithPeriod">
DELETE FROM period_tax_payer_report_rule WHERE period=#{period,jdbcType=INTEGER};
</delete>
<deleteid="clearDataSourceWithPeriod">
DELETE d FROM data_source d JOIN period_formula_block f ON d.id = f.data_source_id WHERE f.Period = #{period,jdbcType=INTEGER};
</delete>
<deleteid="clearDataSourceDetailWithPeriod">
DELETE d FROM data_source_detail d JOIN period_formula_block f ON d.data_source_id = f.data_source_id WHERE f.Period = #{period,jdbcType=INTEGER};
</delete>
<deleteid="clearCellDataWithPeriod">
DELETE FROM cell_data
<iftest="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''">
WHERE report_id not in (${exceptReportTemplateIDs});
</if>
</delete>
<!--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};-->