Commit c1c9c63c by 翁国栋 Committed by 284718418@qq.com

人员异动

parent 1216f831
ALTER TABLE `zzgl_log_dgjl`
ADD COLUMN `type` int(11) NULL COMMENT '1 转正 2调岗 3离职 4岗位删除员工 5 岗位添加员工' AFTER `comment`;
CREATE TABLE `yggl_emp_lzyy`
(
`id` int(11) NOT NULL,
`value` varchar(255) NULL COMMENT '离职原因',
PRIMARY KEY (`id`)
) COMMENT = '离职原因';
ALTER TABLE `yggl_emp_lzyy`
MODIFY COLUMN `id` int(11) NOT NULL AUTO_INCREMENT FIRST;
ALTER TABLE `timer_test`.`yggl_emp_lzyy`
ADD COLUMN `org_code` int(11) NULL DEFAULT NULL COMMENT '企业Id' AFTER `value`;
ALTER TABLE `yggl_main_lzb`
ADD COLUMN `lzyy_id` int(11) NULL COMMENT '离职原因Id' AFTER `query`,
MODIFY COLUMN `lzbz` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '离职去向(原离职备注)' AFTER `query`,
MODIFY COLUMN `lzyy` varchar(800) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '原因说明(原离职原因)' AFTER `lzbz`;
ALTER TABLE yggl_main_emp`
ADD COLUMN `zpgl_zj_id` int(11) NULL DEFAULT NULL COMMENT '职级字典id' AFTER `zpgl_gzdd_id`;
package cn.timer.api.bean.yggl;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* 离职原因
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-05-06 15:46:06
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name="yggl_emp_lzyy")
@ApiModel("员工离职原因")
public class YgglEmpLzyy extends Model<YgglEmpLzyy> {
private static final long serialVersionUID = -107322833609489522L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value="id 员工编号",example="101")
private Integer id;
/**
* 离职原因
*/
@ApiModelProperty(value="离职原因 ",example="离职原因")
private String value;
@ApiModelProperty(value="企业Id ",example="企业Id")
private Integer orgCode;
/**
* 设置:
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取:
*/
public Integer getId() {
return id;
}
/**
* 设置:离职原因
*/
public void setValue(String value) {
this.value = value;
}
/**
* 获取:离职原因
*/
public String getValue() {
return value;
}
}
......@@ -200,12 +200,16 @@ public class YgglMainLzb extends Model<YgglMainLzb> {
@ApiModelProperty(value="实际离职时间 ",example="实际离职时间")
private Date sjlzTime;
@ApiModelProperty(value="离职原因 ",example="离职原因")
@ApiModelProperty(value="原因说明(原离职原因) ",example="原因说明(原离职原因)")
private String lzyy;
@ApiModelProperty(value="离职备注",example="离职原因")
@ApiModelProperty(value="离职去向(原离职备注)",example="离职去向(原离职备注)")
private String lzbz;
@ApiModelProperty(value="离职原因id",example="离职原因id")
private String lzyyId;
//@Transient
//@TableField(exist = false)
//private String workTime;//工龄
......
......@@ -2,10 +2,7 @@ package cn.timer.api.bean.zzgl;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.*;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......@@ -61,4 +58,14 @@ public class ZzglLogDgjl extends Model<ZzglLogDgjl> {
@ApiModelProperty(value = "记录时间 ", example = "记录时间")
private Date createTime;
@ApiModelProperty(value = "类型 ", example = "1 转正 2调岗 3离职 4岗位删除员工 5 岗位添加员工")
private Integer type;
@ApiModelProperty(value = "备注 ", example = "备注")
private String comment;
@Transient
private String obmgwName;
@Transient
private String nbmgwName;
}
......@@ -91,8 +91,19 @@ public class ZzglBmgwMServiceImpl implements ZzglBmgwMService {
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.set("bmgw_id", dpetId).eq("org_code", orgCode).in("emp_num", empNum);
zzglLogDgjlMapper.insertbyaddemp(empNums, empNum, dpetId, orgCode,
dpetId == null || dpetId == 0 ? "岗位删除员工" : upEmpDeptDto.getIsdg() == null ? "岗位添加员工" : "员工调岗");
String comm;
Integer type;
if(dpetId == null || dpetId == 0 ){
comm="岗位删除员工";
type=4;
}else if(upEmpDeptDto.getIsdg() == null){
comm="岗位添加员工";
type=5;
}else{
comm="员工调岗";
type=2;
}
zzglLogDgjlMapper.insertbyaddemp(empNums,empNum, dpetId,null, orgCode,comm,type);
ygglMainEmp.update(updateWrapper);
}
......
package cn.timer.api.dao.yggl;
import cn.timer.api.bean.yggl.YgglEmpLzyy;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* 离职原因
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-05-06 15:46:06
*/
@Repository
public interface YgglEmpLzyyMapper extends BaseMapper<YgglEmpLzyy> {
}
......@@ -2,6 +2,7 @@ package cn.timer.api.dao.zzgl;
import java.util.List;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......@@ -23,8 +24,10 @@ public interface ZzglLogDgjlMapper extends BaseMapper<ZzglLogDgjl> {
List<ZzglLogDgjlDto> selectListdgjl( ZzglLogDgjlQueryDto zglLogDgjlQueryDto);
void insertbydeldept(@Param("ids") List<Integer>ids,@Param("uid") Integer uid);
void insertbyaddemp(@Param("ids") List<Integer>ids,@Param("uid") Integer uid,@Param("gwid") Integer gwid,@Param("orgc") Integer orgc,@Param("comm") String comm );
void insertbyaddemp(@Param("ids") List<Integer>ids, @Param("uid") Integer uid, @Param("gwid") Integer gwid,@Param("ogwid") Integer ogwid, @Param("orgc") Integer orgc, @Param("comm") String comm, @Param("type")Integer type);
//weng 获取调岗记录
List<LogDgjlsDto> selectListdgjls(IPage<LogDgjlsDto> page,@Param("param") LogDgjlsQueryDto logDgjlsQueryDto);
List<ZzglLogDgjl> selectListByUser(@Param("orgCode")Integer orgCode,@Param("empNum") Integer empNum);
}
......@@ -31,4 +31,7 @@ public class YgzzDto implements Serializable{
@ApiModelProperty(value="转正原因",example="有梦想")
private String zzRemark;
@ApiModelProperty(value="岗位",example="有梦想")
private Integer bmgwId;
}
......@@ -32,4 +32,17 @@ public class UpEmpDeptDto implements Serializable{
@ApiModelProperty(value="是否调岗",example="1")
private Integer isdg;
@ApiModelProperty(value="备注",example="1")
private String remake;
@ApiModelProperty(value="合同公司id",example="1")
private Integer zpglCompanyId;
@ApiModelProperty(value="工作地点id",example="1")
private Integer zpglGzddId;
@ApiModelProperty(value="原职级id",example="1")
private Integer zpglZjId;
}
<?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="cn.timer.api.dao.yggl.YgglEmpLzyyMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.yggl.YgglEmpLzyy" id="ygglEmpLzyyMap">
<result property="id" column="id"/>
<result property="value" column="value"/>
<result property="orgCode" column="org_code"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.yggl.YgglEmpLzyy">
select *
from yggl_emp_lzyy
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.yggl.YgglEmpLzyy">
select * from yggl_emp_lzyy
<where>
<if test="id != null and id != ''">AND `id` = #{id}</if>
<if test="value != null and value != ''">AND `value` = #{value}</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from yggl_emp_lzyy
<where>
<if test="id != null and id != ''">AND `id` = #{id}</if>
<if test="value != null and value != ''">AND `value` = #{value}</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.yggl.YgglEmpLzyy">
insert into yggl_emp_lzyy
(`id`,
`value`)
values (#{id},
#{value})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.yggl.YgglEmpLzyy">
insert into yggl_emp_lzyy
(
<if test="id != null">`id`</if>
<if test="value != null">,`value`</if>
)
values
(
<if test="id != null">#{id}</if>
<if test="value != null">,#{value}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.yggl.YgglEmpLzyy">
insert into yggl_emp_lzyy
(
`id`,
`value`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id},
#{item.value}
)
</foreach>
</insert>
<update id="update" parameterType="cn.timer.api.bean.yggl.YgglEmpLzyy">
update yggl_emp_lzyy
<set>
<if test="value != null">`value` = #{value}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete
from yggl_emp_lzyy
where id = #{value}
</delete>
<delete id="deleteBatch">
delete from yggl_emp_lzyy where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
......@@ -55,6 +55,8 @@
<result column="appopenid" property="appopenid" />
<result column="lz_time" property="lzTime" />
<result column="sjlz_time" property="sjlzTime" />
<result column="lzyy_id" property="lzyyId" />
</resultMap>
<sql id="Base_Column_List">
......@@ -107,7 +109,8 @@
mpopenid,
appopenid,
lz_time,
sjlz_time
sjlz_time,
lzyy_id
</sql>
<sql id="Base_Column_List_Alias">
......@@ -160,7 +163,8 @@
mpopenid YgglMainLzb_mpopenid,
appopenid YgglMainLzb_appopenid,
lz_time YgglMainLzb_lz_time,
sjlz_time YgglMainLzb_sjlz_time
sjlz_time YgglMainLzb_sjlz_time,
lzyyId YgglMainLzb_lzyy_id,
</sql>
<!-- 查询本月离职人数 -->
<select id="queryDeparture" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
......
......@@ -12,6 +12,9 @@
<result column="nbmgw_id" property="nbmgwId" />
<result column="update_id" property="updateId" />
<result column="create_time" property="createTime" />
<result column="type" property="type" />
<result column="comment" property="comment" />
</resultMap>
<sql id="Base_Column_List">
......@@ -21,7 +24,8 @@
a.obmgw_id,
a.nbmgw_id,
a.update_id,
a.create_time
a.create_time,
a.type
</sql>
<sql id="Base_Column_List_Alias">
......@@ -108,8 +112,15 @@
</insert>
<insert id="insertbyaddemp">
insert into zzgl_log_dgjl
(create_time,emp_num,nbmgw_id,obmgw_id,org_code,update_id,comment)
select NOW(),emp_num,#{gwid},bmgw_id,org_code,#{uid},#{comm} from
(create_time,emp_num,nbmgw_id,obmgw_id,org_code,update_id,comment,type)
select NOW(),emp_num,#{gwid},
<if test="ogwid==null">
bmgw_id
</if>
<if test="ogwid!=null">
#{ogwid}
</if>
,org_code,#{uid},#{comm},#{type} from
yggl_main_emp where org_code=#{orgc} and emp_num in
<foreach item="item" index="index" collection="ids" open="("
separator="," close=")">#{item}</foreach>
......@@ -137,4 +148,11 @@
#{pageSize} </select> <select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1) FROM zzgl_log_dgjl </select> -->
<select id="selectListByUser" resultType="cn.timer.api.bean.zzgl.ZzglLogDgjl">
select z.*,zm.`name` as obmgwName,zmn.`name`as nbmgwName from zzgl_log_dgjl z
LEFT JOIN zzgl_bmgw_m zm on zm.id=z.obmgw_id
LEFT JOIN zzgl_bmgw_m zmn on zmn.id=z.nbmgw_id
where z.type in (1,2,3,6,7) and z.emp_num =#{empNum} and z.org_code=#{orgCode}
order by z.create_time desc
</select>
</mapper>
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