| 
					
				 | 
			
			
				@ -153,7 +153,7 @@ public class HealthEduArticlePatientService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            page = 1 ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        int start = (page-1) * pagesize; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql ="select a.article,b.summary,a.attached_content, a.czrq,count(a.patient) as amount,GROUP_CONCAT(p.name) as  patients,a.batch_no from "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql ="select a.article,b.title,b.summary,a.attached_content, a.czrq,count(a.patient) as amount,GROUP_CONCAT(p.name) as  patients,a.batch_no from "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        " wlyy_health_edu_article_patient a, "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        " wlyy_health_edu_article b,"+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        " wlyy_patient p"+ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -175,7 +175,7 @@ public class HealthEduArticlePatientService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String,Object>> findByBatchNo(String doctor,String article, String  batchNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql ="select a.article,b.content,a.attached_content, a.czrq,a.batch_no,sum(a.is_read) as no_read from "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql ="select a.article,b.title,b.content,a.attached_content,b.url, a.czrq as send_time,b.czrq,a.batch_no,sum(a.is_read) as no_read from "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " wlyy_health_edu_article_patient a, "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " wlyy_health_edu_article b,"+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " wlyy_patient p"+ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -185,18 +185,18 @@ public class HealthEduArticlePatientService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " and a.doctor =? "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " and a.article =? "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                (StringUtils.isNotBlank(batchNo)?" and a.batch_no =? ":"and a.batch_no is null ")+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " group BY a.batch_no,a.article,b.content,b.summary,a.doctor"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " group BY a.batch_no,a.article,b.content,b.summary,a.doctor,b.title"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Object params[] =  (StringUtils.isNotBlank(batchNo)?new Object[]{doctor,article,batchNo}:new Object[]{doctor,article,}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql,params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for(Map<String,Object> dataMap :list){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String patientListSql ="select a.patient,p.name,a.is_read,sum(a.is_read) as amount"+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String patientListSql ="select a.patient,p.name,a.is_read "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            " from wlyy_health_edu_article_patient a,wlyy_health_edu_article b,wlyy_patient p"+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            " where "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            " a.article = b.code " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            " and a.doctor=? and  a.article =?"+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            (StringUtils.isNotBlank(batchNo)?" and a.batch_no =? ":" and a.batch_no is null ")+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            " and a.patient = p.code " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            " group BY a.batch_no,a.article,b.content,a.attached_content,a.patient"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            " group BY a.batch_no,a.article,b.content,a.attached_content,a.patient,b.title"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<Map<String,Object>> patientList = jdbcTemplate.queryForList(patientListSql,params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            dataMap.put("patients",patientList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            dataMap.put("read_amount",patientList.size()-Integer.parseInt(dataMap.get("no_read").toString())); 
			 |