change - add员工工资记录
parent
df167fbb8f
commit
4354c15770
@ -1,45 +1,100 @@
|
||||
package com.os.mes.record.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.os.common.annotation.Log;
|
||||
import com.os.common.core.controller.BaseController;
|
||||
import com.os.common.core.domain.AjaxResult;
|
||||
import com.os.common.core.page.TableDataInfo;
|
||||
import com.os.mes.base.domain.BaseCustomData;
|
||||
import com.os.mes.record.domain.RecordStaffAttendance;
|
||||
import com.os.common.enums.BusinessType;
|
||||
import com.os.mes.record.domain.RecordStaffSalary;
|
||||
import com.os.mes.record.service.IRecordStaffAttendanceService;
|
||||
import com.os.mes.record.service.IRecordStaffSalaryService;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.os.common.utils.poi.ExcelUtil;
|
||||
import com.os.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 员工工资记录Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-24
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/record/staffSalary")
|
||||
@RequestMapping("/mes/record/recordStaffSalary")
|
||||
public class RecordStaffSalaryController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IRecordStaffSalaryService staffSalaryService;
|
||||
|
||||
private IRecordStaffSalaryService recordStaffSalaryService;
|
||||
|
||||
/**
|
||||
* 生成班组员工工资
|
||||
* @param recordStaffSalary
|
||||
* @return
|
||||
* 查询员工工资记录列表
|
||||
*/
|
||||
@GetMapping("/selectTeamEmployeesWages")
|
||||
public AjaxResult selectTeamEmployeesWages(RecordStaffSalary recordStaffSalary) {
|
||||
List<RecordStaffSalary> list = staffSalaryService.selectTeamEmployeesWages(recordStaffSalary);
|
||||
return success(list);
|
||||
@PreAuthorize("@ss.hasPermi('mes/record:recordStaffSalary:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RecordStaffSalary recordStaffSalary) {
|
||||
startPage();
|
||||
List<RecordStaffSalary> list = recordStaffSalaryService.selectRecordStaffSalaryList(recordStaffSalary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出员工工资记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/record:recordStaffSalary:export')")
|
||||
@Log(title = "员工工资记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RecordStaffSalary recordStaffSalary) {
|
||||
List<RecordStaffSalary> list = recordStaffSalaryService.selectRecordStaffSalaryList(recordStaffSalary);
|
||||
ExcelUtil<RecordStaffSalary> util = new ExcelUtil<RecordStaffSalary>(RecordStaffSalary.class);
|
||||
util.exportExcel(response, list, "员工工资记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工工资记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/record:recordStaffSalary:query')")
|
||||
@GetMapping(value = "/{objId}")
|
||||
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
|
||||
return success(recordStaffSalaryService.selectRecordStaffSalaryByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增员工工资记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/record:recordStaffSalary:add')")
|
||||
@Log(title = "员工工资记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RecordStaffSalary recordStaffSalary) {
|
||||
recordStaffSalary.setCreateBy(getUsername());
|
||||
return toAjax(recordStaffSalaryService.insertRecordStaffSalary(recordStaffSalary));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改员工工资记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/record:recordStaffSalary:edit')")
|
||||
@Log(title = "员工工资记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RecordStaffSalary recordStaffSalary) {
|
||||
recordStaffSalary.setUpdateBy(getUsername());
|
||||
return toAjax(recordStaffSalaryService.updateRecordStaffSalary(recordStaffSalary));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除员工工资记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/record:recordStaffSalary:remove')")
|
||||
@Log(title = "员工工资记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] objIds) {
|
||||
return toAjax(recordStaffSalaryService.deleteRecordStaffSalaryByObjIds(objIds));
|
||||
}
|
||||
}
|
||||
|
@ -1,143 +1,209 @@
|
||||
package com.os.mes.record.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.os.common.annotation.Excel;
|
||||
import com.os.common.core.domain.BaseEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 员工工资记录对象 record_staff_attendance
|
||||
* 员工工资记录对象 record_staff_salary
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-24
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
public class RecordStaffSalary extends BaseEntity {
|
||||
public class RecordStaffSalary extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 班组编号
|
||||
*/
|
||||
/** 主键标识 */
|
||||
private Long objId;
|
||||
|
||||
/** 身份证 */
|
||||
@Excel(name = "身份证")
|
||||
private String idCard;
|
||||
|
||||
/** 班组编号 */
|
||||
@Excel(name = "班组编号")
|
||||
private String teamCode;
|
||||
private String groupId;
|
||||
|
||||
/**
|
||||
* 班组名称
|
||||
*/
|
||||
@Excel(name = "班组名称")
|
||||
private String teamName;
|
||||
/** 事件日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "事件日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date eventDate;
|
||||
|
||||
/**
|
||||
* 员工ID
|
||||
*/
|
||||
@Excel(name = "员工ID")
|
||||
private String staffId;
|
||||
/** 薪资类别 */
|
||||
@Excel(name = "薪资类别")
|
||||
private String salaryCategory;
|
||||
|
||||
/**
|
||||
* 员工名称
|
||||
*/
|
||||
@Excel(name = "员工名称")
|
||||
private String staffName;
|
||||
/** 收入大类 */
|
||||
@Excel(name = "收入大类")
|
||||
private String revenueClass;
|
||||
|
||||
/**
|
||||
* 工资系数
|
||||
*/
|
||||
/** 收入金额 */
|
||||
@Excel(name = "收入金额")
|
||||
private Long revenueAmount;
|
||||
|
||||
/** 收入理由 */
|
||||
@Excel(name = "收入理由")
|
||||
private String revenueReason;
|
||||
|
||||
/** 扣罚大类 */
|
||||
@Excel(name = "扣罚大类")
|
||||
private String fineClass;
|
||||
|
||||
/** 扣罚金额 */
|
||||
@Excel(name = "扣罚金额")
|
||||
private Long fineAmount;
|
||||
|
||||
/** 扣罚理由 */
|
||||
@Excel(name = "扣罚理由")
|
||||
private String fineReason;
|
||||
|
||||
/** 任务编号 */
|
||||
@Excel(name = "任务编号")
|
||||
private String taskCode;
|
||||
|
||||
/** 工资系数 */
|
||||
@Excel(name = "工资系数")
|
||||
private BigDecimal wageCoefficient;
|
||||
private Long salaryCoefficient;
|
||||
|
||||
/**
|
||||
* 工资
|
||||
*/
|
||||
@Excel(name = "工资")
|
||||
private BigDecimal wage;
|
||||
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
@Excel(name = "开始日期")
|
||||
private Date beginDate;
|
||||
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
@Excel(name = "结束日期")
|
||||
private Date endDate;
|
||||
|
||||
public String getTeamCode() {
|
||||
return teamCode;
|
||||
public void setObjId(Long objId)
|
||||
{
|
||||
this.objId = objId;
|
||||
}
|
||||
|
||||
public void setTeamCode(String teamCode) {
|
||||
this.teamCode = teamCode;
|
||||
public Long getObjId()
|
||||
{
|
||||
return objId;
|
||||
}
|
||||
public void setIdCard(String idCard)
|
||||
{
|
||||
this.idCard = idCard;
|
||||
}
|
||||
|
||||
public String getTeamName() {
|
||||
return teamName;
|
||||
public String getIdCard()
|
||||
{
|
||||
return idCard;
|
||||
}
|
||||
public void setGroupId(String groupId)
|
||||
{
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public void setTeamName(String teamName) {
|
||||
this.teamName = teamName;
|
||||
public String getGroupId()
|
||||
{
|
||||
return groupId;
|
||||
}
|
||||
public void setEventDate(Date eventDate)
|
||||
{
|
||||
this.eventDate = eventDate;
|
||||
}
|
||||
|
||||
public String getStaffId() {
|
||||
return staffId;
|
||||
public Date getEventDate()
|
||||
{
|
||||
return eventDate;
|
||||
}
|
||||
public void setSalaryCategory(String salaryCategory)
|
||||
{
|
||||
this.salaryCategory = salaryCategory;
|
||||
}
|
||||
|
||||
public void setStaffId(String staffId) {
|
||||
this.staffId = staffId;
|
||||
public String getSalaryCategory()
|
||||
{
|
||||
return salaryCategory;
|
||||
}
|
||||
public void setRevenueClass(String revenueClass)
|
||||
{
|
||||
this.revenueClass = revenueClass;
|
||||
}
|
||||
|
||||
public String getStaffName() {
|
||||
return staffName;
|
||||
public String getRevenueClass()
|
||||
{
|
||||
return revenueClass;
|
||||
}
|
||||
public void setRevenueAmount(Long revenueAmount)
|
||||
{
|
||||
this.revenueAmount = revenueAmount;
|
||||
}
|
||||
|
||||
public void setStaffName(String staffName) {
|
||||
this.staffName = staffName;
|
||||
public Long getRevenueAmount()
|
||||
{
|
||||
return revenueAmount;
|
||||
}
|
||||
public void setRevenueReason(String revenueReason)
|
||||
{
|
||||
this.revenueReason = revenueReason;
|
||||
}
|
||||
|
||||
public BigDecimal getWageCoefficient() {
|
||||
return wageCoefficient;
|
||||
public String getRevenueReason()
|
||||
{
|
||||
return revenueReason;
|
||||
}
|
||||
public void setFineClass(String fineClass)
|
||||
{
|
||||
this.fineClass = fineClass;
|
||||
}
|
||||
|
||||
public void setWageCoefficient(BigDecimal wageCoefficient) {
|
||||
this.wageCoefficient = wageCoefficient;
|
||||
public String getFineClass()
|
||||
{
|
||||
return fineClass;
|
||||
}
|
||||
public void setFineAmount(Long fineAmount)
|
||||
{
|
||||
this.fineAmount = fineAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getWage() {
|
||||
return wage;
|
||||
public Long getFineAmount()
|
||||
{
|
||||
return fineAmount;
|
||||
}
|
||||
public void setFineReason(String fineReason)
|
||||
{
|
||||
this.fineReason = fineReason;
|
||||
}
|
||||
|
||||
public void setWage(BigDecimal wage) {
|
||||
this.wage = wage;
|
||||
public String getFineReason()
|
||||
{
|
||||
return fineReason;
|
||||
}
|
||||
public void setTaskCode(String taskCode)
|
||||
{
|
||||
this.taskCode = taskCode;
|
||||
}
|
||||
|
||||
public Date getBeginDate() {
|
||||
return beginDate;
|
||||
public String getTaskCode()
|
||||
{
|
||||
return taskCode;
|
||||
}
|
||||
public void setSalaryCoefficient(Long salaryCoefficient)
|
||||
{
|
||||
this.salaryCoefficient = salaryCoefficient;
|
||||
}
|
||||
|
||||
public void setBeginDate(Date beginDate) {
|
||||
this.beginDate = beginDate;
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
public Long getSalaryCoefficient()
|
||||
{
|
||||
return salaryCoefficient;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RecordStaffSalary{" +
|
||||
"teamCode='" + teamCode + '\'' +
|
||||
", teamName='" + teamName + '\'' +
|
||||
", staffId='" + staffId + '\'' +
|
||||
", staffName='" + staffName + '\'' +
|
||||
", wageCoefficient=" + wageCoefficient +
|
||||
", wage=" + wage +
|
||||
", beginDate=" + beginDate +
|
||||
", endDate=" + endDate +
|
||||
'}';
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("objId", getObjId())
|
||||
.append("idCard", getIdCard())
|
||||
.append("groupId", getGroupId())
|
||||
.append("eventDate", getEventDate())
|
||||
.append("salaryCategory", getSalaryCategory())
|
||||
.append("revenueClass", getRevenueClass())
|
||||
.append("revenueAmount", getRevenueAmount())
|
||||
.append("revenueReason", getRevenueReason())
|
||||
.append("fineClass", getFineClass())
|
||||
.append("fineAmount", getFineAmount())
|
||||
.append("fineReason", getFineReason())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("taskCode", getTaskCode())
|
||||
.append("salaryCoefficient", getSalaryCoefficient())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,61 @@
|
||||
package com.os.mes.record.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.os.mes.record.domain.RecordStaffSalary;
|
||||
|
||||
/**
|
||||
* 员工工资记录Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
public interface RecordStaffSalaryMapper {
|
||||
/**
|
||||
* 查询员工工资记录
|
||||
*
|
||||
* @param objId 员工工资记录主键
|
||||
* @return 员工工资记录
|
||||
*/
|
||||
public RecordStaffSalary selectRecordStaffSalaryByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询员工工资记录列表
|
||||
*
|
||||
* @param recordStaffSalary 员工工资记录
|
||||
* @return 员工工资记录集合
|
||||
*/
|
||||
public List<RecordStaffSalary> selectRecordStaffSalaryList(RecordStaffSalary recordStaffSalary);
|
||||
|
||||
/**
|
||||
* 新增员工工资记录
|
||||
*
|
||||
* @param recordStaffSalary 员工工资记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRecordStaffSalary(RecordStaffSalary recordStaffSalary);
|
||||
|
||||
/**
|
||||
* 修改员工工资记录
|
||||
*
|
||||
* @param recordStaffSalary 员工工资记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRecordStaffSalary(RecordStaffSalary recordStaffSalary);
|
||||
|
||||
/**
|
||||
* 删除员工工资记录
|
||||
*
|
||||
* @param objId 员工工资记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRecordStaffSalaryByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除员工工资记录
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRecordStaffSalaryByObjIds(Long[] objIds);
|
||||
}
|
@ -1,24 +1,61 @@
|
||||
package com.os.mes.record.service;
|
||||
|
||||
|
||||
import com.os.mes.record.domain.RecordStaffAttendance;
|
||||
import com.os.mes.record.domain.RecordStaffSalary;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.os.mes.record.domain.RecordStaffSalary;
|
||||
|
||||
/**
|
||||
* 员工工资记录Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-24
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
public interface IRecordStaffSalaryService {
|
||||
|
||||
/**
|
||||
* 查询员工工资记录
|
||||
*
|
||||
* @param objId 员工工资记录主键
|
||||
* @return 员工工资记录
|
||||
*/
|
||||
public RecordStaffSalary selectRecordStaffSalaryByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 班组员工工资
|
||||
* @param recordStaffSalary
|
||||
* @return
|
||||
* 查询员工工资记录列表
|
||||
*
|
||||
* @param recordStaffSalary 员工工资记录
|
||||
* @return 员工工资记录集合
|
||||
*/
|
||||
List<RecordStaffSalary> selectTeamEmployeesWages(RecordStaffSalary recordStaffSalary);
|
||||
public List<RecordStaffSalary> selectRecordStaffSalaryList(RecordStaffSalary recordStaffSalary);
|
||||
|
||||
/**
|
||||
* 新增员工工资记录
|
||||
*
|
||||
* @param recordStaffSalary 员工工资记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRecordStaffSalary(RecordStaffSalary recordStaffSalary);
|
||||
|
||||
/**
|
||||
* 修改员工工资记录
|
||||
*
|
||||
* @param recordStaffSalary 员工工资记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRecordStaffSalary(RecordStaffSalary recordStaffSalary);
|
||||
|
||||
/**
|
||||
* 批量删除员工工资记录
|
||||
*
|
||||
* @param objIds 需要删除的员工工资记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRecordStaffSalaryByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除员工工资记录信息
|
||||
*
|
||||
* @param objId 员工工资记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRecordStaffSalaryByObjId(Long objId);
|
||||
}
|
||||
|
@ -1,43 +1,89 @@
|
||||
package com.os.mes.record.service.impl;
|
||||
|
||||
import com.os.mes.prod.domain.ProdOrderDetail;
|
||||
import com.os.mes.prod.mapper.ProdOrderDetailMapper;
|
||||
import com.os.mes.record.domain.RecordStaffSalary;
|
||||
import com.os.mes.record.mapper.RecordStaffAttendanceMapper;
|
||||
import com.os.mes.record.service.IRecordStaffSalaryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.os.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.os.mes.record.mapper.RecordStaffSalaryMapper;
|
||||
import com.os.mes.record.domain.RecordStaffSalary;
|
||||
import com.os.mes.record.service.IRecordStaffSalaryService;
|
||||
|
||||
/**
|
||||
* 员工工资记录Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-24
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
@Service
|
||||
public class RecordStaffSalaryServiceImpl implements IRecordStaffSalaryService {
|
||||
@Autowired
|
||||
private RecordStaffAttendanceMapper recordStaffAttendanceMapper;
|
||||
|
||||
@Autowired
|
||||
private ProdOrderDetailMapper prodOrderDetailMapper;
|
||||
private RecordStaffSalaryMapper recordStaffSalaryMapper;
|
||||
|
||||
/**
|
||||
* 班组员工工资
|
||||
* @param recordStaffSalary
|
||||
* @return
|
||||
* 查询员工工资记录
|
||||
*
|
||||
* @param objId 员工工资记录主键
|
||||
* @return 员工工资记录
|
||||
*/
|
||||
@Override
|
||||
public List<RecordStaffSalary> selectTeamEmployeesWages(RecordStaffSalary recordStaffSalary) {
|
||||
|
||||
ProdOrderDetail orderDetail = new ProdOrderDetail();
|
||||
List<ProdOrderDetail> prodOrderDetails = prodOrderDetailMapper.selectProdOrderDetailList(orderDetail);
|
||||
|
||||
return null;
|
||||
public RecordStaffSalary selectRecordStaffSalaryByObjId(Long objId) {
|
||||
return recordStaffSalaryMapper.selectRecordStaffSalaryByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询员工工资记录列表
|
||||
*
|
||||
* @param recordStaffSalary 员工工资记录
|
||||
* @return 员工工资记录
|
||||
*/
|
||||
@Override
|
||||
public List<RecordStaffSalary> selectRecordStaffSalaryList(RecordStaffSalary recordStaffSalary) {
|
||||
return recordStaffSalaryMapper.selectRecordStaffSalaryList(recordStaffSalary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增员工工资记录
|
||||
*
|
||||
* @param recordStaffSalary 员工工资记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRecordStaffSalary(RecordStaffSalary recordStaffSalary) {
|
||||
recordStaffSalary.setCreateTime(DateUtils.getNowDate());
|
||||
return recordStaffSalaryMapper.insertRecordStaffSalary(recordStaffSalary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改员工工资记录
|
||||
*
|
||||
* @param recordStaffSalary 员工工资记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRecordStaffSalary(RecordStaffSalary recordStaffSalary) {
|
||||
return recordStaffSalaryMapper.updateRecordStaffSalary(recordStaffSalary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除员工工资记录
|
||||
*
|
||||
* @param objIds 需要删除的员工工资记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRecordStaffSalaryByObjIds(Long[] objIds) {
|
||||
return recordStaffSalaryMapper.deleteRecordStaffSalaryByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除员工工资记录信息
|
||||
*
|
||||
* @param objId 员工工资记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRecordStaffSalaryByObjId(Long objId) {
|
||||
return recordStaffSalaryMapper.deleteRecordStaffSalaryByObjId(objId);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,133 @@
|
||||
<?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.os.mes.record.mapper.RecordStaffSalaryMapper">
|
||||
|
||||
<resultMap type="RecordStaffSalary" id="RecordStaffSalaryResult">
|
||||
<result property="objId" column="obj_id"/>
|
||||
<result property="idCard" column="id_card"/>
|
||||
<result property="groupId" column="group_id"/>
|
||||
<result property="eventDate" column="event_date"/>
|
||||
<result property="salaryCategory" column="salary_category"/>
|
||||
<result property="revenueClass" column="revenue_class"/>
|
||||
<result property="revenueAmount" column="revenue_amount"/>
|
||||
<result property="revenueReason" column="revenue_reason"/>
|
||||
<result property="fineClass" column="fine_class"/>
|
||||
<result property="fineAmount" column="fine_amount"/>
|
||||
<result property="fineReason" column="fine_reason"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="taskCode" column="task_code"/>
|
||||
<result property="salaryCoefficient" column="salary_coefficient"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRecordStaffSalaryVo">
|
||||
select obj_id,
|
||||
id_card,
|
||||
group_id,
|
||||
event_date,
|
||||
salary_category,
|
||||
revenue_class,
|
||||
revenue_amount,
|
||||
revenue_reason,
|
||||
fine_class,
|
||||
fine_amount,
|
||||
fine_reason,
|
||||
create_time,
|
||||
task_code,
|
||||
salary_coefficient
|
||||
from record_staff_salary
|
||||
</sql>
|
||||
|
||||
<select id="selectRecordStaffSalaryList" parameterType="RecordStaffSalary" resultMap="RecordStaffSalaryResult">
|
||||
<include refid="selectRecordStaffSalaryVo"/>
|
||||
<where>
|
||||
<if test="idCard != null and idCard != ''">and id_card = #{idCard}</if>
|
||||
<if test="groupId != null and groupId != ''">and group_id = #{groupId}</if>
|
||||
<if test="params.beginEventDate != null and params.beginEventDate != '' and params.endEventDate != null and params.endEventDate != ''">
|
||||
and event_date between #{params.beginEventDate} and #{params.endEventDate}
|
||||
</if>
|
||||
<if test="salaryCategory != null and salaryCategory != ''">and salary_category = #{salaryCategory}</if>
|
||||
<if test="revenueClass != null and revenueClass != ''">and revenue_class = #{revenueClass}</if>
|
||||
<if test="revenueAmount != null ">and revenue_amount = #{revenueAmount}</if>
|
||||
<if test="revenueReason != null and revenueReason != ''">and revenue_reason = #{revenueReason}</if>
|
||||
<if test="fineClass != null and fineClass != ''">and fine_class = #{fineClass}</if>
|
||||
<if test="fineAmount != null ">and fine_amount = #{fineAmount}</if>
|
||||
<if test="fineReason != null and fineReason != ''">and fine_reason = #{fineReason}</if>
|
||||
<if test="taskCode != null and taskCode != ''">and task_code = #{taskCode}</if>
|
||||
<if test="salaryCoefficient != null ">and salary_coefficient = #{salaryCoefficient}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRecordStaffSalaryByObjId" parameterType="Long" resultMap="RecordStaffSalaryResult">
|
||||
<include refid="selectRecordStaffSalaryVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertRecordStaffSalary" parameterType="RecordStaffSalary" useGeneratedKeys="true" keyProperty="objId">
|
||||
insert into record_staff_salary
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="idCard != null">id_card,</if>
|
||||
<if test="groupId != null">group_id,</if>
|
||||
<if test="eventDate != null">event_date,</if>
|
||||
<if test="salaryCategory != null">salary_category,</if>
|
||||
<if test="revenueClass != null">revenue_class,</if>
|
||||
<if test="revenueAmount != null">revenue_amount,</if>
|
||||
<if test="revenueReason != null">revenue_reason,</if>
|
||||
<if test="fineClass != null">fine_class,</if>
|
||||
<if test="fineAmount != null">fine_amount,</if>
|
||||
<if test="fineReason != null">fine_reason,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="taskCode != null">task_code,</if>
|
||||
<if test="salaryCoefficient != null">salary_coefficient,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="idCard != null">#{idCard},</if>
|
||||
<if test="groupId != null">#{groupId},</if>
|
||||
<if test="eventDate != null">#{eventDate},</if>
|
||||
<if test="salaryCategory != null">#{salaryCategory},</if>
|
||||
<if test="revenueClass != null">#{revenueClass},</if>
|
||||
<if test="revenueAmount != null">#{revenueAmount},</if>
|
||||
<if test="revenueReason != null">#{revenueReason},</if>
|
||||
<if test="fineClass != null">#{fineClass},</if>
|
||||
<if test="fineAmount != null">#{fineAmount},</if>
|
||||
<if test="fineReason != null">#{fineReason},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="taskCode != null">#{taskCode},</if>
|
||||
<if test="salaryCoefficient != null">#{salaryCoefficient},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRecordStaffSalary" parameterType="RecordStaffSalary">
|
||||
update record_staff_salary
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="idCard != null">id_card = #{idCard},</if>
|
||||
<if test="groupId != null">group_id = #{groupId},</if>
|
||||
<if test="eventDate != null">event_date = #{eventDate},</if>
|
||||
<if test="salaryCategory != null">salary_category = #{salaryCategory},</if>
|
||||
<if test="revenueClass != null">revenue_class = #{revenueClass},</if>
|
||||
<if test="revenueAmount != null">revenue_amount = #{revenueAmount},</if>
|
||||
<if test="revenueReason != null">revenue_reason = #{revenueReason},</if>
|
||||
<if test="fineClass != null">fine_class = #{fineClass},</if>
|
||||
<if test="fineAmount != null">fine_amount = #{fineAmount},</if>
|
||||
<if test="fineReason != null">fine_reason = #{fineReason},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="taskCode != null">task_code = #{taskCode},</if>
|
||||
<if test="salaryCoefficient != null">salary_coefficient = #{salaryCoefficient},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRecordStaffSalaryByObjId" parameterType="Long">
|
||||
delete
|
||||
from record_staff_salary
|
||||
where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRecordStaffSalaryByObjIds" parameterType="String">
|
||||
delete from record_staff_salary where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue