|
@ -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;
|
|
|
|
|
|
/**
|
|
|
* 健康文章业务层代码
|
|
|
*
|
|
@ -474,6 +477,7 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
|
|
|
public HashMap<String, Object> findSendPatientList(String doctorCode, String patientCode, String sendType, int page, int pageSize) {
|
|
|
String sql = " SELECT DISTINCT \n" +
|
|
|
" b.doctor 'sendDoctorCode',b.doctor_name 'sendDoctorName'," +
|
|
|
" date_format(a.create_time,'%Y-%m-%d %H:%i:%S' ) 'articleCreateTime'," +
|
|
|
" c.fabulous 'userFabulous', c.is_read 'userIsRead',c.is_share 'userShare',c.collection 'userCollection'," +
|
|
|
" a.* \n" +
|
|
|
" FROM wlyy_knowledge_article_dict a " +
|
|
@ -483,13 +487,15 @@ 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);
|