|
@ -479,7 +479,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
rs.put("patientCancelType", outpatientDO.getPatientCancelType());
|
|
|
rs.put("patientCancelValue", outpatientDO.getPatientCancelValue());
|
|
|
rs.put("patientCancelRemark", outpatientDO.getPatientCancelRemark());
|
|
|
rs.put("operator", userAgent.getUID());
|
|
|
rs.put("operator",outpatientDO.getOperator());
|
|
|
//居民详情
|
|
|
BasePatientDO basePatientDO = basePatientDao.findById(outpatientDO.getPatient());
|
|
|
rs.put("patientName", basePatientDO.getName());
|
|
@ -593,7 +593,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(startTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
totalSql += " and create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
totalSql += " and create_time >= str_to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
totalSql += " and create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
totalSql += " AND create_time >='" + startTime + " 00:00:00'";
|
|
|
}
|
|
@ -601,7 +606,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
totalSql += " and create_time <= to_date('" + startTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
totalSql += " and create_time <= str_to_date('" + startTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
totalSql += " and create_time <= to_date('" + startTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
} else {
|
|
|
totalSql += " AND create_time <='" + endTime + " 23:59:59'";
|
|
|
}
|
|
@ -668,14 +677,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(startTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " and create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " and create_time >= str_to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " and create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
} else {
|
|
|
sql += " AND create_time >='" + startTime + " 00:00:00'";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " and create_time <= to_date('" + startTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " and create_time <= str_to_date('" + startTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " and create_time <= to_date('" + startTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
} else {
|
|
|
sql += " AND create_time <='" + endTime + " 23:59:59'";
|
|
|
}
|
|
@ -2487,7 +2504,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(startTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
totalSql += " and e.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
totalSql += " and e.create_time >= str_to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
totalSql += " and e.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
} else {
|
|
|
totalSql += " AND e.create_time >='" + startTime + " 00:00:00'";
|
|
|
}
|
|
@ -2495,7 +2516,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
totalSql += " and e.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
totalSql += " and e.create_time <= str_to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
totalSql += " and e.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
} else {
|
|
|
totalSql += " AND e.create_time <='" + endTime + " 23:59:59'";
|
|
|
}
|
|
@ -2509,7 +2534,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
String sql = "SELECT ";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql = sql + "to_char(e.create_time,'YYYY-MM-DD hh24:mi:ss') AS \"createTime\",";
|
|
|
if (flag){
|
|
|
sql = sql + "date_format(e.create_time,'YYYY-MM-DD hh24:mi:ss') AS \"createTime\",";
|
|
|
}else {
|
|
|
sql = sql + "to_char(e.create_time,'YYYY-MM-DD hh24:mi:ss') AS \"createTime\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql = sql + "date_format(e.create_time,'%Y-%m-%d %H:%i:%S' ) AS \"createTime\",";
|
|
|
}
|
|
@ -2537,7 +2567,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(startTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " and e.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " and e.create_time >= str_to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " and e.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
} else {
|
|
|
sql += " AND e.create_time >='" + startTime + " 00:00:00'";
|
|
|
}
|
|
@ -2545,7 +2579,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " and e.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " and e.create_time <= str_to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " and e.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql += " AND e.create_time <='" + endTime + " 23:59:59'";
|
|
|
}
|
|
@ -3303,6 +3342,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
//更改门诊状态
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outPatientId);
|
|
|
wlyyOutpatientDO.setStatus("-1");
|
|
|
//报错拒诊操作人
|
|
|
wlyyOutpatientDO.setOperator(userAgent.getUID());
|
|
|
String description = null;
|
|
|
if (1 == operator) {
|
|
|
//居民取消
|
|
@ -3824,7 +3865,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"patient.birthday AS \"birthday\"," +
|
|
|
"room.consult_type AS \"consult_type\",";
|
|
|
if ("xm_ykyy_wx".equals(wechatId)) {
|
|
|
sql += "to_char(room.reservation_time ,'yyyy-MM-dd hh24:mi:ss' ) AS \"timedate_format\",";
|
|
|
if(flag){
|
|
|
sql += "date_format(room.reservation_time ,'yyyy-MM-dd hh24:mi:ss' ) AS \"timedate_format\",";
|
|
|
}else {
|
|
|
sql += "to_char(room.reservation_time ,'yyyy-MM-dd hh24:mi:ss' ) AS \"timedate_format\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS timedate_format,";
|
|
|
}
|
|
@ -3867,7 +3913,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
sql += " AND outpatient.dept='" + dept + "' ";
|
|
|
}
|
|
|
|
|
|
|
|
|
logger.info("接口名称:findWaitingRoomOutpatientByDoctor-->sql="+sql);
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
if (list != null && list.size() > 0) {
|
|
|
//根据身份证计算年龄
|
|
@ -3912,8 +3958,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
String totalSql = "SELECT count(id) AS \"total\" FROM wlyy_hospital_waiting_room WHERE visit_status=1 ";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
totalSql += " and reservation_time >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
totalSql += " and reservation_time <= to_date('" + DateUtil.dateToStrShort(new Date()) + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
totalSql += " and reservation_time >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
totalSql += " and reservation_time <= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
} else {
|
|
|
totalSql += " and reservation_time >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
totalSql += " and reservation_time <= to_date('" + DateUtil.dateToStrShort(new Date()) + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
totalSql += " AND reservation_time >='" + DateUtil.dateToStrShort(new Date()) + " 00:00:00'";
|
|
|
totalSql += " AND reservation_time <='" + DateUtil.dateToStrShort(new Date()) + " 23:59:59'";
|
|
@ -3984,8 +4036,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
waitingSql += " AND room.reservation_time >= to_date('" + date + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
waitingSql += " AND room.reservation_time <= to_date('" + date + " 23:59:59','YYYY-MM-DD HH24:MI:SS') GROUP BY room.doctor,room.doctor_name";
|
|
|
if (flag){
|
|
|
waitingSql += " AND room.reservation_time >= str_to_date('" + date + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
waitingSql += " AND room.reservation_time <= str_to_date('" + date + " 23:59:59','YYYY-MM-DD HH24:MI:SS') GROUP BY room.doctor,room.doctor_name";
|
|
|
}else {
|
|
|
waitingSql += " AND room.reservation_time >= to_date('" + date + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
waitingSql += " AND room.reservation_time <= to_date('" + date + " 23:59:59','YYYY-MM-DD HH24:MI:SS') GROUP BY room.doctor,room.doctor_name";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
waitingSql = waitingSql + "AND room.reservation_time>='" + date + " 00:00:00' AND room.reservation_time<='" + date + " 23:59:59' GROUP BY room.doctor,room.doctor_name; ";
|
|
|
}
|
|
@ -4028,7 +4086,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"patient.birthday AS \"birthday\"," +
|
|
|
"room.consult_type AS \"consult_type\",";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
onlineSql = onlineSql + "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",ceil((sysdate-to_date(to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'))* 24 * 60) AS \"time_cost\",";
|
|
|
if(flag){
|
|
|
onlineSql = onlineSql + "date_format(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",ceil((sysdate-to_date(date_format(room.reservation_time,'YYYY-MM-DD hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'))* 24 * 60) AS \"time_cost\",";
|
|
|
}else {
|
|
|
onlineSql = onlineSql + "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",ceil((sysdate-to_date(to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'))* 24 * 60) AS \"time_cost\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
onlineSql = onlineSql + "date_format(room.reservation_time,'%Y-%m-%d %H:%i:%S' ) AS \"time\",TIMESTAMPDIFF(MINUTE, room.reservation_time,NOW()) AS \"time_cost\",";
|
|
|
}
|
|
@ -4053,8 +4116,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
onlineSql = onlineSql+ "AND room.reservation_time>='"+date+" 00:00:00' AND room.reservation_time<='"+date+" 23:59:59' GROUP BY room.doctor";
|
|
|
*/
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wxId)) {
|
|
|
onlineSql += " AND room.reservation_time >= to_date('" + date + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
onlineSql += " AND room.reservation_time <= to_date('" + date + " 23:59:59','YYYY-MM-DD HH24:MI:SS') ";
|
|
|
if (flag){
|
|
|
onlineSql += " AND room.reservation_time >= str_to_date('" + date + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
onlineSql += " AND room.reservation_time <= str_to_date('" + date + " 23:59:59','YYYY-MM-DD HH24:MI:SS') ";
|
|
|
}else {
|
|
|
onlineSql += " AND room.reservation_time >= to_date('" + date + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
onlineSql += " AND room.reservation_time <= to_date('" + date + " 23:59:59','YYYY-MM-DD HH24:MI:SS') ";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
onlineSql = onlineSql + "AND room.reservation_time>='" + date + " 00:00:00' AND room.reservation_time<='" + date + " 23:59:59' ";
|
|
|
}
|
|
@ -4652,7 +4721,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if (one.getEndTime().before(workTimeDO.getStartTime()) || one.getStartTime().after(workTimeDO.getEndTime())) {
|
|
|
|
|
|
} else {
|
|
|
throw new Exception("您选择的时间与“开始时间-结束时间”的医院排班/自己排班冲突,请重新选择!");
|
|
|
throw new Exception("您选择的时间与“开始时间:"+one.getStartTime()+"-结束时间:"+one.getEndTime()+"”的医院排班/自己排班冲突,请重新选择!");
|
|
|
}
|
|
|
|
|
|
}
|
|
@ -4853,7 +4922,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
public List<Map<String, Object>> getVideoPrescriptionByDoctor(String doctor, String general_doctor, String wxId) {
|
|
|
String condition = "";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
if (flag){
|
|
|
condition += "date_format(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
}else {
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
condition += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS \"time\",";
|
|
|
}
|
|
@ -4919,8 +4993,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
public String generalDoctorWaitingNumber(String doctor, String wxId, String outpatientId) {
|
|
|
String condition = "";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD') AS \"group_date\",";
|
|
|
if (flag){
|
|
|
condition += "date_format(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
condition += "date_format(room.reservation_time,'YYYY-MM-DD') AS \"group_date\",";
|
|
|
}else {
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD') AS \"group_date\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
condition += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS \"time\",";
|
|
|
condition += "date_format(room.reservation_time ,'%Y-%m-%d' ) AS \"group_date\",";
|
|
@ -4957,7 +5037,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
// "AND room.reservation_time>='"+DateUtil.getStringDate("yyyy-MM-dd")+" 00:00:00"+"' ";*/
|
|
|
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " AND room.reservation_time >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if(flag){
|
|
|
sql += " AND room.reservation_time >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " AND room.reservation_time >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql += " AND room.reservation_time >= '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' ";
|
|
|
}
|
|
@ -4977,8 +5062,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
public com.alibaba.fastjson.JSONArray getWaitingForVisitVideoPrescriptionByDoctor(String doctor, String wxId) {
|
|
|
String condition = "";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD') AS \"group_date\",";
|
|
|
if(flag){
|
|
|
condition += "date_format(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
condition += "date_format(room.reservation_time,'YYYY-MM-DD') AS \"group_date\",";
|
|
|
}else{
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD') AS \"group_date\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
condition += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS \"time\",";
|
|
|
condition += "date_format(room.reservation_time ,'%Y-%m-%d' ) AS \"group_date\",";
|
|
@ -5015,7 +5106,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
// "AND room.reservation_time>='"+DateUtil.getStringDate("yyyy-MM-dd")+" 00:00:00"+"' ";*/
|
|
|
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " AND room.reservation_time >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if(flag){
|
|
|
sql += " AND room.reservation_time >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " AND room.reservation_time >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql += " AND room.reservation_time >= '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' ";
|
|
|
}
|
|
@ -5269,7 +5365,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
sql = sql + " AND outpatient.type= '" + type + "' ";
|
|
|
if ("2".equals(type)) {//视频复诊才需要判断时间,
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " AND outpatient.register_date is not null and outpatient.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " AND outpatient.register_date is not null and outpatient.register_date >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " AND outpatient.register_date is not null and outpatient.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
} else {
|
|
|
sql = sql + " AND outpatient.register_date is not null AND outpatient.register_date >= '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' ";
|
|
|
}
|
|
@ -5277,11 +5377,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
} else if ("2".equals(outpatient_type)) {
|
|
|
//协同门诊也需要判断时间
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " AND outpatient.register_date is not null and outpatient.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " AND outpatient.register_date is not null and outpatient.register_date >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " AND outpatient.register_date is not null and outpatient.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql = sql + " AND outpatient.register_date is not null AND outpatient.register_date >= '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' ";
|
|
|
}
|
|
|
}
|
|
|
logger.info("接口名称:doctorReviewConsultCount-->sql="+sql);
|
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
Long waitVideoCount = 0l;
|
|
@ -5697,7 +5803,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if (StringUtils.isNotBlank(startDate)) {
|
|
|
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sqlTotal += " and o.register_date >= to_date('" + startDate + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sqlTotal += " and o.register_date >= str_to_date('" + startDate + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sqlTotal += " and o.register_date >= to_date('" + startDate + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sqlTotal += " AND o.register_date >='" + startDate + " 00:00:00' ";
|
|
|
}
|
|
@ -5705,7 +5816,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endDate)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sqlTotal += " and o.register_date <= to_date('" + endDate + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sqlTotal += " and o.register_date <= str_to_date('" + endDate + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sqlTotal += " and o.register_date <= to_date('" + endDate + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sqlTotal += " AND o.register_date <='" + endDate + " 23:59:59' ";
|
|
|
}
|
|
@ -5764,14 +5880,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
" o.general_doctor = '" + generalDoctor + "'";
|
|
|
if (StringUtils.isNotBlank(startDate)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " and o.register_date >= to_date('" + startDate + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " and o.register_date >= str_to_date('" + startDate + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " and o.register_date >= to_date('" + startDate + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql += " AND o.register_date >='" + startDate + " 00:00:00' ";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endDate)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " and o.register_date <= to_date('" + endDate + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " and o.register_date <= str_to_date('" + endDate + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " and o.register_date <= to_date('" + endDate + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql += " AND o.register_date <='" + endDate + " 23:59:59' ";
|
|
|
}
|
|
@ -6004,7 +6130,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
String condition = "";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
condition = "to_char(p.register_date,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
if (flag){
|
|
|
condition = "date_format(p.register_date,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
}else {
|
|
|
condition = "to_char(p.register_date,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
condition = "date_format(p.register_date,'%Y-%m-%d %H:%i:%S' ) AS \"time\",";
|
|
|
}
|
|
@ -6012,9 +6143,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
String sql = "SELECT " + condition + "d.NAME as \"doctorName\",d.job_title_name as \"job_title_name\",d.photo AS \"photo\",p.id as \"outpatientid\" FROM wlyy_outpatient p,base_doctor d " +
|
|
|
"WHERE p.patient='" + patient + "' AND p.doctor=d.id AND p.status=0 ";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
if (flag){
|
|
|
sql += " AND p.register_date >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
sql += " AND p.register_date <= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " AND p.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
sql += " AND p.register_date <= to_date('" + DateUtil.dateToStrShort(new Date()) + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
sql += " AND p.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
sql += " AND p.register_date <= to_date('" + DateUtil.dateToStrShort(new Date()) + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
} else {
|
|
|
sql += " BETWEEN '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' AND '" + DateUtil.dateToStrShort(new Date()) + " 23:59:59' ";
|
|
|
}
|
|
@ -6338,7 +6474,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"\tp.idcard as \"idcard\",\n" +
|
|
|
"\tp.ssc as \"ssc\",\n";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql = sql + "to_char(p.create_time,'YYYY-MM-DD hh24:mi:ss') AS \"createTime\",";
|
|
|
if (flag){
|
|
|
sql = sql + "date_format(p.create_time,'YYYY-MM-DD hh24:mi:ss') AS \"createTime\",";
|
|
|
}else {
|
|
|
sql = sql + "to_char(p.create_time,'YYYY-MM-DD hh24:mi:ss') AS \"createTime\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql = sql + "date_format(p.create_time,'%Y-%m-%d %H:%i:%S' ) AS \"createTime\",";
|
|
|
}
|