工资比例计算
This commit is contained in:
		| @@ -0,0 +1,101 @@ | ||||
| package com.stdiet.custom.domain; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import com.stdiet.common.annotation.Excel; | ||||
| import com.stdiet.common.core.domain.BaseEntity; | ||||
| import lombok.Data; | ||||
|  | ||||
| /** | ||||
|  * 工资比例配置对象 sys_salary_compose_config | ||||
|  * | ||||
|  * @author xiezhijun | ||||
|  * @date 2021-03-13 | ||||
|  */ | ||||
| @Data | ||||
| public class SysSalaryComposeConfig extends BaseEntity | ||||
| { | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     //继续教育补贴界限,超过该值才有继续教育补贴 | ||||
|     public static final Double educationAllowanceLimit = 15000.00; | ||||
|  | ||||
|     //工资低于该值时,基本薪资+岗位津贴+绩效等于{baseSalarySum} | ||||
|     public static final Double baseSalarySumLimit = 6000.00; | ||||
|  | ||||
|     //工资低于{baseSalarySumLimit}时,基本薪资+岗位津贴+绩效之和 | ||||
|     public static final Double lowerBaseSalarySum = 3000.00; | ||||
|  | ||||
|     //工资高于{baseSalarySumLimit}时,基本薪资+岗位津贴+绩效之和 | ||||
|     public static final Double higherBaseSalarySum = 5000.00 * 0.99; | ||||
|  | ||||
|     /** $column.columnComment */ | ||||
|     private Long id; | ||||
|  | ||||
|     /** 岗位名称 */ | ||||
|     @Excel(name = "岗位名称") | ||||
|     private String salaryPostName; | ||||
|  | ||||
|     /** 基本薪资 */ | ||||
|     @Excel(name = "基本薪资") | ||||
|     private BigDecimal baseSalary; | ||||
|  | ||||
|     /** 岗位津贴比例(非全额比例),百分制,与绩效比例加起来为100% */ | ||||
|     @Excel(name = "岗位津贴比例(非全额比例),百分制,与绩效比例加起来为100%") | ||||
|     private Integer postAllowanceRate; | ||||
|  | ||||
|     /** 加班补贴占全额比例,百分制 */ | ||||
|     @Excel(name = "加班补贴占全额比例,百分制") | ||||
|     private Integer overtimeAllowanceRate; | ||||
|  | ||||
|     /** 绩效补贴比例(非全额比例),百分制,与岗位津贴加起来100% */ | ||||
|     @Excel(name = "绩效补贴比例(非全额比例),百分制,与岗位津贴加起来100%") | ||||
|     private Integer meritsAllowanceRate; | ||||
|  | ||||
|     /** 车补贴占全额比例,百分制 */ | ||||
|     @Excel(name = "车补贴占全额比例,百分制") | ||||
|     private Integer carAllowanceRate; | ||||
|  | ||||
|     /** 餐补占全额比例,百分制 */ | ||||
|     @Excel(name = "餐补占全额比例,百分制") | ||||
|     private Integer mealAllowanceRate; | ||||
|  | ||||
|     /** 全勤奖 */ | ||||
|     @Excel(name = "全勤奖") | ||||
|     private BigDecimal fullAttendanceSalary; | ||||
|  | ||||
|     /** 房补贴占全额比例,百分制 */ | ||||
|     @Excel(name = "房补贴占全额比例,百分制") | ||||
|     private Integer houseAllowanceRate; | ||||
|  | ||||
|     /** 差旅补贴占全额比例,百分制 */ | ||||
|     @Excel(name = "差旅补贴占全额比例,百分制") | ||||
|     private Integer travelAllowanceRate; | ||||
|  | ||||
|     /** 技能补贴占全额比例,百分制 */ | ||||
|     @Excel(name = "技能补贴占全额比例,百分制") | ||||
|     private Integer skillAllowanceRate; | ||||
|  | ||||
|     /** 培训补贴占全额比例,百分制 */ | ||||
|     @Excel(name = "培训补贴占全额比例,百分制") | ||||
|     private Integer trainAllowanceRate; | ||||
|  | ||||
|     /** 部门补贴占全额比例,百分制 */ | ||||
|     @Excel(name = "部门补贴占全额比例,百分制") | ||||
|     private Integer departmentAllowanceRate; | ||||
|  | ||||
|     /** 继续教育补贴占全额比例,百分制 */ | ||||
|     @Excel(name = "继续教育补贴占全额比例,百分制") | ||||
|     private Integer educationAllowanceRate; | ||||
|  | ||||
|     /** 删除标识 0未删除 1已删除 */ | ||||
|     private Integer delFlag; | ||||
|  | ||||
|     /** | ||||
|      * 获取固定比例之和,不能超过100% | ||||
|      * @return | ||||
|      */ | ||||
|     public int getBaseRateSum(){ | ||||
|           return overtimeAllowanceRate + carAllowanceRate + mealAllowanceRate + houseAllowanceRate + travelAllowanceRate + skillAllowanceRate + trainAllowanceRate | ||||
|                   + departmentAllowanceRate + educationAllowanceRate; | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,104 @@ | ||||
| package com.stdiet.custom.domain; | ||||
|  | ||||
| import com.stdiet.common.annotation.Excel; | ||||
| import com.stdiet.common.core.domain.BaseEntity; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
|  | ||||
| @Data | ||||
| public class SysSalaryRate extends BaseEntity { | ||||
|  | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|      * 构造函数初始化,全部设为0 | ||||
|      */ | ||||
|     public SysSalaryRate(){ | ||||
|         this.baseSalary = BigDecimal.valueOf(0.0); | ||||
|         this.postAllowance = BigDecimal.valueOf(0.0); | ||||
|         this.overtimeAllowance = BigDecimal.valueOf(0.0); | ||||
|         this.meritsAllowance = BigDecimal.valueOf(0.0); | ||||
|         this.carAllowance = BigDecimal.valueOf(0.0); | ||||
|         this.mealAllowance = BigDecimal.valueOf(0.0); | ||||
|         this.fullAttendanceSalary = BigDecimal.valueOf(0.0); | ||||
|         this.houseAllowance = BigDecimal.valueOf(0.0); | ||||
|         this.travelAllowance = BigDecimal.valueOf(0.0); | ||||
|         this.skillAllowance = BigDecimal.valueOf(0.0); | ||||
|         this.trainAllowance = BigDecimal.valueOf(0.0); | ||||
|         this.departmentAllowance = BigDecimal.valueOf(0.0); | ||||
|         this.educationAllowance = BigDecimal.valueOf(0.0); | ||||
|     } | ||||
|  | ||||
|     /** $column.columnComment */ | ||||
|     private Long id; | ||||
|  | ||||
|     /** 员工姓名 */ | ||||
|     @Excel(name = "姓名") | ||||
|     private String name; | ||||
|  | ||||
|     /** 岗位名称ID,对应工资岗位字典表的键值 */ | ||||
|     private String salaryPostId; | ||||
|  | ||||
|     @Excel(name = "岗位") | ||||
|     private String salaryPostName; | ||||
|  | ||||
|     /** 基本薪资 */ | ||||
|     @Excel(name = "基本薪资") | ||||
|     private BigDecimal baseSalary; | ||||
|  | ||||
|     /** 岗位津贴 */ | ||||
|     @Excel(name = "岗位津贴") | ||||
|     private BigDecimal postAllowance; | ||||
|  | ||||
|     /** 加班补贴 */ | ||||
|     @Excel(name = "加班补贴") | ||||
|     private BigDecimal overtimeAllowance; | ||||
|  | ||||
|     @Excel(name = "绩效") | ||||
|     private BigDecimal meritsAllowance; | ||||
|  | ||||
|     @Excel(name = "车补") | ||||
|     private BigDecimal carAllowance; | ||||
|  | ||||
|     /** 餐补*/ | ||||
|     @Excel(name = "餐补") | ||||
|     private BigDecimal mealAllowance; | ||||
|  | ||||
|     /** 全勤奖 */ | ||||
|     @Excel(name = "全勤奖") | ||||
|     private BigDecimal fullAttendanceSalary; | ||||
|  | ||||
|     /** 房补 */ | ||||
|     @Excel(name = "房补") | ||||
|     private BigDecimal houseAllowance; | ||||
|  | ||||
|     /** 差旅费 */ | ||||
|     @Excel(name = "差旅费") | ||||
|     private BigDecimal travelAllowance; | ||||
|  | ||||
|     /** 技能补贴 */ | ||||
|     @Excel(name = "技能补贴") | ||||
|     private BigDecimal skillAllowance; | ||||
|  | ||||
|     /** 培训补贴 */ | ||||
|     @Excel(name = "培训补贴") | ||||
|     private BigDecimal trainAllowance; | ||||
|  | ||||
|     /** 部门补贴 */ | ||||
|     @Excel(name = "部门补贴") | ||||
|     private BigDecimal departmentAllowance; | ||||
|  | ||||
|     /** 继续教育补贴*/ | ||||
|     @Excel(name = "继续教育补贴") | ||||
|     private BigDecimal educationAllowance; | ||||
|  | ||||
|     /** | ||||
|      * 获取固定比例的薪资总和 | ||||
|      * @return | ||||
|      */ | ||||
|     public BigDecimal getTotalRateSalary(){ | ||||
|         return overtimeAllowance.add(carAllowance).add(mealAllowance).add(houseAllowance).add(travelAllowance) | ||||
|                 .add(skillAllowance).add(trainAllowance).add(departmentAllowance).add(educationAllowance); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,28 @@ | ||||
| package com.stdiet.custom.dto.request; | ||||
|  | ||||
| import com.stdiet.common.annotation.Excel; | ||||
| import com.stdiet.common.core.domain.BaseEntity; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
|  | ||||
|  | ||||
| @Data | ||||
| public class SalaryRequest extends BaseEntity { | ||||
|  | ||||
|     //姓名 | ||||
|     @Excel(name = "姓名") | ||||
|     private String name; | ||||
|  | ||||
|     //薪资部门ID | ||||
|     @Excel(name = "岗位",prompt = "营养师、营养师助理、销售主管、销售、商务、策划运营、策划助理、人事、IT") | ||||
|     private String salaryPostName; | ||||
|  | ||||
|     //薪资 | ||||
|     @Excel(name = "薪资",prompt="保留两位小数") | ||||
|     private BigDecimal salary; | ||||
|  | ||||
|     //是否全勤 | ||||
|     @Excel(name = "是否全勤",prompt="是、否") | ||||
|     private String fullWork; | ||||
| } | ||||
| @@ -0,0 +1,61 @@ | ||||
| package com.stdiet.custom.mapper; | ||||
|  | ||||
| import java.util.List; | ||||
| import com.stdiet.custom.domain.SysSalaryComposeConfig; | ||||
|  | ||||
| /** | ||||
|  * 工资比例配置Mapper接口 | ||||
|  * | ||||
|  * @author xiezhijun | ||||
|  * @date 2021-03-13 | ||||
|  */ | ||||
| public interface SysSalaryComposeConfigMapper | ||||
| { | ||||
|     /** | ||||
|      * 查询工资比例配置 | ||||
|      * | ||||
|      * @param id 工资比例配置ID | ||||
|      * @return 工资比例配置 | ||||
|      */ | ||||
|     public SysSalaryComposeConfig selectSysSalaryComposeConfigById(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 查询工资比例配置列表 | ||||
|      * | ||||
|      * @param sysSalaryComposeConfig 工资比例配置 | ||||
|      * @return 工资比例配置集合 | ||||
|      */ | ||||
|     public List<SysSalaryComposeConfig> selectSysSalaryComposeConfigList(SysSalaryComposeConfig sysSalaryComposeConfig); | ||||
|  | ||||
|     /** | ||||
|      * 新增工资比例配置 | ||||
|      * | ||||
|      * @param sysSalaryComposeConfig 工资比例配置 | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int insertSysSalaryComposeConfig(SysSalaryComposeConfig sysSalaryComposeConfig); | ||||
|  | ||||
|     /** | ||||
|      * 修改工资比例配置 | ||||
|      * | ||||
|      * @param sysSalaryComposeConfig 工资比例配置 | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int updateSysSalaryComposeConfig(SysSalaryComposeConfig sysSalaryComposeConfig); | ||||
|  | ||||
|     /** | ||||
|      * 删除工资比例配置 | ||||
|      * | ||||
|      * @param id 工资比例配置ID | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int deleteSysSalaryComposeConfigById(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 批量删除工资比例配置 | ||||
|      * | ||||
|      * @param ids 需要删除的数据ID | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int deleteSysSalaryComposeConfigByIds(Long[] ids); | ||||
| } | ||||
| @@ -0,0 +1,14 @@ | ||||
| package com.stdiet.custom.service; | ||||
|  | ||||
| import com.stdiet.custom.domain.SysSalaryComposeConfig; | ||||
| import com.stdiet.custom.domain.SysSalaryRate; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import java.util.Map; | ||||
|  | ||||
| public interface ISysSalaryRateService { | ||||
|  | ||||
|     Map<String, SysSalaryComposeConfig> getSalaryComposeConfigMap(); | ||||
|  | ||||
|     SysSalaryRate calculateSingleRate(BigDecimal totalSalary, Boolean fullWorkFlag, SysSalaryComposeConfig sysSalaryComposeConfig); | ||||
| } | ||||
| @@ -0,0 +1,130 @@ | ||||
| package com.stdiet.custom.service.impl; | ||||
|  | ||||
| import com.stdiet.common.utils.NumberUtils; | ||||
| import com.stdiet.custom.domain.SysSalaryComposeConfig; | ||||
| import com.stdiet.custom.domain.SysSalaryRate; | ||||
| import com.stdiet.custom.mapper.SysSalaryComposeConfigMapper; | ||||
| import com.stdiet.custom.service.ISysSalaryRateService; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import java.math.BigDecimal; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| @Service | ||||
| public class ISysSalaryRateServiceImpl implements ISysSalaryRateService { | ||||
|  | ||||
|     @Autowired | ||||
|     private SysSalaryComposeConfigMapper sysSalaryComposeConfigMapper; | ||||
|  | ||||
|    /* @Override | ||||
|     public AjaxResult calculateSalaryRate(List<SalaryRequest> salaryList){ | ||||
|         AjaxResult result = AjaxResult.success(); | ||||
|         List<SysSalaryRate> sysSalaryRateList = new ArrayList<>(); | ||||
|         Map<String,SysSalaryComposeConfig> configMap = getSalaryComposeConfigMap(); | ||||
|         if(salaryList != null && salaryList.size() > 0 && configMap != null && configMap.size() > 0){ | ||||
|             for (SalaryRequest salaryRequest : salaryList) { | ||||
|                 if(StringUtils.isEmpty(salaryRequest.getName()) || salaryRequest.getSalary().doubleValue() < 0 || | ||||
|                         StringUtils.isEmpty(salaryRequest.getSalaryPostName()) || salaryRequest.getFullWork() == null){ | ||||
|                     return AjaxResult.error("Excel数据格式错误"); | ||||
|                 } | ||||
|                 SysSalaryComposeConfig config = configMap.get(salaryRequest.getSalaryPostName().trim()); | ||||
|                 if(config == null){ | ||||
|                     return AjaxResult.error(salaryRequest.getName()+"所在岗位不存在"); | ||||
|                 } | ||||
|                 if(config.getBaseRateSum() > 100){ | ||||
|                     return AjaxResult.error("岗位薪资配置比例超过100"); | ||||
|                 } | ||||
|                 SysSalaryRate sysSalaryRate = calculateSingleRate(salaryRequest.getSalary(), salaryRequest.getFullWork(), config); | ||||
|                 sysSalaryRate.setName(salaryRequest.getName().trim()); | ||||
|                 sysSalaryRate.setSalaryPostName(salaryRequest.getSalaryPostName()); | ||||
|                 sysSalaryRateList.add(sysSalaryRate); | ||||
|             } | ||||
|         } | ||||
|         result.put("sysSalaryRateList", sysSalaryRateList); | ||||
|         return result; | ||||
|     }*/ | ||||
|  | ||||
|     /** | ||||
|      * 获取薪资部门配置 | ||||
|      * @return | ||||
|      */ | ||||
|     @Override | ||||
|     public Map<String,SysSalaryComposeConfig> getSalaryComposeConfigMap(){ | ||||
|         Map<String,SysSalaryComposeConfig> configMap = new HashMap<>(); | ||||
|         List<SysSalaryComposeConfig> configList = sysSalaryComposeConfigMapper.selectSysSalaryComposeConfigList(new SysSalaryComposeConfig()); | ||||
|         if(configList != null && configList.size() > 0){ | ||||
|             for (SysSalaryComposeConfig config : configList) { | ||||
|                 configMap.put(config.getSalaryPostName(), config); | ||||
|             } | ||||
|         } | ||||
|         return configMap; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 计算工资比例 | ||||
|      * @param totalSalary 总工资 | ||||
|      * @param fullWorkFlag 是否全勤 | ||||
|      * @param sysSalaryComposeConfig 比例配置 | ||||
|      * @return | ||||
|      */ | ||||
|     @Override | ||||
|     public SysSalaryRate calculateSingleRate(BigDecimal totalSalary, Boolean fullWorkFlag, SysSalaryComposeConfig sysSalaryComposeConfig){ | ||||
|         SysSalaryRate sysSalaryRate = new SysSalaryRate(); | ||||
|         //计算加班补贴 | ||||
|         sysSalaryRate.setOvertimeAllowance(NumberUtils.getNumberByRoundHalfUp(totalSalary.doubleValue()*sysSalaryComposeConfig.getOvertimeAllowanceRate()/100, 2)); | ||||
|         //计算车补 | ||||
|         sysSalaryRate.setCarAllowance(NumberUtils.getNumberByRoundHalfUp(totalSalary.doubleValue()*sysSalaryComposeConfig.getCarAllowanceRate()/100, 2)); | ||||
|         //计算餐补 | ||||
|         sysSalaryRate.setMealAllowance(NumberUtils.getNumberByRoundHalfUp(totalSalary.doubleValue()*sysSalaryComposeConfig.getMealAllowanceRate()/100, 2)); | ||||
|         //计算房补 | ||||
|         sysSalaryRate.setHouseAllowance(NumberUtils.getNumberByRoundHalfUp(totalSalary.doubleValue()*sysSalaryComposeConfig.getHouseAllowanceRate()/100, 2)); | ||||
|         //计算差旅费 | ||||
|         sysSalaryRate.setTravelAllowance(NumberUtils.getNumberByRoundHalfUp(totalSalary.doubleValue()*sysSalaryComposeConfig.getTravelAllowanceRate()/100, 2)); | ||||
|         //计算技能补贴 | ||||
|         sysSalaryRate.setSkillAllowance(NumberUtils.getNumberByRoundHalfUp(totalSalary.doubleValue()*sysSalaryComposeConfig.getSkillAllowanceRate()/100, 2)); | ||||
|         //计算培训补贴 | ||||
|         sysSalaryRate.setTrainAllowance(NumberUtils.getNumberByRoundHalfUp(totalSalary.doubleValue()*sysSalaryComposeConfig.getTrainAllowanceRate()/100, 2)); | ||||
|         //计算部门补贴 | ||||
|         sysSalaryRate.setDepartmentAllowance(NumberUtils.getNumberByRoundHalfUp(totalSalary.doubleValue()*sysSalaryComposeConfig.getDepartmentAllowanceRate()/100, 2)); | ||||
|         //该岗位存在继续教育补贴而且大于等于该薪资界限才有继续教育补贴 | ||||
|         if(sysSalaryComposeConfig.getEducationAllowanceRate().intValue() > 0 && totalSalary.doubleValue() >= SysSalaryComposeConfig.educationAllowanceLimit){ | ||||
|             sysSalaryRate.setEducationAllowance(NumberUtils.getNumberByRoundHalfUp(totalSalary.doubleValue()*sysSalaryComposeConfig.getDepartmentAllowanceRate()/100, 2)); | ||||
|         } | ||||
|         BigDecimal totalRateSalary = sysSalaryRate.getTotalRateSalary(); | ||||
|         //计算剩余薪资 | ||||
|         Double surplusSalary = totalSalary.doubleValue() - totalRateSalary.doubleValue(); | ||||
|         if(surplusSalary <= 0){ | ||||
|             return sysSalaryRate; | ||||
|         } | ||||
|         //是否全勤 | ||||
|         if(fullWorkFlag){ | ||||
|             //减去全勤奖 | ||||
|             surplusSalary -= sysSalaryComposeConfig.getFullAttendanceSalary().doubleValue(); | ||||
|             sysSalaryRate.setFullAttendanceSalary(surplusSalary >= 0 ? sysSalaryComposeConfig.getFullAttendanceSalary() : BigDecimal.valueOf(surplusSalary + sysSalaryComposeConfig.getFullAttendanceSalary().doubleValue())); | ||||
|             if(surplusSalary <= 0){ | ||||
|                 return sysSalaryRate; | ||||
|             } | ||||
|         } | ||||
|         //减去基本薪资 | ||||
|         surplusSalary -= sysSalaryComposeConfig.getBaseSalary().doubleValue(); | ||||
|         sysSalaryRate.setBaseSalary(surplusSalary >= 0 ? sysSalaryComposeConfig.getBaseSalary() : BigDecimal.valueOf(surplusSalary + sysSalaryComposeConfig.getBaseSalary().doubleValue())); | ||||
|         if(surplusSalary <= 0){ | ||||
|             return sysSalaryRate; | ||||
|         } | ||||
|         BigDecimal postSalary = null; | ||||
|         Double baseSalarySum = totalRateSalary.doubleValue() >= SysSalaryComposeConfig.baseSalarySumLimit ? SysSalaryComposeConfig.higherBaseSalarySum : SysSalaryComposeConfig.lowerBaseSalarySum; | ||||
|         //计算原有基础岗位补贴 | ||||
|         postSalary = NumberUtils.getNumberByRoundHalfUp((baseSalarySum - sysSalaryComposeConfig.getBaseSalary().doubleValue()) * sysSalaryComposeConfig.getPostAllowanceRate()/100, 2); | ||||
|         //减去岗位补贴 | ||||
|         surplusSalary -= postSalary.doubleValue(); | ||||
|         sysSalaryRate.setPostAllowance(surplusSalary >= 0 ? postSalary : BigDecimal.valueOf(surplusSalary + postSalary.doubleValue())); | ||||
|         if(surplusSalary <= 0){ | ||||
|             return sysSalaryRate; | ||||
|         } | ||||
|         //剩余薪资全部为绩效 | ||||
|         sysSalaryRate.setMeritsAllowance(BigDecimal.valueOf(surplusSalary)); | ||||
|         return sysSalaryRate; | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,126 @@ | ||||
| <?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.stdiet.custom.mapper.SysSalaryComposeConfigMapper"> | ||||
|  | ||||
|     <resultMap type="SysSalaryComposeConfig" id="SysSalaryComposeConfigResult"> | ||||
|         <result property="id"    column="id"    /> | ||||
|         <result property="salaryPostName"    column="salary_post_name"    /> | ||||
|         <result property="baseSalary"    column="base_salary"    /> | ||||
|         <result property="postAllowanceRate"    column="post_allowance_rate"    /> | ||||
|         <result property="overtimeAllowanceRate"    column="overtime_allowance_rate"    /> | ||||
|         <result property="meritsAllowanceRate"    column="merits_allowance_rate"    /> | ||||
|         <result property="carAllowanceRate"    column="car_allowance_rate"    /> | ||||
|         <result property="mealAllowanceRate"    column="meal_allowance_rate"    /> | ||||
|         <result property="fullAttendanceSalary"    column="full_attendance_salary"    /> | ||||
|         <result property="houseAllowanceRate"    column="house_allowance_rate"    /> | ||||
|         <result property="travelAllowanceRate"    column="travel_allowance_rate"    /> | ||||
|         <result property="skillAllowanceRate"    column="skill_allowance_rate"    /> | ||||
|         <result property="trainAllowanceRate"    column="train_allowance_rate"    /> | ||||
|         <result property="departmentAllowanceRate"    column="department_allowance_rate"    /> | ||||
|         <result property="educationAllowanceRate"    column="education_allowance_rate"    /> | ||||
|         <result property="createTime"    column="create_time"    /> | ||||
|         <result property="createBy"    column="create_by"    /> | ||||
|         <result property="updateTime"    column="update_time"    /> | ||||
|         <result property="updateBy"    column="update_by"    /> | ||||
|         <result property="delFlag"    column="del_flag"    /> | ||||
|     </resultMap> | ||||
|  | ||||
|     <sql id="selectSysSalaryComposeConfigVo"> | ||||
|         select id, salary_post_name, base_salary, post_allowance_rate, overtime_allowance_rate, merits_allowance_rate, car_allowance_rate, meal_allowance_rate, full_attendance_salary, house_allowance_rate, travel_allowance_rate, skill_allowance_rate, train_allowance_rate, department_allowance_rate, education_allowance_rate, create_time, create_by, update_time, update_by, del_flag from sys_salary_compose_config | ||||
|     </sql> | ||||
|  | ||||
|     <select id="selectSysSalaryComposeConfigList" parameterType="SysSalaryComposeConfig" resultMap="SysSalaryComposeConfigResult"> | ||||
|         <include refid="selectSysSalaryComposeConfigVo"/> where del_flag = 0 | ||||
|     </select> | ||||
|  | ||||
|     <select id="selectSysSalaryComposeConfigById" parameterType="Long" resultMap="SysSalaryComposeConfigResult"> | ||||
|         <include refid="selectSysSalaryComposeConfigVo"/> | ||||
|         where id = #{id} and del_flag = 0 | ||||
|     </select> | ||||
|  | ||||
|     <insert id="insertSysSalaryComposeConfig" parameterType="SysSalaryComposeConfig" useGeneratedKeys="true" keyProperty="id"> | ||||
|         insert into sys_salary_compose_config | ||||
|         <trim prefix="(" suffix=")" suffixOverrides=","> | ||||
|             <if test="salaryPostName != null">salary_post_name,</if> | ||||
|             <if test="baseSalary != null">base_salary,</if> | ||||
|             <if test="postAllowanceRate != null">post_allowance_rate,</if> | ||||
|             <if test="overtimeAllowanceRate != null">overtime_allowance_rate,</if> | ||||
|             <if test="meritsAllowanceRate != null">merits_allowance_rate,</if> | ||||
|             <if test="carAllowanceRate != null">car_allowance_rate,</if> | ||||
|             <if test="mealAllowanceRate != null">meal_allowance_rate,</if> | ||||
|             <if test="fullAttendanceSalary != null">full_attendance_salary,</if> | ||||
|             <if test="houseAllowanceRate != null">house_allowance_rate,</if> | ||||
|             <if test="travelAllowanceRate != null">travel_allowance_rate,</if> | ||||
|             <if test="skillAllowanceRate != null">skill_allowance_rate,</if> | ||||
|             <if test="trainAllowanceRate != null">train_allowance_rate,</if> | ||||
|             <if test="departmentAllowanceRate != null">department_allowance_rate,</if> | ||||
|             <if test="educationAllowanceRate != null">education_allowance_rate,</if> | ||||
|             <if test="createTime != null">create_time,</if> | ||||
|             <if test="createBy != null">create_by,</if> | ||||
|             <if test="updateTime != null">update_time,</if> | ||||
|             <if test="updateBy != null">update_by,</if> | ||||
|             <if test="delFlag != null">del_flag,</if> | ||||
|         </trim> | ||||
|         <trim prefix="values (" suffix=")" suffixOverrides=","> | ||||
|             <if test="salaryPostName != null">#{salaryPostName},</if> | ||||
|             <if test="baseSalary != null">#{baseSalary},</if> | ||||
|             <if test="postAllowanceRate != null">#{postAllowanceRate},</if> | ||||
|             <if test="overtimeAllowanceRate != null">#{overtimeAllowanceRate},</if> | ||||
|             <if test="meritsAllowanceRate != null">#{meritsAllowanceRate},</if> | ||||
|             <if test="carAllowanceRate != null">#{carAllowanceRate},</if> | ||||
|             <if test="mealAllowanceRate != null">#{mealAllowanceRate},</if> | ||||
|             <if test="fullAttendanceSalary != null">#{fullAttendanceSalary},</if> | ||||
|             <if test="houseAllowanceRate != null">#{houseAllowanceRate},</if> | ||||
|             <if test="travelAllowanceRate != null">#{travelAllowanceRate},</if> | ||||
|             <if test="skillAllowanceRate != null">#{skillAllowanceRate},</if> | ||||
|             <if test="trainAllowanceRate != null">#{trainAllowanceRate},</if> | ||||
|             <if test="departmentAllowanceRate != null">#{departmentAllowanceRate},</if> | ||||
|             <if test="educationAllowanceRate != null">#{educationAllowanceRate},</if> | ||||
|             <if test="createTime != null">#{createTime},</if> | ||||
|             <if test="createBy != null">#{createBy},</if> | ||||
|             <if test="updateTime != null">#{updateTime},</if> | ||||
|             <if test="updateBy != null">#{updateBy},</if> | ||||
|             <if test="delFlag != null">#{delFlag},</if> | ||||
|         </trim> | ||||
|     </insert> | ||||
|  | ||||
|     <update id="updateSysSalaryComposeConfig" parameterType="SysSalaryComposeConfig"> | ||||
|         update sys_salary_compose_config | ||||
|         <trim prefix="SET" suffixOverrides=","> | ||||
|             <if test="salaryPostName != null">salary_post_name = #{salaryPostName},</if> | ||||
|             <if test="baseSalary != null">base_salary = #{baseSalary},</if> | ||||
|             <if test="postAllowanceRate != null">post_allowance_rate = #{postAllowanceRate},</if> | ||||
|             <if test="overtimeAllowanceRate != null">overtime_allowance_rate = #{overtimeAllowanceRate},</if> | ||||
|             <if test="meritsAllowanceRate != null">merits_allowance_rate = #{meritsAllowanceRate},</if> | ||||
|             <if test="carAllowanceRate != null">car_allowance_rate = #{carAllowanceRate},</if> | ||||
|             <if test="mealAllowanceRate != null">meal_allowance_rate = #{mealAllowanceRate},</if> | ||||
|             <if test="fullAttendanceSalary != null">full_attendance_salary = #{fullAttendanceSalary},</if> | ||||
|             <if test="houseAllowanceRate != null">house_allowance_rate = #{houseAllowanceRate},</if> | ||||
|             <if test="travelAllowanceRate != null">travel_allowance_rate = #{travelAllowanceRate},</if> | ||||
|             <if test="skillAllowanceRate != null">skill_allowance_rate = #{skillAllowanceRate},</if> | ||||
|             <if test="trainAllowanceRate != null">train_allowance_rate = #{trainAllowanceRate},</if> | ||||
|             <if test="departmentAllowanceRate != null">department_allowance_rate = #{departmentAllowanceRate},</if> | ||||
|             <if test="educationAllowanceRate != null">education_allowance_rate = #{educationAllowanceRate},</if> | ||||
|             <if test="createTime != null">create_time = #{createTime},</if> | ||||
|             <if test="createBy != null">create_by = #{createBy},</if> | ||||
|             <if test="updateTime != null">update_time = #{updateTime},</if> | ||||
|             <if test="updateBy != null">update_by = #{updateBy},</if> | ||||
|             <if test="delFlag != null">del_flag = #{delFlag},</if> | ||||
|         </trim> | ||||
|         where id = #{id} | ||||
|     </update> | ||||
|  | ||||
|     <update id="deleteSysSalaryComposeConfigById" parameterType="Long"> | ||||
|         update sys_salary_compose_config set del_flag = 1 where id = #{id} | ||||
|     </update> | ||||
|  | ||||
|     <update id="deleteSysSalaryComposeConfigByIds" parameterType="String"> | ||||
|         update sys_salary_compose_config set del_flag = 1 where id in | ||||
|         <foreach item="id" collection="array" open="(" separator="," close=")"> | ||||
|             #{id} | ||||
|         </foreach> | ||||
|     </update> | ||||
|  | ||||
| </mapper> | ||||
		Reference in New Issue
	
	Block a user