多模塊下的mybatis plus配置

  1. application.yaml 配置
mybatis-plus:  
    # 配置要掃描的xml文件目錄,classpath* 代表所有模塊的resources目錄 classpath 不加星號代表當前模塊下的resources目錄
    mapper-locations: classpath*:/mapper/*.xml
    # 實體掃描,*通配符
    typeAliasesPackage: com.demo.*.entity
  1. 註解
@MapperScan("com.demo.**.mapper")
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章