springboot Mybatis二级缓存
application.yml配值mybatis
mybatis:
# 设置别名映射包名
type-aliases-package: bean
# 指定mapper的xml文件位置
mapper-locations: classpath*:mybatis/mapper-*.xml
configuration:
# 开启mybatis的日志打印
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# 开启懒加载
lazy-loading-enabled: true
# 默认路径
lazy-load-trigger-methods:
# 开启二级缓存
cache-enabled: true
mybatis书写
<cache/>
<select useCache="true" id="findEmployeeByNameEn" resultType="com.jiuqi.ais.tocc_ais.bean.Employee">
select * from employee where replace((upper(nameen)),' ','') like replace(upper ('%'||#{nameEn}||'%'),' ','')
</select>
```