CloudModelApplication.java 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. package com.hssx.cloudmodel;
  2. import com.github.pagehelper.PageHelper;
  3. import org.mybatis.spring.annotation.MapperScan;
  4. import org.springframework.boot.SpringApplication;
  5. import org.springframework.boot.autoconfigure.SpringBootApplication;
  6. import org.springframework.context.annotation.Bean;
  7. import java.util.Properties;
  8. @SpringBootApplication
  9. @MapperScan("com.hssx.cloudmodel.mapper")
  10. public class CloudModelApplication {
  11. public static void main(String[] args) {
  12. SpringApplication.run(CloudModelApplication.class, args);
  13. }
  14. @Bean
  15. public PageHelper pageHelper(){
  16. PageHelper pageHelper = new PageHelper();
  17. Properties properties = new Properties();
  18. properties.setProperty("offsetAsPageNum","true");
  19. properties.setProperty("rowBoundsWithCount","true");
  20. properties.setProperty("reasonable","true");
  21. properties.setProperty("dialect","mysql"); //配置mysql数据库的方言
  22. pageHelper.setProperties(properties);
  23. return pageHelper;
  24. }
  25. }