I am using spring boot version 2.4.0.
I need to get the data from table where name is not null but it should conditional based on mandflag, if mandflag=true then only name is not null should be executed. Kindly suggest how to add this flag based condition in below query.
@Query("SELECT p FROM testtable p WHERE name is not null ")
public List<PatientEntity> findRecords(@Param("mandflag") boolean mandflag);
Edit Requirement- Fetch data from table where name is not null if input flag is true
I need data from table where condition should be executed based on boolean flag