|  | @ -83,7 +83,7 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public PageEnvelop<List<Map<String,Object>>> archiveList(String doctorId, int page, int size,Integer signStatus,String name){
 | 
	
		
			
				|  |  |         String sql = "SELECT a.create_time,p.idcard,p.mobile,p.name,p.sex,p.id,p.photo,CAST(a.sign_status AS char) sign_status ";
 | 
	
		
			
				|  |  |         String sql = " select * from ( SELECT a.create_time,p.idcard,p.mobile,p.name,p.sex,p.id,p.photo,CAST(a.sign_status AS char) sign_status ";
 | 
	
		
			
				|  |  |         String countSql = "SELECT count(*) from ( ";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String filters = "from wlyy_archive a,base_patient p " +
 | 
	
	
		
			
				|  | @ -97,7 +97,7 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(name)){
 | 
	
		
			
				|  |  |             filters += " and p.name like '%"+name+"%'";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (signStatus!=null&&signStatus==1){//已签约不按建档查询,是要该居民服务医生就在列表中
 | 
	
		
			
				|  |  |         if (signStatus!=null&&signStatus==1){//已签约不按建档查询,只要该居民服务医生就在列表中
 | 
	
		
			
				|  |  |             filters+=" UNION " +
 | 
	
		
			
				|  |  |                     " SELECT a.create_time,p.idcard,p.mobile,p.name,p.sex,p.id,p.photo,CAST(a.sign_status AS char) sign_status \n" +
 | 
	
		
			
				|  |  |                     "from wlyy_archive a,base_patient p WHERE  a.patient = p.id and a.sign_status = 1 and EXISTS( " +
 | 
	
	
		
			
				|  | @ -113,8 +113,9 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             filters+= " and m.del = '1' and sr.`status`=1 ) ";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         filters+= " )tmp GROUP BY tmp.id ";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String orderBy = " ORDER BY create_time DESC " +
 | 
	
		
			
				|  |  |         String orderBy = "  ORDER BY tmp.create_time DESC " +
 | 
	
		
			
				|  |  |                 "LIMIT "+ (page - 1) * size + "," + size;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         List<Map<String,Object>> list = jdbcTemplate.queryForList(sql+filters+orderBy);
 |