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