| 
					
				 | 
			
			
				@ -81,17 +81,17 @@ public class DeviceDetailService extends BaseJpaService<DeviceDetail, DeviceDeta 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if (isFirst){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							String updateFirstSql ="update wlyy_devices dd set dd.is_grant=1,dd.grant_admin_team=?,dd.grant_org_code=?,dd.binding_count=?,dd.grant_time = ?,dd.org_name=?,dd.grant_doctor=?,dd.grant_doctor_name=?,dd.is_binding=1 where dd.device_code=?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							String updateFirstSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.grant_admin_team=?,dd.grant_org_code=?,dd.binding_count=?,dd.grant_time = ?,dd.org_name=?,dd.grant_doctor=?,dd.grant_doctor_name=?,dd.is_binding=1 where dd.device_code=?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							jdbcTemplate.update(updateFirstSql,new Object[]{String.valueOf(adminTeam),hospital,isFirstBind,grantTime,hospitalName,doctorCode, doctorName, devicePatientDevice.getDeviceSn()}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						}else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							List<DevicePatientDevice> devicePatientDeviceList = patientDeviceDao.findByDeviceSn(devicePatientDevice.getDeviceSn()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							int patientDeviceSize = devicePatientDeviceList.size(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							String updateSql = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							if (bind == 0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								updateSql ="update wlyy_devices dd set dd.is_grant=1,dd.grant_admin_team=?,dd.grant_org_code=?,dd.binding_count=?,dd.is_binding=?,dd.org_name=?,dd.grant_doctor=?,dd.grant_doctor_name=?  where dd.device_code=?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								updateSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.grant_admin_team=?,dd.grant_org_code=?,dd.binding_count=?,dd.is_binding=?,dd.org_name=?,dd.grant_doctor=?,dd.grant_doctor_name=?  where dd.device_code=?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								jdbcTemplate.update(updateSql,new Object[]{String.valueOf(adminTeam),hospital,isFirstBind,patientDeviceSize,hospitalName,doctorCode,doctorName, devicePatientDevice.getDeviceSn()}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							}else if (bind>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								updateSql ="update wlyy_devices dd set dd.is_grant=1,dd.binding_count=?,dd.is_binding=? where dd.device_code=?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								updateSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.binding_count=?,dd.is_binding=? where dd.device_code=?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								jdbcTemplate.update(updateSql,new Object[]{isFirstBind,patientDeviceSize, devicePatientDevice.getDeviceSn()}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 |