Selaa lähdekoodia

判断idcard是否为空

wangjun 4 vuotta sitten
vanhempi
commit
8ede323ed5

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

@ -67,6 +67,8 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
    private UserAgent userAgent;
    @Autowired
    private IotCompanyDao iotCompanyDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    /**
     * 新增
@ -269,10 +271,10 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
            sqlEqt = sqlEqt +" and t.device_code = '"+snCode+"'";
        }
        System.out.println("查询患者name和code开始");
        List<Map<String,Object>> nameList = jdbcTempalte.queryForList(sql);
        List<Map<String,Object>> nameList = hibenateUtils.createSQLQuery(sql);
        System.out.println("查询患者name和code结束:"+nameList);
        System.out.println("查询设备名称开始");
        List<Map<String,Object>> deviceList = jdbcTempalte.queryForList(sqlEqt);
        List<Map<String,Object>> deviceList = hibenateUtils.createSQLQuery(sqlEqt);
        System.out.println("查询设备名称结束:"+deviceList);
        if(nameList.size()>0){
            String code = null==nameList.get(0).get("code")?"":nameList.get(0).get("code").toString();
@ -292,19 +294,21 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
                String sqlEqt="select t.device_name as\"device_name\" from device.wlyy_devices t where 1=1";
                String idCard = locationDataVO.getIdCard();
                String snCoed = locationDataVO.getDeviceSn();
                List<Map<String,Object>> nameList = new ArrayList<>();
                List<Map<String,Object>> deviceList = new ArrayList<>();
                System.out.println("idCard:="+idCard);
                System.out.println("snCode:="+snCoed);
                if (StringUtils.isNotEmpty(idCard)){
                    sql = sql +" and t.idcard = '"+idCard+"'";
                    System.out.println("查询患者name和code开始");
                    nameList = jdbcTempalte.queryForList(sql);
                    System.out.println("查询患者name和code结束:"+nameList);
                }if (StringUtils.isNotEmpty(snCoed)){
                    sqlEqt = sqlEqt +" and t.device_code = '"+snCoed+"'";
                    System.out.println("查询设备名称开始");
                    deviceList = jdbcTempalte.queryForList(sqlEqt);
                    System.out.println("查询设备名称结束:"+deviceList);
                }
                System.out.println("idCard:="+idCard);
                System.out.println("snCode:="+snCoed);
                System.out.println("查询患者name和code开始");
                List<Map<String,Object>> nameList = jdbcTempalte.queryForList(sql);
                System.out.println("查询患者name和code结束:"+nameList);
                System.out.println("查询设备名称开始");
                List<Map<String,Object>> deviceList = jdbcTempalte.queryForList(sqlEqt);
                System.out.println("查询设备名称结束:"+deviceList);
                if(nameList.size()>0){
                    String code = null==nameList.get(0).get("code")?"":nameList.get(0).get("code").toString();
                    String name = null==nameList.get(0).get("name")?"":nameList.get(0).get("name").toString();