|  | @ -72,9 +72,7 @@ import com.yihu.jw.restmodel.hospital.archive.ArchiveVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalSysDictVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.hospital.doctor.WlyyDoctorWorkTimeVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.hospital.prescription.*;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.Envelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.MixEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.PageEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.*;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.iot.IotRequestMapping;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.common.IdCardUtil;
 | 
	
	
		
			
				|  | @ -11173,4 +11171,102 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取核酸检测记录
 | 
	
		
			
				|  |  |      * @param realOrder 处方号
 | 
	
		
			
				|  |  |      * @param name 居民姓名
 | 
	
		
			
				|  |  |      * @param hospitalFlag 机构
 | 
	
		
			
				|  |  |      * @param mobile 电话
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param payStatus 支付状态
 | 
	
		
			
				|  |  |      * @param medicare 社保卡
 | 
	
		
			
				|  |  |      * @param createTime 创建时间
 | 
	
		
			
				|  |  |      * @param appointmentTime 预约时间
 | 
	
		
			
				|  |  |      * @param page
 | 
	
		
			
				|  |  |      * @param pageSize
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public Envelop getNatAppointmentList(String realOrder, String name, String hospitalFlag, String mobile, String idcard, String payStatus, String medicare, String createTime, String appointmentTime, Integer page, Integer pageSize) {
 | 
	
		
			
				|  |  |         String sql = "select t.name as \"name\"," +
 | 
	
		
			
				|  |  |                 "t.card_no as \"cardNo\"," +
 | 
	
		
			
				|  |  |                 "t.card_type as \"cardType\"," +
 | 
	
		
			
				|  |  |                 "t.mobile as \"mobile\"," +
 | 
	
		
			
				|  |  |                 "t.inspection_name as \"inspectionName\"," +
 | 
	
		
			
				|  |  |                 "t.real_order as \"realOrder\"," +
 | 
	
		
			
				|  |  |                 "t.is_success as \"isSuccess\"," +
 | 
	
		
			
				|  |  |                 "t.create_time as \"createTime\"," +
 | 
	
		
			
				|  |  |                 "t.pay_status as \"payStatus\"," +
 | 
	
		
			
				|  |  |                 "t.medicare as \"medicare\"," +
 | 
	
		
			
				|  |  |                 "t.voucher_no as \"voucherNo\"," +
 | 
	
		
			
				|  |  |                 "t.dept as \"dept\"," +
 | 
	
		
			
				|  |  |                 "t.dept_name as \"deptName\"," +
 | 
	
		
			
				|  |  |                 "t.id as \"id\"," +
 | 
	
		
			
				|  |  |                 "t.card_no_type as \"cardNoType\"," +
 | 
	
		
			
				|  |  |                 "t.HOSPITAL_FLAG as \"hospitalFlag\"," +
 | 
	
		
			
				|  |  |                 "t.appointment_time as \"appointmentTime\" " +
 | 
	
		
			
				|  |  |                 " from base_nat_appointment t where 1=1 ";
 | 
	
		
			
				|  |  |         if (StringUtils.isNotBlank(realOrder)) {
 | 
	
		
			
				|  |  |             sql += " and t.real_order = '" + realOrder + "' ";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isNotBlank(name)) {
 | 
	
		
			
				|  |  |             sql += " and t.name like '%" + name + "%'";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isNotBlank(mobile)) {
 | 
	
		
			
				|  |  |             sql += " and t.mobile like '%" + mobile + "%' ";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isNotBlank(idcard)) {
 | 
	
		
			
				|  |  |             sql += " and t.card_no like '%" + idcard + "%' ";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         //支付状态
 | 
	
		
			
				|  |  |         if (StringUtils.isNotBlank(payStatus)) {
 | 
	
		
			
				|  |  |             sql += " and t.pay_status ='" + payStatus + "' ";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         //社保卡
 | 
	
		
			
				|  |  |         if (StringUtils.isNotBlank(medicare)) {
 | 
	
		
			
				|  |  |             sql += " and t.medicare like '%" + medicare + "%' ";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         if (StringUtils.isNotBlank(appointmentTime)) {
 | 
	
		
			
				|  |  |             if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
 | 
	
		
			
				|  |  |                 sql += " and t.appointment_time >= to_date('" + appointmentTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss')";
 | 
	
		
			
				|  |  |                 sql += " and t.appointment_time <= to_date('" + appointmentTime + " 23:59:59', 'yyyy-mm-dd hh24:mi:ss')";
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  |                 sql += " and t.appointment_time >='" + appointmentTime + " 00:00:00'";
 | 
	
		
			
				|  |  |                 sql += " and t.appointment_time <='" + appointmentTime + " 23:59:59'";
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isNotBlank(createTime)) {
 | 
	
		
			
				|  |  |             if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
 | 
	
		
			
				|  |  |                 sql += " and t.create_time >= to_date('" + createTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss')";
 | 
	
		
			
				|  |  |                 sql+=" and t.create_time <= to_date('" + createTime + " 23:59:59', 'yyyy-mm-dd hh24:mi:ss')";
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  |                 sql += " and t.create_time >='" + createTime + " 00:00:00'";
 | 
	
		
			
				|  |  |                 sql+=" and t.create_time <='"+createTime+" 23:59:59'";
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         sql += " order by t.appointment_time desc ";
 | 
	
		
			
				|  |  |         List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, page, pageSize);
 | 
	
		
			
				|  |  |         List<Map<String, Object>> listCount = hibenateUtils.createSQLQuery(sql);
 | 
	
		
			
				|  |  |         logger.info("查询数据" + sql);
 | 
	
		
			
				|  |  |         if (page != null && pageSize != null) {
 | 
	
		
			
				|  |  |             MixEnvelop envelop = new MixEnvelop();
 | 
	
		
			
				|  |  |             envelop.setStatus(200);
 | 
	
		
			
				|  |  |             envelop.setMessage("获取成功!");
 | 
	
		
			
				|  |  |             if (listCount != null && listCount.size() > 0) {
 | 
	
		
			
				|  |  |                 envelop.setCurrPage(page);
 | 
	
		
			
				|  |  |                 envelop.setPageSize(pageSize);
 | 
	
		
			
				|  |  |                 envelop.setTotalCount(listCount.size());
 | 
	
		
			
				|  |  |                 envelop.setDetailModelList(list);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             return envelop;
 | 
	
		
			
				|  |  |         }else {
 | 
	
		
			
				|  |  |             ListEnvelop envelop = new ListEnvelop();
 | 
	
		
			
				|  |  |             envelop.setStatus(200);
 | 
	
		
			
				|  |  |             envelop.setMessage("获取成功!");
 | 
	
		
			
				|  |  |             envelop.setDetailModelList(list);
 | 
	
		
			
				|  |  |             return envelop;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | }
 |