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

员工年假修改

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