Map <String, Object> params = new HashMap <String, Object>();
params.put ("itemCode", itemCode);
params.put ("patient", patient);
其中patient是一个对象,在sql语句中可能要取出对象的属性来进行条件的选择判断,取出的方法就是#{对象key点上属性名}即#{patient.patientId}这样
where ip.id = indrug.pid and
ip.patientno = #{patient.localId}and
and ip.orgcode =
#{patient.orgcode}