|
@ -167,6 +167,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
@Value("${demo.flag}")
|
|
|
private boolean demoFlag;
|
|
|
@Value("${wechat.id}")
|
|
|
private String wechatId;
|
|
|
|
|
|
/**
|
|
|
* 获取居民就诊记录接口
|
|
@ -257,82 +259,97 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
*/
|
|
|
public MixEnvelop findReOutpatientList(String patient,Integer status,String startTime,String endTime,Integer page,Integer size){
|
|
|
String totalSql = "SELECT " +
|
|
|
" COUNT(1) AS total " +
|
|
|
" COUNT(1) AS \"total\" " +
|
|
|
" FROM " +
|
|
|
" wlyy_outpatient o " +
|
|
|
" WHERE " +
|
|
|
" o.patient = ? AND o.outpatient_type != '2' ";
|
|
|
List<Object> totalParams = new ArrayList<>();
|
|
|
totalParams.add(patient);
|
|
|
" o.patient =:patient AND o.outpatient_type != '2' ";
|
|
|
Map<String,Object> totalParams = new HashedMap();
|
|
|
totalParams.put("patient",patient);
|
|
|
if(status!=null){
|
|
|
totalSql += " AND o.status =:status ";
|
|
|
totalParams.put("status",status);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(startTime)){
|
|
|
totalSql += " AND o.create_time >=:createTime ";
|
|
|
totalParams.put("createTime",DateUtil.strToDateLong(startTime+" 00:00:00"));
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(endTime)){
|
|
|
totalSql += " AND o.create_time <=:endTime ";
|
|
|
totalParams.put("endTime",DateUtil.strToDateLong(endTime+" 23:59:59"));
|
|
|
|
|
|
}
|
|
|
/* totalParams.add(patient);
|
|
|
if(status!=null){
|
|
|
totalSql += " AND o.status = ? ";
|
|
|
totalParams.add(status);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(startTime)){
|
|
|
totalSql += " AND create_time >= ? ";
|
|
|
totalParams.add(startTime+" 00:00:00");
|
|
|
totalParams.add(DateUtil.strToDateLong(startTime+" 00:00:00"));
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(endTime)){
|
|
|
totalSql += " AND create_time <= ? ";
|
|
|
totalParams.add(endTime+" 23:59:59");
|
|
|
}
|
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql,totalParams.toArray());
|
|
|
totalParams.add(DateUtil.strToDateLong(endTime+" 23:59:59"));
|
|
|
}*/
|
|
|
List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(totalSql,totalParams);
|
|
|
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()) ;
|
|
|
}
|
|
|
String sql ="SELECT " +
|
|
|
" o.id, " +
|
|
|
" o.adm_no AS admNo, " +
|
|
|
" o.origin_adm_no AS originAdmNo, " +
|
|
|
" o.register_no AS registerNo, " +
|
|
|
" o.origin_register_no AS originRegisterNo, " +
|
|
|
" o.origin_con_no AS originConNo," +
|
|
|
" o.con_no AS conNo," +
|
|
|
" o.hospital," +
|
|
|
" o.hospital_name AS hospitalName," +
|
|
|
" o.win_no AS winNo," +
|
|
|
" o.type," +
|
|
|
" o.dept AS dept, " +
|
|
|
" o.dept_name AS deptName, " +
|
|
|
" o.patient AS patient, " +
|
|
|
" o.patient_name AS patientName, " +
|
|
|
" o.doctor AS doctor, " +
|
|
|
" o.doctor_name AS doctorName, " +
|
|
|
" o.idcard AS idcard, " +
|
|
|
" o.card_no AS cardNo," +
|
|
|
" o.mjz AS mjz, " +
|
|
|
" o.icd10 AS icd10, " +
|
|
|
" o.icd10_name AS icd10Name, " +
|
|
|
" o.adm_date AS admDate, " +
|
|
|
" o.con_date AS conDate, " +
|
|
|
" o.description AS description, " +
|
|
|
" o.disease_img AS diseaseImg, " +
|
|
|
" o.create_time AS createTime, " +
|
|
|
" o.`status` AS `status`," +
|
|
|
" o.register_date AS registerDate," +
|
|
|
" o.evaluate_status AS evaluateStatus " +
|
|
|
" o.id AS \"id\", " +
|
|
|
" o.adm_no AS \"admNo\", " +
|
|
|
" o.origin_adm_no AS \"originAdmNo\", " +
|
|
|
" o.register_no AS \"registerNo\", " +
|
|
|
" o.origin_register_no AS \"originRegisterNo\", " +
|
|
|
" o.origin_con_no AS \"originConNo\"," +
|
|
|
" o.con_no AS \"conNo\"," +
|
|
|
" o.hospital AS \"hospital\"," +
|
|
|
" o.hospital_name AS \"hospitalName\"," +
|
|
|
" o.win_no AS \"winNo\"," +
|
|
|
" o.type AS \"type\"," +
|
|
|
" o.dept AS \"dept\", " +
|
|
|
" o.dept_name AS \"deptName\", " +
|
|
|
" o.patient AS \"patient\", " +
|
|
|
" o.patient_name AS \"patientName\", " +
|
|
|
" o.doctor AS \"doctor\", " +
|
|
|
" o.doctor_name AS \"doctorName\", " +
|
|
|
" o.idcard AS \"idcard\", " +
|
|
|
" o.card_no AS \"cardNo\"," +
|
|
|
" o.mjz AS \"mjz\", " +
|
|
|
" o.icd10 AS \"icd10\", " +
|
|
|
" o.icd10_name AS \"icd10Name\", " +
|
|
|
" o.adm_date AS \"admDate\", " +
|
|
|
" o.con_date AS \"conDate\", " +
|
|
|
" o.description AS \"description\", " +
|
|
|
" o.disease_img AS \"diseaseImg\", " +
|
|
|
" o.create_time AS \"createTime\", " +
|
|
|
" o.status AS \"status\"," +
|
|
|
" o.register_date AS \"registerDate\"," +
|
|
|
" o.evaluate_status AS \"evaluateStatus\"" +
|
|
|
" o.pay_status as \"payStatus\" "+
|
|
|
" FROM " +
|
|
|
" wlyy_outpatient o " +
|
|
|
" WHERE " +
|
|
|
" o.patient = ? ";
|
|
|
List<Object> params = new ArrayList<>();
|
|
|
params.add(patient);
|
|
|
" o.patient =:patient ";
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
params.put("patient",patient);
|
|
|
if(status!=null){
|
|
|
sql += " AND o.status = ? ";
|
|
|
params.add(status);
|
|
|
sql += " AND o.status =:status ";
|
|
|
params.put("status",status);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(startTime)){
|
|
|
sql += " AND o.create_time >= ? ";
|
|
|
params.add(startTime+" 00:00:00");
|
|
|
sql += " AND o.create_time >=:createTime ";
|
|
|
params.put("createTime",DateUtil.strToDateLong(startTime+" 00:00:00"));
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(endTime)){
|
|
|
sql += " AND o.create_time <= ? ";
|
|
|
params.add(endTime+" 23:59:59");
|
|
|
sql += " AND o.create_time <=:endTime ";
|
|
|
params.put("endTime",DateUtil.strToDateLong(endTime+" 23:59:59"));
|
|
|
|
|
|
}
|
|
|
sql += " AND o.outpatient_type != '2' ORDER BY o.create_time DESC LIMIT " + (page - 1) * size + "," + size + " ";
|
|
|
List<WlyyOutpatientVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(WlyyOutpatientVO.class),params.toArray());
|
|
|
sql += " AND o.outpatient_type != '2' ORDER BY o.create_time DESC ";
|
|
|
List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params,page,size);
|
|
|
|
|
|
return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, list, page, size, count);
|
|
|
}
|
|
@ -398,14 +415,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
rs.put("expressage",null);
|
|
|
}
|
|
|
|
|
|
//物流配送新
|
|
|
/* //物流配送新
|
|
|
List<WlyyPrescriptionExpressageLogDO> expressageLogDOs = prescriptionExpressageLogDao.queryByOutpatientIdOrderByCreateTimeDesc(outpatientId);
|
|
|
List<WlyyPrescriptionExpressageLogVO> expressageLogVOs = new ArrayList<>();
|
|
|
if(expressageLogDOs!=null&&expressageLogDOs.size()>0){
|
|
|
rs.put("expressageLogs",convertToModels(expressageLogDOs,expressageLogVOs, WlyyPrescriptionExpressageLogVO.class));
|
|
|
}else{
|
|
|
rs.put("expressageLogs",null);
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
//预约记录
|
|
|
List<WlyyPatientRegisterTimeDO> timeDOs = patientRegisterTimeDao.findByOutpatientId(outpatientId);
|
|
@ -452,7 +469,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
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());
|
|
|
}
|
|
|
|
|
|
String sql ="SELECT " +
|
|
@ -692,13 +709,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
//pay_status`:处方结算状态,0为未结算,1为结算成功,默认为0',
|
|
|
String outPatientSql="";
|
|
|
if ("1".equals(status)) {
|
|
|
sql = "UPDATE base.wlyy_prescription p SET p.`status`='13' WHERE p.adm_no='" + admNo + "' AND p.real_order='" + realOrder + "' ";
|
|
|
sql = "UPDATE base.wlyy_prescription p SET p.status='13' WHERE p.adm_no='" + admNo + "' AND p.real_order='" + realOrder + "' ";
|
|
|
WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findByRealOrder(realOrder);
|
|
|
jdbcTemplate.execute(sql);
|
|
|
|
|
|
} else if ("2".equals(status)) {
|
|
|
//开方成功时候,先用处方号获取本地处方状态是否为开方失败,如果是则需要更新本地的处方
|
|
|
sql = "UPDATE base.wlyy_prescription p SET p.`status`='20' WHERE p.adm_no='" + admNo + "' AND p.real_order='" + realOrder + "' ";
|
|
|
sql = "UPDATE base.wlyy_prescription p SET p.status='20' WHERE p.adm_no='" + admNo + "' AND p.real_order='" + realOrder + "' ";
|
|
|
//变更门诊状态
|
|
|
outPatientSql="UPDATE base.wlyy_outpatient p SET p.`status`='2' WHERE p.adm_no='" + admNo + "'";
|
|
|
jdbcTemplate.execute(outPatientSql);
|
|
@ -884,21 +901,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
*/
|
|
|
public List<Map<String,Object>> findDoctorByHospitalAndDept(String orgCode,String dept,String chargeType,String doctorCode,String outpatientType,String startDate,String endDate,String key,String consultStatus){
|
|
|
String sql ="SELECT " +
|
|
|
" d.id, " +
|
|
|
" d.photo, " +
|
|
|
" d.`name`, " +
|
|
|
" d.expertise," +
|
|
|
" d.introduce," +
|
|
|
" d.job_title_code AS jobTitleCode, " +
|
|
|
" d.job_title_name AS jobTitleName," +
|
|
|
" d.charge_type AS chargeType," +
|
|
|
" d.outpatient_type AS outpatientType," +
|
|
|
" d.consult_status AS consultStatus" +
|
|
|
" d.id AS \"id\", " +
|
|
|
" d.photo AS \"photo\", " +
|
|
|
" d.name AS \"name\", " +
|
|
|
" d.expertise AS \"expertise\"," +
|
|
|
" d.introduce AS \"introduce\"," +
|
|
|
" d.job_title_code AS \"jobTitleCode\", " +
|
|
|
" d.job_title_name AS \"jobTitleName\"," +
|
|
|
" d.charge_type AS \"chargeType\"," +
|
|
|
" d.outpatient_type AS \"outpatientType\"," +
|
|
|
" d.consult_status AS \"consultStatus\"" +
|
|
|
" FROM " +
|
|
|
" base_doctor d " +
|
|
|
" JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
|
|
|
" WHERE " +
|
|
|
" 1=1";
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
if (StringUtils.isNotBlank(dept)) {
|
|
|
sql += " AND h.dept_code = '" + dept + "'";
|
|
|
}
|
|
@ -937,14 +955,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
" wlyy_doctor_work_time t " +
|
|
|
" WHERE " +
|
|
|
" t.doctor = d.id " +
|
|
|
" AND t.start_time >='" + startDate + "'" +
|
|
|
" AND t.start_time <='" + endDate + "'" +
|
|
|
" AND t.start_time >=:startDate" +
|
|
|
" AND t.start_time <=:endDate" +
|
|
|
" )";
|
|
|
params.put("startDate",DateUtil.stringToDate(startDate,"yyyy-MM-ss HH:mm:ss"));
|
|
|
params.put("endDate",DateUtil.stringToDate(endDate,"yyyy-MM-ss HH:mm:ss"));
|
|
|
|
|
|
}
|
|
|
|
|
|
logger.info("findDoctorByHospitalAndDept sql:" + sql);
|
|
|
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql,params);
|
|
|
|
|
|
if (list != null && list.size() > 0 && StringUtils.isNotBlank(doctorCode)) {
|
|
|
//排序
|
|
@ -969,12 +990,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
public MixEnvelop findDoctorWithWork(String orgCode, String dept, String chargeType, String doctorCode, String outpatientType, String startDate, String endDate, String key, String consultStatus, Integer page, Integer size) {
|
|
|
|
|
|
String totalSql = "SELECT " +
|
|
|
" count(1) AS total " +
|
|
|
" count(1) AS \"total\" " +
|
|
|
" FROM " +
|
|
|
" base_doctor d " +
|
|
|
" JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
|
|
|
" WHERE " +
|
|
|
" 1=1 ";
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
if (StringUtils.isNotBlank(dept)) {
|
|
|
totalSql += " AND h.dept_code = '" + dept + "'";
|
|
|
}
|
|
@ -1018,30 +1040,32 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
" wlyy_doctor_work_time t " +
|
|
|
" WHERE " +
|
|
|
" t.doctor = d.id " +
|
|
|
" AND t.start_time >='" + startDate + "'" +
|
|
|
" AND t.start_time <='" + endDate + "'" +
|
|
|
" AND t.start_time >=:startDate" +
|
|
|
" AND t.start_time <=:endDate" +
|
|
|
" )";
|
|
|
params.put("startDate",DateUtil.stringToDate(startDate,"yyyy-MM-ss HH:mm:ss"));
|
|
|
params.put("endDate",DateUtil.stringToDate(endDate,"yyyy-MM-ss HH:mm:ss"));
|
|
|
}
|
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
|
|
|
List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(totalSql,params);
|
|
|
|
|
|
Long count = 0L;
|
|
|
if (rstotal != null && rstotal.size() > 0) {
|
|
|
count = (Long) rstotal.get(0).get("total");
|
|
|
count = hibenateUtils.objTransformLong(rstotal.get(0).get("total"));
|
|
|
}
|
|
|
|
|
|
String sql = "SELECT " +
|
|
|
" d.id, " +
|
|
|
" d.photo, " +
|
|
|
" d.`name`, " +
|
|
|
" d.expertise," +
|
|
|
" d.introduce," +
|
|
|
" d.job_title_code AS jobTitleCode, " +
|
|
|
" d.job_title_name AS jobTitleName," +
|
|
|
" d.charge_type AS chargeType," +
|
|
|
" h.dept_code AS deptCode," +
|
|
|
" h.dept_Name AS deptName," +
|
|
|
" d.outpatient_type AS outpatientType," +
|
|
|
" d.consult_status AS consultStatus" +
|
|
|
" d.id AS \"id\", " +
|
|
|
" d.photo AS \"photo\", " +
|
|
|
" d.name AS \"name\", " +
|
|
|
" d.expertise AS \"expertise\"," +
|
|
|
" d.introduce AS \"introduce\"," +
|
|
|
" d.job_title_code AS \"jobTitleCode\", " +
|
|
|
" d.job_title_name AS \"jobTitleName\"," +
|
|
|
" d.charge_type AS \"chargeType\"," +
|
|
|
" h.dept_code AS \"deptCode\"," +
|
|
|
" h.dept_Name AS \"deptName\"," +
|
|
|
" d.outpatient_type AS \"outpatientType\"," +
|
|
|
" d.consult_status AS \"consultStatus\"" +
|
|
|
" FROM " +
|
|
|
" base_doctor d " +
|
|
|
" JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
|
|
@ -1093,13 +1117,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
" wlyy_doctor_work_time t " +
|
|
|
" WHERE " +
|
|
|
" t.doctor = d.id " +
|
|
|
" AND t.start_time >='" + startDate + "'" +
|
|
|
" AND t.start_time <='" + endDate + "'" +
|
|
|
" AND t.start_time >= :startDate" +
|
|
|
" AND t.start_time <= :endDate" +
|
|
|
" )";
|
|
|
}
|
|
|
sql += " AND d.del='1' AND d.outpatient_type is not null LIMIT " + (page - 1) * size + "," + size + "";
|
|
|
sql += " AND d.del='1' AND d.outpatient_type is not null ";
|
|
|
logger.info("withwork sql:" +sql);
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql,params,page,size);
|
|
|
if (list != null && list.size() > 0) {
|
|
|
//获取排班
|
|
|
for (Map<String, Object> doctor : list) {
|
|
@ -1170,7 +1194,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
public MixEnvelop findDoctorWithMouthWork(String orgCode, String dept, String chargeType, String date, String nameKey,String iswork, Integer page, Integer size) {
|
|
|
|
|
|
String totalSql = "SELECT " +
|
|
|
" count(1) AS total " +
|
|
|
" count(1) AS \"total\" " +
|
|
|
" FROM " +
|
|
|
" base_doctor d " +
|
|
|
" JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
|
|
@ -1204,7 +1228,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
" FROM " +
|
|
|
" wlyy_doctor_work_time t " +
|
|
|
" WHERE " +
|
|
|
" t.date LIKE '%"+date+"%' " +
|
|
|
" t.work_date LIKE '%"+date+"%' " +
|
|
|
" )";
|
|
|
}else{
|
|
|
totalSql +=" AND d.id NOT IN ( " +
|
|
@ -1213,29 +1237,29 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
" FROM " +
|
|
|
" wlyy_doctor_work_time t " +
|
|
|
" WHERE " +
|
|
|
" t.date LIKE '%"+date+"%' " +
|
|
|
" t.work_date LIKE '%"+date+"%' " +
|
|
|
" )";
|
|
|
}
|
|
|
|
|
|
}
|
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
|
|
|
List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(totalSql);
|
|
|
|
|
|
Long count = 0L;
|
|
|
if (rstotal != null && rstotal.size() > 0) {
|
|
|
count = (Long) rstotal.get(0).get("total");
|
|
|
count = hibenateUtils.objTransformLong(rstotal.get(0).get("total"));
|
|
|
}
|
|
|
|
|
|
String sql = "SELECT " +
|
|
|
" d.id, " +
|
|
|
" d.photo, " +
|
|
|
" d.`name`, " +
|
|
|
" d.expertise," +
|
|
|
" d.introduce," +
|
|
|
" d.job_title_code AS jobTitleCode, " +
|
|
|
" d.job_title_name AS jobTitleName," +
|
|
|
" d.charge_type AS chargeType," +
|
|
|
" h.dept_code AS deptCode," +
|
|
|
" h.dept_Name AS deptName" +
|
|
|
" d.id AS \"id\", " +
|
|
|
" d.photo AS \"photo\", " +
|
|
|
" d.name AS \"name\", " +
|
|
|
" d.expertise AS \"expertise\"," +
|
|
|
" d.introduce AS \"introduce\"," +
|
|
|
" d.job_title_code AS \"jobTitleCode\", " +
|
|
|
" d.job_title_name AS \"jobTitleName\"," +
|
|
|
" d.charge_type AS \"chargeType\"," +
|
|
|
" h.dept_code AS \"deptCode\"," +
|
|
|
" h.dept_Name AS \"deptName\"" +
|
|
|
" FROM " +
|
|
|
" base_doctor d " +
|
|
|
" JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
|
|
@ -1268,7 +1292,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
" FROM " +
|
|
|
" wlyy_doctor_work_time t " +
|
|
|
" WHERE " +
|
|
|
" t.date LIKE '%"+date+"%' " +
|
|
|
" t.work_date LIKE '%"+date+"%' " +
|
|
|
" )";
|
|
|
}else{
|
|
|
sql +=" AND d.id NOT IN ( " +
|
|
@ -1277,13 +1301,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
" FROM " +
|
|
|
" wlyy_doctor_work_time t " +
|
|
|
" WHERE " +
|
|
|
" t.date LIKE '%"+date+"%' " +
|
|
|
" t.work_date LIKE '%"+date+"%' " +
|
|
|
" )";
|
|
|
}
|
|
|
|
|
|
}
|
|
|
sql += " LIMIT " + (page - 1) * size + "," + size + "";
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql,page,size);
|
|
|
if (list != null && list.size() > 0) {
|
|
|
//获取排班
|
|
|
for (Map<String, Object> doctor : list) {
|
|
@ -2736,11 +2760,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
//医生角色
|
|
|
String sql = "SELECT " +
|
|
|
" t. CODE AS roleCode, " +
|
|
|
" t. NAME AS roleName" +
|
|
|
" t. CODE AS \"roleCode\", " +
|
|
|
" t. NAME AS \"roleName\"" +
|
|
|
" FROM " +
|
|
|
" base_doctor_role r " +
|
|
|
" JOIN base_doctor_role_dict t ON t.`code` = r.role_code " +
|
|
|
" JOIN base_doctor_role_dict t ON t.code = r.role_code " +
|
|
|
" WHERE " +
|
|
|
" r.doctor_code = '"+doctor+"'";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
@ -2772,7 +2796,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
|
|
|
//专家咨询
|
|
|
String zjCountsql = "SELECT id FROM wlyy_consult_team WHERE doctor='"+doctor+"' AND (type=1 OR type=15)";
|
|
|
String zjCountsql = "SELECT id AS \"id\" FROM wlyy_consult_team WHERE doctor='"+doctor+"' AND (type=1 OR type=15)";
|
|
|
List<Map<String,Object>> zjList = jdbcTemplate.queryForList(zjCountsql);
|
|
|
|
|
|
if(zjList!=null&&zjList.size()>0){
|
|
@ -2783,8 +2807,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
//查询医生各项评价平均分
|
|
|
String sqlscore = "SELECT " +
|
|
|
"AVG(a.score) AS score," +
|
|
|
"a.score_type AS score_type " +
|
|
|
"AVG(a.score) AS \"score\"," +
|
|
|
"a.score_type AS \"score_type\" " +
|
|
|
"FROM base_evaluate a,base_evaluate_score b " +
|
|
|
"WHERE " +
|
|
|
"a.relation_code=b.id " +
|
|
@ -2796,7 +2820,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
if(listscore!=null&&listscore.size()>0){
|
|
|
for(Map<String,Object> _listscore :listscore){
|
|
|
doctorScore += (Double)_listscore.get("score");
|
|
|
doctorScore += Double.parseDouble(_listscore.get("score").toString());
|
|
|
}
|
|
|
}
|
|
|
doctorScore = doctorScore/3;
|
|
@ -2810,16 +2834,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
//查询评价明细
|
|
|
String sqlScoreList = "SELECT " +
|
|
|
"a.score as score," +
|
|
|
"b.score as doctorscore," +
|
|
|
"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\"," +
|
|
|
"b.score as \"doctorscore\"," +
|
|
|
"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 " +
|
|
|
"base_evaluate a " +
|
|
|
"LEFT JOIN base_evaluate_score b ON b.id=a.relation_code " +
|
|
@ -3056,20 +3080,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
public List<Map<String,Object>> findWaitingRoomOutpatientByDoctor(String doctor, Integer type,Integer query_status,String dept) {
|
|
|
|
|
|
String sql ="SELECT " +
|
|
|
"room.outpatient_id AS id," +
|
|
|
"room.patient_id AS patient_id," +
|
|
|
"room.patient_name AS name," +
|
|
|
"patient.sex AS sex," +
|
|
|
"patient.idcard AS idcard," +
|
|
|
"patient.photo AS photo," +
|
|
|
"outpatient.mobile AS mobile," +
|
|
|
"patient.birthday AS birthday," +
|
|
|
"room.consult_type AS consult_type," +
|
|
|
"date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS timedate_format," +
|
|
|
"outpatient.disease_img AS disease_img," +
|
|
|
"outpatient.description AS description," +
|
|
|
"room.reservation_type AS reservation_type," +
|
|
|
"outpatient.origin_con_no AS origin_con_no " +
|
|
|
"room.outpatient_id AS \"id\"," +
|
|
|
"room.patient_id AS \"patient_id\"," +
|
|
|
"room.patient_name AS \"name\"," +
|
|
|
"patient.sex AS \"sex\"," +
|
|
|
"patient.idcard AS \"idcard\"," +
|
|
|
"patient.photo AS \"photo\"," +
|
|
|
"outpatient.mobile AS \"mobile\"," +
|
|
|
"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\"," ;
|
|
|
}else{
|
|
|
sql += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS timedate_format," ;
|
|
|
}
|
|
|
sql += "outpatient.disease_img AS \"disease_img\"," +
|
|
|
"outpatient.description AS \"description\"," +
|
|
|
"room.reservation_type AS \"reservation_type\"," +
|
|
|
"outpatient.origin_con_no AS \"origin_con_no\" " +
|
|
|
"FROM " +
|
|
|
"wlyy_hospital_waiting_room room," +
|
|
|
"base_patient patient," +
|
|
@ -3210,7 +3238,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"room.doctor AS doctor, " +
|
|
|
"room.doctor_name AS doctorName " +
|
|
|
"FROM wlyy_outpatient op,wlyy_hospital_waiting_room room " +
|
|
|
"WHERE op.`status`=0 AND room.outpatient_id=op.id AND room.consult_type=2 " +
|
|
|
"WHERE op.status=0 AND room.outpatient_id=op.id AND room.consult_type=2 " +
|
|
|
"AND room.doctor IS NOT NULL ";
|
|
|
if(StringUtils.isNoneBlank(dept)){
|
|
|
waitingSql = waitingSql + " and op.dept = '"+dept+"' ";
|
|
@ -3392,30 +3420,30 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
String jobTitleNameKey, String outpatientType,
|
|
|
String keyName, String workingTime, String consultStatus,String chargType,String consutlSort,Integer page,Integer pagesize) {
|
|
|
|
|
|
if(page >=1){
|
|
|
/* if(page >=1){
|
|
|
page --;
|
|
|
}
|
|
|
|
|
|
|
|
|
if (pagesize <= 0) {
|
|
|
pagesize = 10;
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
String sql ="SELECT " +
|
|
|
" d.id, " +
|
|
|
" d.photo, " +
|
|
|
" d.`name`, " +
|
|
|
" d.expertise," +
|
|
|
" d.introduce," +
|
|
|
" d.job_title_code AS jobTitleCode, " +
|
|
|
" d.job_title_name AS jobTitleName," +
|
|
|
" d.charge_type AS chargeType," +
|
|
|
" h.dept_name AS deptName," +
|
|
|
" d.consult_status AS consultStatus," +
|
|
|
" d.outpatient_type AS outpatientType," +
|
|
|
" a.total as consultTotal," +
|
|
|
" h.org_name as orgName," +
|
|
|
" follow.patient as followid," +
|
|
|
" h.org_code as orgCode" +
|
|
|
" d.id AS \"id\", " +
|
|
|
" d.photo AS \"photo\", " +
|
|
|
" d.name AS \"name\", " +
|
|
|
" d.expertise AS \"expertise\"," +
|
|
|
" d.introduce AS \"introduce\"," +
|
|
|
" d.job_title_code AS \"jobTitleCode\", " +
|
|
|
" d.job_title_name AS \"jobTitleName\"," +
|
|
|
" d.charge_type AS \"chargeType\"," +
|
|
|
" h.dept_name AS \"deptName\"," +
|
|
|
" d.consult_status AS \"consultStatus\"," +
|
|
|
" d.outpatient_type AS \"outpatientType\"," +
|
|
|
" a.total AS \"consultTotal\"," +
|
|
|
" h.org_name AS \"orgName\"," +
|
|
|
" follow.patient AS \"followid\"," +
|
|
|
" h.org_code AS \"orgCode\"" +
|
|
|
" FROM " +
|
|
|
" base_doctor d " +
|
|
|
" JOIN base_doctor_hospital h ON h.doctor_code = d.id "+
|
|
@ -3427,6 +3455,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
|
|
|
sql += " WHERE 1=1 ";
|
|
|
|
|
|
Map<String, Object> params = new HashedMap();
|
|
|
|
|
|
if(StringUtils.isBlank(chargType)){
|
|
|
sql +=" AND d.charge_type is not null ";
|
|
|
}
|
|
@ -3434,13 +3465,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if("all".equals(chargType)){
|
|
|
//不过滤
|
|
|
}else{
|
|
|
sql+=" AND d.charge_type = '"+chargType+"'";
|
|
|
sql+=" AND d.charge_type = :chargType";
|
|
|
params.put("chargType",chargType);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotBlank(iswork)&&"1".equals(iswork)){
|
|
|
logger.info("iswork:"+iswork);
|
|
|
String date = DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss");
|
|
|
Date date = new Date();
|
|
|
sql+=" AND (" +
|
|
|
" EXISTS ( " +
|
|
|
" SELECT " +
|
|
@ -3449,28 +3481,36 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
" wlyy_doctor_work_time t " +
|
|
|
" WHERE " +
|
|
|
" t.doctor = d.id " +
|
|
|
" AND t.start_time <='" +date+"'" +
|
|
|
" AND t.end_time >='"+date+"'"+
|
|
|
" AND t.start_time <=:startTime" +
|
|
|
" AND t.end_time >=:endTime"+
|
|
|
" ) OR " +
|
|
|
" d.consult_status = '1') ";
|
|
|
params.put("startTime",date);
|
|
|
params.put("endTime",date);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(orgCode)){
|
|
|
sql += " AND h.org_code = '"+orgCode+"'";
|
|
|
sql += " AND h.org_code = :orgCode";
|
|
|
params.put("orgCode",orgCode);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(diseaseKey)){
|
|
|
sql+=" AND d.expertise like '%"+diseaseKey+"%'";
|
|
|
sql+=" AND d.expertise like :diseaseKey";
|
|
|
params.put("diseaseKey","%"+diseaseKey+"%");
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotBlank(doctorNameKey)){
|
|
|
sql+=" AND d.name like '%"+doctorNameKey+"%'";
|
|
|
sql+=" AND d.name like :doctorNameKey";
|
|
|
params.put("doctorNameKey","%"+doctorNameKey+"%");
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotBlank(dept)){
|
|
|
sql+=" AND h.dept_code = '"+dept+"' ";
|
|
|
sql+=" AND h.dept_code = :dept ";
|
|
|
params.put("dept",dept);
|
|
|
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotBlank(jobTitleNameKey)){
|
|
|
sql+=" AND d.job_title_name = '"+jobTitleNameKey+"' ";
|
|
|
sql+=" AND d.job_title_name = :jobTitleNameKey ";
|
|
|
params.put("jobTitleNameKey",jobTitleNameKey);
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotBlank(outpatientType)){
|
|
@ -3497,17 +3537,21 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotBlank(workingTime)){
|
|
|
sql+=" AND wk.date = '"+workingTime+"' ";
|
|
|
sql+=" AND wk.date = :workingTime ";
|
|
|
params.put("workingTime",workingTime);
|
|
|
}
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(consultStatus)){
|
|
|
sql+=" AND d.consult_status = '"+consultStatus+"' ";
|
|
|
sql+=" AND d.consult_status = :consultStatus ";
|
|
|
params.put("consultStatus",consultStatus);
|
|
|
|
|
|
}
|
|
|
|
|
|
sql += " and d.del='1' order by a.total "+ consutlSort +" limit "+page * pagesize +","+pagesize;
|
|
|
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
sql += " and d.del='1' order by a.total "+ consutlSort;
|
|
|
|
|
|
List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params,page,pagesize);
|
|
|
|
|
|
logger.info("findDoctorByHospitalAndDiseaseAndDept end:"+DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));
|
|
|
logger.info("sql:"+sql);
|
|
|
|
|
@ -3520,7 +3564,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String,Object>> findHotDeptAndDiseaseDict(String dictName) {
|
|
|
String sql ="SELECT * from wlyy_hospital_sys_dict where dict_name='"+dictName+"' ORDER BY sort ASC;";
|
|
|
String sql ="SELECT * from wlyy_hospital_sys_dict where dict_name='"+dictName+"' ORDER BY sort ASC";
|
|
|
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
|
@ -3571,10 +3615,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if("1".equals(type)){
|
|
|
String sql ="SELECT " +
|
|
|
" DISTINCT " +
|
|
|
" d.id, " +
|
|
|
" d.`name`, " +
|
|
|
" h.org_code, " +
|
|
|
" h.org_name " +
|
|
|
" d.id AS \"id\", " +
|
|
|
" d.name AS \"name\", " +
|
|
|
" h.org_code AS \"org_code\", " +
|
|
|
" h.org_name AS \"org_name\"" +
|
|
|
" FROM " +
|
|
|
" base_doctor d " +
|
|
|
" JOIN base_doctor_hospital h ON d.id= h.doctor_code " +
|
|
@ -3588,10 +3632,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
String sql ="SELECT " +
|
|
|
" DISTINCT " +
|
|
|
" d.id, " +
|
|
|
" d.`name`, " +
|
|
|
" h.org_code, " +
|
|
|
" h.org_name " +
|
|
|
" d.id AS \"id\", " +
|
|
|
" d.name AS \"name\", " +
|
|
|
" h.org_code AS \"org_code\", " +
|
|
|
" h.org_name AS \"org_name\"" +
|
|
|
" FROM " +
|
|
|
" base_doctor d " +
|
|
|
" JOIN base_doctor_hospital h ON d.id= h.doctor_code " +
|
|
@ -3604,10 +3648,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}else if("3".equals(type)){
|
|
|
String sql ="SELECT " +
|
|
|
" DISTINCT " +
|
|
|
" d.id, " +
|
|
|
" d.`name`, " +
|
|
|
" h.org_code, " +
|
|
|
" h.org_name " +
|
|
|
" d.id AS \"id\", " +
|
|
|
" d.name AS \"name\", " +
|
|
|
" h.org_code AS \"org_code\", " +
|
|
|
" h.org_name AS \"org_name\"" +
|
|
|
" FROM " +
|
|
|
" base_doctor d " +
|
|
|
" JOIN base_doctor_hospital h ON d.id= h.doctor_code " +
|
|
@ -4104,7 +4148,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
Long waitVideoCount = 0l;
|
|
|
if (rstotal != null && rstotal.size() > 0) {
|
|
|
waitVideoCount = (Long) rstotal.get(0).get("total");
|
|
|
waitVideoCount = Long.parseLong(rstotal.get(0).get("total").toString());
|
|
|
}
|
|
|
|
|
|
return waitVideoCount;
|
|
@ -4583,7 +4627,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
Long totalsqlAll = 0l;
|
|
|
if (alltotal != null && alltotal.size() > 0) {
|
|
|
totalsqlAll = (Long) alltotal.get(0).get("total");
|
|
|
totalsqlAll = Long.parseLong(alltotal.get(0).get("total").toString());
|
|
|
}
|
|
|
|
|
|
object.put("all",totalsqlAll);
|
|
@ -4602,7 +4646,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
Long twCount = 0l;
|
|
|
if (imgtotal != null && imgtotal.size() > 0) {
|
|
|
twCount = (Long) imgtotal.get(0).get("total");
|
|
|
twCount = Long.parseLong(imgtotal.get(0).get("total").toString());
|
|
|
}
|
|
|
|
|
|
object.put("twCount",twCount);
|
|
@ -4621,7 +4665,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
Long spcount = 0l;
|
|
|
if (sptotal != null && sptotal.size() > 0) {
|
|
|
spcount = (Long) sptotal.get(0).get("total");
|
|
|
spcount = Long.parseLong(sptotal.get(0).get("total").toString());
|
|
|
}
|
|
|
|
|
|
object.put("spCount",spcount);
|
|
@ -4641,7 +4685,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
Long xtcount = 0l;
|
|
|
if (xttotal != null && xttotal.size() > 0) {
|
|
|
xtcount = (Long) xttotal.get(0).get("total");
|
|
|
xtcount = Long.parseLong(xttotal.get(0).get("total").toString());
|
|
|
}
|
|
|
|
|
|
object.put("xtCount",xtcount);
|
|
@ -4806,6 +4850,63 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
return entranceService.BS10008(idcard,patientId,admitNum,ybcard,demoFlag);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查找未配送处方订单
|
|
|
*/
|
|
|
public List<WlyyPrescriptionVO> findUndeliveredList(){
|
|
|
String sql ="SELECT " +
|
|
|
" p.id AS \"id\", " +
|
|
|
" p.real_order AS \"realOrder\"," +
|
|
|
" p.origin_real_order AS \"originRealOrder\"," +
|
|
|
" p.adm_no AS \"admNo\"," +
|
|
|
" p.origin_adm_no AS \"originAdmNo\"," +
|
|
|
" p.serial_no AS \"serialNo\"," +
|
|
|
" p.type AS \"type\", " +
|
|
|
" p.patient_code AS \"patientCode\", " +
|
|
|
" p.patient_name AS \"patientName\", " +
|
|
|
" p.ssc AS \"ssc\", " +
|
|
|
" p.doctor AS \"doctor\", " +
|
|
|
" p.doctor_name AS \"doctorName\", " +
|
|
|
" p.status AS \"status\", " +
|
|
|
" p.mk_fail_reason AS \"mkFailReason\", " +
|
|
|
" p.mk_time AS \"mk_time\", " +
|
|
|
" p.prescribe_reason AS \"prescribeReason\", " +
|
|
|
" p.prescribe_time AS \"prescribeTime\", " +
|
|
|
" p.pay_time AS \"payTime\", " +
|
|
|
" p.dosage_time AS \"dosageTime\", " +
|
|
|
" p.finish_time AS \"finishTime\", " +
|
|
|
" p.create_time AS \"createTime\", " +
|
|
|
" p.dept AS \"dept\", " +
|
|
|
" p.dept_name AS \"deptName\", " +
|
|
|
" p.hospital AS \"hospital\", " +
|
|
|
" p.hospital_name AS \"hospitalName\", " +
|
|
|
" p.consult AS \"consult\", " +
|
|
|
" p.dispensary_type AS \"dispensaryType\", " +
|
|
|
" p.reason AS \"reason\", " +
|
|
|
" p.remark AS \"remark\", " +
|
|
|
" p.cancel_reason AS \"cancelReason\", " +
|
|
|
" p.ca_cert_data AS \"caCertData\", " +
|
|
|
" p.ca_message AS \"caMessage\", " +
|
|
|
" p.digital_sign_no AS \"digitalSignNo\", " +
|
|
|
" p.original_data_abstract AS \"originalDataAbstract\", " +
|
|
|
" p.str_original_data AS \"strOriginalData\", " +
|
|
|
" p.his_dept_code AS \"hisDeptCode\", " +
|
|
|
" p.his_doctor_code AS \"hisDoctorCode\", " +
|
|
|
" p.his_gister_type_code AS \"hisGisterTypeCode\", " +
|
|
|
" p.his_rate_type_code AS \"hisRateTypeCode\", " +
|
|
|
" p.his_hospital AS \"hisHospital\", " +
|
|
|
" p.his_register_fee AS \"hisRegisterFee\", " +
|
|
|
" p.pay_status AS \"payStatus\" " +
|
|
|
" FROM " +
|
|
|
" wlyy_prescription p " +
|
|
|
" WHERE status = 60 or status = 50 ";
|
|
|
List<WlyyPrescriptionVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(WlyyPrescriptionVO.class));
|
|
|
if(list!=null){
|
|
|
return list;
|
|
|
}
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取医生信息
|
|
|
* @param hospital
|
|
@ -4815,7 +4916,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
public List<Map<String,Object>> findDoctorByName(String hospital, String name,String chargeType){
|
|
|
String sql ="SELECT " +
|
|
|
" d.id AS \"id\", " +
|
|
|
" d.`name` AS \"name\"" +
|
|
|
" d.name AS \"name\"" +
|
|
|
" FROM " +
|
|
|
" base_doctor d ";
|
|
|
if(StringUtils.isNotBlank(hospital)){
|
|
@ -4873,19 +4974,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
public List<Map<String,Object>> findDeptByKeyWord(String keyWord,Integer page,Integer pagesize) {
|
|
|
|
|
|
if(page >=1){
|
|
|
page --;
|
|
|
}
|
|
|
|
|
|
if (pagesize <= 0) {
|
|
|
pagesize = 10;
|
|
|
}
|
|
|
|
|
|
String sql ="SELECT " +
|
|
|
"dept.`code` AS deptCode," +
|
|
|
"dept.`name` AS deptName," +
|
|
|
"org.CODE AS orgCode, " +
|
|
|
"org.NAME AS orgName " +
|
|
|
"dept.code AS \"deptCode\"," +
|
|
|
"dept.name AS \"deptName\"," +
|
|
|
"org.CODE AS \"orgCode\", " +
|
|
|
"org.NAME AS \"orgName\" " +
|
|
|
"FROM " +
|
|
|
"dict_hospital_dept dept," +
|
|
|
"base_org org " +
|
|
@ -4895,9 +4988,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if(StringUtils.isNoneBlank(keyWord)){
|
|
|
sql = sql + "AND dept.NAME LIKE '%"+keyWord+"%' ";
|
|
|
}
|
|
|
sql = sql + " limit "+page * pagesize +","+pagesize ;
|
|
|
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pagesize);
|
|
|
logger.info("sql:"+sql);
|
|
|
return list;
|
|
|
}
|