mybatis 的 sql允许写在 java 文件里头,也可以写在xml里头,如果同时写,会执行哪个?
@Select({"",
"select 1 from t_table where id=#{id}",
""})
int getEo(@Param("id") Integer id);
select 2 from t_table where id=#{id}
会报错,启动失败。
mybatis 的 sql允许写在 java 文件里头,也可以写在xml里头,如果同时写,会执行哪个?
@Select({"",
"select 1 from t_table where id=#{id}",
""})
int getEo(@Param("id") Integer id);
select 2 from t_table where id=#{id}
会报错,启动失败。
微信扫码登录