|  | @ -245,7 +245,7 @@ public class ImService {
 | 
												
													
														
															|  | 	public Long countConsultRecordByPatient(String patient, String id,String type, String title) {
 |  | 	public Long countConsultRecordByPatient(String patient, String id,String type, String title) {
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		String  sql = "SELECT " +
 |  | 		String  sql = "SELECT " +
 | 
												
													
														
															|  | 				" COUNT(1) AS total " +
 |  | 
 | 
												
													
														
															|  | 
 |  | 				" COUNT(1) AS \"total\" " +
 | 
												
													
														
															|  | 				"FROM wlyy_consult a," +
 |  | 				"FROM wlyy_consult a," +
 | 
												
													
														
															|  | 				"wlyy_consult_team b," +
 |  | 				"wlyy_consult_team b," +
 | 
												
													
														
															|  | 				"base_doctor d " +
 |  | 				"base_doctor d " +
 | 
												
											
												
													
														
															|  | @ -279,16 +279,16 @@ public class ImService {
 | 
												
													
														
															|  | 	 */
 |  | 	 */
 | 
												
													
														
															|  | 	public String  getUnfinishedConsult(String patient, String doctor) {
 |  | 	public String  getUnfinishedConsult(String patient, String doctor) {
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		String totalSql = "SELECT a.consult as consultCode " +
 |  | 
 | 
												
													
														
															|  | 
 |  | 		String totalSql = "SELECT a.consult as \"consultCode\" " +
 | 
												
													
														
															|  | 				"FROM wlyy_consult_team a,wlyy_consult_team_doctor b " +
 |  | 				"FROM wlyy_consult_team a,wlyy_consult_team_doctor b " +
 | 
												
													
														
															|  | 				"WHERE a.consult=b.consult " +
 |  | 				"WHERE a.consult=b.consult " +
 | 
												
													
														
															|  | 				"AND a.patient= '" +patient+"' "+
 |  | 				"AND a.patient= '" +patient+"' "+
 | 
												
													
														
															|  | 				"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) {
 | 
												
											
												
													
														
															|  | @ -317,16 +317,16 @@ public class ImService {
 | 
												
													
														
															|  | 	public JSONObject  getUnfinishedConsultByActualSender(String patient, String general_doctor) {
 |  | 	public JSONObject  getUnfinishedConsultByActualSender(String patient, String general_doctor) {
 | 
												
													
														
															|  | 		JSONObject result = new JSONObject();
 |  | 		JSONObject result = new JSONObject();
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		String totalSql = "SELECT a.consult as consultCode,a.doctor as specialDoctor " +
 |  | 
 | 
												
													
														
															|  | 
 |  | 		String totalSql = "SELECT a.consult as \"consultCode\",a.doctor as \"specialDoctor\"  " +
 | 
												
													
														
															|  | 				"FROM wlyy_consult_team a,wlyy_consult_team_doctor b " +
 |  | 				"FROM wlyy_consult_team a,wlyy_consult_team_doctor b " +
 | 
												
													
														
															|  | 				"WHERE a.consult=b.consult " +
 |  | 				"WHERE a.consult=b.consult " +
 | 
												
													
														
															|  | 				"AND a.patient= '" +patient+"' "+
 |  | 				"AND a.patient= '" +patient+"' "+
 | 
												
													
														
															|  | 				"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();
 | 
												
											
												
													
														
															|  | @ -1495,8 +1495,8 @@ public class ImService {
 | 
												
													
														
															|  | 	 * @return
 |  | 	 * @return
 | 
												
													
														
															|  | 	 */
 |  | 	 */
 | 
												
													
														
															|  | 	public String getOutpatientidByConsoultCode(String consult) {
 |  | 	public String getOutpatientidByConsoultCode(String consult) {
 | 
												
													
														
															|  | 		String totalSql = "SELECT relation_code FROM wlyy_consult WHERE id='"+consult+"' ";
 |  | 
 | 
												
													
														
															|  | 		List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
 |  | 
 | 
												
													
														
															|  | 
 |  | 		String totalSql = "SELECT relation_code as \"relation_code\" FROM wlyy_consult WHERE id='"+consult+"' ";
 | 
												
													
														
															|  | 
 |  | 		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();
 | 
												
											
												
													
														
															|  | @ -1592,22 +1592,22 @@ public class ImService {
 | 
												
													
														
															|  | 	public List<Map<String,Object>> getEvaluationByConsultCode(String consult) {
 |  | 	public List<Map<String,Object>> getEvaluationByConsultCode(String consult) {
 | 
												
													
														
															|  | 		//查询评价明细
 |  | 		//查询评价明细
 | 
												
													
														
															|  | 		String sqlScoreList = "SELECT " +
 |  | 		String sqlScoreList = "SELECT " +
 | 
												
													
														
															|  | 				"a.score as score," +
 |  | 
 | 
												
													
														
															|  | 				"a.score_type as score_type," +
 |  | 
 | 
												
													
														
															|  | 				"a.content as content," +
 |  | 
 | 
												
													
														
															|  | 				"b.create_time as create_time," +
 |  | 
 | 
												
													
														
															|  | 				"c.type as type," +
 |  | 
 | 
												
													
														
															|  | 				"c.name as patientname," +
 |  | 
 | 
												
													
														
															|  | 				"b.id as id," +
 |  | 
 | 
												
													
														
															|  | 				"c.photo as patientphoto," +
 |  | 
 | 
												
													
														
															|  | 				"b.type as niming " +
 |  | 
 | 
												
													
														
															|  | 
 |  | 				"a.score as \"score\"," +
 | 
												
													
														
															|  | 
 |  | 				"a.score_type as \"score_type\"," +
 | 
												
													
														
															|  | 
 |  | 				"a.content as \"content\"," +
 | 
												
													
														
															|  | 
 |  | 				"b.create_time as \"create_time\"," +
 | 
												
													
														
															|  | 
 |  | 				"c.type as \"type\"," +
 | 
												
													
														
															|  | 
 |  | 				"c.name as \"patientname\"," +
 | 
												
													
														
															|  | 
 |  | 				"b.id as \"id\"," +
 | 
												
													
														
															|  | 
 |  | 				"c.photo as \"patientphoto\"," +
 | 
												
													
														
															|  | 
 |  | 				"b.type as \"niming\" " +
 | 
												
													
														
															|  | 				"FROM " +
 |  | 				"FROM " +
 | 
												
													
														
															|  | 				"base_evaluate a " +
 |  | 				"base_evaluate a " +
 | 
												
													
														
															|  | 				"LEFT JOIN base_evaluate_score b ON b.id=a.relation_code " +
 |  | 				"LEFT JOIN base_evaluate_score b ON b.id=a.relation_code " +
 | 
												
													
														
															|  | 				"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,35 +1693,27 @@ 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(",")){
 | 
												
													
														
															|  | 			sql = "SELECT " +
 |  | 			sql = "SELECT " +
 | 
												
													
														
															|  | 					"a.id AS id," +
 |  | 
 | 
												
													
														
															|  | 					"a.type AS type," +
 |  | 
 | 
												
													
														
															|  | 					"a.title AS title," +
 |  | 
 | 
												
													
														
															|  | 					"a.symptoms AS symptoms," +
 |  | 
 | 
												
													
														
															|  | 					"a.czrq AS czrq," +
 |  | 
 | 
												
													
														
															|  | 					"b.status AS status," +
 |  | 
 | 
												
													
														
															|  | 					"b.evaluate AS evaluate," +
 |  | 
 | 
												
													
														
															|  | 					"d.name AS patientName," +
 |  | 
 | 
												
													
														
															|  | 					"d.id as patientId," +
 |  | 
 | 
												
													
														
															|  | 					"d.idcard as patientIdcard," +
 |  | 
 | 
												
													
														
															|  | 					"d.sex as patientsex," +
 |  | 
 | 
												
													
														
															|  | 					"d.photo AS patientphoto " +
 |  | 
 | 
												
													
														
															|  | 
 |  | 					"a.id AS \"id\"," +
 | 
												
													
														
															|  | 
 |  | 					"a.type AS \"type\"," +
 | 
												
													
														
															|  | 
 |  | 					"a.title AS \"title\"," +
 | 
												
													
														
															|  | 
 |  | 					"a.symptoms AS \"symptoms\"," +
 | 
												
													
														
															|  | 
 |  | 					"a.czrq AS \"czrq\"," +
 | 
												
													
														
															|  | 
 |  | 					"b.status AS \"status\"," +
 | 
												
													
														
															|  | 
 |  | 					"b.evaluate AS \"evaluate\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.name AS \"patientName\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.id as \"patientId\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.idcard as \"patientIdcard\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.sex as \"patientsex\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.photo AS \"patientphoto\" " +
 | 
												
													
														
															|  | 					"FROM wlyy_consult a," +
 |  | 					"FROM wlyy_consult a," +
 | 
												
													
														
															|  | 					"wlyy_consult_team b," +
 |  | 					"wlyy_consult_team b," +
 | 
												
													
														
															|  | 					"base_patient d " +
 |  | 					"base_patient d " +
 | 
												
											
												
													
														
															|  | @ -1730,22 +1722,22 @@ public class ImService {
 | 
												
													
														
															|  | 		}else{
 |  | 		}else{
 | 
												
													
														
															|  | 			
 |  | 			
 | 
												
													
														
															|  | 			sql = "SELECT " +
 |  | 			sql = "SELECT " +
 | 
												
													
														
															|  | 					"a.id AS id," +
 |  | 
 | 
												
													
														
															|  | 					"a.type AS type," +
 |  | 
 | 
												
													
														
															|  | 					"a.title AS title," +
 |  | 
 | 
												
													
														
															|  | 					"a.symptoms AS symptoms," +
 |  | 
 | 
												
													
														
															|  | 					"a.czrq AS czrq," +
 |  | 
 | 
												
													
														
															|  | 					"b.status AS status," +
 |  | 
 | 
												
													
														
															|  | 					"b.evaluate AS evaluate," +
 |  | 
 | 
												
													
														
															|  | 					"d.name AS patientName," +
 |  | 
 | 
												
													
														
															|  | 					"d.id as patientId," +
 |  | 
 | 
												
													
														
															|  | 					"d.idcard as patientIdcard," +
 |  | 
 | 
												
													
														
															|  | 					"d.sex as patientsex," +
 |  | 
 | 
												
													
														
															|  | 					"op.id as outpatientid," +
 |  | 
 | 
												
													
														
															|  | 					"op.type as consultType," +
 |  | 
 | 
												
													
														
															|  | 					"op.general_doctor as generalDoctor," +
 |  | 
 | 
												
													
														
															|  | 					"op.icd10_name as icd10Name," +
 |  | 
 | 
												
													
														
															|  | 					"d.photo AS patientphoto " +
 |  | 
 | 
												
													
														
															|  | 
 |  | 					"a.id AS \"id\"," +
 | 
												
													
														
															|  | 
 |  | 					"a.type AS \"type\"," +
 | 
												
													
														
															|  | 
 |  | 					"a.title AS \"title\"," +
 | 
												
													
														
															|  | 
 |  | 					"a.symptoms AS \"symptoms\"," +
 | 
												
													
														
															|  | 
 |  | 					"a.czrq AS \"czrq\"," +
 | 
												
													
														
															|  | 
 |  | 					"b.status AS \"status\"," +
 | 
												
													
														
															|  | 
 |  | 					"b.evaluate AS \"evaluate\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.name AS \"patientName\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.id as \"patientId\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.idcard as \"patientIdcard\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.sex as \"patientsex\"," +
 | 
												
													
														
															|  | 
 |  | 					"op.id as \"outpatientid\"," +
 | 
												
													
														
															|  | 
 |  | 					"op.type as \"consultType\"," +
 | 
												
													
														
															|  | 
 |  | 					"op.general_doctor as \"generalDoctor\"," +
 | 
												
													
														
															|  | 
 |  | 					"op.icd10_name as \"icd10Name\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.photo AS \"patientphoto\" " +
 | 
												
													
														
															|  | 					"FROM wlyy_consult a," +
 |  | 					"FROM wlyy_consult a," +
 | 
												
													
														
															|  | 					"wlyy_consult_team b," +
 |  | 					"wlyy_consult_team b," +
 | 
												
													
														
															|  | 					"base_patient d, " +
 |  | 					"base_patient d, " +
 | 
												
											
												
													
														
															|  | @ -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);
 | 
												
													
														
															|  | 	}
 |  | 	}
 | 
												
													
														
															|  | 	
 |  | 	
 | 
												
													
														
															|  | 	/**
 |  | 	/**
 | 
												
											
												
													
														
															|  | @ -1812,7 +1799,7 @@ public class ImService {
 | 
												
													
														
															|  | 	public Long countConsultRecordByDoctor(String doctor, String id,String type, Integer status,String title,String start_time,String end_time) {
 |  | 	public Long countConsultRecordByDoctor(String doctor, String id,String type, Integer status,String title,String start_time,String end_time) {
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		String  sql = "SELECT " +
 |  | 		String  sql = "SELECT " +
 | 
												
													
														
															|  | 				" COUNT(1) AS total " +
 |  | 
 | 
												
													
														
															|  | 
 |  | 				" COUNT(1) AS \"total\" " +
 | 
												
													
														
															|  | 				"FROM wlyy_consult a," +
 |  | 				"FROM wlyy_consult a," +
 | 
												
													
														
															|  | 				"wlyy_consult_team b," +
 |  | 				"wlyy_consult_team b," +
 | 
												
													
														
															|  | 				"base_patient d," +
 |  | 				"base_patient d," +
 | 
												
											
												
													
														
															|  | @ -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) {
 | 
												
											
												
													
														
															|  | @ -2101,20 +2088,20 @@ public class ImService {
 | 
												
													
														
															|  | 		}
 |  | 		}
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		String  sql = "SELECT " +
 |  | 		String  sql = "SELECT " +
 | 
												
													
														
															|  | 				"a.id AS id," +
 |  | 
 | 
												
													
														
															|  | 				"a.type AS type," +
 |  | 
 | 
												
													
														
															|  | 				"a.title AS title," +
 |  | 
 | 
												
													
														
															|  | 				"a.symptoms AS symptoms," +
 |  | 
 | 
												
													
														
															|  | 				"a.czrq AS czrq," +
 |  | 
 | 
												
													
														
															|  | 				"b.status AS status," +
 |  | 
 | 
												
													
														
															|  | 				"b.evaluate AS evaluate," +
 |  | 
 | 
												
													
														
															|  | 				"d.name AS patientName," +
 |  | 
 | 
												
													
														
															|  | 				"d.id as patientId," +
 |  | 
 | 
												
													
														
															|  | 				"d.idcard as patientIdcard," +
 |  | 
 | 
												
													
														
															|  | 				"d.sex as patientsex," +
 |  | 
 | 
												
													
														
															|  | 				"d.photo AS patientphoto, " +
 |  | 
 | 
												
													
														
															|  | 				"doctor.name AS doctorName, " +
 |  | 
 | 
												
													
														
															|  | 				"doctor.job_title_name AS jobTitleName " +
 |  | 
 | 
												
													
														
															|  | 
 |  | 				"a.id AS \"id\"," +
 | 
												
													
														
															|  | 
 |  | 				"a.type AS \"type\"," +
 | 
												
													
														
															|  | 
 |  | 				"a.title AS \"title\"," +
 | 
												
													
														
															|  | 
 |  | 				"a.symptoms AS \"symptoms\"," +
 | 
												
													
														
															|  | 
 |  | 				"a.czrq AS \"czrq\"," +
 | 
												
													
														
															|  | 
 |  | 				"b.status AS \"status\"," +
 | 
												
													
														
															|  | 
 |  | 				"b.evaluate AS \"evaluate\"," +
 | 
												
													
														
															|  | 
 |  | 				"d.name AS \"patientName\"," +
 | 
												
													
														
															|  | 
 |  | 				"d.id as \"patientId\"," +
 | 
												
													
														
															|  | 
 |  | 				"d.idcard as \"patientIdcard\"," +
 | 
												
													
														
															|  | 
 |  | 				"d.sex as \"patientsex\"," +
 | 
												
													
														
															|  | 
 |  | 				"d.photo AS \"patientphoto\", " +
 | 
												
													
														
															|  | 
 |  | 				"doctor.name AS \"doctorName\", " +
 | 
												
													
														
															|  | 
 |  | 				"doctor.job_title_name AS \"jobTitleName\" " +
 | 
												
													
														
															|  | 				"FROM wlyy_consult a," +
 |  | 				"FROM wlyy_consult a," +
 | 
												
													
														
															|  | 				"wlyy_consult_team b," +
 |  | 				"wlyy_consult_team b," +
 | 
												
													
														
															|  | 				"base_doctor doctor," +
 |  | 				"base_doctor doctor," +
 | 
												
											
												
													
														
															|  | @ -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);
 | 
												
													
														
															|  | 	}
 |  | 	}
 | 
												
													
														
															|  | 	
 |  | 	
 | 
												
													
														
															|  | 	
 |  | 	
 | 
												
											
												
													
														
															|  | @ -2180,7 +2167,7 @@ public class ImService {
 | 
												
													
														
															|  | 	public Long findexpertConsultRecordByDoctor(String doctor, String id,Integer type, Integer status,String title,String start_time,String end_time,String patient) {
 |  | 	public Long findexpertConsultRecordByDoctor(String doctor, String id,Integer type, Integer status,String title,String start_time,String end_time,String patient) {
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		String  sql = "SELECT " +
 |  | 		String  sql = "SELECT " +
 | 
												
													
														
															|  | 				" COUNT(1) AS total " +
 |  | 
 | 
												
													
														
															|  | 
 |  | 				" COUNT(1) AS \"total\" " +
 | 
												
													
														
															|  | 				"FROM wlyy_consult a," +
 |  | 				"FROM wlyy_consult a," +
 | 
												
													
														
															|  | 				"wlyy_consult_team b," +
 |  | 				"wlyy_consult_team b," +
 | 
												
													
														
															|  | 				"base_patient d " +
 |  | 				"base_patient d " +
 | 
												
											
												
													
														
															|  | @ -2260,9 +2247,9 @@ public class ImService {
 | 
												
													
														
															|  | 				break;
 |  | 				break;
 | 
												
													
														
															|  | 		}
 |  | 		}
 | 
												
													
														
															|  | 		
 |  | 		
 | 
												
													
														
															|  | 		String sql = "select id, session_id, sender_id, sender_name, content_type, content, 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);
 | 
												
											
												
													
														
															|  | @ -2398,28 +2385,26 @@ public class ImService {
 | 
												
													
														
															|  | 	 * 医生待办事项列表
 |  | 	 * 医生待办事项列表
 | 
												
													
														
															|  | 	 * @param doctorCode
 |  | 	 * @param doctorCode
 | 
												
													
														
															|  | 	 * @param type
 |  | 	 * @param type
 | 
												
													
														
															|  | 	 * @param page
 |  | 
 | 
												
													
														
															|  | 	 * @param pagesize
 |  | 
 | 
												
													
														
															|  | 	 * @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 " +
 | 
												
													
														
															|  | 					"a.id AS id," +
 |  | 
 | 
												
													
														
															|  | 					"a.type AS type," +
 |  | 
 | 
												
													
														
															|  | 					"a.title AS title," +
 |  | 
 | 
												
													
														
															|  | 					"a.symptoms AS symptoms," +
 |  | 
 | 
												
													
														
															|  | 					"a.czrq AS czrq," +
 |  | 
 | 
												
													
														
															|  | 					"b.status AS status," +
 |  | 
 | 
												
													
														
															|  | 					"b.evaluate AS evaluate," +
 |  | 
 | 
												
													
														
															|  | 					"b.doctor AS doctorCode," +
 |  | 
 | 
												
													
														
															|  | 					"b.actual_sender AS generalDoctor," +
 |  | 
 | 
												
													
														
															|  | 					"d.name AS patientName," +
 |  | 
 | 
												
													
														
															|  | 					"d.id as patientId," +
 |  | 
 | 
												
													
														
															|  | 					"d.idcard as patientIdcard," +
 |  | 
 | 
												
													
														
															|  | 					"d.sex as patientsex," +
 |  | 
 | 
												
													
														
															|  | 					"d.photo AS patientphoto " +
 |  | 
 | 
												
													
														
															|  | 
 |  | 					"a.id AS \"id\"," +
 | 
												
													
														
															|  | 
 |  | 					"a.type AS \"type\"," +
 | 
												
													
														
															|  | 
 |  | 					"a.title AS \"title\"," +
 | 
												
													
														
															|  | 
 |  | 					"a.symptoms AS \"symptoms\"," +
 | 
												
													
														
															|  | 
 |  | 					"a.czrq AS \"czrq\"," +
 | 
												
													
														
															|  | 
 |  | 					"b.status AS \"status\"," +
 | 
												
													
														
															|  | 
 |  | 					"b.evaluate AS \"evaluate\"," +
 | 
												
													
														
															|  | 
 |  | 					"b.doctor AS \"doctorCode\"," +
 | 
												
													
														
															|  | 
 |  | 					"b.actual_sender AS \"generalDoctor\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.name AS \"patientName\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.id as \"patientId\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.idcard as \"patientIdcard\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.sex as \"patientsex\"," +
 | 
												
													
														
															|  | 
 |  | 					"d.photo AS \"patientphoto\" " +
 | 
												
													
														
															|  | 					"FROM wlyy_consult a," +
 |  | 					"FROM wlyy_consult a," +
 | 
												
													
														
															|  | 					"wlyy_consult_team b," +
 |  | 					"wlyy_consult_team b," +
 | 
												
													
														
															|  | 					"base_patient d  " +
 |  | 					"base_patient d  " +
 | 
												
											
												
													
														
															|  | @ -2429,20 +2414,20 @@ public class ImService {
 | 
												
													
														
															|  | 		}
 |  | 		}
 | 
												
													
														
															|  | 		if("9".equals(type) || "16".equals(type)|| "12".equals(type)){
 |  | 		if("9".equals(type) || "16".equals(type)|| "12".equals(type)){
 | 
												
													
														
															|  | 			sql = "SELECT " +
 |  | 			sql = "SELECT " +
 | 
												
													
														
															|  | 					"op.description AS title," +
 |  | 
 | 
												
													
														
															|  | 					"op.description AS symptoms," +
 |  | 
 | 
												
													
														
															|  | 					"op.create_time AS czrq," +
 |  | 
 | 
												
													
														
															|  | 					"op.status AS status," +
 |  | 
 | 
												
													
														
															|  | 					"op.evaluate_status AS evaluate," +
 |  | 
 | 
												
													
														
															|  | 					"op.doctor AS doctorCode," +
 |  | 
 | 
												
													
														
															|  | 					"op.general_doctor AS generalDoctor," +
 |  | 
 | 
												
													
														
															|  | 					"patient.NAME AS patientName," +
 |  | 
 | 
												
													
														
															|  | 					"patient.id AS patientId," +
 |  | 
 | 
												
													
														
															|  | 					"patient.idcard AS patientIdcard," +
 |  | 
 | 
												
													
														
															|  | 					"patient.sex AS patientsex," +
 |  | 
 | 
												
													
														
															|  | 					"patient.photo AS patientphoto," +
 |  | 
 | 
												
													
														
															|  | 					"op.id AS outpatientid," +
 |  | 
 | 
												
													
														
															|  | 					"op.register_date AS registerDate," +
 |  | 
 | 
												
													
														
															|  | 
 |  | 					"op.description AS \"title\"," +
 | 
												
													
														
															|  | 
 |  | 					"op.description AS \"symptoms\"," +
 | 
												
													
														
															|  | 
 |  | 					"op.create_time AS \"czrq\"," +
 | 
												
													
														
															|  | 
 |  | 					"op.status AS \"status\"," +
 | 
												
													
														
															|  | 
 |  | 					"op.evaluate_status AS \"evaluate\"," +
 | 
												
													
														
															|  | 
 |  | 					"op.doctor AS \"doctorCode\"," +
 | 
												
													
														
															|  | 
 |  | 					"op.general_doctor AS \"generalDoctor\"," +
 | 
												
													
														
															|  | 
 |  | 					"patient.NAME AS \"patientName\"," +
 | 
												
													
														
															|  | 
 |  | 					"patient.id AS \"patientId\"," +
 | 
												
													
														
															|  | 
 |  | 					"patient.idcard AS \"patientIdcard\"," +
 | 
												
													
														
															|  | 
 |  | 					"patient.sex AS \"patientsex\"," +
 | 
												
													
														
															|  | 
 |  | 					"patient.photo AS \"patientphoto\"," +
 | 
												
													
														
															|  | 
 |  | 					"op.id AS \"outpatientid\"," +
 | 
												
													
														
															|  | 
 |  | 					"op.register_date AS \"registerDate\"," +
 | 
												
													
														
															|  | 					"op.status AS outpatientstatus " +
 |  | 					"op.status AS outpatientstatus " +
 | 
												
													
														
															|  | 					"FROM wlyy_outpatient op," +
 |  | 					"FROM wlyy_outpatient op," +
 | 
												
													
														
															|  | 					"base_patient patient " +
 |  | 					"base_patient patient " +
 | 
												
											
												
													
														
															|  | @ -2465,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);
 | 
												
													
														
															|  | 	}
 |  | 	}
 | 
												
													
														
															|  | 	
 |  | 	
 | 
												
													
														
															|  | 	/**
 |  | 	/**
 | 
												
											
												
													
														
															|  | @ -2493,11 +2476,11 @@ public class ImService {
 | 
												
													
														
															|  | 	public List<Map<String,Object>>  getDoctorConsultCount(String doctorids) throws Exception{
 |  | 	public List<Map<String,Object>>  getDoctorConsultCount(String doctorids) throws Exception{
 | 
												
													
														
															|  | 		//医生角色
 |  | 		//医生角色
 | 
												
													
														
															|  | 		String sql = "SELECT " +
 |  | 		String sql = "SELECT " +
 | 
												
													
														
															|  | 				"count(id) AS total," +
 |  | 
 | 
												
													
														
															|  | 				"doctor " +
 |  | 
 | 
												
													
														
															|  | 
 |  | 				"count(id) AS \"total\"," +
 | 
												
													
														
															|  | 
 |  | 				"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;
 | 
												
													
														
															|  | 	}
 |  | 	}
 | 
												
													
														
															|  | }
 |  | }
 |