package thyyxxk.webserver.dao.his.lc.company;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import thyyxxk.webserver.entity.lc.company.LcCompany;

@Mapper
public interface LcCompanyDao extends BaseMapper<LcCompany> {

    @Select(" SELECT RIGHT('000' + CAST(MAX(CAST(serial_no AS INT)) + 1 AS VARCHAR(3)), 3) AS next_serial_no FROM lc_company where company_type = #{companyType}")
    String getSerialNo(@Param("companyType") String companyType);
}
