|
@ -126,7 +126,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
|
|
|
|
|
|
//根据患者id查询关联家属
|
|
|
public List<Map<String,Object>> findFamilyByPatientId(String patientId) throws ParseException {
|
|
|
String sql = "select t.card_type as \"cardType\", t.patient as \"patient\",b.name as \"name\",b.sex as \"sex\"," +
|
|
|
String sql = "select t.id as \"id\",t.card_type as \"cardType\", t.patient as \"patient\",b.name as \"name\",b.sex as \"sex\"," +
|
|
|
"b.birthday as\"birthday\",b.idcard as \"idcard\",c.relation_name as \"relationName\" " +
|
|
|
" from wlyy_patient_family_member t left join base_patient b" +
|
|
|
" on t.family_member = b.id left join base_patient_member_dict c on t.family_relation=c.id where 1=1";
|
|
@ -182,16 +182,26 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
|
|
|
}
|
|
|
}
|
|
|
//获取单个亲属详细信息
|
|
|
public List<Map<String,Object>> findMemberById(String id){
|
|
|
public List<Map<String,Object>> findMemberById(String id) throws ParseException {
|
|
|
String sql="select t.id as \"id\",t.card_type as \"cardType\",t.patient as \"patient\"," +
|
|
|
"b.name as \"name\",b.idcard as \"idcard\",b.mobile as \"mobile\"," +
|
|
|
"c.relation_name \"relation_name\" from wlyy_patient_family_member t left join base_patient b" +
|
|
|
"c.relation_name \"relationName\",b.birthday as\"birthday\",b.sex as\"sex\"" +
|
|
|
" from wlyy_patient_family_member t left join base_patient b" +
|
|
|
" on t.family_member = b.id left join base_patient_member_dict c on t.family_relation=c.id " +
|
|
|
" where 1=1";
|
|
|
if (StringUtils.isNotBlank(id)){
|
|
|
sql+=" and t.id='"+id+"'";
|
|
|
}
|
|
|
List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
|
|
|
if (list.size()>0){
|
|
|
for (Map<String,Object> map:list){
|
|
|
if (map.get("birthday")!=null){
|
|
|
SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
int age = getAgeByBirth(sp.parse(map.get("birthday").toString()));
|
|
|
map.put("age",age);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
}
|