合同见证上传
This commit is contained in:
parent
8ea97c30e8
commit
755ec8021b
|
|
@ -0,0 +1,126 @@
|
||||||
|
package com.bonus.bmw.controller;
|
||||||
|
import com.bonus.bmw.domain.vo.BmWorkerContract;
|
||||||
|
import com.bonus.bmw.domain.vo.BmWorkerWageCard;
|
||||||
|
import com.bonus.bmw.service.impl.BmWorkerContractServiceImpl;
|
||||||
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
|
import com.bonus.common.log.annotation.SysLog;
|
||||||
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.common.security.annotation.InnerAuth;
|
||||||
|
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||||
|
import com.bonus.system.api.domain.SysRole;
|
||||||
|
import com.bonus.system.api.domain.SysUser;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员合同信息表(bm_worker_contract)表控制层
|
||||||
|
*
|
||||||
|
* @author fly
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/workerContract")
|
||||||
|
public class BmWorkerContractController extends BaseController {
|
||||||
|
/**
|
||||||
|
* 服务对象
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private BmWorkerContractServiceImpl service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
* @param o
|
||||||
|
* @return
|
||||||
|
* , requiresPermissions = @RequiresPermissions("system:contract:list")
|
||||||
|
*/
|
||||||
|
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false))
|
||||||
|
@GetMapping("/list")
|
||||||
|
@SysLog(title = "合同管理", businessType = OperaType.QUERY, logType = 0, module = "施工人员->红绿灯管理->合同管理", details = "查询合同列表")
|
||||||
|
public TableDataInfo list(BmWorkerContract o) {
|
||||||
|
try {
|
||||||
|
startPage();
|
||||||
|
List<BmWorkerContract> list = service.selectContractList(o);
|
||||||
|
return getDataTable(list);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.toString(), e);
|
||||||
|
}
|
||||||
|
return getDataTableError(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
* @param o
|
||||||
|
* @return
|
||||||
|
* , requiresPermissions = @RequiresPermissions("system:contract:list")
|
||||||
|
*/
|
||||||
|
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false))
|
||||||
|
@GetMapping("/workerList")
|
||||||
|
@SysLog(title = "合同管理", businessType = OperaType.QUERY, logType = 0, module = "施工人员->红绿灯管理->合同管理", details = "查询单人合同列表")
|
||||||
|
public TableDataInfo workerList(BmWorkerContract o) {
|
||||||
|
try {
|
||||||
|
startPage();
|
||||||
|
List<BmWorkerContract> list = service.selectContractListByWorkerId(o);
|
||||||
|
return getDataTable(list);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.toString(), e);
|
||||||
|
}
|
||||||
|
return getDataTableError(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同获取详细信息
|
||||||
|
*/
|
||||||
|
//, requiresPermissions = @RequiresPermissions("system:contract:query")
|
||||||
|
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth)
|
||||||
|
@GetMapping({ "/{id}"})
|
||||||
|
public AjaxResult getInfo(@PathVariable(value = "id") Integer id) {
|
||||||
|
try {
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
BmWorkerContract o = new BmWorkerContract();
|
||||||
|
o.setId(id);
|
||||||
|
List<BmWorkerContract> list = service.selectContractListByWorkerId(o);
|
||||||
|
ajax.put("data", list);
|
||||||
|
return ajax;
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.toString(), e);
|
||||||
|
}
|
||||||
|
return error("系统异常,请联系管理员");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//, requiresPermissions = @RequiresPermissions("system:contract:edit")
|
||||||
|
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@SysLog(title = "合同管理", businessType = OperaType.UPDATE, logType = 0, module = "施工人员->红绿灯管理->合同管理", details = "修改合同")
|
||||||
|
public AjaxResult edit(@Validated @RequestBody BmWorkerContract o) {
|
||||||
|
try {
|
||||||
|
return toAjax(service.updateByPrimaryKey(o));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.toString(), e);
|
||||||
|
}
|
||||||
|
return error("系统异常,请联系管理员");
|
||||||
|
}
|
||||||
|
|
||||||
|
//, requiresPermissions = @RequiresPermissions("system:contract:remove")
|
||||||
|
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth)
|
||||||
|
@PostMapping("/delete/{id}")
|
||||||
|
@SysLog(title = "合同管理", businessType = OperaType.DELETE, logType = 0, module = "施工人员->红绿灯管理->合同管理", details = "删除合同")
|
||||||
|
public AjaxResult remove(@PathVariable("id") Integer id) {
|
||||||
|
try {
|
||||||
|
return toAjax(service.deleteByPrimaryKey(id));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.toString(), e);
|
||||||
|
}
|
||||||
|
return error("系统异常,请联系管理员");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -52,9 +52,10 @@ public class BmWorkerWageCardController extends BaseController {
|
||||||
return getDataTableError(new ArrayList<>());
|
return getDataTableError(new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:wageCard:edit"))
|
//, requiresPermissions = @RequiresPermissions("system:wageCard:edit")
|
||||||
|
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth)
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@SysLog(title = "查询工资卡列表", businessType = OperaType.UPDATE, logType = 0, module = "施工人员->红绿灯管理->工资卡管理", details = "修改工资卡")
|
@SysLog(title = "工资卡管理", businessType = OperaType.UPDATE, logType = 0, module = "施工人员->红绿灯管理->工资卡管理", details = "修改工资卡")
|
||||||
public AjaxResult edit(@Validated @RequestBody BmWorkerWageCard o) {
|
public AjaxResult edit(@Validated @RequestBody BmWorkerWageCard o) {
|
||||||
try {
|
try {
|
||||||
return toAjax(service.updateByPrimaryKey(o));
|
return toAjax(service.updateByPrimaryKey(o));
|
||||||
|
|
@ -64,8 +65,8 @@ public class BmWorkerWageCardController extends BaseController {
|
||||||
return error("系统异常,请联系管理员");
|
return error("系统异常,请联系管理员");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//, requiresPermissions = @RequiresPermissions("system:wageCard:remove")
|
||||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:user:remove"))
|
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth)
|
||||||
@PostMapping("/delete/{id}")
|
@PostMapping("/delete/{id}")
|
||||||
@SysLog(title = "工资卡管理", businessType = OperaType.DELETE, logType = 0, module = "施工人员->红绿灯管理->工资卡管理", details = "删除工资卡")
|
@SysLog(title = "工资卡管理", businessType = OperaType.DELETE, logType = 0, module = "施工人员->红绿灯管理->工资卡管理", details = "删除工资卡")
|
||||||
public AjaxResult remove(@PathVariable("id") Integer id) {
|
public AjaxResult remove(@PathVariable("id") Integer id) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,121 @@
|
||||||
|
package com.bonus.bmw.domain.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员合同信息表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BmWorkerContract {
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 施工人员id
|
||||||
|
*/
|
||||||
|
private Integer workerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同编码
|
||||||
|
*/
|
||||||
|
private String contractCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同期限类型
|
||||||
|
*/
|
||||||
|
private String contractTermType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同开始时间
|
||||||
|
*/
|
||||||
|
private Date contractStartDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同结束时间
|
||||||
|
*/
|
||||||
|
private Date contractStopDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工资核定方式:天、月
|
||||||
|
*/
|
||||||
|
private String wageApprovedWay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工资核定标准(元)
|
||||||
|
*/
|
||||||
|
private Double wageCriterion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日工资标准(月按30天平均计入)
|
||||||
|
*/
|
||||||
|
private Double dayRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同上传时间
|
||||||
|
*/
|
||||||
|
private Date contractUploadDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同失效时间
|
||||||
|
*/
|
||||||
|
private Date contractInvalidDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人
|
||||||
|
*/
|
||||||
|
private String updateUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证号码
|
||||||
|
*/
|
||||||
|
private String idNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程名称
|
||||||
|
*/
|
||||||
|
private String proName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组名称
|
||||||
|
*/
|
||||||
|
private String teamName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分包名称
|
||||||
|
*/
|
||||||
|
private String subName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否签合同
|
||||||
|
*/
|
||||||
|
private String isSign;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同是否有效
|
||||||
|
*/
|
||||||
|
private String isActive;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.bonus.bmw.mapper;
|
||||||
|
|
||||||
|
import com.bonus.bmw.domain.vo.BmWorkerContract;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface BmWorkerContractMapper {
|
||||||
|
/**
|
||||||
|
* delete by primary key
|
||||||
|
* @param id primaryKey
|
||||||
|
* @return deleteCount
|
||||||
|
*/
|
||||||
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* insert record to table
|
||||||
|
* @param record the record
|
||||||
|
* @return insert count
|
||||||
|
*/
|
||||||
|
int insert(BmWorkerContract record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询合同列表
|
||||||
|
* @param o
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<BmWorkerContract> selectContractList(BmWorkerContract o);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询单人合同列表
|
||||||
|
* @param o
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<BmWorkerContract> selectContractListByWorkerId(BmWorkerContract o);
|
||||||
|
}
|
||||||
|
|
@ -5,6 +5,12 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: BmWorkerWageCardMapper
|
||||||
|
* @Author: fly
|
||||||
|
* @Date: 2025-08-11 09:09
|
||||||
|
* @Copyright: Copyright (c) 2025 fly. All rights reserved.
|
||||||
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface BmWorkerWageCardMapper {
|
public interface BmWorkerWageCardMapper {
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.bonus.bmw.service;
|
||||||
|
|
||||||
|
import com.bonus.bmw.domain.vo.BmWorkerContract;
|
||||||
|
import com.bonus.bmw.domain.vo.BmWorkerWageCard;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface BmWorkerContractService{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除合同
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改合同
|
||||||
|
* @param record
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateByPrimaryKey(BmWorkerContract record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询合同列表
|
||||||
|
* @param o
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<BmWorkerContract> selectContractList(BmWorkerContract o);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据施工人员id查询合同列表
|
||||||
|
* @param o
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<BmWorkerContract> selectContractListByWorkerId(BmWorkerContract o);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.bonus.bmw.service.impl;
|
||||||
|
|
||||||
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import com.bonus.bmw.mapper.BmWorkerContractMapper;
|
||||||
|
import com.bonus.bmw.domain.vo.BmWorkerContract;
|
||||||
|
import com.bonus.bmw.service.BmWorkerContractService;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BmWorkerContractServiceImpl implements BmWorkerContractService{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BmWorkerContractMapper mapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteByPrimaryKey(Integer id) {
|
||||||
|
return mapper.deleteByPrimaryKey(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新合同
|
||||||
|
* @param record
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateByPrimaryKey(BmWorkerContract record) {
|
||||||
|
//如果有旧的有效合同执行删除
|
||||||
|
if(record.getId() != null){
|
||||||
|
deleteByPrimaryKey(record.getId());
|
||||||
|
}
|
||||||
|
//存文件 TODO
|
||||||
|
record.setCreateUser(SecurityUtils.getUsername());
|
||||||
|
//判断是日合同还是月合同
|
||||||
|
if ("月".equals(record.getWageApprovedWay())) {
|
||||||
|
BigDecimal wageCriterion = BigDecimal.valueOf(record.getWageCriterion());
|
||||||
|
BigDecimal dayRate = wageCriterion.divide(BigDecimal.valueOf(30), 2, RoundingMode.HALF_UP);
|
||||||
|
record.setDayRate(dayRate.doubleValue());
|
||||||
|
} else {
|
||||||
|
// 保持原值,也建议保留两位小数以统一精度
|
||||||
|
BigDecimal wageCriterion = BigDecimal.valueOf(record.getWageCriterion());
|
||||||
|
BigDecimal dayRate = wageCriterion.setScale(2, RoundingMode.HALF_UP);
|
||||||
|
record.setDayRate(dayRate.doubleValue());
|
||||||
|
}
|
||||||
|
int insert = mapper.insert(record);
|
||||||
|
//将合同id保存到入场表 TODO
|
||||||
|
return insert;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询合同列表
|
||||||
|
* @param o
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BmWorkerContract> selectContractList(BmWorkerContract o) {
|
||||||
|
return mapper.selectContractList(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询单人合同列表
|
||||||
|
* @param o
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BmWorkerContract> selectContractListByWorkerId(BmWorkerContract o) {
|
||||||
|
return mapper.selectContractListByWorkerId(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,119 @@
|
||||||
|
<?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.bonus.bmw.mapper.BmWorkerContractMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.bonus.bmw.domain.vo.BmWorkerContract">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table bm_worker_contract-->
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="worker_id" property="workerId" />
|
||||||
|
<result column="contract_code" property="contractCode" />
|
||||||
|
<result column="contract_term_type" property="contractTermType" />
|
||||||
|
<result column="contract_start_date" property="contractStartDate" />
|
||||||
|
<result column="contract_stop_date" property="contractStopDate" />
|
||||||
|
<result column="wage_approved_way" property="wageApprovedWay" />
|
||||||
|
<result column="wage_criterion" property="wageCriterion" />
|
||||||
|
<result column="day_rate" property="dayRate" />
|
||||||
|
<result column="contract_upload_date" property="contractUploadDate" />
|
||||||
|
<result column="contract_invalid_date" property="contractInvalidDate" />
|
||||||
|
<result column="create_user" property="createUser" />
|
||||||
|
<result column="update_user" property="updateUser" />
|
||||||
|
<result column="pro_name" property="proName" />
|
||||||
|
<result column="team_name" property="teamName" />
|
||||||
|
<result column="sub_name" property="subName" />
|
||||||
|
<result column="name" property="name" />
|
||||||
|
<result column="id_number" property="idNumber" />
|
||||||
|
<result column="isSign" property="isSign" />
|
||||||
|
<result column="is_active" property="isActive" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
id, worker_id, contract_code, contract_term_type, contract_start_date, contract_stop_date,
|
||||||
|
wage_approved_way, wage_criterion, day_rate, contract_upload_date, contract_invalid_date,
|
||||||
|
create_user, update_user
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
update bm_worker_contract set is_active = 0
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.bonus.bmw.domain.vo.BmWorkerContract" useGeneratedKeys="true">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
insert into bm_worker_contract (worker_id, contract_code, contract_term_type, contract_start_date,
|
||||||
|
contract_stop_date, wage_approved_way, wage_criterion, day_rate, contract_upload_date,
|
||||||
|
contract_invalid_date, create_user)
|
||||||
|
values (#{workerId}, #{contractCode}, #{contractTermType}, #{contractStartDate},
|
||||||
|
#{contractStopDate}, #{wageApprovedWay}, #{wageCriterion}, #{dayRate}, #{contractUploadDate},
|
||||||
|
#{contractInvalidDate}, #{createUser})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="selectContractList" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
pw.`name`,
|
||||||
|
pw.id_number,
|
||||||
|
bwem.pro_name,
|
||||||
|
bwem.sub_name,
|
||||||
|
bwem.team_name,
|
||||||
|
bwc.contract_code,
|
||||||
|
bwc.contract_start_date,
|
||||||
|
bwc.id,
|
||||||
|
if(bwc.id is null ,0,1) AS isSign
|
||||||
|
FROM
|
||||||
|
pm_worker pw
|
||||||
|
LEFT JOIN bm_worker_ein_msg bwem ON bwem.worker_id = pw.id
|
||||||
|
LEFT JOIN bm_worker_contract bwc ON pw.id = bwc.worker_id AND bwc.is_active = 1
|
||||||
|
WHERE pw.is_active = 1
|
||||||
|
<if test="name != null">
|
||||||
|
AND pw.`name` LIKE CONCAT('%', #{name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="idNumber != null">
|
||||||
|
AND pw.id_number LIKE CONCAT('%', #{idNumber}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="proName != null">
|
||||||
|
AND bwem.pro_name LIKE CONCAT('%', #{proName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="teamName != null">
|
||||||
|
AND bwem.team_name LIKE CONCAT('%', #{teamName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="subName != null">
|
||||||
|
AND bwem.sub_name LIKE CONCAT('%', #{subName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="contractCode != null">
|
||||||
|
AND bwc.contract_code LIKE CONCAT('%', #{contractCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="isSign != null">
|
||||||
|
<if test="isSign == 1">
|
||||||
|
AND bwc.id IS NOT NULL
|
||||||
|
</if>
|
||||||
|
<if test="isSign == 0">
|
||||||
|
AND bwc.id IS NULL
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectContractListByWorkerId" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
bwc.id,
|
||||||
|
bwc.contract_code,
|
||||||
|
bwc.contract_start_date,
|
||||||
|
bwc.is_active,
|
||||||
|
bwc.contract_stop_date,
|
||||||
|
bwc.contract_term_type,
|
||||||
|
bwc.contract_upload_date,
|
||||||
|
bwc.contract_invalid_date,
|
||||||
|
bwc.wage_approved_way,
|
||||||
|
bwc.wage_criterion
|
||||||
|
FROM
|
||||||
|
bm_worker_contract bwc
|
||||||
|
<where>
|
||||||
|
<if test="workerId != null">
|
||||||
|
AND bwc.worker_id = #{workerId}
|
||||||
|
</if>
|
||||||
|
<if test="id != null">
|
||||||
|
AND bwc.id = #{id}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by
|
||||||
|
bwc.id desc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
@ -2,8 +2,6 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.bonus.bmw.mapper.BmWorkerWageCardMapper">
|
<mapper namespace="com.bonus.bmw.mapper.BmWorkerWageCardMapper">
|
||||||
<resultMap id="BaseResultMap" type="com.bonus.bmw.domain.vo.BmWorkerWageCard">
|
<resultMap id="BaseResultMap" type="com.bonus.bmw.domain.vo.BmWorkerWageCard">
|
||||||
<!--@mbg.generated-->
|
|
||||||
<!--@Table bm_worker_wage_card-->
|
|
||||||
<id column="id" property="id" />
|
<id column="id" property="id" />
|
||||||
<result column="worker_id" property="workerId" />
|
<result column="worker_id" property="workerId" />
|
||||||
<result column="bank_card_code" property="bankCardCode" />
|
<result column="bank_card_code" property="bankCardCode" />
|
||||||
|
|
@ -17,24 +15,22 @@
|
||||||
<result column="id_number" property="idNumber" />
|
<result column="id_number" property="idNumber" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
<!--@mbg.generated-->
|
|
||||||
id, worker_id, bank_card_code, bank_name, bank_branch_name, create_user, update_user
|
id, worker_id, bank_card_code, bank_name, bank_branch_name, create_user, update_user
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||||
<!--@mbg.generated-->
|
|
||||||
update bm_worker_wage_card set is_active = 0
|
update bm_worker_wage_card set is_active = 0
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.bonus.system.api.domain.BmWorkerWageCard" useGeneratedKeys="true">
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.bonus.bmw.domain.vo.BmWorkerWageCard" useGeneratedKeys="true">
|
||||||
<!--@mbg.generated-->
|
|
||||||
insert into bm_worker_wage_card (worker_id, bank_card_code, bank_name, bank_branch_name, create_user)
|
insert into bm_worker_wage_card (worker_id, bank_card_code, bank_name, bank_branch_name, create_user)
|
||||||
values (#{workerId}, #{bankCardCode}, #{bankName}, #{bankBranchName}, #{createUser})
|
values (#{workerId}, #{bankCardCode}, #{bankName}, #{bankBranchName}, #{createUser})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<select id="selectWageCardList" resultMap="BaseResultMap">
|
<select id="selectWageCardList" resultMap="BaseResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
|
pw.id as worker_id,
|
||||||
pw.name,
|
pw.name,
|
||||||
pw.id_number,
|
pw.id_number,
|
||||||
pw.phone,
|
pw.phone,
|
||||||
Loading…
Reference in New Issue