package com.bofeng.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.bofeng.entity.IdRule;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface IdRuleMapper extends BaseMapper<IdRule> {

    @Select("select current_value from id_value where id_code=#{id_code}")
    long selectIdCurrentValue(@Param("id_code") String idCode);


    @Select("select id_name,id_type,seq_type,id_express from id_rule where id_name=#{id_name}")
    IdRule selectExpress(@Param("id_name") String idName);

    @Select("SELECT ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000) as r")
    long getDbTime();
}
