查询预算通过的项目
parent
40f9706e29
commit
9073362fcc
|
@ -204,10 +204,13 @@ public class ProcessController {
|
||||||
return processService.getProjectRepaidAmount(id);
|
return processService.getProjectRepaidAmount(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索符合条件的项目,供给选择
|
||||||
|
*/
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@GetMapping("/projects")
|
@GetMapping("/projects")
|
||||||
public List<Map<String, Object>> query(@RequestParam String q) {
|
public List<Map<String, Object>> query(@RequestParam String q) {
|
||||||
return projectRepository.findByProjectNoOrName(q)
|
return projectRepository.findBudgetPassedProjects(q)
|
||||||
.stream()
|
.stream()
|
||||||
.map(project -> {
|
.map(project -> {
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
|
|
@ -40,8 +40,12 @@ public interface ProjectRepository extends JpaRepository<Project,Integer> {
|
||||||
@Query(value = "update project set approve_id=?, approve_name=? where approve_id = ?", nativeQuery = true)
|
@Query(value = "update project set approve_id=?, approve_name=? where approve_id = ?", nativeQuery = true)
|
||||||
int batchUpdateApprove(int targetAdminId, String targetAdminName, int adminId);
|
int batchUpdateApprove(int targetAdminId, String targetAdminName, int adminId);
|
||||||
|
|
||||||
@Query(value = "select * from project where `project_no` like concat('%', :q, '%') or `name` like concat('%', :q, '%')",
|
/**
|
||||||
|
* 查询预算通过的项目
|
||||||
|
*/
|
||||||
|
@Query(value = "select * from project where (`status` > 5 or (`status` = 5 and approve_status_budget = 2)) " +
|
||||||
|
" and (`project_no` like concat('%', :q, '%') or `name` like concat('%', :q, '%'))",
|
||||||
nativeQuery = true)
|
nativeQuery = true)
|
||||||
List<Project> findByProjectNoOrName(@Param("q") String query);
|
List<Project> findBudgetPassedProjects(@Param("q") String query);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue