|
@ -1251,44 +1251,6 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询给患者发送的健康教育文章
|
|
|
*
|
|
|
* @param patient
|
|
|
* @param teamCode
|
|
|
* @param page
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
// public List<Map<String, Object>> findByPatientAndTeam(String patient, long teamCode, int page, int pageSize) {
|
|
|
// List<Object> params = new ArrayList<Object>();
|
|
|
// String sql = "select " +
|
|
|
// " a.article" +
|
|
|
// " ,b.title" +
|
|
|
// " ,b.url" +
|
|
|
// " ,a.czrq" +
|
|
|
// " ,b.summary content" +
|
|
|
// " ,d.code" +
|
|
|
// " ,d.name" +
|
|
|
// " ,d.photo" +
|
|
|
// " ,a.admin_team_code" +
|
|
|
// " ,a.is_read" +
|
|
|
// " ,a.attached_content" +
|
|
|
// " from" +
|
|
|
// " wlyy_health_edu_article_patient a" +
|
|
|
// " ,wlyy_health_edu_article b" +
|
|
|
// " ,wlyy_doctor d" +
|
|
|
// " where" +
|
|
|
// " a.article = b.code " +
|
|
|
// " and a.doctor = d.code " +
|
|
|
// " and ( a.send_type =1 or a.send_type is null or a.send_type = '') "+ //添加类型判断是集美的推送还是三师原来的推送
|
|
|
// " and a.patient = ?" +
|
|
|
// " and a.admin_team_code = ?" +
|
|
|
// " order by a.czrq desc limit " + page*pageSize + "," + pageSize;
|
|
|
//
|
|
|
// List<Map<String,Object>> result = jdbcTemplate.queryForList(sql,new Object[]{patient,teamCode});
|
|
|
// return result;
|
|
|
// }
|
|
|
|
|
|
public List<HealthEduArticleES> findByPatientAndTeam(String patient, long teamCode, int page, int pageSize) {
|
|
|
|
|
@ -1313,17 +1275,22 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
|
|
|
|
|
|
page = (page - 1) * pagesize;
|
|
|
|
|
|
|
|
|
//查询记录sql
|
|
|
String sql = "SELECT * FROM " + esType + " where patientCode= '" + patientCode + "' and adminTeamCode = '"+teamCode+"' and doctorCode='" + uid + "' and userType = 1";
|
|
|
|
|
|
//查询总数sql
|
|
|
String countSql = "SELECT COUNT(*) AS count FROM " + esType + " where patientCode= '" + patientCode + "' and adminTeamCode = '"+teamCode+"' and doctorCode='" + uid + "' and userType = 1";
|
|
|
|
|
|
if(!StringUtils.isEmpty(level1Type)){
|
|
|
sql= sql + " and firstLevelCategoryId = '"+level1Type+"' ";
|
|
|
countSql= countSql + " and firstLevelCategoryId = '"+level1Type+"' ";
|
|
|
}
|
|
|
sql += " order by createTime desc ";
|
|
|
if(pagesize !=0){
|
|
|
sql= sql+ " limit " + page + "," + pagesize;
|
|
|
}
|
|
|
|
|
|
|
|
|
Long total = elasticsearchUtil.excuteForLong(countSql,esIndex, esType);
|
|
|
List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql, HealthEduArticleES.class, esIndex, esType);
|
|
|
HealthEduArticlePatientModel heapm = null;
|
|
|
JSONObject article = null;
|
|
@ -1356,6 +1323,7 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
heapm.setLeaveWords(one.getLeaveWords());//医生留言
|
|
|
doctor = doctorDao.findByCode(one.getDoctorCode());
|
|
|
heapm.setPhoto(doctor.getPhoto());
|
|
|
heapm.setTotalData(total);
|
|
|
result.add(heapm);
|
|
|
// heapm.setTime();//时间 xx小时前 2017-10-11
|
|
|
}
|