|
@ -5,6 +5,7 @@ import com.yihu.jw.article.dao.KnowledgeArticleDao;
|
|
|
import com.yihu.jw.article.dao.KnowledgeArticleDeptDao;
|
|
|
import com.yihu.jw.article.dao.KnowledgeArticleDictDao;
|
|
|
import com.yihu.jw.article.dao.KnowledgeArticleUserDao;
|
|
|
import com.yihu.jw.constants.ServiceApi;
|
|
|
import com.yihu.jw.doctor.dao.BaseDoctorDao;
|
|
|
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
|
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
@ -34,6 +35,8 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
import static com.yihu.jw.constants.ServiceApi.AppPushMessage.list;
|
|
|
|
|
|
/**
|
|
|
* 健康文章业务层代码
|
|
|
*
|
|
@ -483,16 +486,18 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
|
|
|
if (StringUtils.isNotBlank(doctorCode)) {
|
|
|
sql += " and b.doctor='" + doctorCode + "' ";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(doctorCode)) {
|
|
|
if (StringUtils.isNotBlank(patientCode)) {
|
|
|
sql += " and b.patient='" + patientCode + "' ";
|
|
|
}
|
|
|
|
|
|
String countSql = " slect count(1) from (" + sql + ") qqq";
|
|
|
sql += " order by create_time desc " + " LIMIT " + (page - 1) * pageSize + "," + pageSize + "";
|
|
|
List<BasePatientBusinessDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BasePatientBusinessDO.class));
|
|
|
String countSql = " select count(1) from (" + sql + ") qqq";
|
|
|
sql += " order by a.create_time desc " + " LIMIT " + (page - 1) * pageSize + "," + pageSize + "";
|
|
|
System.out.println("sql-->"+sql);
|
|
|
System.out.println("countSql-->"+countSql);
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
Integer count = jdbcTemplate.queryForObject(countSql, Integer.class);
|
|
|
HashMap<String, Object> resultMap = new HashMap<>();
|
|
|
resultMap.put("data", list);
|
|
|
resultMap.put("data", ServiceApi.AppPushMessage.list);
|
|
|
resultMap.put("count", count);
|
|
|
return resultMap;
|
|
|
}
|