Explorar o código

修改oracle 语句兼容

huangwenjie %!s(int64=5) %!d(string=hai) anos
pai
achega
6ec5776b1e

+ 8 - 30
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -177,14 +177,6 @@ public class ImService {
	public List<Map<String,Object>>  findConsultRecordByPatient(String patient, String id,String type, int page,int pagesize, String title,Integer status,Integer payStatus) {
		
		
		if(page >=1){
			page --;
		}
		
		if (pagesize <= 0) {
			pagesize = 10;
		}
		
		String  sql = "SELECT " +
				"a.id AS \"id\"," +
				"a.type AS \"type\"," +
@ -229,8 +221,8 @@ public class ImService {
		if (!StringUtils.isEmpty(payStatus)) {
			sql += " and a.pay_status = " + payStatus + "";
		}
		sql += " ORDER BY a.czrq desc limit "+page * pagesize+","+pagesize+"";
		List<Map<String,Object>> result = hibenateUtils.createSQLQuery(sql);
		sql += " ORDER BY a.czrq desc ";
		List<Map<String,Object>> result = hibenateUtils.createSQLQuery(sql,page,pagesize);
		/*result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));*/
		return result;
	}
@ -265,7 +257,7 @@ public class ImService {
		List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
		Long count = 0L;
		if (rstotal != null && rstotal.size() > 0) {
			count = (Long) rstotal.get(0).get("total");
			count = Long.parseLong(rstotal.get(0).get("total").toString());
		}
		
		return count;
@ -1698,13 +1690,7 @@ public class ImService {
	                                                  String type, Integer status,
	                                                  int page,int pagesize,
	                                                  String title,String start_time,String end_time) {
		if(page >=1){
			page --;
		}
		
		if (pagesize <= 0) {
			pagesize = 10;
		}
		String  sql = "";
		//专家咨询
		if("1".equals(type) || "15".equals(type) || type.contains(",")){
@ -1787,9 +1773,9 @@ public class ImService {
		if (!StringUtils.isEmpty(id)) {
			sql += " and a.id = '" + id + "'";
		}
		sql += " ORDER BY a.czrq desc limit "+page * pagesize+","+pagesize+"";
		sql += " ORDER BY a.czrq desc ";
		
		return hibenateUtils.createSQLQuery(sql);
		return hibenateUtils.createSQLQuery(sql,page,pagesize);
	}
	
	/**
@ -2086,14 +2072,6 @@ public class ImService {
	                                                  int page,int pagesize,
	                                                  String title,String start_time,String end_time,String patinet) {
		
		if(page >=1){
			page --;
		}
		
		if (pagesize <= 0) {
			pagesize = 10;
		}
		
		String  sql = "SELECT " +
				"a.id AS \"id\"," +
				"a.type AS \"type\"," +
@ -2151,11 +2129,11 @@ public class ImService {
		if (!StringUtils.isEmpty(id)) {
			sql += " and a.id = '" + id + "'";
		}
		sql += " ORDER BY a.czrq desc limit "+page * pagesize+","+pagesize+"";
		sql += " ORDER BY a.czrq desc ";
		
//		result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));
		
		return hibenateUtils.createSQLQuery(sql);
		return hibenateUtils.createSQLQuery(sql,page,pagesize);
	}
	
	

+ 23 - 18
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -129,7 +129,6 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
								@ApiParam(name = "pagesize", value = "分页大小")
								@RequestParam(value = "pagesize",required = false) int pagesize
								)throws Exception{
		JSONArray array = new JSONArray();
		List<Map<String,Object>>  data = imService.findConsultRecordByPatient(patient, id,type, page,pagesize, title,status,payStatus);
		
		/*if (data != null) {
@ -168,7 +167,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		
		JSONObject result = new JSONObject();
		result.put("total",total);
		result.put("list",array);
		result.put("list",data);
		return success(result);
	}
	
@ -424,28 +423,34 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			hospitalSystemMessageService.saveMessage(systemMessageDO);
			BaseDoctorDO d = baseDoctorDao.findById(re.getString("doctor"));
			BasePatientDO p = basePatientDao.findById(re.getString("patient"));
			//眼科支付订单
			if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
				if (type==1||type==2){
					BusinessOrderDO businessOrderDO = new BusinessOrderDO();
					businessOrderDO.setDoctor(doctor);
					businessOrderDO.setPatient(patient);
					businessOrderDO.setPatientName(re.getString("patientName"));
					businessOrderDO.setDescription("专家咨询费");
					businessOrderDO.setOrderCategory("1");
					if (type==1){
						businessOrderDO.setOrderType(1);
					}else if (type==17){
						businessOrderDO.setOrderType(3);
						businessOrderDO.setRelationCode(re.getString("consult"));
						businessOrderDO.setRelationName("新增专家咨询");
			
			try {
				//眼科支付订单
				if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
					if (type==1||type==2){
						BusinessOrderDO businessOrderDO = new BusinessOrderDO();
						businessOrderDO.setDoctor(doctor);
						businessOrderDO.setPatient(patient);
						businessOrderDO.setPatientName(re.getString("patientName"));
						businessOrderDO.setDescription("专家咨询费");
						businessOrderDO.setOrderCategory("1");
						if (type==1){
							businessOrderDO.setOrderType(1);
						}else if (type==17){
							businessOrderDO.setOrderType(3);
							businessOrderDO.setRelationCode(re.getString("consult"));
							businessOrderDO.setRelationName("新增专家咨询");
						}
						businessOrderService.saveOrder(businessOrderDO);
					}
					businessOrderService.saveOrder(businessOrderDO);
				}
			}catch (Exception e){
			    logger.info("支付订单失败:"+e.getMessage());
			}
			//发送企业号推送
			try{