<?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="cn.ezhizao.project.business.financialBase.mapper.BizFinancialMergeMapper">
    <!-- 基础的返回map 多表复杂的 自行组合 -->
    <resultMap id="BaseResultMap" type="cn.ezhizao.project.business.financialBase.domain.BizFinancialMerge">
        <id column="id" jdbcType="BIGINT" property="id"/>
    </resultMap>
    <!--根据主表id，删除 为的是表单保存时，明细统一物理删除后，再统一插入-->
    <delete id="physicallyDelete">
        DELETE FROM biz_financial_merge
        where deleted = 0
        <if test="id != null"> and id = #{id}</if>
        <if test="financialIndividualIncomeTaxDetailId!= null"> and financial_individual_income_tax_detail_id = #{financialIndividualIncomeTaxDetailId}</if>
        <if test="financialReportTaxDetailId!= null"> and financial_report_tax_detail_id = #{financialReportTaxDetailId}</if>
    </delete>


</mapper>
