| 
					
				 | 
			
			
				@ -2,6 +2,7 @@ package com.yihu.jw.care.service.label; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.dao.label.WlyyPatientLabelDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.service.common.DictService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.service.device.DeviceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.util.ConstantUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.care.label.WlyyPatientLabelDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.PageEnvelop; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -24,6 +25,8 @@ public class PatientLableService extends BaseJpaService<WlyyPatientLabelDO, Wlyy 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private WlyyPatientLabelDao patientLabelDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private DictService dictService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private DeviceService deviceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 按团队查找签约居民的标签统计 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -58,7 +61,7 @@ public class PatientLableService extends BaseJpaService<WlyyPatientLabelDO, Wlyy 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public PageEnvelop<List<Map<String,Object>>> findSignPatientLabelListByTeamCode(String teamCode, String labelCode, String name, int page, int size){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT DISTINCT p.id,p.name,p.photo,p.idcard,p.mobile,p.openid,p.sex " ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT DISTINCT p.id,p.name,p.photo,p.idcard,p.mobile,p.openid,p.sex,p.pad_imei padImei " ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String countSql = "SELECT count(DISTINCT p.id) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String filters = "from base_service_package_sign_record sr,base_service_package_record r,  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "                base_service_package_item i,base_patient p,wlyy_patient_label l " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -74,6 +77,7 @@ public class PatientLableService extends BaseJpaService<WlyyPatientLabelDO, Wlyy 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (Map<String,Object> map : list){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String idcard = map.get("idcard").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("age", IdCardUtil.getAgeForIdcard(idcard)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("deviceType",deviceService.getPatientDeviceCategoryCode(map.get("id").toString())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Long count = jdbcTemplate.queryForObject(countSql+filters,Long.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return PageEnvelop.getSuccessListWithPage("success",list,page,size,count); 
			 |