other_user_id 参数在执行时不起作用我不知道为什么 [英] other_user_id parameter is not working at execution time i dont why

查看:48
本文介绍了other_user_id 参数在执行时不起作用我不知道为什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public interface ConnectionsRepository extends CrudRepository<Connections,String> {
    @Query(value = "SELECT * FROM connections WHERE other_user_id=?1 and acceptance=0 and name like %?2% "
            + " or designation like %?2% "
            + " or entity like %?2% "
            + " or location like %?2%"
            + " or contact1 like %?2%"
            + " or contact2 like %?2%"
            + " or icsnid like %?2%"
            + " or email like %?2%",nativeQuery = true)
    List<Connections> getManagingList(String userId,String keyword, int offset);

推荐答案

你只是缺少()

@Query(value = "SELECT * FROM connections WHERE other_user_id=?1 and acceptance=0 and (name like %?2% "
        + " or designation like %?2% "
        + " or entity like %?2% "
        + " or location like %?2%"
        + " or contact1 like %?2%"
        + " or contact2 like %?2%"
        + " or icsnid like %?2%"
        + " or email like %?2%)",nativeQuery = true)


两者之间存在差异


there is a diffrence between

a && b && c || d

a && b && (c || d)

这篇关于other_user_id 参数在执行时不起作用我不知道为什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