Merge branch 'master' of https://gitlink.org.cn/xuos/xiuos_IoT
This commit is contained in:
commit
3d1b8008a2
|
@ -10,6 +10,7 @@ import com.aiit.xiuos.model.UserInfo;
|
|||
import com.aiit.xiuos.service.FzDeviceInfoService;
|
||||
import com.aiit.xiuos.tdengine.TDengineJDBCUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
@ -52,7 +53,13 @@ public class FzDeviceManageController {
|
|||
|
||||
@GetMapping("/select")
|
||||
public ResultRespons selectDevice(@RequestParam("type") String type, HttpServletRequest request){
|
||||
List<FzDeviceInfo> fzDeviceInfos = fzDeviceInfoService.selectByType(type);
|
||||
List<FzDeviceInfo> fzDeviceInfos =null;
|
||||
if(StringUtils.isEmpty(type)){
|
||||
fzDeviceInfos=fzDeviceInfoService.selectAll();
|
||||
}else{
|
||||
fzDeviceInfos= fzDeviceInfoService.selectByType(type);
|
||||
}
|
||||
|
||||
return new ResultRespons(Constant.SUCCESS_CODE,"查询设备成功!",fzDeviceInfos);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,15 +21,15 @@ public interface FzDeviceInfoMapper {
|
|||
|
||||
int updateByPrimaryKey(FzDeviceInfo record);
|
||||
|
||||
@Select("select * from fz_device_info")
|
||||
@Select("select * from fz_device_info order by fz_device_user")
|
||||
List<FzDeviceInfo> selectAll();
|
||||
|
||||
@Select("select * from fz_device_info where fz_device_type =#{type}")
|
||||
@Select("select * from fz_device_info where fz_device_type =#{type} order by fz_device_user")
|
||||
List<FzDeviceInfo> selectByType(@Param("type") String type);
|
||||
|
||||
@Select("select * from fz_device_info where fz_device_status =#{status}")
|
||||
@Select("select * from fz_device_info where fz_device_status =#{status} order by fz_device_user")
|
||||
List<FzDeviceInfo> selectByStatus(@Param("status") String status);
|
||||
|
||||
@Select("select * from fz_device_info where fz_device_user =#{user}")
|
||||
@Select("select * from fz_device_info where fz_device_user =#{user} order by fz_device_user")
|
||||
List<FzDeviceInfo> selectByUser(@Param("user") String user);
|
||||
}
|
Loading…
Reference in New Issue