From 7abc626fc3f5f197e31f0ac3fc89bfa1645956c0 Mon Sep 17 00:00:00 2001 From: e Date: Wed, 25 Mar 2020 12:12:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wave/controller/WaveToDownController.java | 22 +++++++++++++-- .../wave/controller/WaveToFjController.java | 27 ++++++++++++++++--- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/zzjee/wave/controller/WaveToDownController.java b/src/main/java/com/zzjee/wave/controller/WaveToDownController.java index f94a1107..4d890898 100644 --- a/src/main/java/com/zzjee/wave/controller/WaveToDownController.java +++ b/src/main/java/com/zzjee/wave/controller/WaveToDownController.java @@ -370,8 +370,26 @@ public class WaveToDownController extends BaseController { ResultDO D0 = new ResultDO(); D0.setOK(true); - List listWaveToDowns=waveToDownService.getList(WaveToDownEntity.class); - D0.setObj(listWaveToDowns); + String hql="from WaveToDownEntity where waveId = ? "; + + List listWaveToDowns =new ArrayList<>(); + if(StringUtil.isEmpty(searchstr)&&StringUtil.isEmpty(searchstr2)){ + hql="from WaveToDownEntity "; + listWaveToDowns = waveToDownService.findHql(hql); + } + if(StringUtil.isNotEmpty(searchstr)&&StringUtil.isEmpty(searchstr2)){ + hql="from WaveToDownEntity where waveId = ? "; + listWaveToDowns = waveToDownService.findHql(hql,searchstr); + } + if(StringUtil.isEmpty(searchstr)&&StringUtil.isNotEmpty(searchstr2)){ + hql="from WaveToDownEntity where binId = ? "; + listWaveToDowns = waveToDownService.findHql(hql,searchstr2); + } + if(StringUtil.isNotEmpty(searchstr)&&StringUtil.isNotEmpty(searchstr2)){ + hql="from WaveToDownEntity where waveId = ? and binId = ?"; + listWaveToDowns = waveToDownService.findHql(hql,searchstr,searchstr2); + } + D0.setObj(listWaveToDowns); return new ResponseEntity(D0, HttpStatus.OK); } diff --git a/src/main/java/com/zzjee/wave/controller/WaveToFjController.java b/src/main/java/com/zzjee/wave/controller/WaveToFjController.java index 29dea609..3ca2a9b4 100644 --- a/src/main/java/com/zzjee/wave/controller/WaveToFjController.java +++ b/src/main/java/com/zzjee/wave/controller/WaveToFjController.java @@ -1,5 +1,6 @@ package com.zzjee.wave.controller; import com.zzjee.api.ResultDO; +import com.zzjee.wave.entity.WaveToDownEntity; import com.zzjee.wave.entity.WaveToFjEntity; import com.zzjee.wave.service.WaveToFjServiceI; import java.util.ArrayList; @@ -103,7 +104,7 @@ public class WaveToFjController extends BaseController { * @param request * @param response * @param dataGrid - * @param user + */ @RequestMapping(params = "datagrid") @@ -177,7 +178,7 @@ public class WaveToFjController extends BaseController { /** * 添加wave_to_fj * - * @param ids + * @return */ @RequestMapping(params = "doAdd") @@ -201,7 +202,7 @@ public class WaveToFjController extends BaseController { /** * 更新wave_to_fj * - * @param ids + * @return */ @RequestMapping(params = "doUpdate") @@ -346,8 +347,26 @@ public class WaveToFjController extends BaseController { @RequestParam(value="searchstr2", required=false)String searchstr2) { ResultDO D0 = new ResultDO(); D0.setOK(true); + String hql="from WaveToDownEntity where waveId = ? "; - List listWaveToFjs=waveToFjService.getList(WaveToFjEntity.class); + List listWaveToFjs =new ArrayList<>(); + if(StringUtil.isEmpty(searchstr)&&StringUtil.isEmpty(searchstr2)){ + hql="from WaveToFjEntity "; + listWaveToFjs=waveToFjService.findHql(hql); + } + if(StringUtil.isNotEmpty(searchstr)&&StringUtil.isEmpty(searchstr2)){ + hql="from WaveToFjEntity where waveId = ? "; + listWaveToFjs=waveToFjService.findHql(hql,searchstr); + } + if(StringUtil.isEmpty(searchstr)&&StringUtil.isNotEmpty(searchstr2)){ + hql="from WaveToFjEntity where firstRq = ? "; + listWaveToFjs=waveToFjService.findHql(hql,searchstr2); + } + if(StringUtil.isNotEmpty(searchstr)&&StringUtil.isNotEmpty(searchstr2)){ + hql="from WaveToFjEntity where waveId = ? and firstRq = ?"; + listWaveToFjs=waveToFjService.findHql(hql,searchstr,searchstr2); + } +// List listWaveToFjs=waveToFjService.getList(WaveToFjEntity.class); D0.setObj(listWaveToFjs); return new ResponseEntity(D0, HttpStatus.OK);