|
|
|
@ -208,6 +208,15 @@ public class PatientDao { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 查询所有未领取健康卡的用户信息,民族、电话不能为空,一次读取15条信息 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public List<Patient> selectPatient4BatchUpdateHealthCard() { |
|
|
|
|
|
|
|
String sql = "select * from patientBase where HealthCardID is null and ifNull(idCardNo,'') <> '' " + |
|
|
|
|
|
|
|
"and ifNull(nation,'') <> '' and ifNull(tel, '') <> '' and callFlag=0 LIMIT 15"; |
|
|
|
|
|
|
|
return DataBase.select(sql, Patient.class); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 根据身份证查询患者 |
|
|
|
* 根据身份证查询患者 |
|
|
|
@ -244,7 +253,7 @@ public class PatientDao { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String sql = "update patientBase set deletedState=0, updateTime=now(), healthCardId=?, name=?, nation=?, tel=?, address=?, uuid=?, areaCode=?, areaAddress=?, patientId=?, empiId=?, gmcBindState=?, gmcCheckTime=?, " + |
|
|
|
String sql = "update patientBase set deletedState=0, bindDate=now(), healthCardId=?, name=?, nation=?, tel=?, address=?, uuid=?, areaCode=?, areaAddress=?, patientId=?, empiId=?, gmcBindState=?, gmcCheckTime=?, " + |
|
|
|
" uniqueId=if(uniqueId is null or uniqueId = '', ?, uniqueId), " + |
|
|
|
" uniqueId=if(uniqueId is null or uniqueId = '', ?, uniqueId), " + |
|
|
|
" gmcUniqueId=if(gmcUniqueId is null or gmcUniqueId = '', ?, gmcUniqueId) " + |
|
|
|
" gmcUniqueId=if(gmcUniqueId is null or gmcUniqueId = '', ?, gmcUniqueId) " + |
|
|
|
" where id=? and openid=? and idCardNo=?"; |
|
|
|
" where id=? and openid=? and idCardNo=?"; |
|
|
|
@ -294,8 +303,8 @@ public class PatientDao { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean insert(boolean isMyself, Patient bindData) { |
|
|
|
public boolean insert(boolean isMyself, Patient bindData) { |
|
|
|
bindData.setIsMyself(isMyself); |
|
|
|
bindData.setIsMyself(isMyself); |
|
|
|
String sql = "insert into patientBase(bindDate, openid, patientId, hisTransNo, name, sex, idCardNo, tel, birthday, nation, healthCardId, age, uuid, fatherName, fatherTel, fatherIDCardNo, motherName, motherTel, motherIDCardNo, address, areaCode, areaAddress, isMyself, cardType, unionId, uniqueId, empiId, gmcUniqueId, gmcBindState, gmcCheckTime) " + |
|
|
|
String sql = "insert into patientBase(createTime, bindDate, openid, patientId, hisTransNo, name, sex, idCardNo, tel, birthday, nation, healthCardId, age, uuid, fatherName, fatherTel, fatherIDCardNo, motherName, motherTel, motherIDCardNo, address, areaCode, areaAddress, isMyself, cardType, unionId, uniqueId, empiId, gmcUniqueId, gmcBindState, gmcCheckTime) " + |
|
|
|
" values(now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; |
|
|
|
" values(now(), now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; |
|
|
|
|
|
|
|
|
|
|
|
return DataBase.insert(sql, ps -> { |
|
|
|
return DataBase.insert(sql, ps -> { |
|
|
|
setInsertPs(ps, bindData); |
|
|
|
setInsertPs(ps, bindData); |
|
|
|
@ -310,8 +319,8 @@ public class PatientDao { |
|
|
|
* @return bool |
|
|
|
* @return bool |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int insertBatch(List<Patient> dataList) { |
|
|
|
public int insertBatch(List<Patient> dataList) { |
|
|
|
String sql = "insert into patientBase(bindDate, openid, patientId, hisTransNo, name, sex, idCardNo, tel, birthday, nation, healthCardId, age, uuid, fatherName, fatherTel, fatherIDCardNo, motherName, motherTel, motherIDCardNo, address, areaCode, areaAddress, isMyself, cardType, unionId, uniqueId, empiId, gmcUniqueId, gmcBindState, gmcCheckTime %s) " + |
|
|
|
String sql = "insert into patientBase(createTime, bindDate, openid, patientId, hisTransNo, name, sex, idCardNo, tel, birthday, nation, healthCardId, age, uuid, fatherName, fatherTel, fatherIDCardNo, motherName, motherTel, motherIDCardNo, address, areaCode, areaAddress, isMyself, cardType, unionId, uniqueId, empiId, gmcUniqueId, gmcBindState, gmcCheckTime %s) " + |
|
|
|
" values(now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? %s)"; |
|
|
|
" values(now(), now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? %s)"; |
|
|
|
|
|
|
|
|
|
|
|
List<Patient> hasIdList = new ArrayList<>(); |
|
|
|
List<Patient> hasIdList = new ArrayList<>(); |
|
|
|
List<Patient> noneIdList = new ArrayList<>(); |
|
|
|
List<Patient> noneIdList = new ArrayList<>(); |
|
|
|
@ -382,14 +391,6 @@ public class PatientDao { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 查询所有未领取健康卡的用户信息,民族、电话不能为空,一次读取15条信息 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public List<Patient> selectPatient4BatchUpdateHealthCard() { |
|
|
|
|
|
|
|
String sql = "select * from patientBase where HealthCardID is null and ifNull(idCardNo,'') <> '' " + |
|
|
|
|
|
|
|
"and ifNull(nation,'') <> '' and ifNull(tel, '') <> '' and callFlag=0 LIMIT 15"; |
|
|
|
|
|
|
|
return DataBase.select(sql, Patient.class); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
|