public ArrayList<HashMap<String, String>> patientList(String did){ String sql="select patient.pid, patient.name as pname,record.ordertime,record.state, record.rid,record.visitdate,record.visittime "+ "from record,patient where "+ "record.did=? and record.pid=patient.pid "+ "order by ordertime desc"; ArrayList<HashMap<String, String>> list = DBUtil.getHashmap(sql, new Object[]{did}); return list; }
时间: 2024-01-29 09:02:37 浏览: 164
这段代码是用来查询数据库中符合某一条件的患者信息的方法。其中,参数did表示医生的ID。代码中使用了预编译的SQL语句,其中使用了多表连接查询,查询了patient和record两张表,使用了where子句限定了查询条件,即查询record表中医生ID为did的记录,并且这些记录的患者ID和patient表中的患者ID相同。最终调用了DBUtil.getHashmap()方法来执行查询,并返回查询结果。查询结果是一个ArrayList类型的列表,其中每个元素是一个HashMap类型的映射,映射键是列名,映射值是该列对应的值。这个方法查询了patient、record两张表中的pid、name、ordertime、state、rid、visitdate和visittime共7个字段。
阅读全文
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![ppt](https://img-home.csdnimg.cn/images/20241231044937.png)
![txt](https://img-home.csdnimg.cn/images/20241231045021.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)