Commit 324e39f3 authored by ‘老张’'s avatar ‘老张’

员工年假修改

parent 48c48c83
...@@ -25,6 +25,10 @@ public class EmployeeBalance extends BaseEntity ...@@ -25,6 +25,10 @@ public class EmployeeBalance extends BaseEntity
@Excel(name = "员工ID") @Excel(name = "员工ID")
private Long employeeId; private Long employeeId;
/** 员工姓名(关联到员工表) */
@Excel(name = "员工姓名")
private String name;
/** 年假余额 */ /** 年假余额 */
@Excel(name = "年假余额/天") @Excel(name = "年假余额/天")
private BigDecimal annualLeaveBalance; private BigDecimal annualLeaveBalance;
...@@ -59,6 +63,14 @@ public class EmployeeBalance extends BaseEntity ...@@ -59,6 +63,14 @@ public class EmployeeBalance extends BaseEntity
this.employeeId = employeeId; this.employeeId = employeeId;
} }
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public BigDecimal getAnnualLeaveBalance() { public BigDecimal getAnnualLeaveBalance() {
return annualLeaveBalance; return annualLeaveBalance;
} }
...@@ -96,6 +108,7 @@ public class EmployeeBalance extends BaseEntity ...@@ -96,6 +108,7 @@ public class EmployeeBalance extends BaseEntity
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("employeeId", getEmployeeId()) .append("employeeId", getEmployeeId())
.append("name", getName())
.append("annualLeaveBalance", getAnnualLeaveBalance()) .append("annualLeaveBalance", getAnnualLeaveBalance())
.append("overtimeHoursBalance", getOvertimeHoursBalance()) .append("overtimeHoursBalance", getOvertimeHoursBalance())
.append("createdAt", getCreatedAt()) .append("createdAt", getCreatedAt())
......
package com.ruoyi.service.impl; package com.ruoyi.service.impl;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -64,6 +66,10 @@ public class EmployeeBalanceServiceImpl implements IEmployeeBalanceService ...@@ -64,6 +66,10 @@ public class EmployeeBalanceServiceImpl implements IEmployeeBalanceService
@Override @Override
public int updateEmployeeBalance(EmployeeBalance employeeBalance) public int updateEmployeeBalance(EmployeeBalance employeeBalance)
{ {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
String formattedDate = dateFormat.format(new Date());
java.sql.Date sqlDate = java.sql.Date.valueOf(formattedDate);
employeeBalance.setUpdatedAt(sqlDate);
return employeeBalanceMapper.updateEmployeeBalance(employeeBalance); return employeeBalanceMapper.updateEmployeeBalance(employeeBalance);
} }
......
...@@ -16,14 +16,20 @@ ...@@ -16,14 +16,20 @@
select id, employee_id, annual_leave_balance, overtime_hours_balance, created_at, updated_at from employee_balance select id, employee_id, annual_leave_balance, overtime_hours_balance, created_at, updated_at from employee_balance
</sql> </sql>
<sql id="selectEmployeeBalanceVo1">
select eb.id, eb.employee_id, ea.name, eb.annual_leave_balance, eb.overtime_hours_balance, eb.created_at, eb.updated_at
from employee_balance eb
join employment_approval ea on eb.employee_id = ea.id
</sql>
<select id="selectEmployeeBalanceList" parameterType="EmployeeBalance" resultMap="EmployeeBalanceResult"> <select id="selectEmployeeBalanceList" parameterType="EmployeeBalance" resultMap="EmployeeBalanceResult">
<include refid="selectEmployeeBalanceVo"/> <include refid="selectEmployeeBalanceVo1"/>
<where> <where>
<if test="employeeId != null "> and employee_id = #{employeeId}</if> <if test="employeeId != null "> and eb.employee_id = #{employeeId}</if>
<if test="annualLeaveBalance != null "> and annual_leave_balance = #{annualLeaveBalance}</if> <if test="annualLeaveBalance != null "> and eb.annual_leave_balance = #{annualLeaveBalance}</if>
<if test="overtimeHoursBalance != null "> and overtime_hours_balance = #{overtimeHoursBalance}</if> <if test="overtimeHoursBalance != null "> and eb.overtime_hours_balance = #{overtimeHoursBalance}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if> <if test="createdAt != null "> and eb.created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if> <if test="updatedAt != null "> and eb.updated_at = #{updatedAt}</if>
</where> </where>
</select> </select>
......
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