|
@ -72,11 +72,56 @@ public class ZyDictService {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String, Object>> findDictByDoctorAndName(String doctor,String name){
|
|
|
String sql = "SELECT yp.physic_code drugCode,yp.physic_name drugName,yp.physic_spec drugFormat,yp.subject_class subjectClass,yp.dose_unit physicDoseUnit, " +
|
|
|
" com1.`name`physicDoseUnitName,yp.quantity_unit drugNumUnit,com2.`name`drugNumUnitName FROM zy_common_dict com1,zy_common_dict com2,(SELECT p.physic_code, " +
|
|
|
" p.physic_name,p.physic_spec,p.subject_class,p.dose_unit,p.quantity_unit,class.class_name FROM zy_iv_subject_class_dict class,zy_iv_physic_dict p, " +
|
|
|
" (SELECT o.physic_code,o.org_code FROM wlyy_doctor_mapping h,zy_iv_org_physic_allot_dict o WHERE o.org_code=h.jw_doctor_hospital AND h.doctor_code=? " +
|
|
|
" )ho WHERE ho.physic_code=p.physic_code AND class.class_code=p.subject_class " ;
|
|
|
String sql = "SELECT " +
|
|
|
" yp.physic_code drugCode, " +
|
|
|
" yp.physic_name drugName, " +
|
|
|
" yp.physic_spec drugFormat, " +
|
|
|
" yp.subject_class subjectClass, " +
|
|
|
" yp.dose_unit physicDoseUnit, " +
|
|
|
" com1.`name` physicDoseUnitName, " +
|
|
|
" yp.quantity_unit drugNumUnit, " +
|
|
|
" com2.`name` drugNumUnitName " +
|
|
|
" FROM " +
|
|
|
" ( " +
|
|
|
" SELECT " +
|
|
|
" * " +
|
|
|
" FROM " +
|
|
|
" zy_common_dict " +
|
|
|
" WHERE " +
|
|
|
" dict_name = 'IV_MEASURE_UNIT_DICT' " +
|
|
|
" ) com1, " +
|
|
|
" ( " +
|
|
|
" SELECT " +
|
|
|
" * " +
|
|
|
" FROM " +
|
|
|
" zy_common_dict " +
|
|
|
" WHERE " +
|
|
|
" dict_name = 'IV_MEASURE_UNIT_DICT' " +
|
|
|
" ) com2, " +
|
|
|
" zy_iv_subject_class_dict class, " +
|
|
|
" ( " +
|
|
|
" SELECT " +
|
|
|
" p.physic_code, " +
|
|
|
" p.physic_name, " +
|
|
|
" p.physic_spec, " +
|
|
|
" p.subject_class, " +
|
|
|
" p.dose_unit, " +
|
|
|
" p.quantity_unit " +
|
|
|
" FROM " +
|
|
|
" zy_iv_physic_dict p, " +
|
|
|
" ( " +
|
|
|
" SELECT " +
|
|
|
" o.physic_code, " +
|
|
|
" o.org_code " +
|
|
|
" FROM " +
|
|
|
" wlyy_doctor_mapping h, " +
|
|
|
" zy_iv_org_physic_allot_dict o " +
|
|
|
" WHERE " +
|
|
|
" o.org_code = h.jw_doctor_hospital " +
|
|
|
" AND h.doctor_code = ? " +
|
|
|
" ) ho " +
|
|
|
" WHERE " +
|
|
|
" ho.physic_code = p.physic_code " ;
|
|
|
if(StringUtils.isNotBlank(name)){
|
|
|
if(isEnglish(name)){
|
|
|
sql += " and p.spell_code like '%"+name.toUpperCase()+"%'";
|
|
@ -84,7 +129,11 @@ public class ZyDictService {
|
|
|
sql += " and p.physic_name like '%"+name+"%'";
|
|
|
}
|
|
|
}
|
|
|
sql +=" )yp WHERE com1.dict_name='IV_MEASURE_UNIT_DICT'AND com1.`code`=yp.dose_unit AND com2.dict_name='IV_MEASURE_UNIT_DICT'AND com2.`code`=yp.quantity_unit;";
|
|
|
sql +=" ) yp " +
|
|
|
"WHERE " +
|
|
|
" com1.`code` = yp.dose_unit " +
|
|
|
" AND com2.`code` = yp.quantity_unit " +
|
|
|
" AND class.class_code = yp.subject_class";
|
|
|
// subjectClass
|
|
|
// drugNumUnit":"224","drugNumUnitName":"支",
|
|
|
// physicDoseUnit":"224","physicDoseUnitName":"支",
|