|
@@ -7,6 +7,8 @@ import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* @Description: 用户注册登录等相关接口
|
|
|
* @Author: zsy
|
|
@@ -14,17 +16,23 @@ import org.springframework.data.jpa.repository.Query;
|
|
|
*/
|
|
|
public interface TaskRepository extends BaseRepository<TaskEntity, String> {
|
|
|
|
|
|
- @Query(value = "select * from t_task_info where task_type = ?1 " +
|
|
|
+ @Query(value = "select * from t_task_info where 1=1 " +
|
|
|
+ "and if(?1 is not null and ?1 !='',(task_type = ?1),1=1) " +
|
|
|
"and if(?2 is not null and ?2 !='',(details like CONCAT('%',?2,'%') or phone like CONCAT('%',?2,'%')),1=1) " +
|
|
|
"and if(?3 is not null and ?3 !='',(publish_user_id = ?3),1=1) " +
|
|
|
"and if(?4 is not null and ?4 !='',(accept_user_id = ?4),1=1) " +
|
|
|
"and if(?5 is not null and ?5 !='',(task_status = ?5),1=1) " +
|
|
|
"order by create_time desc ",
|
|
|
- countQuery = "select * from t_task_info where task_type = ?1 " +
|
|
|
+ countQuery = "select * from t_task_info where where 1=1 " +
|
|
|
+ "and if(?1 is not null and ?1 !='',(task_type = ?1),1=1) " +
|
|
|
"and if(?2 is not null and ?2 !='',(details like CONCAT('%',?2,'%') or phone like CONCAT('%',?2,'%')),1=1) " +
|
|
|
"and if(?3 is not null and ?3 !='',(publish_user_id = ?3),1=1) " +
|
|
|
"and if(?4 is not null and ?4 !='',(accept_user_id = ?4),1=1) " +
|
|
|
"and if(?5 is not null and ?5 !='',(task_status = ?5),1=1) ",
|
|
|
nativeQuery = true)
|
|
|
Page<TaskEntity> findTaskList(String taskType, String searchKey, String publishUserId, String acceptUserId, String taskStatus, PageRequest of);
|
|
|
+
|
|
|
+ List<TaskEntity> findByPublishUserId(String userId);
|
|
|
+
|
|
|
+ List<TaskEntity> findByAcceptUserId(String userId);
|
|
|
}
|