|
@ -159,7 +159,7 @@ public class SignWebService extends BaseService {
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String, Object>> getSignWebByDoctor(String doctor, int status, int page, int pageSize) {
|
|
|
public List<Map<String, Object>> getSignWebByDoctor(String doctor, int status, String patientInfo, int page, int pageSize) {
|
|
|
|
|
|
Doctor d = doctorDao.findByCode(doctor);
|
|
|
String sql;
|
|
@ -171,6 +171,7 @@ public class SignWebService extends BaseService {
|
|
|
" ,b.code as patient" +
|
|
|
" ,b.idcard " +
|
|
|
" ,b.name " +
|
|
|
" ,b.mobile" +
|
|
|
" ,b.province_name as provinceName" +
|
|
|
" ,b.city_name as cityName" +
|
|
|
" ,b.town_name as townName" +
|
|
@ -188,7 +189,8 @@ public class SignWebService extends BaseService {
|
|
|
" ( select renew_flag,code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin from wlyy_sign_family where doctor_health = ? and doctor is null and status = ? and type = 2" +
|
|
|
(status == 3 ? " and expenses_status = '1'" : "") + " order by begin desc ) a " +
|
|
|
" ,wlyy_patient b " +
|
|
|
" where a.patient = b.code order by applyDate desc limit " + page * pageSize + "," + pageSize;
|
|
|
" where a.patient = b.code and (b.`name` like ? or b.code LIKE ? ) "+
|
|
|
" order by applyDate desc limit " + page * pageSize + "," + pageSize;
|
|
|
} else {
|
|
|
// 查询语句
|
|
|
sql = "select " +
|
|
@ -197,6 +199,7 @@ public class SignWebService extends BaseService {
|
|
|
" ,b.code as patient" +
|
|
|
" ,b.idcard " +
|
|
|
" ,b.name " +
|
|
|
" ,b.mobile" +
|
|
|
" ,b.province_name as provinceName" +
|
|
|
" ,b.city_name as cityName" +
|
|
|
" ,b.town_name as townName" +
|
|
@ -214,7 +217,8 @@ public class SignWebService extends BaseService {
|
|
|
" ( select renew_flag,code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin from wlyy_sign_family where doctor = ? and status = ? and type = 2" +
|
|
|
(status == 3 ? " and expenses_status = '1'" : "") + " order by begin desc ) a " +
|
|
|
" ,wlyy_patient b " +
|
|
|
" where a.patient = b.code order by applyDate desc limit " + page * pageSize + "," + pageSize;
|
|
|
" where a.patient = b.code and (b.`name` like ? or b.code LIKE ? ) "+
|
|
|
"order by applyDate desc limit " + page * pageSize + "," + pageSize;
|
|
|
}
|
|
|
|
|
|
// 查询已经签约语句
|
|
@ -224,6 +228,7 @@ public class SignWebService extends BaseService {
|
|
|
" ,b.code as patient" +
|
|
|
" ,b.idcard " +
|
|
|
" ,b.name " +
|
|
|
" ,b.mobile" +
|
|
|
" ,b.province_name as provinceName" +
|
|
|
" ,b.city_name as cityName" +
|
|
|
" ,b.town_name as townName" +
|
|
@ -241,13 +246,15 @@ public class SignWebService extends BaseService {
|
|
|
" ( select renew_flag,code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin from wlyy_sign_family where (doctor = ? or doctor_health = ?) and status = ? and type = 2" +
|
|
|
(status == 3 ? " and expenses_status = '1'" : "") + " order by begin desc ) a " +
|
|
|
" ,wlyy_patient b " +
|
|
|
" where a.patient = b.code order by applyDate desc limit " + page * pageSize + "," + pageSize;
|
|
|
" where a.patient = b.code and (b.`name` like ? or b.code LIKE ? ) "+
|
|
|
"order by applyDate desc limit " + page * pageSize + "," + pageSize;
|
|
|
// 未缴费查询语句
|
|
|
String sqlExpenses = "select " +
|
|
|
" a.code " +
|
|
|
" ,a.doctor " +
|
|
|
" ,b.code as patient" +
|
|
|
" ,b.name " +
|
|
|
" ,b.mobile" +
|
|
|
" ,b.idcard " +
|
|
|
" ,b.province_name as provinceName" +
|
|
|
" ,b.city_name as cityName" +
|
|
@ -265,7 +272,8 @@ public class SignWebService extends BaseService {
|
|
|
" from " +
|
|
|
" ( select patient_apply_date,renew_flag,code,patient,doctor,status,id,apply_date,reason,begin,expenses_status,LENGTH(trim(ifnull(expenses_status,''))) len from wlyy_sign_family where (doctor = ? or doctor_health = ?) and status > ? and type = 2 order by begin desc ) a " +
|
|
|
" ,wlyy_patient b " +
|
|
|
" where a.patient = b.code and (a.expenses_status = '0' or a.len < 1) order by applyDate desc limit " + page * pageSize + "," + pageSize;
|
|
|
" where a.patient = b.code and (a.expenses_status = '0' or a.len < 1) and (b.`name` like ? or b.code LIKE ? ) "+
|
|
|
"order by applyDate desc limit " + page * pageSize + "," + pageSize;
|
|
|
|
|
|
// 已解约查询语句
|
|
|
String surrSql = "select " +
|
|
@ -273,6 +281,7 @@ public class SignWebService extends BaseService {
|
|
|
" ,a.doctor " +
|
|
|
" ,b.code as patient" +
|
|
|
" ,b.name " +
|
|
|
" ,b.mobile" +
|
|
|
" ,b.idcard " +
|
|
|
" ,b.province_name as provinceName" +
|
|
|
" ,b.city_name as cityName" +
|
|
@ -290,7 +299,8 @@ public class SignWebService extends BaseService {
|
|
|
" from " +
|
|
|
" ( select patient_apply_date,renew_flag,code,patient,doctor,status,id,apply_date,apply_unsign_date,reason,begin from wlyy_sign_family where (doctor = ? or doctor_health = ?) and ( status = ? or status = ? ) and type = 2 order by begin desc ) a " +
|
|
|
" ,wlyy_patient b " +
|
|
|
" where a.patient = b.code order by applyDate desc limit " + page * pageSize + "," + pageSize;
|
|
|
" where a.patient = b.code and (b.`name` or b.code like ? ) " +
|
|
|
"order by applyDate desc limit " + page * pageSize + "," + pageSize;
|
|
|
|
|
|
// 分页信息
|
|
|
//PageRequest pageRequest = new PageRequest(page - 1, pageSize);
|
|
@ -299,19 +309,19 @@ public class SignWebService extends BaseService {
|
|
|
List<Map<String, Object>> patients = null;
|
|
|
switch (status) {
|
|
|
case 1:// 待签约
|
|
|
patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, 0});
|
|
|
patients = StringUtils.isBlank(patientInfo) ? jdbcTemplate.queryForList(sql, new Object[]{doctor, 0, "%%", "%%"}):jdbcTemplate.queryForList(sql, new Object[]{doctor, 0, "%"+patientInfo + "%", "%"+patientInfo + "%"});
|
|
|
break;
|
|
|
case 2:// 待解约
|
|
|
patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, 2});
|
|
|
patients = StringUtils.isBlank(patientInfo) ? jdbcTemplate.queryForList(sql, new Object[]{doctor, 2, "%%", "%%"}) : jdbcTemplate.queryForList(sql, new Object[]{doctor, 2, "%"+patientInfo + "%", "%"+patientInfo + "%"});
|
|
|
break;
|
|
|
case 3:// 已签约
|
|
|
patients = jdbcTemplate.queryForList(isSignSql, new Object[]{doctor, doctor, 1});
|
|
|
patients = StringUtils.isBlank(patientInfo) ? jdbcTemplate.queryForList(isSignSql, new Object[]{doctor, doctor, 1, "%%", "%%"}) : jdbcTemplate.queryForList(isSignSql, new Object[]{doctor, doctor, 1, "%"+patientInfo + "%", "%"+patientInfo + "%"});
|
|
|
break;
|
|
|
case 4:// 4已经解约
|
|
|
patients = jdbcTemplate.queryForList(surrSql, new Object[]{doctor, doctor, -3, -4});
|
|
|
patients = StringUtils.isBlank(patientInfo) ? jdbcTemplate.queryForList(surrSql, new Object[]{doctor, doctor, -3, -4, "%%", "%%"}) : jdbcTemplate.queryForList(surrSql, new Object[]{doctor, doctor, -3, -4, "%"+patientInfo + "%", "%"+patientInfo + "%"});
|
|
|
break;
|
|
|
case 5: // 未缴费
|
|
|
patients = jdbcTemplate.queryForList(sqlExpenses, new Object[]{doctor, doctor, 0});
|
|
|
patients = StringUtils.isBlank(patientInfo) ? jdbcTemplate.queryForList(sqlExpenses, new Object[]{doctor, doctor, 0, "%%", "%%"}) : jdbcTemplate.queryForList(sqlExpenses, new Object[]{doctor, doctor, 0, "%"+patientInfo + "%", "%"+patientInfo + "%"});
|
|
|
}
|
|
|
|
|
|
return patients;
|