7 changed files with 132 additions and 3 deletions
@ -0,0 +1,89 @@ |
|||||
|
package com.qs.serve.modules.sys.entity; |
||||
|
|
||||
|
import java.time.LocalDate; |
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* 用户编码对照表 实体类 |
||||
|
* @author YenHex |
||||
|
* @since 2023-09-08 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("sys_user_code_math") |
||||
|
public class SysUserCodeMath implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** 旧编码 */ |
||||
|
@Length(max = 255,message = "旧编码长度不能超过255字") |
||||
|
@TableId(type = IdType.ASSIGN_UUID) |
||||
|
private String sourCode; |
||||
|
|
||||
|
/** 当前编码 */ |
||||
|
@Length(max = 255,message = "当前编码长度不能超过255字") |
||||
|
private String currCode; |
||||
|
|
||||
|
/** 用户名称 */ |
||||
|
@Length(max = 255,message = "用户名称长度不能超过255字") |
||||
|
private String userName; |
||||
|
|
||||
|
/** 创建时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
/** 最后更新时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
/** 所属租户 */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** 创建人 */ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private String createBy; |
||||
|
|
||||
|
/** 更新人 */ |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private String updateBy; |
||||
|
|
||||
|
/** 逻辑删除标记(0:显示;1:隐藏) */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String delFlag; |
||||
|
|
||||
|
|
||||
|
public static SysUserCodeMath toNewObject(SysUserCodeMath source){ |
||||
|
SysUserCodeMath userCodeMath = new SysUserCodeMath(); |
||||
|
userCodeMath.setSourCode(source.getSourCode()); |
||||
|
userCodeMath.setCurrCode(source.getCurrCode()); |
||||
|
userCodeMath.setUserName(source.getUserName()); |
||||
|
userCodeMath.setCreateTime(source.getCreateTime()); |
||||
|
userCodeMath.setUpdateTime(source.getUpdateTime()); |
||||
|
userCodeMath.setTenantId(source.getTenantId()); |
||||
|
userCodeMath.setCreateBy(source.getCreateBy()); |
||||
|
userCodeMath.setUpdateBy(source.getUpdateBy()); |
||||
|
userCodeMath.setDelFlag(source.getDelFlag()); |
||||
|
return userCodeMath; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,22 @@ |
|||||
|
package com.qs.serve.modules.sys.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.sys.entity.SysUserCodeMath; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.apache.ibatis.annotations.Select; |
||||
|
|
||||
|
/** |
||||
|
* 用户编码对照表 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2023-09-08 |
||||
|
*/ |
||||
|
public interface SysUserCodeMathMapper extends BaseMapper<SysUserCodeMath> { |
||||
|
|
||||
|
|
||||
|
@InterceptorIgnore(tenantLine = "true") |
||||
|
@Select("select `curr_code` from sys_user_code_math where sour_code = #{oldCode} limit 1 ") |
||||
|
String getNewCode(@Param("oldCode") String oldCode); |
||||
|
|
||||
|
} |
||||
|
|
Loading…
Reference in new issue