<?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="com.engine.salary.mapper.SysTaxRateDetailMapper">
    <resultMap id="BaseResultMap" type="com.engine.salary.entity.taxrate.SysTaxRateDetailPO">
        <result column="id" property="id"/>
        <result column="base_id" property="baseId"/>
        <result column="index_num" property="indexNum"/>
        <result column="income_lower_limit" property="incomeLowerLimit"/>
        <result column="income_upper_limit" property="incomeUpperLimit"/>
        <result column="duty_free_value" property="dutyFreeValue"/>
        <result column="duty_free_rate" property="dutyFreeRate"/>
        <result column="taxable_income_ll" property="incomeLowerLimit"/>
        <result column="taxable_income_ul" property="taxableIncomeULimit"/>
        <result column="tax_rate" property="taxRate"/>
        <result column="tax_deduction" property="taxDeduction"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="creator" property="creator"/>
        <result column="delete_type" property="deleteType"/>
        <result column="tenant_key" property="tenantKey"/>
    </resultMap>

    <!-- 表字段 -->
    <sql id="baseColumns">
        t
        .
        id
        , t.base_id
        , t.index_num
        , t.income_lower_limit
        , t.income_upper_limit
        , t.duty_free_value
        , t.duty_free_rate
        , t.taxable_income_ll
        , t.taxable_income_ul
        , t.tax_rate
        , t.tax_deduction
        , t.create_time
        , t.update_time
        , t.creator
        , t.delete_type
        , t.tenant_key
    </sql>

    <!-- 查询全部 -->
    <select id="listByBaseId" resultMap="BaseResultMap">
        SELECT
        <include refid="baseColumns"/>
        FROM hrsa_sys_tax_rate_detail t
        WHERE delete_type = 0
        and base_id =#{baseId}
    </select>


</mapper>