add new feature about select device by user

This commit is contained in:
wty 2023-08-02 14:46:49 +08:00
parent 508b6a33f1
commit 2fa02050ef
5 changed files with 42 additions and 2 deletions

View File

@ -123,11 +123,18 @@
</dependency>
<!-- okhttps -->
<dependency>
<groupId>cn.zhxu</groupId>
<groupId>com.ejlchina</groupId>
<artifactId>okhttps-fastjson</artifactId>
<version>4.0.1</version>
<version>3.5.3</version>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>

View File

@ -68,6 +68,30 @@ public class FzDeviceManageController {
}
@GetMapping("/selectByStatus")
public ResultRespons selectDeviceByStatus(@RequestParam("status") String status, HttpServletRequest request){
List<FzDeviceInfo> fzDeviceInfos = fzDeviceInfoService.selectByStatus(status);
if(fzDeviceInfos!=null){
return new ResultRespons(Constant.SUCCESS_CODE,"查询设备成功!",fzDeviceInfos);
}else
{
return new ResultRespons(Constant.SUCCESS_CODE,"设备不存在!");
}
}
@GetMapping("/selectByUser")
public ResultRespons selectDeviceByUser(@RequestParam("user") String user, HttpServletRequest request){
List<FzDeviceInfo> fzDeviceInfos= fzDeviceInfoService.selectByUser(user);
if(fzDeviceInfos!=null){
return new ResultRespons(Constant.SUCCESS_CODE,"查询设备成功!",fzDeviceInfos);
}else
{
return new ResultRespons(Constant.SUCCESS_CODE,"设备不存在!");
}
}
@GetMapping("/selectAll")
public ResultRespons selectDevice(){
List<FzDeviceInfo> fzDeviceInfos = fzDeviceInfoService.selectAll();

View File

@ -29,4 +29,7 @@ public interface FzDeviceInfoMapper {
@Select("select * from fz_device_info where fz_device_status =#{status}")
List<FzDeviceInfo> selectByStatus(@Param("status") String status);
@Select("select * from fz_device_info where fz_device_user =#{user}")
List<FzDeviceInfo> selectByUser(@Param("user") String user);
}

View File

@ -12,5 +12,6 @@ public interface FzDeviceInfoService {
int updateDevice(FzDeviceInfo fzDeviceInfo);
int deleteDevice(String deviceNo);
List<FzDeviceInfo> selectByStatus(String status);
List<FzDeviceInfo> selectByUser(String user);
}

View File

@ -45,4 +45,9 @@ public class FzDeviceInfoServiceImpl implements FzDeviceInfoService {
public List<FzDeviceInfo> selectByStatus(String status) {
return fzDeviceInfoMapper.selectByStatus(status);
}
@Override
public List<FzDeviceInfo> selectByUser(String user) {
return fzDeviceInfoMapper.selectByUser(user);
}
}