用mybatisplus吧,这种单表查询都可以通过IService或者Wrapper实现,很便捷
这种通过注解写sql的方式很久没用过了,不过这个写法放到xml里面应该没啥问题你遇到的问题好像还比较普遍
能运行 ,但就是报红什么问题
@Select("select * from tb_brand where id=#{id}") Brand seLectById2(@Param("id") int id);