查询飞行员
This commit is contained in:
parent
1dd543cf9c
commit
55e109002c
@ -26,6 +26,7 @@ import com.aircraft.modules.security.service.OnlineUserService;
|
|||||||
import com.aircraft.modules.security.service.UserDetailsServiceImpl;
|
import com.aircraft.modules.security.service.UserDetailsServiceImpl;
|
||||||
import com.aircraft.modules.security.service.dto.AuthUserDto;
|
import com.aircraft.modules.security.service.dto.AuthUserDto;
|
||||||
import com.aircraft.modules.security.service.dto.JwtUserDto;
|
import com.aircraft.modules.security.service.dto.JwtUserDto;
|
||||||
|
import com.aircraft.modules.system.domain.EmArea;
|
||||||
import com.aircraft.modules.system.domain.EmEmployees;
|
import com.aircraft.modules.system.domain.EmEmployees;
|
||||||
import com.aircraft.modules.system.domain.User;
|
import com.aircraft.modules.system.domain.User;
|
||||||
import com.aircraft.modules.system.domain.dto.EmEmployeesQueryCriteria;
|
import com.aircraft.modules.system.domain.dto.EmEmployeesQueryCriteria;
|
||||||
@ -40,6 +41,7 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@ -157,4 +159,14 @@ public class EmEmployeesController {
|
|||||||
return new ResponseEntity<>(records,HttpStatus.OK);
|
return new ResponseEntity<>(records,HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "条件查询全部飞行员")
|
||||||
|
@RequestMapping(value = "all", method = RequestMethod.GET)
|
||||||
|
public ResponseEntity<Object> all(EmEmployees example) {
|
||||||
|
List<EmEmployees> entitys = emEmployeesService.list(example);
|
||||||
|
if (null != entitys) {
|
||||||
|
return new ResponseEntity<>(entitys, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
return new ResponseEntity<>(Collections.emptyList(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.aircraft.modules.system.service;
|
package com.aircraft.modules.system.service;
|
||||||
|
|
||||||
|
import com.aircraft.modules.system.domain.EmArea;
|
||||||
import com.aircraft.modules.system.domain.EmEmployees;
|
import com.aircraft.modules.system.domain.EmEmployees;
|
||||||
import com.aircraft.modules.system.domain.dto.EmEmployeesQueryCriteria;
|
import com.aircraft.modules.system.domain.dto.EmEmployeesQueryCriteria;
|
||||||
|
|
||||||
@ -122,4 +123,11 @@ public interface EmEmployeesService extends IService<EmEmployees> {
|
|||||||
* @param encryptPassword 密码
|
* @param encryptPassword 密码
|
||||||
*/
|
*/
|
||||||
void updatePass(String username, String encryptPassword);
|
void updatePass(String username, String encryptPassword);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条件查询
|
||||||
|
* @param example
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EmEmployees> list(EmEmployees example);
|
||||||
}
|
}
|
@ -109,6 +109,11 @@ public class EmEmployeesServiceImpl extends ServiceImpl<EmEmployeesMapper, EmEmp
|
|||||||
userCacheManager.cleanEmployeesCache(username);
|
userCacheManager.cleanEmployeesCache(username);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmEmployees> list(EmEmployees example) {
|
||||||
|
return this.list(buildWrapper(example));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(EmEmployees resources) {
|
public void update(EmEmployees resources) {
|
||||||
@ -159,6 +164,22 @@ public class EmEmployeesServiceImpl extends ServiceImpl<EmEmployeesMapper, EmEmp
|
|||||||
return wrapper;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建查询
|
||||||
|
*
|
||||||
|
* @param example
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private QueryWrapper<EmEmployees> buildWrapper(EmEmployees example) {
|
||||||
|
String name = example.getName();
|
||||||
|
QueryWrapper<EmEmployees> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.lambda()
|
||||||
|
.like(StringUtils.isNotEmpty(name), EmEmployees::getName, name)
|
||||||
|
.eq(EmEmployees::getAreaId,example.getAreaId())
|
||||||
|
.eq(BaseEntity::getDelFlag,0);
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<EmEmployees> findByScenicId(Long areaId) {
|
public List<EmEmployees> findByScenicId(Long areaId) {
|
||||||
QueryWrapper<EmEmployees> wrapper = new QueryWrapper<>();
|
QueryWrapper<EmEmployees> wrapper = new QueryWrapper<>();
|
||||||
|
Loading…
Reference in New Issue
Block a user