| 
					
				 | 
			
			
				@ -215,6 +215,7 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						MixEnvelop mixEnvelop = new MixEnvelop(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						sql.append("SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								" t.id, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								" b.used as \"used\","+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								" t.title, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								" t.template_comment AS templateComment, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								" t.organization, " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -265,13 +266,22 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								return mixEnvelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								//0为查询模板 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							} else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								sql.append("where t.del = 1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								sql.append("JOIN wlyy_survey_label_info i ON t.id = i.survey_temp_code where 1=1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								sql.append(" and t.del = 1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								if (StringUtils.isNotEmpty(doctor)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									sql.append(" and t.title like '%" + title + "%'"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								String sqlCount = "select Count(1) as \"total\" from ("+sql+") l"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql.toString(), page, pageSize); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								List<Map<String, Object>> listCount = hibenateUtils.createSQLQuery(sqlCount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								Long count = 0L; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								if (listCount.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									count = hibenateUtils.objTransformLong(listCount.get(0).get("total")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								if (list.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									for (Map<String, Object> map : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
										List<WlyySurveyLabelInfoVO>  wlyySurveyLabelInfoVOS= surveyService.findSurveyTemplateLabel(null==map.get("id")?"":map.get("id").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
										map.put("labels",wlyySurveyLabelInfoVOS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
										String createTime = null == map.get("create_time") ? "" : map.get("create_time").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
										String creater = null == map.get("creater") ? "" : map.get("creater").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
										map.put("create_time", DateUtil.dateToStrLong(DateUtil.strToDateLong(createTime))); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -281,21 +291,33 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine 
			 | 
		
	
		
			
				 | 
				 | 
			
			
										} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								mixEnvelop.setPageSize(pageSize); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								mixEnvelop.setCurrPage(page); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								mixEnvelop.setTotalCount(count.intValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								mixEnvelop.setDetailModelList(list); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								return mixEnvelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							//空位查我的问卷 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							sql.append("where t.del = 1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							sql.append("JOIN wlyy_survey_label_info i ON t.id = i.survey_temp_code where 1=1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							sql.append(" and t.del = 1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							if (StringUtils.isNotEmpty(doctor)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								sql.append(" and t.creater = '" + doctor + "'"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							if (StringUtils.isNotEmpty(doctor)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								sql.append(" and t.title like '%" + title + "%'"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							String sqlCount = "select Count(1) as \"total\" from ("+sql+") l"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql.toString(), page, pageSize); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							List<Map<String, Object>> listCount = hibenateUtils.createSQLQuery(sqlCount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							Long count = 0L; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							if (listCount.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								count = hibenateUtils.objTransformLong(listCount.get(0).get("total")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							if (list.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								for (Map<String, Object> map : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									List<WlyySurveyLabelInfoVO>  wlyySurveyLabelInfoVOS= surveyService.findSurveyTemplateLabel(null==map.get("id")?"":map.get("id").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									map.put("labels",wlyySurveyLabelInfoVOS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									String createTime = null == map.get("create_time") ? "" : map.get("create_time").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									String creater = null == map.get("creater") ? "" : map.get("creater").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									map.put("create_time", DateUtil.dateToStrLong(DateUtil.strToDateLong(createTime))); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -306,6 +328,9 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							mixEnvelop.setPageSize(pageSize); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							mixEnvelop.setCurrPage(page); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							mixEnvelop.setTotalCount(count.intValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							mixEnvelop.setDetailModelList(list); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							return mixEnvelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 |