|
@ -1777,10 +1777,11 @@ public class FamilyContractService extends BaseService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
public JSONArray findNoHealthSignFamilyHealthByParams(String doctorCode, String patientAddr, String patientName) throws Exception {
|
|
|
JSONArray returnMap = new JSONArray();
|
|
|
String sql = "select a.signcode,a.name,a.address,a.code,a.hasopenid,a.idcard from( SELECT " +
|
|
|
public JSONObject findNoHealthSignFamilyHealthByParams(String doctorCode,String teamCode, String params) throws Exception {
|
|
|
JSONObject returnMap = new JSONObject();
|
|
|
String addressSql = "select a.signcode,a.name,a.address,a.code,a.hasopenid,a.idcard from( SELECT " +
|
|
|
" sf.CODE signcode, " +
|
|
|
" p.photo photo, " +
|
|
|
" p.name name, " +
|
|
|
" p.address address, " +
|
|
|
" p.code code, " +
|
|
@ -1793,25 +1794,64 @@ public class FamilyContractService extends BaseService {
|
|
|
" sf.type = 2 " +
|
|
|
" AND sf. STATUS >= 0 " +
|
|
|
" and sf.doctor = ? " +
|
|
|
" and sf.admin_team_code = ? " +
|
|
|
" AND ( sf.doctor_health is null or sf.doctor_health ='' ) ) a where 1=1";
|
|
|
if (!org.springframework.util.StringUtils.isEmpty(patientAddr)) {
|
|
|
sql += " AND a.address like '%" + patientAddr + "%'";
|
|
|
if (!org.springframework.util.StringUtils.isEmpty(params)) {
|
|
|
addressSql += " AND a.address like '%" + params + "%'";
|
|
|
}
|
|
|
if (!org.springframework.util.StringUtils.isEmpty(patientName)) {
|
|
|
sql += " AND a.name like '%" + patientName + "%'";
|
|
|
List<Map<String, Object>> datas = jdbcTemplate.queryForList(addressSql, doctorCode,teamCode);
|
|
|
if (datas != null && datas.size() > 0) {
|
|
|
JSONArray jsonArray=new JSONArray();
|
|
|
for (Map<String, Object> map : datas) {
|
|
|
JSONObject jo = new JSONObject();
|
|
|
jo.put("signcode", map.get("signcode"));
|
|
|
jo.put("name", map.get("name"));
|
|
|
jo.put("photo", map.get("photo"));
|
|
|
jo.put("address", map.get("address"));
|
|
|
jo.put("code", map.get("code"));
|
|
|
jo.put("hasopenid", map.get("hasopenid"));
|
|
|
jo.put("age", IdCardUtil.getAgeForIdcard(map.get("idcard").toString()));
|
|
|
jo.put("sex", IdCardUtil.getSexForIdcard_new(map.get("idcard").toString()));
|
|
|
jsonArray.put(jo);
|
|
|
}
|
|
|
returnMap.put("address",jsonArray);
|
|
|
}
|
|
|
List<Map<String, Object>> datas = jdbcTemplate.queryForList(sql, doctorCode);
|
|
|
String patientNameSql = "select a.signcode,a.name,a.address,a.code,a.hasopenid,a.idcard from( SELECT " +
|
|
|
" sf.CODE signcode, " +
|
|
|
" p.name name, " +
|
|
|
" p.photo photo, " +
|
|
|
" p.address address, " +
|
|
|
" p.code code, " +
|
|
|
" CASE WHEN p.openid is null THEN '0' WHEN p.openid='' THEN '0' else 1 END hasopenid, " +
|
|
|
" p.idcard idcard " +
|
|
|
" FROM " +
|
|
|
" wlyy_sign_family sf " +
|
|
|
" JOIN wlyy_patient p ON sf.patient = p.CODE " +
|
|
|
" WHERE " +
|
|
|
" sf.type = 2 " +
|
|
|
" AND sf. STATUS >= 0 " +
|
|
|
" and sf.doctor = ? " +
|
|
|
" and sf.admin_team_code = ? " +
|
|
|
" AND ( sf.doctor_health is null or sf.doctor_health ='' ) ) a where 1=1";
|
|
|
|
|
|
if (!org.springframework.util.StringUtils.isEmpty(params)) {
|
|
|
patientNameSql += " AND a.name like '%" + params + "%'";
|
|
|
}
|
|
|
datas = jdbcTemplate.queryForList(patientNameSql, doctorCode,teamCode);
|
|
|
if (datas != null && datas.size() > 0) {
|
|
|
JSONArray jsonArray=new JSONArray();
|
|
|
for (Map<String, Object> map : datas) {
|
|
|
JSONObject jo = new JSONObject();
|
|
|
jo.put("signcode", map.get("signcode"));
|
|
|
jo.put("name", map.get("name"));
|
|
|
jo.put("photo", map.get("photo"));
|
|
|
jo.put("code", map.get("code"));
|
|
|
jo.put("hasopenid", map.get("hasopenid"));
|
|
|
jo.put("age", IdCardUtil.getAgeForIdcard(map.get("idcard").toString()));
|
|
|
jo.put("sex", IdCardUtil.getSexForIdcard_new(map.get("idcard").toString()));
|
|
|
returnMap.put(jo);
|
|
|
jsonArray.put(jo);
|
|
|
}
|
|
|
returnMap.put("name",jsonArray);
|
|
|
}
|
|
|
return returnMap;
|
|
|
}
|