package com.hzdaba.config.myBatis;
import org.springframework.context.annotation.Bean;
import tk.mybatis.spring.mapper.MapperScannerConfigurer;
import java.util.Properties;
public class MyBatisConfig {
@Bean
public MapperScannerConfigurer mapperScannerConfigurer() {
MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
mapperScannerConfigurer.setBasePackage("classpath:mapper");
Properties propertiesMapper = new Properties();
propertiesMapper.setProperty("mappers", "tk.mybatis.mapper.common.Mapper");
propertiesMapper.setProperty("IDENTITY", "SELECT REPLACE(UUID(),''-'','''')");
propertiesMapper.setProperty("ORDER", "BEFORE");
mapperScannerConfigurer.setProperties(propertiesMapper);
return mapperScannerConfigurer;
}
}