外部人员基础类

This commit is contained in:
钱涛 2023-03-01 09:05:03 +08:00
parent 8c8d79aba3
commit 1568b1e03d
9 changed files with 823 additions and 0 deletions

View File

@ -0,0 +1,8 @@
package com.api.salary.web;
import javax.ws.rs.Path;
@Path("/bs/hrmsalary/extEmp")
public class ExtEmpController extends com.engine.salary.web.ExtEmpController{
}

View File

@ -0,0 +1,27 @@
package com.engine.salary.entity.extemp.param;
import com.engine.salary.common.BaseQueryParam;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 数据采集-累计专项附加扣除查询参数
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ExtEmpQueryParam extends BaseQueryParam {
//姓名
private String username;
}

View File

@ -0,0 +1,123 @@
package com.engine.salary.entity.extemp.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 外部人员
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
//hrsa_external_employee
public class ExtEmpPO {
private Long id;
/**
* 姓名
*/
private String username;
/**
* 部门
*/
private String departmentName;
/**
* 部门ID
*/
private Long departmentId;
/**
* 分部
*/
private String subcompanyName;
/**
* 分部ID
*/
private Long subcompanyId;
/**
* 岗位
*/
private String jobtitleName;
/**
* 岗位ID
*/
private Long jobtitleId;
/**
* 入职日期
*/
private String companystartdate;
/**
* 手机
*/
private String mobile;
/**
* 状态编码
*/
private String status;
/**
* 工号
*/
private String workcode;
/**
* 性别
*/
private String sex;
/**
* 邮件
*/
private String email;
/**
* 电话
*/
private String telephone;
/**
* 职称
*/
private String jobcall;
/**
* 出生日期
*/
private String birthday;
/**
* 身份证号码
*/
private String idNo;
/**
* 本人开户的银行卡卡号
*/
private String bankCardNum;
/**
* 本人开户的银行卡开户支行全称
*/
private String bankName;
/**
* 是否已删除0未删除1已删除
*/
private Integer deleteType;
/**
* 创建人
*/
private Long creator;
/**
* 修改人
*/
private Long modifier;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
/**
* 租户ID
*/
private String tenantKey;
}

View File

@ -0,0 +1,64 @@
package com.engine.salary.mapper.extemp;
import com.engine.salary.entity.extemp.po.ExtEmpPO;
import java.util.List;
public interface ExternalEmployeeMapper {
/**
* 查询所有记录
*
* @return 返回集合没有返回空List
*/
List<ExtEmpPO> listAll();
/**
* 根据主键查询
*
* @param id 主键
* @return 返回记录没有返回null
*/
ExtEmpPO getById(Integer id);
/**
* 新增插入所有字段
*
* @param externalEmployee 新增的记录
* @return 返回影响行数
*/
int insert(ExtEmpPO externalEmployee);
/**
* 新增忽略null字段
*
* @param externalEmployee 新增的记录
* @return 返回影响行数
*/
int insertIgnoreNull(ExtEmpPO externalEmployee);
/**
* 修改修改所有字段
*
* @param externalEmployee 修改的记录
* @return 返回影响行数
*/
int update(ExtEmpPO externalEmployee);
/**
* 修改忽略null字段
*
* @param externalEmployee 修改的记录
* @return 返回影响行数
*/
int updateIgnoreNull(ExtEmpPO externalEmployee);
/**
* 删除记录
*
* @return 返回影响行数
*/
int delete(Long id);
}

View File

