mybatis mapper接口中使用@select 注解 @select中使用模糊查询like

不使用concat会出现
Parameter index out of range (1 > number of parameters, which is 0)这个错误

正确示例:
    @Select("SELECT  * FROM shop WHERE shop.name_text LIKE CONCAT('%',#{0},'%')  ")
    public List<Shop> selectByName(String name_text);

猜你喜欢

转载自blog.csdn.net/weixin_38570967/article/details/80753489