//如果该该患者和医生建立的关系,不进行操作
String[] split = docPatientChat.getPatienIds().split(",");
String ch = chat.getPatienIds();
boolean contains1 = Arrays.asList(split).contains(ch);
if(contains1){
System.out.println("已经存在");
}else{
System.out.println("不存在");
StringBuilder str=new StringBuilder();
str.append(docPatientChat.getPatienIds()).append(",").append(chat.getPatienIds());
chat.setPatienIds(str.toString());
chatMapper.updateByDocId(chat);
}
判断一个字符串是否在否个字符串中
最新推荐文章于 2022-08-18 16:37:14 发布