Commit 285eade3 authored by chenhao's avatar chenhao

添加查询所有消防人员的分页接口

parent 4c98ebdc
...@@ -4,6 +4,7 @@ import java.util.Collection; ...@@ -4,6 +4,7 @@ import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.annotation.Condition; import org.typroject.tyboot.core.rdbms.annotation.Condition;
...@@ -166,11 +167,14 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -166,11 +167,14 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
return this.baseMapper.selectMaps(wrapper); return this.baseMapper.selectMaps(wrapper);
} }
public List<Map<String, Object>> getAllFirefightersPerson() { public Object getAllFirefightersPerson(int size, int current, String jobCode) {
LambdaQueryWrapper<Firefighters> wrapper = new LambdaQueryWrapper<Firefighters>(); LambdaQueryWrapper<Firefighters> wrapper = new LambdaQueryWrapper<Firefighters>();
wrapper.eq(Firefighters::getIsDelete, false); wrapper.eq(Firefighters::getIsDelete, false);
wrapper.eq(Firefighters::getStateCode, "94");//在职 wrapper.eq(Firefighters::getStateCode, "94");//在职
wrapper.select(Firefighters::getName,Firefighters::getEmployeeNumber); if(StringUtils.isNotBlank(jobCode)) {
wrapper.eq(Firefighters::getJobTitleCode, jobCode);
}
wrapper.last("limit "+current+","+size);
return this.baseMapper.selectMaps(wrapper); return this.baseMapper.selectMaps(wrapper);
} }
......
...@@ -334,7 +334,7 @@ public class FirefightersController extends BaseController { ...@@ -334,7 +334,7 @@ public class FirefightersController extends BaseController {
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/all/fire/person", method = RequestMethod.GET) @RequestMapping(value = "/all/fire/person", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "所有的消防人员", notes = "所有的消防人员") @ApiOperation(httpMethod = "GET", value = "所有的消防人员", notes = "所有的消防人员")
public ResponseModel<Object> getAllFirefightersPerson() throws Exception { public ResponseModel<Object> getAllFirefightersPerson(@RequestParam int size ,@RequestParam int current,@RequestParam(required = false) String jobCode)throws Exception {
return ResponseHelper.buildResponse(iFirefightersService.getAllFirefightersPerson()); return ResponseHelper.buildResponse(iFirefightersService.getAllFirefightersPerson(size,current,jobCode));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment