|  | @ -286,9 +286,9 @@ public class ImService {
 | 
												
													
														
															|  | 				"AND b.to_doctor='" +doctor+"' "+
 |  | 				"AND b.to_doctor='" +doctor+"' "+
 | 
												
													
														
															|  | 				"AND a.del='1' " +
 |  | 				"AND a.del='1' " +
 | 
												
													
														
															|  | 				"AND (a.type<> 9 or a.type<> 16)" +
 |  | 				"AND (a.type<> 9 or a.type<> 16)" +
 | 
												
													
														
															|  | 				"AND a.`status`=0";
 |  | 
 | 
												
													
														
															|  | 
 |  | 				"AND a.status=0";
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
 |  | 
 | 
												
													
														
															|  | 
 |  | 		List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(totalSql);
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		String consultCode = "";
 |  | 		String consultCode = "";
 | 
												
													
														
															|  | 		if (rstotal != null && rstotal.size() > 0) {
 |  | 		if (rstotal != null && rstotal.size() > 0) {
 | 
												
											
												
													
														
															|  | @ -324,9 +324,9 @@ public class ImService {
 | 
												
													
														
															|  | 				"AND a.actual_sender='" +general_doctor+"' "+
 |  | 				"AND a.actual_sender='" +general_doctor+"' "+
 | 
												
													
														
															|  | 				"AND a.del='1' " +
 |  | 				"AND a.del='1' " +
 | 
												
													
														
															|  | 				"AND a.type<> 12 " +
 |  | 				"AND a.type<> 12 " +
 | 
												
													
														
															|  | 				"AND a.`status`=0";
 |  | 
 | 
												
													
														
															|  | 
 |  | 				"AND a.status=0";
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
 |  | 
 | 
												
													
														
															|  | 
 |  | 		List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(totalSql);
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		String consultCode = "";
 |  | 		String consultCode = "";
 | 
												
													
														
															|  | 		String specialDoctor = "";
 |  | 		String specialDoctor = "";
 | 
												
											
												
													
														
															|  | @ -1481,7 +1481,7 @@ public class ImService {
 | 
												
													
														
															|  | 	 */
 |  | 	 */
 | 
												
													
														
															|  | 	public String getConsultCodeByOutpatientId(String outpatientid) {
 |  | 	public String getConsultCodeByOutpatientId(String outpatientid) {
 | 
												
													
														
															|  | 		String totalSql = "SELECT id FROM wlyy_consult WHERE relation_code='"+outpatientid+"' ";
 |  | 		String totalSql = "SELECT id FROM wlyy_consult WHERE relation_code='"+outpatientid+"' ";
 | 
												
													
														
															|  | 		List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
 |  | 
 | 
												
													
														
															|  | 
 |  | 		List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(totalSql);
 | 
												
													
														
															|  | 		String id = "";
 |  | 		String id = "";
 | 
												
													
														
															|  | 		if (rstotal != null && rstotal.size() > 0) {
 |  | 		if (rstotal != null && rstotal.size() > 0) {
 | 
												
													
														
															|  | 			id = rstotal.get(0).get("id").toString();
 |  | 			id = rstotal.get(0).get("id").toString();
 | 
												
											
												
													
														
															|  | @ -1496,7 +1496,7 @@ public class ImService {
 | 
												
													
														
															|  | 	 */
 |  | 	 */
 | 
												
													
														
															|  | 	public String getOutpatientidByConsoultCode(String consult) {
 |  | 	public String getOutpatientidByConsoultCode(String consult) {
 | 
												
													
														
															|  | 		String totalSql = "SELECT relation_code as \"relation_code\" FROM wlyy_consult WHERE id='"+consult+"' ";
 |  | 		String totalSql = "SELECT relation_code as \"relation_code\" FROM wlyy_consult WHERE id='"+consult+"' ";
 | 
												
													
														
															|  | 		List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
 |  | 
 | 
												
													
														
															|  | 
 |  | 		List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(totalSql);
 | 
												
													
														
															|  | 		String id = "";
 |  | 		String id = "";
 | 
												
													
														
															|  | 		if (rstotal != null && rstotal.size() > 0) {
 |  | 		if (rstotal != null && rstotal.size() > 0) {
 | 
												
													
														
															|  | 			id = rstotal.get(0).get("relation_code").toString();
 |  | 			id = rstotal.get(0).get("relation_code").toString();
 | 
												
											
												
													
														
															|  | @ -1607,7 +1607,7 @@ public class ImService {
 | 
												
													
														
															|  | 				"LEFT JOIN wlyy_consult_team c ON c.consult=b.relation_code " +
 |  | 				"LEFT JOIN wlyy_consult_team c ON c.consult=b.relation_code " +
 | 
												
													
														
															|  | 				"WHERE a.relation_code=b.id "+
 |  | 				"WHERE a.relation_code=b.id "+
 | 
												
													
														
															|  | 				"AND c.consult='"+consult+"'";
 |  | 				"AND c.consult='"+consult+"'";
 | 
												
													
														
															|  | 		List<Map<String,Object>> scoreList = jdbcTemplate.queryForList(sqlScoreList);
 |  | 
 | 
												
													
														
															|  | 
 |  | 		List<Map<String,Object>> scoreList = hibenateUtils.createSQLQuery(sqlScoreList);
 | 
												
													
														
															|  | 		if(scoreList.isEmpty()){
 |  | 		if(scoreList.isEmpty()){
 | 
												
													
														
															|  | 			return null;
 |  | 			return null;
 | 
												
													
														
															|  | 		}else{
 |  | 		}else{
 | 
												
											
												
													
														
															|  | @ -1693,19 +1693,11 @@ public class ImService {
 | 
												
													
														
															|  | 	 * @param end_time 结束时间
 |  | 	 * @param end_time 结束时间
 | 
												
													
														
															|  | 	 * @return
 |  | 	 * @return
 | 
												
													
														
															|  | 	 */
 |  | 	 */
 | 
												
													
														
															|  | 	public List<ConsultVO>  findConsultRecordByDoctor(String doctor, String id,
 |  | 
 | 
												
													
														
															|  | 
 |  | 	public List<Map<String,Object>>  findConsultRecordByDoctor(String doctor, String id,
 | 
												
													
														
															|  | 	                                                  String type, Integer status,
 |  | 	                                                  String type, Integer status,
 | 
												
													
														
															|  | 	                                                  int page,int pagesize,
 |  | 	                                                  int page,int pagesize,
 | 
												
													
														
															|  | 	                                                  String title,String start_time,String end_time) {
 |  | 	                                                  String title,String start_time,String end_time) {
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		if(page >=1){
 |  | 
 | 
												
													
														
															|  | 			page --;
 |  | 
 | 
												
													
														
															|  | 		}
 |  | 
 | 
												
													
														
															|  | 		
 |  | 
 | 
												
													
														
															|  | 		if (pagesize <= 0) {
 |  | 
 | 
												
													
														
															|  | 			pagesize = 10;
 |  | 
 | 
												
													
														
															|  | 		}
 |  | 
 | 
												
													
														
															|  | 		
 |  | 
 | 
												
													
														
															|  | 		String  sql = "";
 |  | 		String  sql = "";
 | 
												
													
														
															|  | 		//专家咨询
 |  | 		//专家咨询
 | 
												
													
														
															|  | 		if("1".equals(type) || "15".equals(type) || type.contains(",")){
 |  | 		if("1".equals(type) || "15".equals(type) || type.contains(",")){
 | 
												
											
												
													
														
															|  | @ -1755,10 +1747,6 @@ public class ImService {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 		}
 |  | 		}
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		
 |  | 
 | 
												
													
														
															|  | 		
 |  | 
 | 
												
													
														
															|  | 		List<ConsultVO> result = new ArrayList<>();
 |  | 
 | 
												
													
														
															|  | 		
 |  | 
 | 
												
													
														
															|  | 		if(!StringUtils.isEmpty(title)){
 |  | 		if(!StringUtils.isEmpty(title)){
 | 
												
													
														
															|  | 			title="%"+title+"%";
 |  | 			title="%"+title+"%";
 | 
												
													
														
															|  | 			sql +=" and a.title like '"+title+"'";
 |  | 			sql +=" and a.title like '"+title+"'";
 | 
												
											
												
													
														
															|  | @ -1794,8 +1782,7 @@ public class ImService {
 | 
												
													
														
															|  | 		}
 |  | 		}
 | 
												
													
														
															|  | 		sql += " ORDER BY a.czrq desc limit "+page * pagesize+","+pagesize+"";
 |  | 		sql += " ORDER BY a.czrq desc limit "+page * pagesize+","+pagesize+"";
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));
 |  | 
 | 
												
													
														
															|  | 		return result;
 |  | 
 | 
												
													
														
															|  | 
 |  | 		return hibenateUtils.createSQLQuery(sql);
 | 
												
													
														
															|  | 	}
 |  | 	}
 | 
												
													
														
															|  | 	
 |  | 	
 | 
												
													
														
															|  | 	/**
 |  | 	/**
 | 
												
											
												
													
														
															|  | @ -1855,7 +1842,7 @@ public class ImService {
 | 
												
													
														
															|  | 			sql += " and a.id = '" + id + "'";
 |  | 			sql += " and a.id = '" + id + "'";
 | 
												
													
														
															|  | 		}
 |  | 		}
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
 |  | 
 | 
												
													
														
															|  | 
 |  | 		List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(sql);
 | 
												
													
														
															|  | 		Long count = 0L;
 |  | 		Long count = 0L;
 | 
												
													
														
															|  | 		if (rstotal != null && rstotal.size() > 0) {
 |  | 		if (rstotal != null && rstotal.size() > 0) {
 | 
												
													
														
															|  | 			count = (Long) rstotal.get(0).get("total");
 |  | 			count = (Long) rstotal.get(0).get("total");
 | 
												
											
												
													
														
															|  | @ -2087,7 +2074,7 @@ public class ImService {
 | 
												
													
														
															|  | 	 * @param end_time 结束时间
 |  | 	 * @param end_time 结束时间
 | 
												
													
														
															|  | 	 * @return
 |  | 	 * @return
 | 
												
													
														
															|  | 	 */
 |  | 	 */
 | 
												
													
														
															|  | 	public List<ConsultVO>  findexpertConsultRecordByDoctor(String doctor, String id,
 |  | 
 | 
												
													
														
															|  | 
 |  | 	public List<Map<String,Object>>   findexpertConsultRecordByDoctor(String doctor, String id,
 | 
												
													
														
															|  | 	                                                  Integer type, Integer status,
 |  | 	                                                  Integer type, Integer status,
 | 
												
													
														
															|  | 	                                                  int page,int pagesize,
 |  | 	                                                  int page,int pagesize,
 | 
												
													
														
															|  | 	                                                  String title,String start_time,String end_time,String patinet) {
 |  | 	                                                  String title,String start_time,String end_time,String patinet) {
 | 
												
											
												
													
														
															|  | @ -2159,9 +2146,9 @@ public class ImService {
 | 
												
													
														
															|  | 		}
 |  | 		}
 | 
												
													
														
															|  | 		sql += " ORDER BY a.czrq desc limit "+page * pagesize+","+pagesize+"";
 |  | 		sql += " ORDER BY a.czrq desc limit "+page * pagesize+","+pagesize+"";
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));
 |  | 
 | 
												
													
														
															|  | 
 |  | //		result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		return result;
 |  | 
 | 
												
													
														
															|  | 
 |  | 		return hibenateUtils.createSQLQuery(sql);
 | 
												
													
														
															|  | 	}
 |  | 	}
 | 
												
													
														
															|  | 	
 |  | 	
 | 
												
													
														
															|  | 	
 |  | 	
 | 
												
											
												
													
														
															|  | @ -2262,7 +2249,7 @@ public class ImService {
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		String sql = "id AS \"id\",session_id AS \"session_id\",sender_id AS \"sender_id\",sender_name AS \"sender_name\",content_type AS \"content_type\",content AS \"content\",timestamp AS \"timestamp\"  from " + data_base_name + "." +
 |  | 		String sql = "id AS \"id\",session_id AS \"session_id\",sender_id AS \"sender_id\",sender_name AS \"sender_name\",content_type AS \"content_type\",content AS \"content\",timestamp AS \"timestamp\"  from " + data_base_name + "." +
 | 
												
													
														
															|  | 				tableName + " where id in(" + content + ") order by timestamp desc ";
 |  | 				tableName + " where id in(" + content + ") order by timestamp desc ";
 | 
												
													
														
															|  | 		List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
 |  | 
 | 
												
													
														
															|  | 
 |  | 		List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql);
 | 
												
													
														
															|  | 		com.alibaba.fastjson.JSONArray ja = new com.alibaba.fastjson.JSONArray();
 |  | 		com.alibaba.fastjson.JSONArray ja = new com.alibaba.fastjson.JSONArray();
 | 
												
													
														
															|  | 		for (int i = 0; i < list.size(); i++) {
 |  | 		for (int i = 0; i < list.size(); i++) {
 | 
												
													
														
															|  | 			Map<String, Object> map = list.get(i);
 |  | 			Map<String, Object> map = list.get(i);
 | 
												
											
												
													
														
															|  | @ -2400,7 +2387,7 @@ public class ImService {
 | 
												
													
														
															|  | 	 * @param type
 |  | 	 * @param type
 | 
												
													
														
															|  | 	 * @return
 |  | 	 * @return
 | 
												
													
														
															|  | 	 */
 |  | 	 */
 | 
												
													
														
															|  | 	public List<ConsultVO> doctorUpcomingList(String doctorCode, String type) {
 |  | 
 | 
												
													
														
															|  | 
 |  | 	public List<Map<String,Object>> doctorUpcomingList(String doctorCode, String type) {
 | 
												
													
														
															|  | 		String sql = "";
 |  | 		String sql = "";
 | 
												
													
														
															|  | 		if("1,15".equals(type)) {
 |  | 		if("1,15".equals(type)) {
 | 
												
													
														
															|  | 			sql = "SELECT " +
 |  | 			sql = "SELECT " +
 | 
												
											
												
													
														
															|  | @ -2463,9 +2450,7 @@ public class ImService {
 | 
												
													
														
															|  | 			sql =sql +" ORDER BY op.create_time DESC";
 |  | 			sql =sql +" ORDER BY op.create_time DESC";
 | 
												
													
														
															|  | 		}
 |  | 		}
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		List<ConsultVO> result = new ArrayList<>();
 |  | 
 | 
												
													
														
															|  | 		result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));
 |  | 
 | 
												
													
														
															|  | 		return result;
 |  | 
 | 
												
													
														
															|  | 
 |  | 		return hibenateUtils.createSQLQuery(sql);
 | 
												
													
														
															|  | 	}
 |  | 	}
 | 
												
													
														
															|  | 	
 |  | 	
 | 
												
													
														
															|  | 	/**
 |  | 	/**
 | 
												
											
												
													
														
															|  | @ -2492,10 +2477,10 @@ public class ImService {
 | 
												
													
														
															|  | 		//医生角色
 |  | 		//医生角色
 | 
												
													
														
															|  | 		String sql = "SELECT " +
 |  | 		String sql = "SELECT " +
 | 
												
													
														
															|  | 				"count(id) AS \"total\"," +
 |  | 				"count(id) AS \"total\"," +
 | 
												
													
														
															|  | 				"doctor " +
 |  | 
 | 
												
													
														
															|  | 
 |  | 				"doctor as \"doctor\"" +
 | 
												
													
														
															|  | 				"FROM wlyy_consult_team " +
 |  | 				"FROM wlyy_consult_team " +
 | 
												
													
														
															|  | 				"WHERE doctor IN ("+doctorids+") AND (type=1 OR type=15) and status = 0 GROUP BY doctor";
 |  | 				"WHERE doctor IN ("+doctorids+") AND (type=1 OR type=15) and status = 0 GROUP BY doctor";
 | 
												
													
														
															|  | 		List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
 |  | 
 | 
												
													
														
															|  | 
 |  | 		List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
 | 
												
													
														
															|  | 		return list;
 |  | 		return list;
 | 
												
													
														
															|  | 	}
 |  | 	}
 | 
												
													
														
															|  | }
 |  | }
 |