|
@ -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'";
|
|
|
}
|
|
@ -3824,7 +3863,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 +3911,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 +3956,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 +4034,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 +4084,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 +4114,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' ";
|
|
|
}
|
|
@ -4853,7 +4920,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 +4991,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 +5035,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 +5060,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 +5104,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 +5363,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 +5375,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 +5801,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 +5814,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 +5878,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 +6128,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 +6141,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 +6472,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\",";
|
|
|
}
|