소스 검색

解绑设备标识

Shi Kejing 4 년 전
부모
커밋
24382f66d6
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java

+ 2 - 2
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java

@ -777,13 +777,13 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
    }
    }
    public List<PatientDevice> findByDeviceSnAndCategory(String deviceSn, String categoryCode){
    public List<PatientDevice> findByDeviceSnAndCategory(String deviceSn, String categoryCode){
        String sqlFind = "select * from wlyy.wlyy_patient_device where device_sn="+deviceSn +" and category_code="+categoryCode;
        String sqlFind = "select * from wlyy.wlyy_patient_device where device_sn='"+deviceSn +"' and category_code="+categoryCode;
        List<PatientDevice> patientDevices = jdbcTempalte.query(sqlFind , new BeanPropertyRowMapper<>(PatientDevice.class));
        List<PatientDevice> patientDevices = jdbcTempalte.query(sqlFind , new BeanPropertyRowMapper<>(PatientDevice.class));
        return patientDevices;
        return patientDevices;
    }
    }
    public void deleteDevices(String deviceSn, String type) {
    public void deleteDevices(String deviceSn, String type) {
        String sqlFind = "select * from wlyy.wlyy_patient_device where device_sn="+deviceSn +" and category_code="+type;
        String sqlFind = "select * from wlyy.wlyy_patient_device where device_sn='"+deviceSn +"' and category_code="+type;
        List<PatientDevice> patientDevices = jdbcTempalte.query(sqlFind , new BeanPropertyRowMapper<>(PatientDevice.class));
        List<PatientDevice> patientDevices = jdbcTempalte.query(sqlFind , new BeanPropertyRowMapper<>(PatientDevice.class));
        if (patientDevices == null || patientDevices.size() == 0) {
        if (patientDevices == null || patientDevices.size() == 0) {
            throw new RuntimeException("设备未被绑定!");
            throw new RuntimeException("设备未被绑定!");