@ -0,0 +1,468 @@
<?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.engine.salary.mapper.extemp.ExternalEmployeeMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.extemp.po.ExtEmpPO">
<result column="id" property="id"/>
<result column="username" property="username"/>
<result column="department_name" property="departmentName"/>
<result column="department_id" property="departmentId"/>
<result column="subcompany_name" property="subcompanyName"/>
<result column="subcompany_id" property="subcompanyId"/>
<result column="jobtitle_name" property="jobtitleName"/>
<result column="jobtitle_id" property="jobtitleId"/>
<result column="companystartdate" property="companystartdate"/>
<result column="mobile" property="mobile"/>
<result column="status" property="status"/>
<result column="workcode" property="workcode"/>
<result column="sex" property="sex"/>
<result column="email" property="email"/>
<result column="telephone" property="telephone"/>
<result column="jobcall" property="jobcall"/>
<result column="birthday" property="birthday"/>
<result column="id_no" property="idNo"/>
<result column="bank_card_num" property="bankCardNum"/>
<result column="bank_name" property="bankName"/>
<result column="delete_type" property="deleteType"/>
<result column="creator" property="creator"/>
<result column="modifier" property="modifier"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="tenant_key" property="tenantKey"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t
.
id
, t.username
, t.department_name
, t.department_id
, t.subcompany_name
, t.subcompany_id
, t.jobtitle_name
, t.jobtitle_id
, t.companystartdate
, t.mobile
, t.status
, t.workcode
, t.sex
, t.email
, t.telephone
, t.jobcall
, t.birthday
, t.id_no
, t.bank_card_num
, t.bank_name
, t.delete_type
, t.creator
, t.modifier
, t.create_time
, t.update_time
, t.tenant_key
</sql>
<!-- 查询全部 -->
<select id="listAll" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM hrsa_external_employee t
WHERE delete_type = 0
</select>
<!-- 根据主键获取单条记录 -->
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
SELECT
<include refid="baseColumns"/>
FROM hrsa_external_employee t
WHERE id = #{id} AND delete_type = 0
</select>
<!-- 条件查询 -->
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.extemp.po.ExtEmpPO">
SELECT
<include refid="baseColumns"/>
FROM hrsa_external_employee t
WHERE delete_type = 0
<if test="id != null">
AND id = #{id}
</if>
<if test="username != null">
AND username = #{username}
</if>
<if test="departmentName != null">
AND department_name = #{departmentName}
</if>
<if test="departmentId != null">
AND department_id = #{departmentId}
</if>
<if test="subcompanyName != null">
AND subcompany_name = #{subcompanyName}
</if>
<if test="subcompanyId != null">
AND subcompany_id = #{subcompanyId}
</if>
<if test="jobtitleName != null">
AND jobtitle_name = #{jobtitleName}
</if>
<if test="jobtitleId != null">
AND jobtitle_id = #{jobtitleId}
</if>
<if test="companystartdate != null">
AND companystartdate = #{companystartdate}
</if>
<if test="mobile != null">
AND mobile = #{mobile}
</if>
<if test="status != null">
AND status = #{status}
</if>
<if test="workcode != null">
AND workcode = #{workcode}
</if>
<if test="sex != null">
AND sex = #{sex}
</if>
<if test="email != null">
AND email = #{email}
</if>
<if test="telephone != null">
AND telephone = #{telephone}
</if>
<if test="jobcall != null">
AND jobcall = #{jobcall}
</if>
<if test="birthday != null">
AND birthday = #{birthday}
</if>
<if test="idNo != null">
AND id_no = #{idNo}
</if>
<if test="bankCardNum != null">
AND bank_card_num = #{bankCardNum}
</if>
<if test="bankName != null">
AND bank_name = #{bankName}
</if>
<if test="deleteType != null">
AND delete_type = #{deleteType}
</if>
<if test="creator != null">
AND creator = #{creator}
</if>
<if test="modifier != null">
AND modifier = #{modifier}
</if>
<if test="createTime != null">
AND create_time = #{createTime}
</if>
<if test="updateTime != null">
AND update_time = #{updateTime}
</if>
<if test="tenantKey != null">
AND tenant_key = #{tenantKey}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
ORDER BY id DESC
</select>
<!-- 插入不为NULL的字段 -->
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.extemp.po.ExtEmpPO">
INSERT INTO hrsa_external_employee
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="username != null">
username,
</if>
<if test="departmentName != null">
department_name,
</if>
<if test="departmentId != null">
department_id,
</if>
<if test="subcompanyName != null">
subcompany_name,
</if>
<if test="subcompanyId != null">
subcompany_id,
</if>
<if test="jobtitleName != null">
jobtitle_name,
</if>
<if test="jobtitleId != null">
jobtitle_id,
</if>
<if test="companystartdate != null">
companystartdate,
</if>
<if test="mobile != null">
mobile,
</if>
<if test="status != null">
status,
</if>
<if test="workcode != null">
workcode,
</if>
<if test="sex != null">
sex,
</if>
<if test="email != null">
email,
</if>
<if test="telephone != null">
telephone,
</if>
<if test="jobcall != null">
jobcall,
</if>
<if test="birthday != null">
birthday,
</if>
<if test="idNo != null">
id_no,
</if>
<if test="bankCardNum != null">
bank_card_num,
</if>
<if test="bankName != null">
bank_name,
</if>
<if test="deleteType != null">
delete_type,
</if>
<if test="creator != null">
creator,
</if>
<if test="modifier != null">
modifier,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="tenantKey != null">
tenant_key,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="username != null">
#{username},
</if>
<if test="departmentName != null">
#{departmentName},
</if>
<if test="departmentId != null">
#{departmentId},
</if>
<if test="subcompanyName != null">
#{subcompanyName},
</if>
<if test="subcompanyId != null">
#{subcompanyId},
</if>
<if test="jobtitleName != null">
#{jobtitleName},
</if>
<if test="jobtitleId != null">
#{jobtitleId},
</if>
<if test="companystartdate != null">
#{companystartdate},
</if>
<if test="mobile != null">
#{mobile},
</if>
<if test="status != null">
#{status},
</if>
<if test="workcode != null">
#{workcode},
</if>
<if test="sex != null">
#{sex},
</if>
<if test="email != null">
#{email},
</if>
<if test="telephone != null">
#{telephone},
</if>
<if test="jobcall != null">
#{jobcall},
</if>
<if test="birthday != null">
#{birthday},
</if>
<if test="idNo != null">
#{idNo},
</if>
<if test="bankCardNum != null">
#{bankCardNum},
</if>
<if test="bankName != null">
#{bankName},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="creator != null">
#{creator},
</if>
<if test="modifier != null">
#{modifier},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="tenantKey != null">
#{tenantKey},
</if>
</trim>
</insert>
<!-- 更新,更新全部字段 -->
<update id="update" parameterType="com.engine.salary.entity.extemp.po.ExtEmpPO">
UPDATE hrsa_external_employee
<set>
username=#{username},
department_name=#{departmentName},
department_id=#{departmentId},
subcompany_name=#{subcompanyName},
subcompany_id=#{subcompanyId},
jobtitle_name=#{jobtitleName},
jobtitle_id=#{jobtitleId},
companystartdate=#{companystartdate},
mobile=#{mobile},
status=#{status},
workcode=#{workcode},
sex=#{sex},
email=#{email},
telephone=#{telephone},
jobcall=#{jobcall},
birthday=#{birthday},
id_no=#{idNo},
bank_card_num=#{bankCardNum},
bank_name=#{bankName},
delete_type=#{deleteType},
creator=#{creator},
modifier=#{modifier},
create_time=#{createTime},
update_time=#{updateTime},
tenant_key=#{tenantKey},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 更新不为NULL的字段 -->
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.extemp.po.ExtEmpPO">
UPDATE hrsa_external_employee
<set>
<if test="username != null">
username=#{username},
</if>
<if test="departmentName != null">
department_name=#{departmentName},
</if>
<if test="departmentId != null">
department_id=#{departmentId},
</if>
<if test="subcompanyName != null">
subcompany_name=#{subcompanyName},
</if>
<if test="subcompanyId != null">
subcompany_id=#{subcompanyId},
</if>
<if test="jobtitleName != null">
jobtitle_name=#{jobtitleName},
</if>
<if test="jobtitleId != null">
jobtitle_id=#{jobtitleId},
</if>
<if test="companystartdate != null">
companystartdate=#{companystartdate},
</if>
<if test="mobile != null">
mobile=#{mobile},
</if>
<if test="status != null">
status=#{status},
</if>
<if test="workcode != null">
workcode=#{workcode},
</if>
<if test="sex != null">
sex=#{sex},
</if>
<if test="email != null">
email=#{email},
</if>
<if test="telephone != null">
telephone=#{telephone},
</if>
<if test="jobcall != null">
jobcall=#{jobcall},
</if>
<if test="birthday != null">
birthday=#{birthday},
</if>
<if test="idNo != null">
id_no=#{idNo},
</if>
<if test="bankCardNum != null">
bank_card_num=#{bankCardNum},
</if>
<if test="bankName != null">
bank_name=#{bankName},
</if>
<if test="deleteType != null">
delete_type=#{deleteType},
</if>
<if test="creator != null">
creator=#{creator},
</if>
<if test="modifier != null">
modifier=#{modifier},
</if>
<if test="createTime != null">
create_time=#{createTime},
</if>
<if test="updateTime != null">
update_time=#{updateTime},
</if>
<if test="tenantKey != null">
tenant_key=#{tenantKey},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 根据主键删除记录 -->
<delete id="delete">
UPDATE hrsa_external_employee
SET delete_type=1
WHERE id = #{id}
AND delete_type = 0
</delete>
</mapper>

