参数在执行时不起作用我不知道为什么

参数在执行时不起作用我不知道为什么

本文介绍了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 参数在执行时不起作用我不知道为什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-08 07:04