Commit 01136f48 authored by hongguangwu's avatar hongguangwu

MVP1.5.4-SALARY实发倒推应发初次提交

parent 15e3902b
......@@ -113,4 +113,10 @@ public class TSalaryAccountItem extends Model<TSalaryAccountItem> {
@TableField(exist = false)
private String salaryMonth;
/**
* 年终奖扣税方案0:合并;1:单独
*/
@TableField(exist = false)
private String annualBonusType;
}
......@@ -42,5 +42,14 @@ public interface TSalaryTaxConfigMapper extends BaseMapper<TSalaryTaxConfig> {
**/
List<TSalaryTaxConfig> getTaxConfigByAnnualBonusList(@Param("tSalaryTaxConfig") TSalaryTaxConfig tSalaryTaxConfig);
/**
* @param tSalaryTaxConfig
* @Description: 实发倒推
* @Author: hgw
* @Date: 2023/5/16 10:33
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryTaxConfig>
**/
List<TSalaryTaxConfig> getTaxConfigByActualList(@Param("tSalaryTaxConfig") TSalaryTaxConfig tSalaryTaxConfig);
}
......@@ -41,5 +41,7 @@ public interface TSalaryTaxConfigService extends IService<TSalaryTaxConfig> {
**/
List<TSalaryTaxConfig> getTaxConfigByAnnualBonusList(TSalaryTaxConfig tSalaryTaxConfig);
List<TSalaryTaxConfig> getTaxConfigByActualList(TSalaryTaxConfig tSalaryTaxConfig);
}
......@@ -505,6 +505,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
String checkYearFinalStyle; //薪资和年终奖扣税方案(0:合并;1:单独)
List<TSalaryTaxConfig> personTax = tSalaryTaxConfigService.getTaxConfigByPersonList(new TSalaryTaxConfig());
List<TSalaryTaxConfig> annousTax = tSalaryTaxConfigService.getTaxConfigByAnnualBonusList(new TSalaryTaxConfig());
List<TSalaryTaxConfig> actualTax = tSalaryTaxConfigService.getTaxConfigByActualList(new TSalaryTaxConfig());
int size = savList.size();
TSalaryAccountItem annousSai;
// 自有员工人数
......@@ -725,7 +726,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
//年终奖优化方案 2:自动计算
if (CommonConstants.TWO_STRING.equals(checkYearFinalStyle)) {
checkYearFinalStyle = checkYearFinalStyle(isActual, asList, sdSum
, costReduction, personTax, saiList, annualBonus, annousTax, a);
, costReduction, personTax, actualTax, saiList, annualBonus, annousTax, a);
}
//年终奖单独扣税
if (CommonConstants.ONE_STRING.equals(checkYearFinalStyle)) {
......@@ -748,14 +749,14 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
personalDebt = personalDebt.add(this.saveNewItems(saiList, SalaryConstants.SALARY_TAX,
SalaryConstants.SALARY_TAX_JAVA,
calculation2PersonSalary(isActual, saiList, asList, sdSum
, costReduction, personTax, saiList, a), CommonConstants.ZERO_INT));
, costReduction, personTax, actualTax, saiList, a), CommonConstants.ZERO_INT));
} else {
// 实发倒推个税应发
if (!isLabor) {
this.saveNewItems(saiList, SalaryConstants.SALARY_TAX,
SalaryConstants.SALARY_TAX_JAVA,
calculation2PersonSalary(isActual, saiList, asList, sdSum
, costReduction, personTax, saiList, a), CommonConstants.ZERO_INT);
, costReduction, personTax, actualTax, saiList, a), CommonConstants.ZERO_INT);
} else {
// 实发劳务费,按月累计扣税 2022-3-2 17:32:40 樊青青提的需求
this.saveNewItems(saiList, SalaryConstants.SALARY_TAX,
......@@ -1160,37 +1161,52 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
**/
private static BigDecimal calculation2PersonSalary(boolean isActual, List<TSalaryAccountItem> itemList
, List<TSalaryAccountItem> itemHistoryList, BigDecimal specialDeductionSum
, BigDecimal costReduction, List<TSalaryTaxConfig> subs, List<TSalaryAccountItem> saiList, TSalaryAccount a) {
, BigDecimal costReduction, List<TSalaryTaxConfig> subs, List<TSalaryTaxConfig> actualTax
, List<TSalaryAccountItem> saiList, TSalaryAccount a) {
//本次纳税额
BigDecimal res = SalaryConstants.B_ZERO;
BigDecimal annualBonus = SalaryConstants.B_ZERO;
BigDecimal sumTax = SalaryConstants.B_ZERO;
BigDecimal realDeduSalary = SalaryConstants.B_ZERO;
BigDecimal addRelaySalary = SalaryConstants.B_ZERO; // 实发倒推应发后需要加上其余金额,成为应发。
BigDecimal actualSalarySumNow = SalaryConstants.B_ZERO; // 本次实发。
// 实发倒推-属性:
BigDecimal actualSalaryNow = SalaryConstants.B_ZERO; // 本次实发
BigDecimal actualSalary = SalaryConstants.B_ZERO; // 实发
BigDecimal annualBonus = SalaryConstants.B_ZERO; // -单独年终奖
BigDecimal deduction = SalaryConstants.B_ZERO; // +个人代扣
BigDecimal phoneSubsidy = SalaryConstants.B_ZERO; // -通讯补贴(不计税)
BigDecimal otherDeduction = SalaryConstants.B_ZERO; // -其他扣除项,包含【累计个人社保(含代扣,含本期)+累计个人公积金(含代扣)
// +累计年金(个人含本期)+累计个人代扣(各类个人代扣费用,含本期)+免个税个人代扣(含本期)】
// - costReduction - specialDeductionSum
BigDecimal relaySalaryHistory = SalaryConstants.B_ZERO; // 历史应发
//本次
for (TSalaryAccountItem item : itemList) {
if (SalaryConstants.ANNUAL_BONUS_JAVA.equals(item.getJavaFiedName())) {
if (SalaryConstants.ANNUAL_BONUS_JAVA.equals(item.getJavaFiedName()) && CommonConstants.ONE_STRING.equals(a.getAnnualBonusType())) {
annualBonus = item.getSalaryMoney();
}
if (SalaryConstants.RELAY_SALARY_JAVA.equals(item.getJavaFiedName())) {
res = res.add(item.getSalaryMoney());
}
if (SalaryConstants.PDEDUCTION_JAVA.equals(item.getJavaFiedName())) {
deduction = deduction.add(item.getSalaryMoney());
otherDeduction = otherDeduction.add(item.getSalaryMoney());
}
if (SalaryConstants.PHONE_SUBSIDY_JAVA.equals(item.getJavaFiedName())) {
phoneSubsidy = phoneSubsidy.add(item.getSalaryMoney());
}
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(item.getJavaFiedName())) {
realDeduSalary = realDeduSalary.add(item.getSalaryMoney());
actualSalarySumNow = actualSalarySumNow.add(item.getSalaryMoney());
actualSalary = actualSalary.add(item.getSalaryMoney());
actualSalaryNow = actualSalaryNow.add(item.getSalaryMoney());
}
if (CommonConstants.ONE_INT == item.getIsTax()) {
res = res.subtract(item.getSalaryMoney());
realDeduSalary = realDeduSalary.subtract(item.getSalaryMoney());
addRelaySalary = addRelaySalary.add(item.getSalaryMoney());
}
otherDeduction = getOtherDeducation(otherDeduction, item);
}
BigDecimal realSalaryHistory = SalaryConstants.B_ZERO;
//历史累计
for (TSalaryAccountItem item : itemHistoryList) {
if (SalaryConstants.ANNUAL_BONUS_JAVA.equals(item.getJavaFiedName())) {
if (SalaryConstants.ANNUAL_BONUS_JAVA.equals(item.getJavaFiedName()) && CommonConstants.ONE_STRING.equals(item.getAnnualBonusType())) {
annualBonus = annualBonus.add(item.getSalaryMoney());
}
if (SalaryConstants.SALARY_TAX_JAVA.equals(item.getJavaFiedName())) {
......@@ -1198,15 +1214,23 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
if (SalaryConstants.RELAY_SALARY_JAVA.equals(item.getJavaFiedName())) {
res = res.add(item.getSalaryMoney());
realSalaryHistory = realSalaryHistory.add(item.getSalaryMoney());
relaySalaryHistory = relaySalaryHistory.add(item.getSalaryMoney());
}
if (SalaryConstants.PHONE_SUBSIDY_JAVA.equals(item.getJavaFiedName())) {
phoneSubsidy = phoneSubsidy.add(item.getSalaryMoney());
}
if (SalaryConstants.PDEDUCTION_JAVA.equals(item.getJavaFiedName())) {
deduction = deduction.add(item.getSalaryMoney());
otherDeduction = otherDeduction.add(item.getSalaryMoney());
}
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(item.getJavaFiedName())) {
realDeduSalary = realDeduSalary.add(item.getSalaryMoney());
actualSalary = actualSalary.add(item.getSalaryMoney());
}
if (CommonConstants.ONE_INT == item.getIsTax()) {
res = res.subtract(item.getSalaryMoney());
addRelaySalary = addRelaySalary.add(item.getSalaryMoney());
}
otherDeduction = getOtherDeducation(otherDeduction, item);
}
if (specialDeductionSum != null) {
res = res.subtract(specialDeductionSum);
......@@ -1215,7 +1239,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (costReduction != null) {
res = res.subtract(costReduction);
realDeduSalary = realDeduSalary.subtract(costReduction);
addRelaySalary = addRelaySalary.add(costReduction);
}
if (!isActual) {
for (TSalaryTaxConfig sub : subs) {
......@@ -1229,49 +1252,62 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
}
} else {
BigDecimal testArea; // 应发-起征点,判断计算金额范围;
//倒推公式(原先):
//((实发合计-减除费用)/ (1-税率) - (速算/(1-税率)) + 减除费用)
// -
// (历史应发)
// =
// 本次应发
TSalaryAccountItem sai;
BigDecimal relaySalary;
for (TSalaryTaxConfig sub : subs) {
//res = realDeduSalary / (1- (double) ((sub.getTaxRate() * 1.0) / 100))
// - (sub.getQuick()/ (1- (double) ((sub.getTaxRate() * 1.0) / 100)))
// + addRelaySalary
res = realDeduSalary.divide(new BigDecimal("1").subtract(new BigDecimal(sub.getWithholdingRate()).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP)), SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP)
.subtract(sub.getQuickDeducation().divide(new BigDecimal("1").subtract(new BigDecimal(sub.getWithholdingRate()).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP)), SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP))
.add(addRelaySalary);
testArea = res.subtract(costReduction);
if (testArea.compareTo(SalaryConstants.B_ZERO) < SalaryConstants.EQUAL) {
testArea = SalaryConstants.B_ZERO;
// -实发倒推应发改版-2023-5-16 10:51:31-版本MVP1.5.4-王成提供的新倒推公式
// 1 数据处理:报账明细中若存在“年终奖单独扣税”不为0的行时,在进行本公式计算时,应将年终奖金额从应发和实发中分别扣除后,再参与计算
// 2 计算税率档(税率、速算扣除数)=(累计实发金额(去掉年终奖单独扣税的部分实发,含本期)+个人代扣(各类个人代扣费用,不包含免个税个人代扣,含本期)
// -通讯补贴(不计税)-费用扣除标准(本期)-专项附加扣除(含本期))
// 税率档
BigDecimal areaMoney = actualSalary.subtract(annualBonus).add(deduction).subtract(phoneSubsidy);
if (costReduction != null) {
areaMoney = areaMoney.subtract(costReduction);
}
if (specialDeductionSum != null) {
areaMoney = areaMoney.subtract(specialDeductionSum);
}
// 应缴税所得额
BigDecimal doTaxMoney = BigDecimal.ZERO;
for (TSalaryTaxConfig sub : actualTax) {
if (areaMoney.compareTo(sub.getMinIncome()) > SalaryConstants.EQUAL
&& areaMoney.compareTo(sub.getMaxIncome()) <= SalaryConstants.EQUAL) {
// 3 计算应缴税所得额(参与计税的金额)= (税率档位-速算扣除数)/(1—税率)
doTaxMoney = (areaMoney.subtract(sub.getQuickDeducation())).divide(SalaryConstants.B_ONEHUNDRED.subtract(new BigDecimal(sub.getWithholdingRate())).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP));
break;
}
if (testArea.compareTo(sub.getMinIncome()) > SalaryConstants.EQUAL
&& testArea.compareTo(sub.getMaxIncome()) <= SalaryConstants.EQUAL) {
//res = res - realSalary - tf.getActualSalarySum(); //应发-历史应发=本次应发;本次应发-本次实发=税
relaySalary = res.subtract(realSalaryHistory);
res = relaySalary.subtract(actualSalarySumNow);
// 本次个人应发合计
sai = new TSalaryAccountItem();
sai.setCnName(SalaryConstants.RELAY_SALARY);
sai.setJavaFiedName(SalaryConstants.RELAY_SALARY_JAVA);
sai.setIsTax(CommonConstants.ZERO_INT);
if (res.compareTo(SalaryConstants.B_ZERO) <= SalaryConstants.EQUAL) {
sai.setSalaryMoney(actualSalarySumNow);
a.setRelaySalary(actualSalarySumNow);
} else {
sai.setSalaryMoney(relaySalary);
a.setRelaySalary(relaySalary);
}
saiList.add(sai);
}
// 累计个税
BigDecimal taxAll = BigDecimal.ZERO;
// 4 计算累计个税 =应纳税所得额×适用税率-速算扣除数
for (TSalaryTaxConfig sub : subs) {
if (doTaxMoney.compareTo(sub.getMinIncome()) > SalaryConstants.EQUAL
&& doTaxMoney.compareTo(sub.getMaxIncome()) <= SalaryConstants.EQUAL) {
taxAll = doTaxMoney.multiply(new BigDecimal(sub.getWithholdingRate()).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP))
.subtract(sub.getQuickDeducation());// 应纳税额
break;
}
}
if (taxAll.compareTo(SalaryConstants.B_ZERO) < SalaryConstants.EQUAL) {
taxAll = BigDecimal.ZERO;
}
// 5 计算应发=累计实发工资(含本期)+累计个税+累计个人社保(含代扣,含本期)+累计个人公积金(含代扣)
// +累计年金(个人含本期)+累计个人代扣(各类个人代扣费用,含本期)+免个税个人代扣(含本期)-历史累计应发(不含本期)
// 本次应发
BigDecimal relaySalaryNow = actualSalary.add(taxAll).add(otherDeduction).subtract(relaySalaryHistory);
if (relaySalaryNow.compareTo(actualSalaryNow) <= SalaryConstants.EQUAL) {
relaySalaryNow = actualSalaryNow;
}
res = relaySalaryNow.subtract(actualSalaryNow);
// 本次个人应发合计
TSalaryAccountItem sai = new TSalaryAccountItem();
sai.setCnName(SalaryConstants.RELAY_SALARY);
sai.setJavaFiedName(SalaryConstants.RELAY_SALARY_JAVA);
sai.setIsTax(CommonConstants.ZERO_INT);
sai.setSalaryMoney(relaySalaryNow);
a.setRelaySalary(relaySalaryNow);
saiList.add(sai);
}
if (res.compareTo(SalaryConstants.B_ZERO) < SalaryConstants.EQUAL) {
return SalaryConstants.B_ZERO;
......@@ -1281,6 +1317,38 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
return res;
}
/**
* @param otherDeduction
* @param item
* @Description: 实发倒推应发,获取其他累加项
* @Author: hgw
* @Date: 2023/5/16 17:09
* @return: java.math.BigDecimal
**/
private static BigDecimal getOtherDeducation(BigDecimal otherDeduction, TSalaryAccountItem item) {
if (SalaryConstants.WITHHOLIDING_PERSON_SOCIAL.equals(item.getJavaFiedName())) {
otherDeduction = otherDeduction.add(item.getSalaryMoney());
}
if (SalaryConstants.WITHHOLIDING_PERSON_FUND.equals(item.getJavaFiedName())) {
otherDeduction = otherDeduction.add(item.getSalaryMoney());
}
if (SalaryConstants.PERSONAL_SOCIAL_JAVA.equals(item.getJavaFiedName())) {
otherDeduction = otherDeduction.add(item.getSalaryMoney());
}
if (SalaryConstants.PERSONAL_FUND_JAVA.equals(item.getJavaFiedName())) {
otherDeduction = otherDeduction.add(item.getSalaryMoney());
}
// 企业(职业)年金
if (SalaryConstants.ENTERPRISE_ANNUITY_JAVA.equals(item.getJavaFiedName())) {
otherDeduction = otherDeduction.add(item.getSalaryMoney());
}
// 免个税个人代扣
if (SalaryConstants.EXEMPTION_PERSION_TAX_JAVA.equals(item.getJavaFiedName())) {
otherDeduction = otherDeduction.add(item.getSalaryMoney());
}
return otherDeduction;
}
/**
* @param itemList
......@@ -1364,11 +1432,11 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @author hgw
*/
public static String checkYearFinalStyle(boolean isActual, List<TSalaryAccountItem> asList, BigDecimal sdSum
, BigDecimal costReduction, List<TSalaryTaxConfig> personTax
, BigDecimal costReduction, List<TSalaryTaxConfig> personTax, List<TSalaryTaxConfig> actualTax
, List<TSalaryAccountItem> saiList, BigDecimal annualBonus
, List<TSalaryTaxConfig> annousTax, TSalaryAccount a) {
BigDecimal finalSalaryWithSalary = calculation2PersonSalary(isActual, saiList, asList, sdSum
, costReduction, personTax, saiList, a);
, costReduction, personTax, actualTax, saiList, a);
BigDecimal finalSalaryNoSalary = calculation2FinalSalary(a, annualBonus, annousTax);
if (finalSalaryWithSalary.compareTo(finalSalaryNoSalary) > SalaryConstants.EQUAL) {
return "1";
......
......@@ -55,4 +55,16 @@ public class TSalaryTaxConfigServiceImpl extends ServiceImpl<TSalaryTaxConfigMap
return baseMapper.getTaxConfigByAnnualBonusList(tSalaryTaxConfig);
}
/**
* @param tSalaryTaxConfig
* @Description: 获取年终奖配置
* @Author: hgw
* @Date: 2019/10/8 14:40
* @return: java.util.List<com.yifu.cloud.v1.hrms.api.entity.TSalaryTaxConfig>
**/
@Override
public List<TSalaryTaxConfig> getTaxConfigByActualList(TSalaryTaxConfig tSalaryTaxConfig) {
return baseMapper.getTaxConfigByActualList(tSalaryTaxConfig);
}
}
......@@ -155,6 +155,8 @@ public class SalaryConstants {
public static final String IS_PERSON = "个人承担全部税费";
//个人代扣
public static final String PDEDUCTION_JAVA = "pdeduction";
// 通讯补贴(不计税)
public static final String PHONE_SUBSIDY_JAVA = "phoneSubsidy";
// 代扣前缀
public static final String WITHHOLIDING = "withholiding";
//单位代扣
......
......@@ -26,6 +26,7 @@
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="settlementMonth" column="SETTLEMENT_MONTH"/>
<result property="formType" column="FORM_TYPE"/>
<result property="annualBonusType" column="ANNUAL_BONUS_TYPE"/>
</resultMap>
<!--tSalaryAccountItem简单分页查询-->
......@@ -423,7 +424,8 @@
i.IS_TAX,
a.EMP_IDCARD,
a.SETTLEMENT_MONTH,
a.FORM_TYPE
a.FORM_TYPE,
a.ANNUAL_BONUS_TYPE
FROM
t_salary_account_item i left join t_salary_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
......@@ -453,7 +455,8 @@
i.IS_TAX,
a.EMP_IDCARD,
a.SETTLEMENT_MONTH,
a.FORM_TYPE
a.FORM_TYPE,
a.ANNUAL_BONUS_TYPE
FROM
t_salary_account_item i left join t_salary_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
......
......@@ -16,10 +16,8 @@
<result property="startPoint" column="START_POINT"/>
</resultMap>
<!--tSalaryTaxConfig简单分页查询-->
<select id="getTSalaryTaxConfigPage" resultMap="tSalaryTaxConfigMap">
SELECT
ID,
<sql id="Base_Column_List">
ID,
TAXABLE_INCOME_REMARK,
WITHHOLDING_RATE,
QUICK_DEDUCATION,
......@@ -28,122 +26,82 @@
LEVEL,
TYPE,
START_POINT
</sql>
<sql id="tSalaryTaxConfig_where">
<if test="tSalaryTaxConfig != null">
<if test="tSalaryTaxConfig.id != null and tSalaryTaxConfig.id.trim() != ''">
AND ID = #{tSalaryTaxConfig.id}
</if>
<if test="tSalaryTaxConfig.taxableIncomeRemark != null and tSalaryTaxConfig.taxableIncomeRemark.trim() != ''">
AND TAXABLE_INCOME_REMARK = #{tSalaryTaxConfig.taxableIncomeRemark}
</if>
<if test="tSalaryTaxConfig.withholdingRate != null">
AND WITHHOLDING_RATE = #{tSalaryTaxConfig.withholdingRate}
</if>
<if test="tSalaryTaxConfig.quickDeducation != null">
AND QUICK_DEDUCATION = #{tSalaryTaxConfig.quickDeducation}
</if>
<if test="tSalaryTaxConfig.minIncome != null">
AND MIN_INCOME = #{tSalaryTaxConfig.minIncome}
</if>
<if test="tSalaryTaxConfig.maxIncome != null">
AND MAX_INCOME = #{tSalaryTaxConfig.maxIncome}
</if>
<if test="tSalaryTaxConfig.level != null">
AND LEVEL = #{tSalaryTaxConfig.level}
</if>
<if test="tSalaryTaxConfig.type != null">
AND TYPE = #{tSalaryTaxConfig.type}
</if>
<if test="tSalaryTaxConfig.startPoint != null">
AND START_POINT = #{tSalaryTaxConfig.startPoint}
</if>
</if>
</sql>
<!--tSalaryTaxConfig简单分页查询-->
<select id="getTSalaryTaxConfigPage" resultMap="tSalaryTaxConfigMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_salary_tax_config
<where>
1=1
<if test="tSalaryTaxConfig.id != null and tSalaryTaxConfig.id.trim() != ''">
AND ID = #{tSalaryTaxConfig.id}
</if>
<if test="tSalaryTaxConfig.taxableIncomeRemark != null and tSalaryTaxConfig.taxableIncomeRemark.trim() != ''">
AND TAXABLE_INCOME_REMARK = #{tSalaryTaxConfig.taxableIncomeRemark}
</if>
<if test="tSalaryTaxConfig.withholdingRate != null">
AND WITHHOLDING_RATE = #{tSalaryTaxConfig.withholdingRate}
</if>
<if test="tSalaryTaxConfig.quickDeducation != null">
AND QUICK_DEDUCATION = #{tSalaryTaxConfig.quickDeducation}
</if>
<if test="tSalaryTaxConfig.minIncome != null">
AND MIN_INCOME = #{tSalaryTaxConfig.minIncome}
</if>
<if test="tSalaryTaxConfig.maxIncome != null">
AND MAX_INCOME = #{tSalaryTaxConfig.maxIncome}
</if>
<if test="tSalaryTaxConfig.level != null">
AND LEVEL = #{tSalaryTaxConfig.level}
</if>
<if test="tSalaryTaxConfig.type != null">
AND TYPE = #{tSalaryTaxConfig.type}
</if>
<if test="tSalaryTaxConfig.startPoint != null">
AND START_POINT = #{tSalaryTaxConfig.startPoint}
</if>
<include refid="tSalaryTaxConfig_where"/>
</where>
</select>
<!--tSalaryTaxConfig获取个税配置-->
<select id="getTaxConfigByPersonList" resultMap="tSalaryTaxConfigMap">
SELECT
ID,
TAXABLE_INCOME_REMARK,
WITHHOLDING_RATE,
QUICK_DEDUCATION,
MIN_INCOME,
MAX_INCOME,
LEVEL,
TYPE,
START_POINT
<include refid="Base_Column_List"/>
FROM t_salary_tax_config
<where>
TYPE = 0
<if test="tSalaryTaxConfig.id != null and tSalaryTaxConfig.id.trim() != ''">
AND ID = #{tSalaryTaxConfig.id}
</if>
<if test="tSalaryTaxConfig.taxableIncomeRemark != null and tSalaryTaxConfig.taxableIncomeRemark.trim() != ''">
AND TAXABLE_INCOME_REMARK = #{tSalaryTaxConfig.taxableIncomeRemark}
</if>
<if test="tSalaryTaxConfig.withholdingRate != null">
AND WITHHOLDING_RATE = #{tSalaryTaxConfig.withholdingRate}
</if>
<if test="tSalaryTaxConfig.quickDeducation != null">
AND QUICK_DEDUCATION = #{tSalaryTaxConfig.quickDeducation}
</if>
<if test="tSalaryTaxConfig.minIncome != null">
AND MIN_INCOME = #{tSalaryTaxConfig.minIncome}
</if>
<if test="tSalaryTaxConfig.maxIncome != null">
AND MAX_INCOME = #{tSalaryTaxConfig.maxIncome}
</if>
<if test="tSalaryTaxConfig.level != null">
AND LEVEL = #{tSalaryTaxConfig.level}
</if>
<if test="tSalaryTaxConfig.startPoint != null">
AND START_POINT = #{tSalaryTaxConfig.startPoint}
</if>
<include refid="tSalaryTaxConfig_where"/>
</where>
</select>
<!--tSalaryTaxConfig获取年终奖配置-->
<select id="getTaxConfigByAnnualBonusList" resultMap="tSalaryTaxConfigMap">
SELECT
ID,
TAXABLE_INCOME_REMARK,
WITHHOLDING_RATE,
QUICK_DEDUCATION,
MIN_INCOME,
MAX_INCOME,
LEVEL,
TYPE,
START_POINT
<include refid="Base_Column_List"/>
FROM t_salary_tax_config
<where>
TYPE = 1
<if test="tSalaryTaxConfig.id != null and tSalaryTaxConfig.id.trim() != ''">
AND ID = #{tSalaryTaxConfig.id}
</if>
<if test="tSalaryTaxConfig.taxableIncomeRemark != null and tSalaryTaxConfig.taxableIncomeRemark.trim() != ''">
AND TAXABLE_INCOME_REMARK = #{tSalaryTaxConfig.taxableIncomeRemark}
</if>
<if test="tSalaryTaxConfig.withholdingRate != null">
AND WITHHOLDING_RATE = #{tSalaryTaxConfig.withholdingRate}
</if>
<if test="tSalaryTaxConfig.quickDeducation != null">
AND QUICK_DEDUCATION = #{tSalaryTaxConfig.quickDeducation}
</if>
<if test="tSalaryTaxConfig.minIncome != null">
AND MIN_INCOME = #{tSalaryTaxConfig.minIncome}
</if>
<if test="tSalaryTaxConfig.maxIncome != null">
AND MAX_INCOME = #{tSalaryTaxConfig.maxIncome}
</if>
<if test="tSalaryTaxConfig.level != null">
AND LEVEL = #{tSalaryTaxConfig.level}
</if>
<if test="tSalaryTaxConfig.startPoint != null">
AND START_POINT = #{tSalaryTaxConfig.startPoint}
</if>
<include refid="tSalaryTaxConfig_where"/>
</where>
</select>
<!--tSalaryTaxConfig获取实发倒推配置-->
<select id="getTaxConfigByActualList" resultMap="tSalaryTaxConfigMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_salary_tax_config
<where>
TYPE = 2
<include refid="tSalaryTaxConfig_where"/>
</where>
</select>
</mapper>
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