|
@ -296,6 +296,7 @@ public class BirthdayWishesService {
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
List<Map<String, Object>> resultList = new ArrayList();
|
|
|
Long allCount = 0l;
|
|
|
String year = DateUtil.getNowYear()+"";
|
|
|
//判断是否筛选推送条件,若未筛选则从数据库直接查生日居民,再进行匹配是否推送,若选择已推送则从推送记录查,若未发送则从未推送表查
|
|
|
//社工签约患者
|
|
|
String sql = " SELECT Distinct p.id patient,p.idcard,p.mobile,p.name,p.sex,p.id,p.photo," +
|
|
@ -357,7 +358,7 @@ public class BirthdayWishesService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
whereSql += "and DATE_FORMAT(sr.create_time,'%m%d')< CASE LENGTH(p.idcard) WHEN 18 THEN SUBSTR(p.idcard, 11, 4) WHEN 15 THEN SUBSTR(p.idcard, 9, 4) END ";
|
|
|
whereSql += "and DATE_FORMAT(ph.create_time,'%Y%m%d')<= CONCAT('"+year+"',(CASE LENGTH(p.idcard) WHEN 18 THEN SUBSTR(p.idcard, 11, 4) WHEN 15 THEN SUBSTR(p.idcard, 9, 4) END)) ";
|
|
|
sql = sql + whereSql + " ) order by birthday limit "+(page-1)*pageSize + "," + pageSize;
|
|
|
sqlCount = sqlCount + whereSql+")";
|
|
|
|
|
@ -607,6 +608,7 @@ public class BirthdayWishesService {
|
|
|
public Map<String, Object> helperGetBirthdayPatientList(String doctorCode, String patientName, Integer signYear, String startDate, String endDate, Integer status, String currentUserRole, String currentUserRoleLevel,
|
|
|
Integer roleType, Integer page, Integer pageSize) throws Exception {
|
|
|
|
|
|
String year = DateUtil.getNowYear()+"";
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
List<Map<String, Object>> resultList = new ArrayList();
|
|
|
Long allCount = 0l;
|
|
@ -665,7 +667,7 @@ public class BirthdayWishesService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
whereSql += "and DATE_FORMAT(ph.create_time,'%m%d')< CASE LENGTH(p.idcard) WHEN 18 THEN SUBSTR(p.idcard, 11, 4) WHEN 15 THEN SUBSTR(p.idcard, 9, 4) END ";
|
|
|
whereSql += "and DATE_FORMAT(ph.create_time,'%Y%m%d')<= CONCAT('"+year+"',(CASE LENGTH(p.idcard) WHEN 18 THEN SUBSTR(p.idcard, 11, 4) WHEN 15 THEN SUBSTR(p.idcard, 9, 4) END)) ";
|
|
|
sql = sql + whereSql + " order by birthday limit "+(page-1)*pageSize + "," + pageSize;
|
|
|
sqlCount = sqlCount + whereSql ;
|
|
|
|