parent
7a257eb264
commit
a327ff26ba
@ -0,0 +1,39 @@
|
|||||||
|
package com.ruoyi.common.core.constant;
|
||||||
|
|
||||||
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Alan Scipio
|
||||||
|
* created on 2024/2/18
|
||||||
|
*/
|
||||||
|
public interface IEnum {
|
||||||
|
|
||||||
|
int getCode();
|
||||||
|
|
||||||
|
String getName();
|
||||||
|
|
||||||
|
static IEnum getByCode(IEnum[] enums, int code) {
|
||||||
|
if (enums == null || enums.length == 0) {
|
||||||
|
throw new IllegalArgumentException("enums is empty");
|
||||||
|
}
|
||||||
|
for (IEnum value : enums) {
|
||||||
|
if (value.getCode() == code) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new NoSuchElementException("No such enum with code: [" + code + "], enum type: [" + enums[0].getClass().getName() + "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
static IEnum getByName(IEnum[] enums, String name) {
|
||||||
|
if (enums == null || enums.length == 0) {
|
||||||
|
throw new IllegalArgumentException("enums is empty");
|
||||||
|
}
|
||||||
|
for (IEnum value : enums) {
|
||||||
|
if (value.getName().equals(name)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new NoSuchElementException("No such enum with name: [" + name + "], enum type: [" + enums[0].getClass().getName() + "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,16 +1,17 @@
|
|||||||
package com.ruoyi.common.core.exception;
|
package com.ruoyi.common.core.exception;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码错误异常类
|
* 验证码错误异常类
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class CaptchaException extends RuntimeException
|
public class CaptchaException extends RuntimeException {
|
||||||
{
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public CaptchaException(String msg)
|
public CaptchaException(String msg) {
|
||||||
{
|
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,31 +1,29 @@
|
|||||||
package com.ruoyi.common.core.exception;
|
package com.ruoyi.common.core.exception;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查异常
|
* 检查异常
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class CheckedException extends RuntimeException
|
public class CheckedException extends RuntimeException {
|
||||||
{
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public CheckedException(String message)
|
public CheckedException(String message) {
|
||||||
{
|
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CheckedException(Throwable cause)
|
public CheckedException(Throwable cause) {
|
||||||
{
|
|
||||||
super(cause);
|
super(cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CheckedException(String message, Throwable cause)
|
public CheckedException(String message, Throwable cause) {
|
||||||
{
|
|
||||||
super(message, cause);
|
super(message, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CheckedException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace)
|
public CheckedException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
|
||||||
{
|
|
||||||
super(message, cause, enableSuppression, writableStackTrace);
|
super(message, cause, enableSuppression, writableStackTrace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
package com.ruoyi.common.core.exception;
|
package com.ruoyi.common.core.exception;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 演示模式异常
|
* 演示模式异常
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class DemoModeException extends RuntimeException
|
public class DemoModeException extends RuntimeException {
|
||||||
{
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public DemoModeException()
|
public DemoModeException() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
package com.ruoyi.common.core.exception;
|
package com.ruoyi.common.core.exception;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内部认证异常
|
* 内部认证异常
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class InnerAuthException extends RuntimeException
|
public class InnerAuthException extends RuntimeException {
|
||||||
{
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public InnerAuthException(String message)
|
public InnerAuthException(String message) {
|
||||||
{
|
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.ruoyi.common.core.exception;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.exception.base.BaseException;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Alan Scipio
|
||||||
|
* created on 2024/2/19
|
||||||
|
*/
|
||||||
|
public class NoSuchDataException extends BaseException {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public NoSuchDataException(String module, String code, Object[] args, String defaultMessage) {
|
||||||
|
super(module, code, args, defaultMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NoSuchDataException(String module, String code, Object[] args) {
|
||||||
|
super(module, code, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NoSuchDataException(String module, String defaultMessage) {
|
||||||
|
super(module, defaultMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NoSuchDataException(String code, Object[] args) {
|
||||||
|
super(code, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NoSuchDataException(String defaultMessage) {
|
||||||
|
super(defaultMessage);
|
||||||
|
}
|
||||||
|
}
|
@ -1,15 +1,16 @@
|
|||||||
package com.ruoyi.common.core.exception;
|
package com.ruoyi.common.core.exception;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权限异常
|
* 权限异常
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class PreAuthorizeException extends RuntimeException
|
public class PreAuthorizeException extends RuntimeException {
|
||||||
{
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public PreAuthorizeException()
|
public PreAuthorizeException() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,26 +1,25 @@
|
|||||||
package com.ruoyi.common.core.exception;
|
package com.ruoyi.common.core.exception;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工具类异常
|
* 工具类异常
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class UtilException extends RuntimeException
|
public class UtilException extends RuntimeException {
|
||||||
{
|
@Serial
|
||||||
private static final long serialVersionUID = 8247610319171014183L;
|
private static final long serialVersionUID = 8247610319171014183L;
|
||||||
|
|
||||||
public UtilException(Throwable e)
|
public UtilException(Throwable e) {
|
||||||
{
|
|
||||||
super(e.getMessage(), e);
|
super(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UtilException(String message)
|
public UtilException(String message) {
|
||||||
{
|
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UtilException(String message, Throwable throwable)
|
public UtilException(String message, Throwable throwable) {
|
||||||
{
|
|
||||||
super(message, throwable);
|
super(message, throwable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,34 +1,37 @@
|
|||||||
package com.ruoyi.common.core.exception.job;
|
package com.ruoyi.common.core.exception.job;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划策略异常
|
* 计划策略异常
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class TaskException extends Exception
|
public class TaskException extends Exception {
|
||||||
{
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private Code code;
|
private final Code code;
|
||||||
|
|
||||||
public TaskException(String msg, Code code)
|
public TaskException(String msg, Code code) {
|
||||||
{
|
|
||||||
this(msg, code, null);
|
this(msg, code, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TaskException(String msg, Code code, Exception nestedEx)
|
public TaskException(String msg, Code code, Exception nestedEx) {
|
||||||
{
|
|
||||||
super(msg, nestedEx);
|
super(msg, nestedEx);
|
||||||
this.code = code;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Code getCode()
|
public Code getCode() {
|
||||||
{
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Code
|
public enum Code {
|
||||||
{
|
TASK_EXISTS,
|
||||||
TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE
|
NO_TASK_EXISTS,
|
||||||
|
TASK_ALREADY_STARTED,
|
||||||
|
UNKNOWN,
|
||||||
|
CONFIG_ERROR,
|
||||||
|
TASK_NODE_NOT_AVAILABLE
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>ruoyi-common-services</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
ruoyi-common-services共通业务
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- RuoYi Common Security -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common-log</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-webmvc</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
@ -0,0 +1,68 @@
|
|||||||
|
package com.ruoyi.common.services;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.exception.NoSuchDataException;
|
||||||
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.utils.uuid.snowflake.SnowFlakeIdGenerator;
|
||||||
|
import com.ruoyi.common.services.domain.SysSeqResult;
|
||||||
|
import com.ruoyi.common.services.domain.vo.SeqGenResult;
|
||||||
|
import com.ruoyi.common.services.domain.vo.SeqVo;
|
||||||
|
import com.ruoyi.common.services.mapper.SysSeqResultMapper;
|
||||||
|
import com.ruoyi.common.services.mapper.SysSequenceExtMapper;
|
||||||
|
import com.ruoyi.common.services.sequence.ISequenceGenerator;
|
||||||
|
import com.ruoyi.common.services.sequence.SequenceConfig;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列号生成的业务接口
|
||||||
|
*
|
||||||
|
* @author Alan Scipio
|
||||||
|
* created on 2024/2/18
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysSequenceServiceImpl implements ISysSequenceService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SequenceConfig sequenceConfig;
|
||||||
|
@Resource
|
||||||
|
private SysSequenceExtMapper extMapper;
|
||||||
|
@Resource
|
||||||
|
private SysSeqResultMapper resultMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getNextSequence(String seqDistCd, boolean update) {
|
||||||
|
if (StringUtils.isBlank(seqDistCd)) {
|
||||||
|
throw new IllegalArgumentException("seqDistCd can not be blank");
|
||||||
|
}
|
||||||
|
//查询规则和实绩(第一次生成的话实绩为空)
|
||||||
|
SeqVo seqVo = extMapper.selectMaxSeq(seqDistCd);
|
||||||
|
if (seqVo == null) {
|
||||||
|
throw new NoSuchDataException("seqGen", "No sequence rule found by seqDistCd: [" + seqDistCd + "]");
|
||||||
|
}
|
||||||
|
//检查规则是否启用
|
||||||
|
if (!seqVo.isEnable()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
//获取生成器
|
||||||
|
ISequenceGenerator generator;
|
||||||
|
if (StringUtils.isNotBlank(seqVo.getGeneratorName())) {
|
||||||
|
generator = sequenceConfig.getOrCreateGenerator(seqVo.getGeneratorName());
|
||||||
|
} else {
|
||||||
|
generator = sequenceConfig.getDefaultGenerator();
|
||||||
|
}
|
||||||
|
//生成序列号
|
||||||
|
SeqGenResult result = generator.nextSequenceGen(seqVo, null);
|
||||||
|
//更新记录
|
||||||
|
if (update) {
|
||||||
|
SysSeqResult updateRecord = result.getUpdateRecord();
|
||||||
|
if (result.getSeqId() == null) {
|
||||||
|
updateRecord.setSeqId(SnowFlakeIdGenerator.nextIdLong());
|
||||||
|
resultMapper.insertSelective(updateRecord);
|
||||||
|
} else {
|
||||||
|
resultMapper.updateByPrimaryKeySelective(updateRecord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.getSequenceResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.ruoyi.common.services.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本模块全局配置
|
||||||
|
*
|
||||||
|
* @author Alan Scipio
|
||||||
|
* created on 2024/2/19
|
||||||
|
*/
|
||||||
|
@ComponentScan("com.ruoyi.common.services")
|
||||||
|
@Configuration
|
||||||
|
public class ServicesConfig {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.ruoyi.common.services.constants;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.constant.IEnum;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Alan Scipio
|
||||||
|
* created on 2024/2/18
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum SeqType implements IEnum {
|
||||||
|
|
||||||
|
UNIT_CD(1, "UNIT", "单位代码"),
|
||||||
|
|
||||||
|
GOODE_TYPE_CD(2, "GT", "商品类型代码"),
|
||||||
|
|
||||||
|
WHS_CD(3, "WHS", "仓库代码"),
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
private final int code;
|
||||||
|
|
||||||
|
private final String seqDistCd;
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
SeqType(int code, String seqDistCd, String name) {
|
||||||
|
this.code = code;
|
||||||
|
this.seqDistCd = seqDistCd;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,201 @@
|
|||||||
|
package com.ruoyi.common.services.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class was generated by MyBatis Generator.
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li> Table: sys_seq_result </li>
|
||||||
|
* <li> Remarks: 序列号生成记录表 </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @author ryas
|
||||||
|
* created on 2024-02-19
|
||||||
|
*/
|
||||||
|
public class SysSeqResult extends BaseEntity implements Serializable {
|
||||||
|
/**
|
||||||
|
* 序列号ID
|
||||||
|
*/
|
||||||
|
private Long seqId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列号识别码
|
||||||
|
*/
|
||||||
|
private String seqDistCd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前缀
|
||||||
|
*/
|
||||||
|
private String prefix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分隔符1
|
||||||
|
*/
|
||||||
|
private String separator1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期值
|
||||||
|
*/
|
||||||
|
private String dateVal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分隔符2
|
||||||
|
*/
|
||||||
|
private String separator2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前序列号
|
||||||
|
*/
|
||||||
|
private Integer seqNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注1
|
||||||
|
*/
|
||||||
|
private String remark1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注2
|
||||||
|
*/
|
||||||
|
private String remark2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注3
|
||||||
|
*/
|
||||||
|
private String remark3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注4
|
||||||
|
*/
|
||||||
|
private String remark4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注5
|
||||||
|
*/
|
||||||
|
private String remark5;
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public Long getSeqId() {
|
||||||
|
return seqId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeqId(Long seqId) {
|
||||||
|
this.seqId = seqId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSeqDistCd() {
|
||||||
|
return seqDistCd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeqDistCd(String seqDistCd) {
|
||||||
|
this.seqDistCd = seqDistCd == null ? null : seqDistCd.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPrefix() {
|
||||||
|
return prefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrefix(String prefix) {
|
||||||
|
this.prefix = prefix == null ? null : prefix.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSeparator1() {
|
||||||
|
return separator1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeparator1(String separator1) {
|
||||||
|
this.separator1 = separator1 == null ? null : separator1.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDateVal() {
|
||||||
|
return dateVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDateVal(String dateVal) {
|
||||||
|
this.dateVal = dateVal == null ? null : dateVal.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSeparator2() {
|
||||||
|
return separator2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeparator2(String separator2) {
|
||||||
|
this.separator2 = separator2 == null ? null : separator2.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSeqNo() {
|
||||||
|
return seqNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeqNo(Integer seqNo) {
|
||||||
|
this.seqNo = seqNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemark1() {
|
||||||
|
return remark1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark1(String remark1) {
|
||||||
|
this.remark1 = remark1 == null ? null : remark1.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemark2() {
|
||||||
|
return remark2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark2(String remark2) {
|
||||||
|
this.remark2 = remark2 == null ? null : remark2.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemark3() {
|
||||||
|
return remark3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark3(String remark3) {
|
||||||
|
this.remark3 = remark3 == null ? null : remark3.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemark4() {
|
||||||
|
return remark4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark4(String remark4) {
|
||||||
|
this.remark4 = remark4 == null ? null : remark4.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemark5() {
|
||||||
|
return remark5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark5(String remark5) {
|
||||||
|
this.remark5 = remark5 == null ? null : remark5.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(getClass().getSimpleName());
|
||||||
|
sb.append(" [");
|
||||||
|
sb.append("Hash = ").append(hashCode());
|
||||||
|
sb.append(", seqId=").append(seqId);
|
||||||
|
sb.append(", seqDistCd=").append(seqDistCd);
|
||||||
|
sb.append(", prefix=").append(prefix);
|
||||||
|
sb.append(", separator1=").append(separator1);
|
||||||
|
sb.append(", dateVal=").append(dateVal);
|
||||||
|
sb.append(", separator2=").append(separator2);
|
||||||
|
sb.append(", seqNo=").append(seqNo);
|
||||||
|
sb.append(", remark1=").append(remark1);
|
||||||
|
sb.append(", remark2=").append(remark2);
|
||||||
|
sb.append(", remark3=").append(remark3);
|
||||||
|
sb.append(", remark4=").append(remark4);
|
||||||
|
sb.append(", remark5=").append(remark5);
|
||||||
|
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||||
|
sb.append("]");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.ruoyi.common.services.domain.vo;
|
||||||
|
|
||||||
|
import com.ruoyi.common.services.domain.SysSeqResult;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Alan Scipio
|
||||||
|
* created on 2024/2/19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SeqGenResult {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列号实绩ID
|
||||||
|
*/
|
||||||
|
private Long seqId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列号识别码
|
||||||
|
*/
|
||||||
|
private String seqDistCd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前缀
|
||||||
|
*/
|
||||||
|
private String prefix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分隔符1
|
||||||
|
*/
|
||||||
|
private String separator1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期值
|
||||||
|
*/
|
||||||
|
private String dateVal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分隔符2
|
||||||
|
*/
|
||||||
|
private String separator2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前序列号
|
||||||
|
*/
|
||||||
|
private Integer seqNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完整生成的序列号结果
|
||||||
|
*/
|
||||||
|
private String sequenceResult;
|
||||||
|
|
||||||
|
public SysSeqResult getUpdateRecord() {
|
||||||
|
SysSeqResult result = new SysSeqResult();
|
||||||
|
result.setSeqId(seqId);
|
||||||
|
result.setSeqDistCd(seqDistCd);
|
||||||
|
result.setPrefix(prefix);
|
||||||
|
result.setSeparator1(separator1);
|
||||||
|
result.setDateVal(dateVal);
|
||||||
|
result.setSeparator2(separator2);
|
||||||
|
result.setSeqNo(seqNo);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.ruoyi.common.services.mapper;
|
||||||
|
|
||||||
|
import java.sql.JDBCType;
|
||||||
|
import java.util.Date;
|
||||||
|
import org.mybatis.dynamic.sql.AliasableSqlTable;
|
||||||
|
import org.mybatis.dynamic.sql.SqlColumn;
|
||||||
|
|
||||||
|
public final class SysSeqResultDynamicSqlSupport {
|
||||||
|
public static final SysSeqResult sysSeqResult = new SysSeqResult();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列号ID
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<Long> seqId = sysSeqResult.seqId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列号识别码
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<String> seqDistCd = sysSeqResult.seqDistCd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前缀
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<String> prefix = sysSeqResult.prefix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分隔符1
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<String> separator1 = sysSeqResult.separator1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期值
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<String> dateVal = sysSeqResult.dateVal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分隔符2
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<String> separator2 = sysSeqResult.separator2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前序列号
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<Integer> seqNo = sysSeqResult.seqNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注1
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<String> remark1 = sysSeqResult.remark1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注2
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<String> remark2 = sysSeqResult.remark2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注3
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<String> remark3 = sysSeqResult.remark3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注4
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<String> remark4 = sysSeqResult.remark4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注5
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<String> remark5 = sysSeqResult.remark5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<String> createBy = sysSeqResult.createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<Date> createTime = sysSeqResult.createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<String> updateBy = sysSeqResult.updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<Date> updateTime = sysSeqResult.updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
public static final SqlColumn<String> remark = sysSeqResult.remark;
|
||||||
|
|
||||||
|
public static final class SysSeqResult extends AliasableSqlTable<SysSeqResult> {
|
||||||
|
public final SqlColumn<Long> seqId = column("seq_id", JDBCType.BIGINT);
|
||||||
|
|
||||||
|
public final SqlColumn<String> seqDistCd = column("seq_dist_cd", JDBCType.VARCHAR);
|
||||||
|
|
||||||
|
public final SqlColumn<String> prefix = column("prefix", JDBCType.VARCHAR);
|
||||||
|
|
||||||
|
public final SqlColumn<String> separator1 = column("separator1", JDBCType.VARCHAR);
|
||||||
|
|
||||||
|
public final SqlColumn<String> dateVal = column("date_val", JDBCType.VARCHAR);
|
||||||
|
|
||||||
|
public final SqlColumn<String> separator2 = column("separator2", JDBCType.VARCHAR);
|
||||||
|
|
||||||
|
public final SqlColumn<Integer> seqNo = column("seq_no", JDBCType.INTEGER);
|
||||||
|
|
||||||
|
public final SqlColumn<String> remark1 = column("remark_1", JDBCType.VARCHAR);
|
||||||
|
|
||||||
|
public final SqlColumn<String> remark2 = column("remark_2", JDBCType.VARCHAR);
|
||||||
|
|
||||||
|
public final SqlColumn<String> remark3 = column("remark_3", JDBCType.VARCHAR);
|
||||||
|
|
||||||
|
public final SqlColumn<String> remark4 = column("remark_4", JDBCType.VARCHAR);
|
||||||
|
|
||||||
|
public final SqlColumn<String> remark5 = column("remark_5", JDBCType.VARCHAR);
|
||||||
|
|
||||||
|
public final SqlColumn<String> createBy = column("create_by", JDBCType.VARCHAR);
|
||||||
|
|
||||||
|
public final SqlColumn<Date> createTime = column("create_time", JDBCType.TIMESTAMP);
|
||||||
|
|
||||||
|
public final SqlColumn<String> updateBy = column("update_by", JDBCType.VARCHAR);
|
||||||
|
|
||||||
|
public final SqlColumn<Date> updateTime = column("update_time", JDBCType.TIMESTAMP);
|
||||||
|
|
||||||
|
public final SqlColumn<String> remark = column("remark", JDBCType.VARCHAR);
|
||||||
|
|
||||||
|
public SysSeqResult() {
|
||||||
|
super("sys_seq_result", SysSeqResult::new);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,247 @@
|
|||||||
|
package com.ruoyi.common.services.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.common.security.utils.SecurityUtilsExt;
|
||||||
|
import com.ruoyi.common.services.domain.SysSeqResult;
|
||||||
|
import org.apache.ibatis.annotations.*;
|
||||||
|
import org.apache.ibatis.type.JdbcType;
|
||||||
|
import org.mybatis.dynamic.sql.BasicColumn;
|
||||||
|
import org.mybatis.dynamic.sql.delete.DeleteDSLCompleter;
|
||||||
|
import org.mybatis.dynamic.sql.select.CountDSLCompleter;
|
||||||
|
import org.mybatis.dynamic.sql.select.SelectDSLCompleter;
|
||||||
|
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||||
|
import org.mybatis.dynamic.sql.update.UpdateDSL;
|
||||||
|
import org.mybatis.dynamic.sql.update.UpdateDSLCompleter;
|
||||||
|
import org.mybatis.dynamic.sql.update.UpdateModel;
|
||||||
|
import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
|
||||||
|
import org.mybatis.dynamic.sql.util.mybatis3.*;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import static com.ruoyi.common.services.mapper.SysSeqResultDynamicSqlSupport.*;
|
||||||
|
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface SysSeqResultMapper extends CommonCountMapper, CommonDeleteMapper, CommonInsertMapper<SysSeqResult>, CommonUpdateMapper {
|
||||||
|
BasicColumn[] selectList = BasicColumn.columnList(seqId, seqDistCd, prefix, separator1, dateVal, separator2, seqNo, remark1, remark2, remark3, remark4, remark5, createBy, createTime, updateBy, updateTime, remark);
|
||||||
|
|
||||||
|
@SelectProvider(type=SqlProviderAdapter.class, method="select")
|
||||||
|
@Results(id="SysSeqResultResult", value = {
|
||||||
|
@Result(column="seq_id", property="seqId", jdbcType=JdbcType.BIGINT, id=true),
|
||||||
|
@Result(column="seq_dist_cd", property="seqDistCd", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="prefix", property="prefix", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="separator1", property="separator1", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="date_val", property="dateVal", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="separator2", property="separator2", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="seq_no", property="seqNo", jdbcType=JdbcType.INTEGER),
|
||||||
|
@Result(column="remark_1", property="remark1", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="remark_2", property="remark2", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="remark_3", property="remark3", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="remark_4", property="remark4", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="remark_5", property="remark5", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="create_by", property="createBy", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
|
||||||
|
@Result(column="update_by", property="updateBy", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
|
||||||
|
@Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR)
|
||||||
|
})
|
||||||
|
List<SysSeqResult> selectMany(SelectStatementProvider selectStatement);
|
||||||
|
|
||||||
|
@SelectProvider(type=SqlProviderAdapter.class, method="select")
|
||||||
|
@ResultMap("SysSeqResultResult")
|
||||||
|
Optional<SysSeqResult> selectOne(SelectStatementProvider selectStatement);
|
||||||
|
|
||||||
|
default long count(CountDSLCompleter completer) {
|
||||||
|
return MyBatis3Utils.countFrom(this::count, sysSeqResult, completer);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int delete(DeleteDSLCompleter completer) {
|
||||||
|
return MyBatis3Utils.deleteFrom(this::delete, sysSeqResult, completer);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int deleteByPrimaryKey(Long seqId_) {
|
||||||
|
return delete(c ->
|
||||||
|
c.where(seqId, isEqualTo(seqId_))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int insert(SysSeqResult row) {
|
||||||
|
row.setCommonForInsert(SecurityUtilsExt.getUserIdStr());
|
||||||
|
return MyBatis3Utils.insert(this::insert, row, sysSeqResult, c ->
|
||||||
|
c.map(seqId).toProperty("seqId")
|
||||||
|
.map(seqDistCd).toProperty("seqDistCd")
|
||||||
|
.map(prefix).toProperty("prefix")
|
||||||
|
.map(separator1).toProperty("separator1")
|
||||||
|
.map(dateVal).toProperty("dateVal")
|
||||||
|
.map(separator2).toProperty("separator2")
|
||||||
|
.map(seqNo).toProperty("seqNo")
|
||||||
|
.map(remark1).toProperty("remark1")
|
||||||
|
.map(remark2).toProperty("remark2")
|
||||||
|
.map(remark3).toProperty("remark3")
|
||||||
|
.map(remark4).toProperty("remark4")
|
||||||
|
.map(remark5).toProperty("remark5")
|
||||||
|
.map(createBy).toProperty("createBy")
|
||||||
|
.map(createTime).toProperty("createTime")
|
||||||
|
.map(updateBy).toProperty("updateBy")
|
||||||
|
.map(updateTime).toProperty("updateTime")
|
||||||
|
.map(remark).toProperty("remark")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int insertMultiple(Collection<SysSeqResult> records) {
|
||||||
|
for (SysSeqResult row : records) {
|
||||||
|
row.setCommonForInsert(SecurityUtilsExt.getUserIdStr());
|
||||||
|
}
|
||||||
|
return MyBatis3Utils.insertMultiple(this::insertMultiple, records, sysSeqResult, c ->
|
||||||
|
c.map(seqId).toProperty("seqId")
|
||||||
|
.map(seqDistCd).toProperty("seqDistCd")
|
||||||
|
.map(prefix).toProperty("prefix")
|
||||||
|
.map(separator1).toProperty("separator1")
|
||||||
|
.map(dateVal).toProperty("dateVal")
|
||||||
|
.map(separator2).toProperty("separator2")
|
||||||
|
.map(seqNo).toProperty("seqNo")
|
||||||
|
.map(remark1).toProperty("remark1")
|
||||||
|
.map(remark2).toProperty("remark2")
|
||||||
|
.map(remark3).toProperty("remark3")
|
||||||
|
.map(remark4).toProperty("remark4")
|
||||||
|
.map(remark5).toProperty("remark5")
|
||||||
|
.map(createBy).toProperty("createBy")
|
||||||
|
.map(createTime).toProperty("createTime")
|
||||||
|
.map(updateBy).toProperty("updateBy")
|
||||||
|
.map(updateTime).toProperty("updateTime")
|
||||||
|
.map(remark).toProperty("remark")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int insertSelective(SysSeqResult row) {
|
||||||
|
row.setCommonForInsert(SecurityUtilsExt.getUserIdStr());
|
||||||
|
return MyBatis3Utils.insert(this::insert, row, sysSeqResult, c ->
|
||||||
|
c.map(seqId).toPropertyWhenPresent("seqId", row::getSeqId)
|
||||||
|
.map(seqDistCd).toPropertyWhenPresent("seqDistCd", row::getSeqDistCd)
|
||||||
|
.map(prefix).toPropertyWhenPresent("prefix", row::getPrefix)
|
||||||
|
.map(separator1).toPropertyWhenPresent("separator1", row::getSeparator1)
|
||||||
|
.map(dateVal).toPropertyWhenPresent("dateVal", row::getDateVal)
|
||||||
|
.map(separator2).toPropertyWhenPresent("separator2", row::getSeparator2)
|
||||||
|
.map(seqNo).toPropertyWhenPresent("seqNo", row::getSeqNo)
|
||||||
|
.map(remark1).toPropertyWhenPresent("remark1", row::getRemark1)
|
||||||
|
.map(remark2).toPropertyWhenPresent("remark2", row::getRemark2)
|
||||||
|
.map(remark3).toPropertyWhenPresent("remark3", row::getRemark3)
|
||||||
|
.map(remark4).toPropertyWhenPresent("remark4", row::getRemark4)
|
||||||
|
.map(remark5).toPropertyWhenPresent("remark5", row::getRemark5)
|
||||||
|
.map(createBy).toPropertyWhenPresent("createBy", row::getCreateBy)
|
||||||
|
.map(createTime).toPropertyWhenPresent("createTime", row::getCreateTime)
|
||||||
|
.map(updateBy).toPropertyWhenPresent("updateBy", row::getUpdateBy)
|
||||||
|
.map(updateTime).toPropertyWhenPresent("updateTime", row::getUpdateTime)
|
||||||
|
.map(remark).toPropertyWhenPresent("remark", row::getRemark)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default Optional<SysSeqResult> selectOne(SelectDSLCompleter completer) {
|
||||||
|
return MyBatis3Utils.selectOne(this::selectOne, selectList, sysSeqResult, completer);
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<SysSeqResult> select(SelectDSLCompleter completer) {
|
||||||
|
return MyBatis3Utils.selectList(this::selectMany, selectList, sysSeqResult, completer);
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<SysSeqResult> selectDistinct(SelectDSLCompleter completer) {
|
||||||
|
return MyBatis3Utils.selectDistinct(this::selectMany, selectList, sysSeqResult, completer);
|
||||||
|
}
|
||||||
|
|
||||||
|
default Optional<SysSeqResult> selectByPrimaryKey(Long seqId_) {
|
||||||
|
return selectOne(c ->
|
||||||
|
c.where(seqId, isEqualTo(seqId_))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int update(UpdateDSLCompleter completer) {
|
||||||
|
return MyBatis3Utils.update(this::update, sysSeqResult, completer);
|
||||||
|
}
|
||||||
|
|
||||||
|
static UpdateDSL<UpdateModel> updateAllColumns(SysSeqResult row, UpdateDSL<UpdateModel> dsl) {
|
||||||
|
return dsl.set(seqId).equalTo(row::getSeqId)
|
||||||
|
.set(seqDistCd).equalTo(row::getSeqDistCd)
|
||||||
|
.set(prefix).equalTo(row::getPrefix)
|
||||||
|
.set(separator1).equalTo(row::getSeparator1)
|
||||||
|
.set(dateVal).equalTo(row::getDateVal)
|
||||||
|
.set(separator2).equalTo(row::getSeparator2)
|
||||||
|
.set(seqNo).equalTo(row::getSeqNo)
|
||||||
|
.set(remark1).equalTo(row::getRemark1)
|
||||||
|
.set(remark2).equalTo(row::getRemark2)
|
||||||
|
.set(remark3).equalTo(row::getRemark3)
|
||||||
|
.set(remark4).equalTo(row::getRemark4)
|
||||||
|
.set(remark5).equalTo(row::getRemark5)
|
||||||
|
.set(createBy).equalTo(row::getCreateBy)
|
||||||
|
.set(createTime).equalTo(row::getCreateTime)
|
||||||
|
.set(updateBy).equalTo(row::getUpdateBy)
|
||||||
|
.set(updateTime).equalTo(row::getUpdateTime)
|
||||||
|
.set(remark).equalTo(row::getRemark);
|
||||||
|
}
|
||||||
|
|
||||||
|
static UpdateDSL<UpdateModel> updateSelectiveColumns(SysSeqResult row, UpdateDSL<UpdateModel> dsl) {
|
||||||
|
row.setCommonForUpdate(SecurityUtilsExt.getUserIdStr());
|
||||||
|
return dsl.set(seqId).equalToWhenPresent(row::getSeqId)
|
||||||
|
.set(seqDistCd).equalToWhenPresent(row::getSeqDistCd)
|
||||||
|
.set(prefix).equalToWhenPresent(row::getPrefix)
|
||||||
|
.set(separator1).equalToWhenPresent(row::getSeparator1)
|
||||||
|
.set(dateVal).equalToWhenPresent(row::getDateVal)
|
||||||
|
.set(separator2).equalToWhenPresent(row::getSeparator2)
|
||||||
|
.set(seqNo).equalToWhenPresent(row::getSeqNo)
|
||||||
|
.set(remark1).equalToWhenPresent(row::getRemark1)
|
||||||
|
.set(remark2).equalToWhenPresent(row::getRemark2)
|
||||||
|
.set(remark3).equalToWhenPresent(row::getRemark3)
|
||||||
|
.set(remark4).equalToWhenPresent(row::getRemark4)
|
||||||
|
.set(remark5).equalToWhenPresent(row::getRemark5)
|
||||||
|
.set(createBy).equalToWhenPresent(row::getCreateBy)
|
||||||
|
.set(createTime).equalToWhenPresent(row::getCreateTime)
|
||||||
|
.set(updateBy).equalToWhenPresent(row::getUpdateBy)
|
||||||
|
.set(updateTime).equalToWhenPresent(row::getUpdateTime)
|
||||||
|
.set(remark).equalToWhenPresent(row::getRemark);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int updateByPrimaryKey(SysSeqResult row) {
|
||||||
|
return update(c ->
|
||||||
|
c.set(seqDistCd).equalTo(row::getSeqDistCd)
|
||||||
|
.set(prefix).equalTo(row::getPrefix)
|
||||||
|
.set(separator1).equalTo(row::getSeparator1)
|
||||||
|
.set(dateVal).equalTo(row::getDateVal)
|
||||||
|
.set(separator2).equalTo(row::getSeparator2)
|
||||||
|
.set(seqNo).equalTo(row::getSeqNo)
|
||||||
|
.set(remark1).equalTo(row::getRemark1)
|
||||||
|
.set(remark2).equalTo(row::getRemark2)
|
||||||
|
.set(remark3).equalTo(row::getRemark3)
|
||||||
|
.set(remark4).equalTo(row::getRemark4)
|
||||||
|
.set(remark5).equalTo(row::getRemark5)
|
||||||
|
.set(createBy).equalTo(row::getCreateBy)
|
||||||
|
.set(createTime).equalTo(row::getCreateTime)
|
||||||
|
.set(updateBy).equalTo(row::getUpdateBy)
|
||||||
|
.set(updateTime).equalTo(row::getUpdateTime)
|
||||||
|
.set(remark).equalTo(row::getRemark)
|
||||||
|
.where(seqId, isEqualTo(row::getSeqId))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int updateByPrimaryKeySelective(SysSeqResult row) {
|
||||||
|
row.setCommonForUpdate(SecurityUtilsExt.getUserIdStr());
|
||||||
|
return update(c ->
|
||||||
|
c.set(seqDistCd).equalToWhenPresent(row::getSeqDistCd)
|
||||||
|
.set(prefix).equalToWhenPresent(row::getPrefix)
|
||||||
|
.set(separator1).equalToWhenPresent(row::getSeparator1)
|
||||||
|
.set(dateVal).equalToWhenPresent(row::getDateVal)
|
||||||
|
.set(separator2).equalToWhenPresent(row::getSeparator2)
|
||||||
|
.set(seqNo).equalToWhenPresent(row::getSeqNo)
|
||||||
|
.set(remark1).equalToWhenPresent(row::getRemark1)
|
||||||
|
.set(remark2).equalToWhenPresent(row::getRemark2)
|
||||||
|
.set(remark3).equalToWhenPresent(row::getRemark3)
|
||||||
|
.set(remark4).equalToWhenPresent(row::getRemark4)
|
||||||
|
.set(remark5).equalToWhenPresent(row::getRemark5)
|
||||||
|
.set(createBy).equalToWhenPresent(row::getCreateBy)
|
||||||
|
.set(createTime).equalToWhenPresent(row::getCreateTime)
|
||||||
|
.set(updateBy).equalToWhenPresent(row::getUpdateBy)
|
||||||
|
.set(updateTime).equalToWhenPresent(row::getUpdateTime)
|
||||||
|
.set(remark).equalToWhenPresent(row::getRemark)
|
||||||
|
.where(seqId, isEqualTo(row::getSeqId))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,271 @@
|
|||||||
|
package com.ruoyi.common.services.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.common.security.utils.SecurityUtilsExt;
|
||||||
|
import com.ruoyi.common.services.domain.SysSeqRule;
|
||||||
|
import org.apache.ibatis.annotations.*;
|
||||||
|
import org.apache.ibatis.type.JdbcType;
|
||||||
|
import org.mybatis.dynamic.sql.BasicColumn;
|
||||||
|
import org.mybatis.dynamic.sql.delete.DeleteDSLCompleter;
|
||||||
|
import org.mybatis.dynamic.sql.select.CountDSLCompleter;
|
||||||
|
import org.mybatis.dynamic.sql.select.SelectDSLCompleter;
|
||||||
|
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||||
|
import org.mybatis.dynamic.sql.update.UpdateDSL;
|
||||||
|
import org.mybatis.dynamic.sql.update.UpdateDSLCompleter;
|
||||||
|
import org.mybatis.dynamic.sql.update.UpdateModel;
|
||||||
|
import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
|
||||||
|
import org.mybatis.dynamic.sql.util.mybatis3.*;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import static com.ruoyi.common.services.mapper.SysSeqRuleDynamicSqlSupport.*;
|
||||||
|
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface SysSeqRuleMapper extends CommonCountMapper, CommonDeleteMapper, CommonInsertMapper<SysSeqRule>, CommonUpdateMapper {
|
||||||
|
BasicColumn[] selectList = BasicColumn.columnList(ruleId, seqDistCd, ruleName, prefix, separator1, dateFormat, minDigits, separator2, generatorName, enableFlag, remark1, remark2, remark3, remark4, remark5, createBy, createTime, updateBy, updateTime, remark);
|
||||||
|
|
||||||
|
@SelectProvider(type=SqlProviderAdapter.class, method="select")
|
||||||
|
@Results(id="SysSeqRuleResult", value = {
|
||||||
|
@Result(column="rule_id", property="ruleId", jdbcType=JdbcType.BIGINT, id=true),
|
||||||
|
@Result(column="seq_dist_cd", property="seqDistCd", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="rule_name", property="ruleName", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="prefix", property="prefix", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="separator1", property="separator1", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="date_format", property="dateFormat", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="min_digits", property="minDigits", jdbcType=JdbcType.INTEGER),
|
||||||
|
@Result(column="separator2", property="separator2", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="generator_name", property="generatorName", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="enable_flag", property="enableFlag", jdbcType=JdbcType.INTEGER),
|
||||||
|
@Result(column="remark_1", property="remark1", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="remark_2", property="remark2", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="remark_3", property="remark3", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="remark_4", property="remark4", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="remark_5", property="remark5", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="create_by", property="createBy", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
|
||||||
|
@Result(column="update_by", property="updateBy", jdbcType=JdbcType.VARCHAR),
|
||||||
|
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
|
||||||
|
@Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR)
|
||||||
|
})
|
||||||
|
List<SysSeqRule> selectMany(SelectStatementProvider selectStatement);
|
||||||
|
|
||||||
|
@SelectProvider(type=SqlProviderAdapter.class, method="select")
|
||||||
|
@ResultMap("SysSeqRuleResult")
|
||||||
|
Optional<SysSeqRule> selectOne(SelectStatementProvider selectStatement);
|
||||||
|
|
||||||
|
default long count(CountDSLCompleter completer) {
|
||||||
|
return MyBatis3Utils.countFrom(this::count, sysSeqRule, completer);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int delete(DeleteDSLCompleter completer) {
|
||||||
|
return MyBatis3Utils.deleteFrom(this::delete, sysSeqRule, completer);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int deleteByPrimaryKey(Long ruleId_) {
|
||||||
|
return delete(c ->
|
||||||
|
c.where(ruleId, isEqualTo(ruleId_))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int insert(SysSeqRule row) {
|
||||||
|
row.setCommonForInsert(SecurityUtilsExt.getUserIdStr());
|
||||||
|
return MyBatis3Utils.insert(this::insert, row, sysSeqRule, c ->
|
||||||
|
c.map(ruleId).toProperty("ruleId")
|
||||||
|
.map(seqDistCd).toProperty("seqDistCd")
|
||||||
|
.map(ruleName).toProperty("ruleName")
|
||||||
|
.map(prefix).toProperty("prefix")
|
||||||
|
.map(separator1).toProperty("separator1")
|
||||||
|
.map(dateFormat).toProperty("dateFormat")
|
||||||
|
.map(minDigits).toProperty("minDigits")
|
||||||
|
.map(separator2).toProperty("separator2")
|
||||||
|
.map(generatorName).toProperty("generatorName")
|
||||||
|
.map(enableFlag).toProperty("enableFlag")
|
||||||
|
.map(remark1).toProperty("remark1")
|
||||||
|
.map(remark2).toProperty("remark2")
|
||||||
|
.map(remark3).toProperty("remark3")
|
||||||
|
.map(remark4).toProperty("remark4")
|
||||||
|
.map(remark5).toProperty("remark5")
|
||||||
|
.map(createBy).toProperty("createBy")
|
||||||
|
.map(createTime).toProperty("createTime")
|
||||||
|
.map(updateBy).toProperty("updateBy")
|
||||||
|
.map(updateTime).toProperty("updateTime")
|
||||||
|
.map(remark).toProperty("remark")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int insertMultiple(Collection<SysSeqRule> records) {
|
||||||
|
for (SysSeqRule row : records) {
|
||||||
|
row.setCommonForInsert(SecurityUtilsExt.getUserIdStr());
|
||||||
|
}
|
||||||
|
return MyBatis3Utils.insertMultiple(this::insertMultiple, records, sysSeqRule, c ->
|
||||||
|
c.map(ruleId).toProperty("ruleId")
|
||||||
|
.map(seqDistCd).toProperty("seqDistCd")
|
||||||
|
.map(ruleName).toProperty("ruleName")
|
||||||
|
.map(prefix).toProperty("prefix")
|
||||||
|
.map(separator1).toProperty("separator1")
|
||||||
|
.map(dateFormat).toProperty("dateFormat")
|
||||||
|
.map(minDigits).toProperty("minDigits")
|
||||||
|
.map(separator2).toProperty("separator2")
|
||||||
|
.map(generatorName).toProperty("generatorName")
|
||||||
|
.map(enableFlag).toProperty("enableFlag")
|
||||||
|
.map(remark1).toProperty("remark1")
|
||||||
|
.map(remark2).toProperty("remark2")
|
||||||
|
.map(remark3).toProperty("remark3")
|
||||||
|
.map(remark4).toProperty("remark4")
|
||||||
|
.map(remark5).toProperty("remark5")
|
||||||
|
.map(createBy).toProperty("createBy")
|
||||||
|
.map(createTime).toProperty("createTime")
|
||||||
|
.map(updateBy).toProperty("updateBy")
|
||||||
|
.map(updateTime).toProperty("updateTime")
|
||||||
|
.map(remark).toProperty("remark")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int insertSelective(SysSeqRule row) {
|
||||||
|
row.setCommonForInsert(SecurityUtilsExt.getUserIdStr());
|
||||||
|
return MyBatis3Utils.insert(this::insert, row, sysSeqRule, c ->
|
||||||
|
c.map(ruleId).toPropertyWhenPresent("ruleId", row::getRuleId)
|
||||||
|
.map(seqDistCd).toPropertyWhenPresent("seqDistCd", row::getSeqDistCd)
|
||||||
|
.map(ruleName).toPropertyWhenPresent("ruleName", row::getRuleName)
|
||||||
|
.map(prefix).toPropertyWhenPresent("prefix", row::getPrefix)
|
||||||
|
.map(separator1).toPropertyWhenPresent("separator1", row::getSeparator1)
|
||||||
|
.map(dateFormat).toPropertyWhenPresent("dateFormat", row::getDateFormat)
|
||||||
|
.map(minDigits).toPropertyWhenPresent("minDigits", row::getMinDigits)
|
||||||
|
.map(separator2).toPropertyWhenPresent("separator2", row::getSeparator2)
|
||||||
|
.map(generatorName).toPropertyWhenPresent("generatorName", row::getGeneratorName)
|
||||||
|
.map(enableFlag).toPropertyWhenPresent("enableFlag", row::getEnableFlag)
|
||||||
|
.map(remark1).toPropertyWhenPresent("remark1", row::getRemark1)
|
||||||
|
.map(remark2).toPropertyWhenPresent("remark2", row::getRemark2)
|
||||||
|
.map(remark3).toPropertyWhenPresent("remark3", row::getRemark3)
|
||||||
|
.map(remark4).toPropertyWhenPresent("remark4", row::getRemark4)
|
||||||
|
.map(remark5).toPropertyWhenPresent("remark5", row::getRemark5)
|
||||||
|
.map(createBy).toPropertyWhenPresent("createBy", row::getCreateBy)
|
||||||
|
.map(createTime).toPropertyWhenPresent("createTime", row::getCreateTime)
|
||||||
|
.map(updateBy).toPropertyWhenPresent("updateBy", row::getUpdateBy)
|
||||||
|
.map(updateTime).toPropertyWhenPresent("updateTime", row::getUpdateTime)
|
||||||
|
.map(remark).toPropertyWhenPresent("remark", row::getRemark)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default Optional<SysSeqRule> selectOne(SelectDSLCompleter completer) {
|
||||||
|
return MyBatis3Utils.selectOne(this::selectOne, selectList, sysSeqRule, completer);
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<SysSeqRule> select(SelectDSLCompleter completer) {
|
||||||
|
return MyBatis3Utils.selectList(this::selectMany, selectList, sysSeqRule, completer);
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<SysSeqRule> selectDistinct(SelectDSLCompleter completer) {
|
||||||
|
return MyBatis3Utils.selectDistinct(this::selectMany, selectList, sysSeqRule, completer);
|
||||||
|
}
|
||||||
|
|
||||||
|
default Optional<SysSeqRule> selectByPrimaryKey(Long ruleId_) {
|
||||||
|
return selectOne(c ->
|
||||||
|
c.where(ruleId, isEqualTo(ruleId_))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int update(UpdateDSLCompleter completer) {
|
||||||
|
return MyBatis3Utils.update(this::update, sysSeqRule, completer);
|
||||||
|
}
|
||||||
|
|
||||||
|
static UpdateDSL<UpdateModel> updateAllColumns(SysSeqRule row, UpdateDSL<UpdateModel> dsl) {
|
||||||
|
return dsl.set(ruleId).equalTo(row::getRuleId)
|
||||||
|
.set(seqDistCd).equalTo(row::getSeqDistCd)
|
||||||
|
.set(ruleName).equalTo(row::getRuleName)
|
||||||
|
.set(prefix).equalTo(row::getPrefix)
|
||||||
|
.set(separator1).equalTo(row::getSeparator1)
|
||||||
|
.set(dateFormat).equalTo(row::getDateFormat)
|
||||||
|
.set(minDigits).equalTo(row::getMinDigits)
|
||||||
|
.set(separator2).equalTo(row::getSeparator2)
|
||||||
|
.set(generatorName).equalTo(row::getGeneratorName)
|
||||||
|
.set(enableFlag).equalTo(row::getEnableFlag)
|
||||||
|
.set(remark1).equalTo(row::getRemark1)
|
||||||
|
.set(remark2).equalTo(row::getRemark2)
|
||||||
|
.set(remark3).equalTo(row::getRemark3)
|
||||||
|
.set(remark4).equalTo(row::getRemark4)
|
||||||
|
.set(remark5).equalTo(row::getRemark5)
|
||||||
|
.set(createBy).equalTo(row::getCreateBy)
|
||||||
|
.set(createTime).equalTo(row::getCreateTime)
|
||||||
|
.set(updateBy).equalTo(row::getUpdateBy)
|
||||||
|
.set(updateTime).equalTo(row::getUpdateTime)
|
||||||
|
.set(remark).equalTo(row::getRemark);
|
||||||
|
}
|
||||||
|
|
||||||
|
static UpdateDSL<UpdateModel> updateSelectiveColumns(SysSeqRule row, UpdateDSL<UpdateModel> dsl) {
|
||||||
|
row.setCommonForUpdate(SecurityUtilsExt.getUserIdStr());
|
||||||
|
return dsl.set(ruleId).equalToWhenPresent(row::getRuleId)
|
||||||
|
.set(seqDistCd).equalToWhenPresent(row::getSeqDistCd)
|
||||||
|
.set(ruleName).equalToWhenPresent(row::getRuleName)
|
||||||
|
.set(prefix).equalToWhenPresent(row::getPrefix)
|
||||||
|
.set(separator1).equalToWhenPresent(row::getSeparator1)
|
||||||
|
.set(dateFormat).equalToWhenPresent(row::getDateFormat)
|
||||||
|
.set(minDigits).equalToWhenPresent(row::getMinDigits)
|
||||||
|
.set(separator2).equalToWhenPresent(row::getSeparator2)
|
||||||
|
.set(generatorName).equalToWhenPresent(row::getGeneratorName)
|
||||||
|
.set(enableFlag).equalToWhenPresent(row::getEnableFlag)
|
||||||
|
.set(remark1).equalToWhenPresent(row::getRemark1)
|
||||||
|
.set(remark2).equalToWhenPresent(row::getRemark2)
|
||||||
|
.set(remark3).equalToWhenPresent(row::getRemark3)
|
||||||
|
.set(remark4).equalToWhenPresent(row::getRemark4)
|
||||||
|
.set(remark5).equalToWhenPresent(row::getRemark5)
|
||||||
|
.set(createBy).equalToWhenPresent(row::getCreateBy)
|
||||||
|
.set(createTime).equalToWhenPresent(row::getCreateTime)
|
||||||
|
.set(updateBy).equalToWhenPresent(row::getUpdateBy)
|
||||||
|
.set(updateTime).equalToWhenPresent(row::getUpdateTime)
|
||||||
|
.set(remark).equalToWhenPresent(row::getRemark);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int updateByPrimaryKey(SysSeqRule row) {
|
||||||
|
return update(c ->
|
||||||
|
c.set(seqDistCd).equalTo(row::getSeqDistCd)
|
||||||
|
.set(ruleName).equalTo(row::getRuleName)
|
||||||
|
.set(prefix).equalTo(row::getPrefix)
|
||||||
|
.set(separator1).equalTo(row::getSeparator1)
|
||||||
|
.set(dateFormat).equalTo(row::getDateFormat)
|
||||||
|
.set(minDigits).equalTo(row::getMinDigits)
|
||||||
|
.set(separator2).equalTo(row::getSeparator2)
|
||||||
|
.set(generatorName).equalTo(row::getGeneratorName)
|
||||||
|
.set(enableFlag).equalTo(row::getEnableFlag)
|
||||||
|
.set(remark1).equalTo(row::getRemark1)
|
||||||
|
.set(remark2).equalTo(row::getRemark2)
|
||||||
|
.set(remark3).equalTo(row::getRemark3)
|
||||||
|
.set(remark4).equalTo(row::getRemark4)
|
||||||
|
.set(remark5).equalTo(row::getRemark5)
|
||||||
|
.set(createBy).equalTo(row::getCreateBy)
|
||||||
|
.set(createTime).equalTo(row::getCreateTime)
|
||||||
|
.set(updateBy).equalTo(row::getUpdateBy)
|
||||||
|
.set(updateTime).equalTo(row::getUpdateTime)
|
||||||
|
.set(remark).equalTo(row::getRemark)
|
||||||
|
.where(ruleId, isEqualTo(row::getRuleId))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int updateByPrimaryKeySelective(SysSeqRule row) {
|
||||||
|
row.setCommonForUpdate(SecurityUtilsExt.getUserIdStr());
|
||||||
|
return update(c ->
|
||||||
|
c.set(seqDistCd).equalToWhenPresent(row::getSeqDistCd)
|
||||||
|
.set(ruleName).equalToWhenPresent(row::getRuleName)
|
||||||
|
.set(prefix).equalToWhenPresent(row::getPrefix)
|
||||||
|
.set(separator1).equalToWhenPresent(row::getSeparator1)
|
||||||
|
.set(dateFormat).equalToWhenPresent(row::getDateFormat)
|
||||||
|
.set(minDigits).equalToWhenPresent(row::getMinDigits)
|
||||||
|
.set(separator2).equalToWhenPresent(row::getSeparator2)
|
||||||
|
.set(generatorName).equalToWhenPresent(row::getGeneratorName)
|
||||||
|
.set(enableFlag).equalToWhenPresent(row::getEnableFlag)
|
||||||
|
.set(remark1).equalToWhenPresent(row::getRemark1)
|
||||||
|
.set(remark2).equalToWhenPresent(row::getRemark2)
|
||||||
|
.set(remark3).equalToWhenPresent(row::getRemark3)
|
||||||
|
.set(remark4).equalToWhenPresent(row::getRemark4)
|
||||||
|
.set(remark5).equalToWhenPresent(row::getRemark5)
|
||||||
|
.set(createBy).equalToWhenPresent(row::getCreateBy)
|
||||||
|
.set(createTime).equalToWhenPresent(row::getCreateTime)
|
||||||
|
.set(updateBy).equalToWhenPresent(row::getUpdateBy)
|
||||||
|
.set(updateTime).equalToWhenPresent(row::getUpdateTime)
|
||||||
|
.set(remark).equalToWhenPresent(row::getRemark)
|
||||||
|
.where(ruleId, isEqualTo(row::getRuleId))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.ruoyi.common.services.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.common.services.domain.vo.SeqVo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Alan Scipio
|
||||||
|
* created on 2024/2/18
|
||||||
|
*/
|
||||||
|
public interface SysSequenceExtMapper {
|
||||||
|
|
||||||
|
SeqVo selectMaxSeq(@Param("seqDistCd") String seqDistCd);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package com.ruoyi.common.services.sequence;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列号生成器配置
|
||||||
|
*
|
||||||
|
* @author Alan Scipio
|
||||||
|
* created on 2024/2/19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Component
|
||||||
|
public class SequenceConfig {
|
||||||
|
|
||||||
|
private final Map<String, ISequenceGenerator> generatorMap = new HashMap<>();
|
||||||
|
|
||||||
|
public SequenceConfig() {
|
||||||
|
registerGenerator(new DefaultSequenceGenerator());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void registerGenerator(ISequenceGenerator generator) {
|
||||||
|
if (generator == null) {
|
||||||
|
throw new IllegalArgumentException("generator can not be null");
|
||||||
|
}
|
||||||
|
generatorMap.put(generator.getClass().getName(), generator);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ISequenceGenerator getGenerator(String generatorName) {
|
||||||
|
return generatorMap.get(generatorName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ISequenceGenerator getOrCreateGenerator(String generatorName) {
|
||||||
|
if (StringUtils.isBlank(generatorName)) {
|
||||||
|
throw new IllegalArgumentException("generatorName can not be blank");
|
||||||
|
}
|
||||||
|
return generatorMap.computeIfAbsent(generatorName, name -> {
|
||||||
|
try {
|
||||||
|
ISequenceGenerator generator = (ISequenceGenerator) Class.forName(name).getDeclaredConstructor().newInstance();
|
||||||
|
registerGenerator(generator);
|
||||||
|
return generator;
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new IllegalArgumentException("generatorName: [" + name + "] can not be instantiated", e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public ISequenceGenerator getDefaultGenerator() {
|
||||||
|
return generatorMap.get(DefaultSequenceGenerator.class.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
com.ruoyi.common.services.config.ServicesConfig
|
@ -0,0 +1,49 @@
|
|||||||
|
<?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.ruoyi.common.services.mapper.SysSequenceExtMapper">
|
||||||
|
|
||||||
|
<resultMap id="seqResultMap" type="com.ruoyi.common.services.domain.vo.SeqVo">
|
||||||
|
<result property="ruleId" column="rule_id"/>
|
||||||
|
<result property="seqDistCd" column="seq_dist_cd"/>
|
||||||
|
<result property="ruleName" column="rule_name"/>
|
||||||
|
<result property="prefix" column="prefix"/>
|
||||||
|
<result property="separator1" column="separator1"/>
|
||||||
|
<result property="dateFormat" column="date_format"/>
|
||||||
|
<result property="minDigits" column="min_digits"/>
|
||||||
|
<result property="separator2" column="separator2"/>
|
||||||
|
<result property="generatorName" column="generator_name"/>
|
||||||
|
<result property="enableFlag" column="enable_flag"/>
|
||||||
|
<result property="seqId" column="seq_id"/>
|
||||||
|
<result property="dateVal" column="date_val"/>
|
||||||
|
<result property="seqNo" column="seq_no"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectMaxSeq" resultMap="seqResultMap">
|
||||||
|
select rule.rule_id,
|
||||||
|
rule.seq_dist_cd,
|
||||||
|
rule.rule_name,
|
||||||
|
rule.prefix,
|
||||||
|
rule.separator1,
|
||||||
|
rule.date_format,
|
||||||
|
rule.min_digits,
|
||||||
|
rule.separator2,
|
||||||
|
rule.generator_name,
|
||||||
|
rule.enable_flag,
|
||||||
|
result.seq_id,
|
||||||
|
result.date_val,
|
||||||
|
result.seq_no
|
||||||
|
from sys_seq_rule rule
|
||||||
|
left join (
|
||||||
|
select seq_id,
|
||||||
|
seq_dist_cd,
|
||||||
|
date_val,
|
||||||
|
seq_no
|
||||||
|
from sys_seq_result
|
||||||
|
where seq_dist_cd = #{seqDistCd}
|
||||||
|
order by date_val desc, seq_no desc
|
||||||
|
limit 1
|
||||||
|
) result on result.seq_dist_cd = rule.seq_dist_cd
|
||||||
|
where rule.seq_dist_cd = #{seqDistCd}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -1,125 +1,125 @@
|
|||||||
package com.ruoyi.system.mapper;
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import com.ruoyi.system.domain.SysMenu;
|
import com.ruoyi.system.domain.SysMenu;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单表 数据层
|
* 菜单表 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public interface SysMenuMapper
|
public interface SysMenuMapper {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查询系统菜单列表
|
* 查询系统菜单列表
|
||||||
*
|
*
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuList(SysMenu menu);
|
List<SysMenu> selectMenuList(SysMenu menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户所有权限
|
* 根据用户所有权限
|
||||||
*
|
*
|
||||||
* @return 权限列表
|
* @return 权限列表
|
||||||
*/
|
*/
|
||||||
public List<String> selectMenuPerms();
|
List<String> selectMenuPerms();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户查询系统菜单列表
|
* 根据用户查询系统菜单列表
|
||||||
*
|
*
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuListByUserId(SysMenu menu);
|
List<SysMenu> selectMenuListByUserId(SysMenu menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询权限
|
* 根据角色ID查询权限
|
||||||
*
|
*
|
||||||
* @param roleId 角色ID
|
* @param roleId 角色ID
|
||||||
* @return 权限列表
|
* @return 权限列表
|
||||||
*/
|
*/
|
||||||
public List<String> selectMenuPermsByRoleId(Long roleId);
|
List<String> selectMenuPermsByRoleId(Long roleId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询权限
|
* 根据用户ID查询权限
|
||||||
*
|
*
|
||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 权限列表
|
* @return 权限列表
|
||||||
*/
|
*/
|
||||||
public List<String> selectMenuPermsByUserId(Long userId);
|
List<String> selectMenuPermsByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询菜单
|
* 根据用户ID查询菜单
|
||||||
*
|
*
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuTreeAll();
|
List<SysMenu> selectMenuTreeAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询菜单
|
* 根据用户ID查询菜单
|
||||||
*
|
*
|
||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuTreeByUserId(Long userId);
|
List<SysMenu> selectMenuTreeByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询菜单树信息
|
* 根据角色ID查询菜单树信息
|
||||||
*
|
*
|
||||||
* @param roleId 角色ID
|
* @param roleId 角色ID
|
||||||
* @param menuCheckStrictly 菜单树选择项是否关联显示
|
* @param menuCheckStrictly 菜单树选择项是否关联显示
|
||||||
* @return 选中菜单列表
|
* @return 选中菜单列表
|
||||||
*/
|
*/
|
||||||
public List<Long> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly);
|
List<Long> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据菜单ID查询信息
|
* 根据菜单ID查询信息
|
||||||
*
|
*
|
||||||
* @param menuId 菜单ID
|
* @param menuId 菜单ID
|
||||||
* @return 菜单信息
|
* @return 菜单信息
|
||||||
*/
|
*/
|
||||||
public SysMenu selectMenuById(Long menuId);
|
SysMenu selectMenuById(Long menuId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否存在菜单子节点
|
* 是否存在菜单子节点
|
||||||
*
|
*
|
||||||
* @param menuId 菜单ID
|
* @param menuId 菜单ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int hasChildByMenuId(Long menuId);
|
int hasChildByMenuId(Long menuId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增菜单信息
|
* 新增菜单信息
|
||||||
*
|
*
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertMenu(SysMenu menu);
|
int insertMenu(SysMenu menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改菜单信息
|
* 修改菜单信息
|
||||||
*
|
*
|
||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateMenu(SysMenu menu);
|
int updateMenu(SysMenu menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除菜单管理信息
|
* 删除菜单管理信息
|
||||||
*
|
*
|
||||||
* @param menuId 菜单ID
|
* @param menuId 菜单ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteMenuById(Long menuId);
|
int deleteMenuById(Long menuId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验菜单名称是否唯一
|
* 校验菜单名称是否唯一
|
||||||
*
|
*
|
||||||
* @param menuName 菜单名称
|
* @param menuName 菜单名称
|
||||||
* @param parentId 父菜单ID
|
* @param parentId 父菜单ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId);
|
SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId);
|
||||||
}
|
}
|
||||||
|
@ -1,60 +1,60 @@
|
|||||||
package com.ruoyi.system.mapper;
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ruoyi.system.domain.SysNotice;
|
import com.ruoyi.system.domain.SysNotice;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通知公告表 数据层
|
* 通知公告表 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public interface SysNoticeMapper
|
public interface SysNoticeMapper {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查询公告信息
|
* 查询公告信息
|
||||||
*
|
*
|
||||||
* @param noticeId 公告ID
|
* @param noticeId 公告ID
|
||||||
* @return 公告信息
|
* @return 公告信息
|
||||||
*/
|
*/
|
||||||
public SysNotice selectNoticeById(Long noticeId);
|
SysNotice selectNoticeById(Long noticeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询公告列表
|
* 查询公告列表
|
||||||
*
|
*
|
||||||
* @param notice 公告信息
|
* @param notice 公告信息
|
||||||
* @return 公告集合
|
* @return 公告集合
|
||||||
*/
|
*/
|
||||||
public List<SysNotice> selectNoticeList(SysNotice notice);
|
List<SysNotice> selectNoticeList(SysNotice notice);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增公告
|
* 新增公告
|
||||||
*
|
*
|
||||||
* @param notice 公告信息
|
* @param notice 公告信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertNotice(SysNotice notice);
|
int insertNotice(SysNotice notice);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改公告
|
* 修改公告
|
||||||
*
|
*
|
||||||
* @param notice 公告信息
|
* @param notice 公告信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateNotice(SysNotice notice);
|
int updateNotice(SysNotice notice);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除公告
|
* 批量删除公告
|
||||||
*
|
*
|
||||||
* @param noticeId 公告ID
|
* @param noticeId 公告ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteNoticeById(Long noticeId);
|
int deleteNoticeById(Long noticeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除公告信息
|
* 批量删除公告信息
|
||||||
*
|
*
|
||||||
* @param noticeIds 需要删除的公告ID
|
* @param noticeIds 需要删除的公告ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteNoticeByIds(Long[] noticeIds);
|
int deleteNoticeByIds(Long[] noticeIds);
|
||||||
}
|
}
|
@ -1,48 +1,48 @@
|
|||||||
package com.ruoyi.system.mapper;
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ruoyi.system.api.domain.SysOperLog;
|
import com.ruoyi.system.api.domain.SysOperLog;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作日志 数据层
|
* 操作日志 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public interface SysOperLogMapper
|
public interface SysOperLogMapper {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 新增操作日志
|
* 新增操作日志
|
||||||
*
|
*
|
||||||
* @param operLog 操作日志对象
|
* @param operLog 操作日志对象
|
||||||
*/
|
*/
|
||||||
public int insertOperlog(SysOperLog operLog);
|
int insertOperlog(SysOperLog operLog);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询系统操作日志集合
|
* 查询系统操作日志集合
|
||||||
*
|
*
|
||||||
* @param operLog 操作日志对象
|
* @param operLog 操作日志对象
|
||||||
* @return 操作日志集合
|
* @return 操作日志集合
|
||||||
*/
|
*/
|
||||||
public List<SysOperLog> selectOperLogList(SysOperLog operLog);
|
List<SysOperLog> selectOperLogList(SysOperLog operLog);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除系统操作日志
|
* 批量删除系统操作日志
|
||||||
*
|
*
|
||||||
* @param operIds 需要删除的操作日志ID
|
* @param operIds 需要删除的操作日志ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteOperLogByIds(Long[] operIds);
|
int deleteOperLogByIds(Long[] operIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询操作日志详细
|
* 查询操作日志详细
|
||||||
*
|
*
|
||||||
* @param operId 操作ID
|
* @param operId 操作ID
|
||||||
* @return 操作日志对象
|
* @return 操作日志对象
|
||||||
*/
|
*/
|
||||||
public SysOperLog selectOperLogById(Long operId);
|
SysOperLog selectOperLogById(Long operId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空操作日志
|
* 清空操作日志
|
||||||
*/
|
*/
|
||||||
public void cleanOperLog();
|
void cleanOperLog();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue