spring:profiles: dev
datasource:url: jdbc:mysql://localhost:3306/test_1?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
username: root
password:123456type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
initialSize:5minIdle:5maxActive:20maxWait:60000timeBetweenEvictionRunsMillis:60000minEvictableIdleTimeMillis:300000validaionQuery: SELECT 1 FROM DUAL
testWhileIdle:truetestOnBorrow:falsetestOnReturn:falsepoolPreparedStatements:true
配置mapper类
// 使用 @Mapper 标注这个类@MapperpublicinterfaceMoneyMapper{@Insert("insert into money(id, money) values (#{userId}, #{money})")intcreateMoney(Money money);@Update("update money set money = #{money} where id = #{userId}")intupdateMoney(Money money);@Select("select is_pitch, ratio from money_account where id = #{id}")
MoneyAccount getMine(Integer id);@Delete("delete from money where id = #{id}")intdeleteMoney(Integer id);}