package com.foreverwin.mesnac.common.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.common.model.NextNumber;
import com.foreverwin.mesnac.common.model.NextNumberCode;

import java.math.BigDecimal;

/**
 * <p>
 * 编号生成 服务类
 * </p>
 *
 * @author Roc Li
 * @since 2020-09-03
 */
public interface NextNumberCodeService extends IService<NextNumberCode> {

    NextNumberCode selectForUpdateById(String id);

    NextNumberCode selectOne(String code, String nextNumberBo);

    Long getMaxCurrentSeq(String nextNumberBo);

    boolean updateCurrentSeqByNextNumber(BigDecimal currentSeq, String nextNumberBo);

    Integer getCodeSequence(String site, int qty, String code, NextNumber nextNumber);

    Integer getCodeSequenceByIsolatedTransaction(String site, int qty, String code, NextNumber nextNumber);
}