View File

@ -0,0 +1,19 @@
package com.engine.salary.service;
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
import com.engine.salary.entity.extemp.po.ExtEmpPO;
import java.util.Collection;
import java.util.List;
public interface ExtEmpService {
List<ExtEmpPO> list(ExtEmpQueryParam param);
void save(ExtEmpPO po);
void update(ExtEmpPO po);
void delete(Collection<Long> ids);
}

View File

@ -0,0 +1,51 @@
package com.engine.salary.service.impl;
import com.engine.core.impl.Service;
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
import com.engine.salary.entity.extemp.po.ExtEmpPO;
import com.engine.salary.mapper.extemp.ExternalEmployeeMapper;
import com.engine.salary.service.ExtEmpService;
import com.engine.salary.util.db.MapperProxyFactory;
import org.apache.commons.collections4.CollectionUtils;
import java.util.Collection;
import java.util.List;
/**
* 累计专项
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
public class ExtEmpServiceImpl extends Service implements ExtEmpService {
private ExternalEmployeeMapper getExternalEmployeeMapper() {
return MapperProxyFactory.getProxy(ExternalEmployeeMapper.class);
}
@Override
public List<ExtEmpPO> list(ExtEmpQueryParam param) {
return null;
}
@Override
public void save(ExtEmpPO po) {
getExternalEmployeeMapper().insertIgnoreNull(po);
}
@Override
public void update(ExtEmpPO po) {
getExternalEmployeeMapper().updateIgnoreNull(po);
}
@Override
public void delete(Collection<Long> ids) {
if (CollectionUtils.isNotEmpty(ids)) {
ids.forEach(getExternalEmployeeMapper()::delete);
}
}
}

View File

@ -0,0 +1,15 @@
package com.engine.salary.web;
/**
* 流程相关
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
public class ExtEmpController {
}

View File

@ -0,0 +1,48 @@
package com.engine.salary.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
import com.engine.salary.entity.extemp.po.ExtEmpPO;
import com.engine.salary.service.ExtEmpService;
import com.engine.salary.service.impl.ExtEmpServiceImpl;
import weaver.hrm.User;
import java.util.Collection;
import java.util.List;
/**
* 累计专项
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
public class ExtEmpWrapper extends Service implements ExtEmpService {
private ExtEmpService getExtEmpService(User user) {
return ServiceUtil.getService(ExtEmpServiceImpl.class, user);
}
@Override
public List<ExtEmpPO> list(ExtEmpQueryParam param) {
return null;
}
@Override
public void save(ExtEmpPO po) {
getExtEmpService(user).save(po);
}
@Override
public void update(ExtEmpPO po) {
getExtEmpService(user).update(po);
}
@Override
public void delete(Collection<Long> ids) {
getExtEmpService(user).delete(ids);
}
}