Trick 5 роки тому
батько
коміт
92f522bf48

+ 10 - 1
business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorDao.java

@ -2,8 +2,10 @@ package com.yihu.jw.doctor.dao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@ -19,10 +21,17 @@ import java.util.List;
 * </pre>
 * @since 1.
 */
@Transactional
public interface BaseDoctorDao extends PagingAndSortingRepository<BaseDoctorDO, String>, JpaSpecificationExecutor<BaseDoctorDO>  {
    @Query("from BaseDoctorDO d where d.id = ?1 AND d.del ='1'")
    BaseDoctorDO findById(String id);
    @Modifying
    @Query("update BaseDoctorDO p set p.introduce = ?2,p.expertise = ?3,p.photo = ?4,p.outpatientType = ?5 where p.id = ?1")
    void update(String doctorId,String introduce,String expertise,String photo,String outpatientType);
    @Modifying
    @Query("update BaseDoctorDO p set p.del = ?2 where p.id = ?1")
    void updateStatus(String doctorId,String status);
}

+ 26 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/dao/DoctorSpecialDiseaseDao.java

@ -0,0 +1,26 @@
package com.yihu.jw.doctor.dao;
import com.yihu.jw.entity.base.doctor.DoctorSpecialDiseaseDo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
 * @author zmk
 * @vsrsion 1.0
 * Created at 2019/12/10
 */
@Transactional
public interface DoctorSpecialDiseaseDao extends PagingAndSortingRepository<DoctorSpecialDiseaseDo, Integer>, JpaSpecificationExecutor<DoctorSpecialDiseaseDo> {
    List<DoctorSpecialDiseaseDo> findByDoctorCode(String doctorCode);
    @Modifying
    @Query("delete from DoctorSpecialDiseaseDo p where p.doctorCode=?1")
    void deleteByDoctorCode(String doctorCode);
}

+ 228 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorService.java

@ -0,0 +1,228 @@
package com.yihu.jw.doctor.service;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.DoctorSpecialDiseaseDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorVo;
import com.yihu.jw.entity.base.doctor.DoctorSpecialDiseaseDo;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import net.sf.json.JSONObject;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDao> {
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private DoctorSpecialDiseaseDao specialDiseaseDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private HibenateUtils hibenateUtils;
    /**
     * 查询医生信息分页列表
     * @param city
     * @param hospital
     * @param status
     * @param name
     * @param page
     * @param pageSize
     */
    public Envelop queryList(String city, String hospital, String status, String name, int page, int pageSize){
        Map<String,Object> params = new HashedMap();
        String sqlTotal ="SELECT " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " base_doctor a " +
                " JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
                " JOIN wlyy_charge_dict e ON a.charge_type = e.charge_type " +
                " WHERE " +
                " 1 = 1";
        if (StringUtils.isNotBlank(city)){
            sqlTotal += " AND a.city_name =:city";
            params.put("city",city);
        }
        if (StringUtils.isNotBlank(hospital)){
            sqlTotal += " AND b.org_code =:hospital";
            params.put("hospital",hospital);
        }
        if (StringUtils.isNotBlank(status)){
            sqlTotal += " AND a.del =:status";
            params.put("status",status);
        }
        if (StringUtils.isNotBlank(name)){
            name = name+"%";
            sqlTotal += " AND b.dept_name like:name";
            params.put("name",name);
        }
        sqlTotal += " AND e.dept_type_code =:typeCode";
        params.put("typeCode",6);
        Long count = 0L;
        List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlTotal,params);
        if(count!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            count = hibenateUtils.objTransformLong(total.get(0).get("total"));
        }
        String sql ="SELECT " +
                " a.id AS \"id\", " +
                " a.NAME AS \"name\", " +
                " a.introduce AS \"introduce\", " +
                " a.expertise AS \"expertise\", " +
                " a.outpatient_type AS \"outpatientType\", " +
                " a.del AS \"del\", " +
                " b.dept_name AS \"deptName\", " +
                " e.req_fee AS \"money\" " +
                " FROM " +
                " base_doctor a " +
                " JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
                " JOIN wlyy_charge_dict e ON a.charge_type = e.charge_type " +
                " WHERE 1=1";
        if (StringUtils.isNotBlank(city)){
            sql += " AND a.city_name =:city";
        }
        if (StringUtils.isNotBlank(hospital)){
            sql += " AND b.org_code =:hospital";
        }
        if (StringUtils.isNotBlank(status)){
            sql += " AND a.del =:status";
        }
        if (StringUtils.isNotBlank(name)){
            sql += " AND b.dept_name like:name";
        }
        sql += " AND e.dept_type_code =:typeCode";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params,page,pageSize);
        return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, list, page, pageSize, count);
    }
    /**
     * 根据医生ID,获取医生基础信息
     * @param doctorId
     * @return
     */
    public Object queryById(String doctorId) {
        Map<String,Object> params = new HashedMap();
        String sql ="SELECT " +
                " a.NAME AS \"name\", " +
                " a.job_title_name AS \"jobTitleName\", " +
                " a.introduce AS \"introduce\", " +
                " a.expertise AS \"expertise\", " +
                " a.photo AS \"photo\", " +
                " a.outpatient_type AS \"outpatientType\", " +
                " b.dept_name AS \"deptName\", " +
                " b.org_name AS \"orgName\", " +
                " c.mapping_code AS \"jobNumber\", " +
                " d.disease_name AS \"diseaseName\", " +
                " d.disease_code AS \"diseaseCode\", " +
                " e.req_fee AS \"money\" " +
                " FROM " +
                " base_doctor a " +
                " JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
                " JOIN base_doctor_mapping c ON a.id = c.doctor " +
                " JOIN wlyy_doctor_special_disease d ON a.id = d.doctor_code " +
                " JOIN wlyy_charge_dict e ON a.charge_type = e.charge_type " +
                " WHERE 1=1 ";
        if(StringUtils.isNotBlank(doctorId)){
            sql+=" AND a.id =:id";
            params.put("id",doctorId);
        }
        sql+=" AND e.dept_type_code =:typeCode";
        params.put("typeCode",6);
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params);
        StringBuilder disease = new StringBuilder();
        StringBuilder code = new StringBuilder();
        if (null != list && list.size() > 0){
            for (int i=0;i<list.size();i++){
                if (i == 0 ){
                    disease.append(list.get(i).get("diseaseName"));
                    code.append(list.get(i).get("diseaseCode"));
                }else {
                    disease.append(","+list.get(i).get("diseaseName"));
                    code.append(","+list.get(i).get("diseaseCode"));
                }
            }
            list.get(0).put("diseaseName",disease);
            list.get(0).put("diseaseCode",code);
        }
        return  list.get(0);
    }
    /**
     * 修改医生服务配置
     * @param jsonObject
     */
    public Boolean update(JSONObject jsonObject)throws Exception{
        //取出数据
        String doctorId = jsonObject.get("doctorId").toString();
        String introduce = jsonObject.get("introduce").toString();
        String expertise = jsonObject.get("expertise").toString();
        String photo = jsonObject.get("photo").toString();
        String outpatientType = jsonObject.get("outpatientType").toString();
        String newSpecialDisease = jsonObject.get("specialDisease").toString();
        String newSpecialDiseaseCode = jsonObject.get("specialDiseaseCode").toString();
        //医生简介、擅长不为空
        if (null == introduce || null == expertise){
            return false;
        }
        baseDoctorDao.update(doctorId,introduce,expertise,photo,outpatientType);
        //删除医生旧专病门诊,保存新专病门诊
        //List<DoctorSpecialDiseaseDo> oldSpecialDisease = specialDiseaseDao.findByDoctorCode(doctorId);
        Map<String,Object> params = new HashedMap();
        String sqlTotal ="SELECT " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " wlyy_doctor_special_disease a " +
                " WHERE " +
                " 1 = 1";
        sqlTotal += " AND a.doctor_code =:doctorId";
        params.put("doctorId",doctorId);
        Long count = 0L;
        List<Map<String, Object>> total = hibenateUtils.createSQLQuery(sqlTotal, params);
        //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
        count = hibenateUtils.objTransformLong(total.get(0).get("total"));
        if (count > 0){
            specialDiseaseDao.deleteByDoctorCode(doctorId);
        }
        String[] split = newSpecialDisease.split(",");
        String[] splitCode = newSpecialDiseaseCode.split(",");
        for (int i=0;i<split.length;i++ ){
            DoctorSpecialDiseaseDo specialDiseaseDo = new DoctorSpecialDiseaseDo();
            specialDiseaseDo.setDoctorCode(doctorId);
            specialDiseaseDo.setDiseaseName(split[i]);
            specialDiseaseDo.setDiseaseCode(splitCode[i]);
            specialDiseaseDao.save(specialDiseaseDo);
        }
        return true;
    }
    /**
     * 修改医生状态
     * @param doctorId
     * @param status
     */
    public void updateStatus(String doctorId,String status)throws Exception{
        baseDoctorDao.updateStatus(doctorId,status);
    }
}

+ 15 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/service/DoctorSpecialDiseaseService.java

@ -0,0 +1,15 @@
package com.yihu.jw.doctor.service;
import com.yihu.jw.doctor.dao.DoctorSpecialDiseaseDao;
import com.yihu.jw.entity.base.doctor.DoctorSpecialDiseaseDo;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * @author zmk
 * @vsrsion 1.0
 * Created at 2019/12/10
 */
@Service
public class DoctorSpecialDiseaseService extends BaseJpaService<DoctorSpecialDiseaseDo, DoctorSpecialDiseaseDao> {
}

+ 11 - 6
business/base-service/src/main/java/com/yihu/jw/evaluate/score/service/BaseEvaluateScoreService.java

@ -111,12 +111,12 @@ public class BaseEvaluateScoreService extends BaseJpaService<BaseEvaluateScoreDO
     * @param nowScore
     * @param oldScore
     */
    private Object judgeScore(Double nowScore, Double oldScore){
    public Object judgeScore(Double nowScore, Double oldScore){
        JSONObject object = new JSONObject();
        if (nowScore > oldScore){
            if (oldScore == 0){
                object.put("trend",1);
                object.put("percentage","100%");
                object.put("percentage",nowScore.toString());
            }else {
                Double difScore = nowScore - oldScore;
                String percentage = getPercentage((float) (difScore.intValue()), (float) oldScore.intValue());
@ -124,10 +124,15 @@ public class BaseEvaluateScoreService extends BaseJpaService<BaseEvaluateScoreDO
                object.put("percentage",percentage);
            }
        }else if (nowScore < oldScore){
            Double difScore = oldScore - nowScore;
            String percentage = getPercentage((float) (difScore.intValue()), (float) oldScore.intValue());
            object.put("trend",-1);
            object.put("percentage",percentage);
            if (nowScore == 0){
                object.put("trend",-1);
                object.put("percentage",oldScore.toString());
            }else {
                Double difScore = oldScore - nowScore;
                String percentage = getPercentage((float) (difScore.intValue()), (float) oldScore.intValue());
                object.put("trend",-1);
                object.put("percentage",percentage);
            }
        }else {
            String percentage = "0%";
            object.put("trend",0);

+ 189 - 49
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -46,6 +46,8 @@ public class StatisticsEsService {
    @Autowired
    private BaseDoctorHospitalDao doctorHospitalDao;
    @Autowired
    private DictHospitalDeptDao hospitalDeptDao;
    @Autowired
    private BaseDoctorDao doctorDao;
    @Autowired
    private BaseEvaluateScoreService baseEvaluateScoreService;
@ -67,17 +69,44 @@ public class StatisticsEsService {
        SaveModel saveModel = null;
        //开方量
        SaveModel saveModel1 = null;
        //收入
        SaveModel saveModel2 = null;
        //昨天收入;
        SaveModel saveModel3 = null;
        //上周今天收入;
        SaveModel saveModel4 = null;
        String[] indexes = index.split(",");
        if (StringUtils.isNotEmpty(level2_type)) {
            saveModel = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, indexes[0], SaveModel.timeLevel_DDL, level2_type);
            saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, indexes[1], SaveModel.timeLevel_DDL, level2_type);
            saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, indexes[2], SaveModel.timeLevel_DDL,level2_type);
        } else {
            saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, indexes[0], SaveModel.timeLevel_DDL);
            saveModel1 = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, indexes[1], SaveModel.timeLevel_DDL);
            saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, indexes[2], SaveModel.timeLevel_DDL);
        }
        JSONObject object = new JSONObject();
        String yesterday = DateUtil.getNextDay(endDate, -1);//昨天
        String lastDay = DateUtil.getNextDay(endDate, -7);//上周的今天
        String weekFirstDay = DateUtil.getMondayOfThisWeek();//周一
        String weekLastDay = DateUtil.getSundayOfThisWeek();//周日
        JSONArray array = dateTotalStatistics2(weekFirstDay,weekLastDay,area,level,indexes[2],null,SaveModel.timeLevel_ZL,null);//本周量
        Double prices = 0.0;
        for (int i=0;i<array.size();i++){
            JSONObject jsonObject = array.getJSONObject(i);
            prices +=jsonObject.getDouble("num");
        }
        Double num = prices/array.size();
        DecimalFormat df = new DecimalFormat("0.00");
        String str = df.format(num);
        object.put("dayPrice",str);//日均收入
        saveModel3 = elasticsearchUtil.findOneDateQuotaLevel0(yesterday, yesterday, area, level, indexes[2], SaveModel.timeLevel_DDL);
        saveModel4 = elasticsearchUtil.findOneDateQuotaLevel0(lastDay, lastDay, area, level, indexes[2], SaveModel.timeLevel_DDL);
        object.put("outPatientCount",saveModel.getResult2().longValue());//问诊量
        object.put("prescriptionCount",saveModel1.getResult2().longValue());//开方量
        object.put("priceTotal",saveModel2.getResult1().longValue());//总收入
        object.put("priceDayRate",baseEvaluateScoreService.judgeScore(saveModel2.getResult1().doubleValue(),saveModel3.getResult1().doubleValue()));
        object.put("priceWeekRate",baseEvaluateScoreService.judgeScore(saveModel2.getResult1().doubleValue(),saveModel4.getResult1().doubleValue()));
        String prescriptionRate = baseEvaluateScoreService.getPercentage(saveModel1.getResult2().floatValue(), saveModel.getResult2().floatValue());
        object.put("prescriptionRate",prescriptionRate);//开方率
        String startTime = DateUtil.getStringDateShort()+" 00:00:00";
@ -100,6 +129,7 @@ public class StatisticsEsService {
        object.put("totalAvgScore",scoreAndPercentage.get("totalAvgScore"));//服务总评分
        object.put("weekJudge",scoreAndPercentage.get("weekJudge"));//周同比
        object.put("dayJudge",scoreAndPercentage.get("dayJudge"));//日环比
        return object;
    }
@ -131,18 +161,20 @@ public class StatisticsEsService {
            object.put("data",array);
        }
        if (StringUtils.isNoneBlank(level2_type)){
            //问诊量表格
            //专家咨询数量
            List<SaveModel> specialistSaveModels = elasticsearchUtil.findDateQuotaLevel0(endDate, endDate, area, level, "4", SaveModel.timeLevel_DDL,null,level2_type);
            List<SaveModel> specialistSaveModels = elasticsearchUtil.findDateQuotaLevel0(startDate, endDate, area, level, "4", SaveModel.timeLevel_ZL,null,level2_type);
            //协同门诊
            List<SaveModel> syngySaveModels = elasticsearchUtil.findDateQuotaLevel1(endDate, endDate, area, level, "1", SaveModel.timeLevel_DDL,"2",null,level2_type);
            List<SaveModel> syngySaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"2",null,level2_type);
            //图文复诊
            List<SaveModel> topicSaveModels = elasticsearchUtil.findDateQuotaLevel2(endDate, endDate, area, level, "1", SaveModel.timeLevel_DDL,"1","1",null,level2_type);
            List<SaveModel> topicSaveModels = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"1","1",null,level2_type);
            ///视频复诊
            List<SaveModel> vedioSaveModels = elasticsearchUtil.findDateQuotaLevel2(endDate, endDate, area, level, "1", SaveModel.timeLevel_DDL,"1","2",null,level2_type);
            List<SaveModel> vedioSaveModels = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"1","2",null,level2_type);
            JSONArray array = new JSONArray();
            List<String> list = new ArrayList<>();
            for (SaveModel saveModel:specialistSaveModels){
            for (SaveModel saveModel:syngySaveModels){
                if (level2_type.equals(SaveModel.deptLevel)){
                    list.add(saveModel.getDept());
                }else if (level2_type.equals(SaveModel.doctorLevel)){
@ -152,33 +184,79 @@ public class StatisticsEsService {
            for (int i=0;i<list.size();i++){
                String code = list.get(i);
                JSONObject jsonObject = new JSONObject();
                jsonObject.put("code",code);
                for (SaveModel saveModel:specialistSaveModels){
                    if (level2_type.equals(SaveModel.deptLevel)){
                        if (code.equalsIgnoreCase(saveModel.getDept())){
                            jsonObject.put("name",saveModel.getDeptName());
                            jsonObject.put("specialist",saveModel.getResult1());
                            break;
                        }
                    }else if (level2_type.equals(SaveModel.doctorLevel)){
                        if (code.equalsIgnoreCase(saveModel.getDoctor())){
                            jsonObject.put("name",saveModel.getDoctorName());
                            jsonObject.put("specialist",saveModel.getResult1());
                            break;
                Double specialist = 0.0;
                Double topic = 0.0;
                Double vedio =0.0;
                Double synegy =0.0;
                if (index.equalsIgnoreCase("3")){
                    specialist = 0.0;
                }else if (index.equalsIgnoreCase("1")){
                    for (SaveModel saveModel:specialistSaveModels){
                        if (level2_type.equals(SaveModel.deptLevel)){
                            if (code.equalsIgnoreCase(saveModel.getDept())){
                                jsonObject.put("code",code);
                                jsonObject.put("name",saveModel.getDeptName());
                                jsonObject.put("specialist",saveModel.getResult1());
                                specialist = saveModel.getResult1();
                                break;
                            }
                        }else if (level2_type.equals(SaveModel.doctorLevel)){
                            if (code.equalsIgnoreCase(saveModel.getDoctor())){
                                if (level==6){
                                    List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(area);
                                    if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
                                        BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
                                        jsonObject.put("code",doctorHospitalDO.getDeptCode());
                                        jsonObject.put("name",doctorHospitalDO.getDeptName());
                                    }
                                }else {
                                    DictHospitalDeptDO dictHospitalDeptDO =  hospitalDeptDao.findByCode(area);
                                    jsonObject.put("code",area);
                                    jsonObject.put("name",dictHospitalDeptDO.getName());
                                }
                                jsonObject.put("doctorCode",code);
                                BaseDoctorDO doctorDO = doctorDao.findById(code);
                                jsonObject.put("doctorJob",doctorDO.getJobTitleName());
                                jsonObject.put("doctorName",saveModel.getDoctorName());
                                jsonObject.put("specialist",saveModel.getResult1());
                                specialist = saveModel.getResult1();
                                break;
                            }
                        }
                    }
                }
                for (SaveModel saveModel:syngySaveModels){
                    if (level2_type.equals(SaveModel.deptLevel)){
                        if (code.equalsIgnoreCase(saveModel.getDept())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getDeptName());
                            jsonObject.put("synegy",saveModel.getResult1());
                            synegy = saveModel.getResult1();
                            break;
                        }
                    }else if (level2_type.equals(SaveModel.doctorLevel)){
                        if (code.equalsIgnoreCase(saveModel.getDoctor())){
                            jsonObject.put("name",saveModel.getDoctorName());
                            if (level==6){
                                List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(area);
                                if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
                                    BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
                                    jsonObject.put("code",doctorHospitalDO.getDeptCode());
                                    jsonObject.put("name",doctorHospitalDO.getDeptName());
                                }
                            }else {
                                DictHospitalDeptDO dictHospitalDeptDO =  hospitalDeptDao.findByCode(area);
                                jsonObject.put("code",area);
                                jsonObject.put("name",dictHospitalDeptDO.getName());
                            }
                            BaseDoctorDO doctorDO = doctorDao.findById(code);
                            jsonObject.put("doctorJob",doctorDO.getJobTitleName());
                            jsonObject.put("doctorCode",code);
                            jsonObject.put("doctorName",saveModel.getDoctorName());
                            jsonObject.put("synegy",saveModel.getResult1());
                            synegy = saveModel.getResult1();
                            break;
                        }
                    }
@ -186,14 +264,32 @@ public class StatisticsEsService {
                for (SaveModel saveModel:topicSaveModels){
                    if (level2_type.equals(SaveModel.deptLevel)){
                        if (code.equalsIgnoreCase(saveModel.getDept())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getDeptName());
                            jsonObject.put("topic",saveModel.getResult1());
                            topic = saveModel.getResult1();
                            break;
                        }
                    }else if (level2_type.equals(SaveModel.doctorLevel)){
                        if (code.equalsIgnoreCase(saveModel.getDoctor())){
                            jsonObject.put("name",saveModel.getDoctorName());
                            if (level==6){
                                List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(area);
                                if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
                                    BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
                                    jsonObject.put("code",doctorHospitalDO.getDeptCode());
                                    jsonObject.put("name",doctorHospitalDO.getDeptName());
                                }
                            }else {
                                DictHospitalDeptDO dictHospitalDeptDO =  hospitalDeptDao.findByCode(area);
                                jsonObject.put("code",area);
                                jsonObject.put("name",dictHospitalDeptDO.getName());
                            }
                            BaseDoctorDO doctorDO = doctorDao.findById(code);
                            jsonObject.put("doctorJob",doctorDO.getJobTitleName());
                            jsonObject.put("doctorCode",code);
                            jsonObject.put("doctorName",saveModel.getDoctorName());
                            jsonObject.put("topic",saveModel.getResult1());
                            topic = saveModel.getResult1();
                            break;
                        }
                    }
@ -201,18 +297,40 @@ public class StatisticsEsService {
                for (SaveModel saveModel:vedioSaveModels){
                    if (level2_type.equals(SaveModel.deptLevel)){
                        if (code.equalsIgnoreCase(saveModel.getDept())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getDeptName());
                            jsonObject.put("vedio",saveModel.getResult1());
                            vedio = saveModel.getResult1();
                            break;
                        }
                    }else if (level2_type.equals(SaveModel.doctorLevel)){
                        if (code.equalsIgnoreCase(saveModel.getDoctor())){
                            jsonObject.put("name",saveModel.getDoctorName());
                            if (level==6){
                                List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(area);
                                if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
                                    BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
                                    jsonObject.put("code",doctorHospitalDO.getDeptCode());
                                    jsonObject.put("name",doctorHospitalDO.getDeptName());
                                }
                            }else {
                                DictHospitalDeptDO dictHospitalDeptDO =  hospitalDeptDao.findByCode(area);
                                jsonObject.put("code",area);
                                jsonObject.put("name",dictHospitalDeptDO.getName());
                            }
                            jsonObject.put("doctorCode",code);
                            BaseDoctorDO doctorDO = doctorDao.findById(code);
                            jsonObject.put("doctorJob",doctorDO.getJobTitleName());
                            jsonObject.put("doctorName",saveModel.getDoctorName());
                            jsonObject.put("vedio",saveModel.getResult1());
                            vedio = saveModel.getResult1();
                            break;
                        }
                    }
                }
                Double total1 = topic+vedio ;//图文和视频总和
                Double total = topic+vedio+synegy+specialist;//总和
                jsonObject.put("total1",total1);//图文和视频总和
                jsonObject.put("total",total);//总和
                array.add(jsonObject);
            }
            object.put("excelData",array);
@ -259,13 +377,6 @@ public class StatisticsEsService {
    public JSONObject getOutPatientCircular(String startDate, String endDate, String area, int level, String index, String level2_type) throws Exception {
        JSONObject object = new JSONObject();
        //专家咨询数量
        SaveModel saveModel = null;
        if (StringUtils.isNotEmpty(level2_type)) {
            saveModel = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, "4", SaveModel.timeLevel_DDL, level2_type);
        } else {
            saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, "4", SaveModel.timeLevel_DDL);
        }
        //协同门诊
        SaveModel saveModel1 = null;
        saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "2");
@ -275,20 +386,33 @@ public class StatisticsEsService {
        //视频复诊
        SaveModel saveModel3 = null;
        saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","2");
        Double specialistCount =0.0;
        if(index.equalsIgnoreCase("1")){
            //专家咨询数量
            SaveModel saveModel = null;
            if (StringUtils.isNotEmpty(level2_type)) {
                saveModel = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, "4", SaveModel.timeLevel_DDL, level2_type);
            } else {
                saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, "4", SaveModel.timeLevel_DDL);
            }
            specialistCount = saveModel.getResult1();//专家咨询数量
        }else if (index.equalsIgnoreCase("3")){
            specialistCount = 0.0;
        }
        int specialistCount = saveModel.getResult2().intValue();//专家咨询数量
        int synergyCount = saveModel1.getResult2().intValue();//协同门诊数量
        int topicCount = saveModel2.getResult2().intValue();//图文复诊数量
        int videoCount = saveModel3.getResult2().intValue();//视频复诊数量
        int total = specialistCount+synergyCount+topicCount+videoCount;//总量
        Double synergyCount = saveModel1.getResult1();//协同门诊数量
        Double topicCount = saveModel2.getResult1();//图文复诊数量
        Double videoCount = saveModel3.getResult1();//视频复诊数量
        Double total = specialistCount+synergyCount+topicCount+videoCount;//总量
        object.put("specialistCount",specialistCount);//专家咨询数
        object.put("specialistRate",getRange(specialistCount,total,0));
        object.put("specialistRate",getRange(specialistCount.intValue(),total.intValue(),0));
        object.put("synergyCount",synergyCount);//专家咨询数
        object.put("synergyRate",getRange(synergyCount,total,0));
        object.put("synergyRate",getRange(synergyCount.intValue(),total.intValue(),0));
        object.put("topicCount",topicCount);//图文复诊数量
        object.put("topicRate",getRange(topicCount,total,0));
        object.put("topicRate",getRange(topicCount.intValue(),total.intValue(),0));
        object.put("videoCount",videoCount);//视频复诊数量
        object.put("videoRate",getRange(videoCount,total,0));
        object.put("videoRate",getRange(videoCount.intValue(),total.intValue(),0));
        object.put("total",total);
        return object;
    }
@ -614,8 +738,8 @@ public class StatisticsEsService {
            }else if (level==5){
                for (Map<String,Object> map:mapList){
                    JSONObject object1 = new JSONObject();
                    object1.put("deptCode","-");
                    object1.put("deptName","-");
                    object1.put("deptCode",map.get("dept_code"));
                    object1.put("deptName",map.get("dept_name"));
                    Long topic = 0L;
                    Long vedio =0L;
                    Long synegy = 0L;
@ -641,6 +765,7 @@ public class StatisticsEsService {
                    object1.put("synegy",synegy);//协同
                    object1.put("specialist",specialist);//专家
                    object1.put("other",other);//其他
                    object1.put("doctor",map.get("id"));
                    object1.put("doctorName",map.get("name"));//医生名字
                    object1.put("doctorJob",map.get("job_title_name"));//医生职称
                    array.add(object1);
@ -736,13 +861,20 @@ public class StatisticsEsService {
            }else if (level==5){
                Set<JSONObject> set = new HashSet<>();
                for(SaveModel saveModel:topicModels){
                    BaseDoctorDO doctorDO = doctorDao.findById(saveModel.getDoctor());
                    JSONObject object1 = new JSONObject();
                    BaseDoctorDO doctorDO = doctorDao.findById(saveModel.getDoctor());
                    List<BaseDoctorHospitalDO> doctorHospitalDOs = doctorHospitalDao.findByDoctorCode(saveModel.getDoctor());
                    if (doctorHospitalDOs!=null&&doctorHospitalDOs.size()!=0){
                        object1.put("deptCode",doctorHospitalDOs.get(0).getDeptCode());
                        object1.put("deptName",doctorHospitalDOs.get(0).getDeptName());
                    }else {
                        object1.put("deptCode",null);
                        object1.put("deptName",null);
                    }
                    object1.put("doctor",doctorDO.getId());
                    object1.put("doctorName",doctorDO.getName());//
                    object1.put("doctorJob",doctorDO.getJobTitleName());//
                    object1.put("doctor",doctorDO.getId());
                    object1.put("deptCode","-");
                    object1.put("deptName","-");
                    set.add(object1);
                }
                for (JSONObject jsonObject:set){
@ -849,6 +981,7 @@ public class StatisticsEsService {
            JSONObject json = new JSONObject();
            json.put("range", one.get("date"));
            json.put("amount", 0);
            json.put("num",0.0);
            result.add(json);
        }
//        }
@ -861,10 +994,12 @@ public class StatisticsEsService {
                if (saveModel.getQuotaDate() != null) {
                    range = df.format(saveModel.getQuotaDate());
                }
                double num = saveModel.getResult1();
                long amount = saveModel.getResult2().longValue();
                for(JSONObject obj : result){
                    if((obj.get("range")+"").equals(range)){
                        obj.put("amount", amount);
                        obj.put("num",num);
                    }
                }
@ -1017,6 +1152,7 @@ public class StatisticsEsService {
            JSONObject range = new JSONObject();
            range.put("range", endStr);
            range.put("amount", 0);
            range.put("num",0.0);
            countResult.put(endStr, range);
@ -1058,7 +1194,9 @@ public class StatisticsEsService {
//                }
                if (json != null) {
                    long amount = saveModel.getResult2().longValue();
                    double num = saveModel.getResult1();
                    json.put("amount", amount);
                    json.put("num",num);
                }
            }
@ -1125,7 +1263,7 @@ public class StatisticsEsService {
        if (startDate.compareTo(endDate) == 0) {
            flag = false;
            days.add(end);
       /*     days.add(end);*/
        }
        // 统计日期计算
@ -1143,7 +1281,7 @@ public class StatisticsEsService {
            if (next.getTime().before(DateUtil.strToDate(endDate, "yyyy-MM-dd"))) {
                days.add(next);
            } else {
                days.add(end);
         /*       days.add(end);*/
                flag = false;
            }
            k++;
@ -1152,13 +1290,14 @@ public class StatisticsEsService {
        // 统计结果
        Map<String, JSONObject> countResult = new HashMap<>();
        for (int i = 0; i < days.size() - 1; i++) {
            String endStr = df.format(days.get(i + 1).getTime());
        for (int i = 0; i < days.size(); i++) {
            String endStr = df.format(days.get(i).getTime());
            JSONObject range = new JSONObject();
            range.put("range", endStr);
            range.put("amount", 0);
            range.put("num",0.0);
            countResult.put(endStr, range);
        }
@ -1166,7 +1305,6 @@ public class StatisticsEsService {
        if (startDate.equals(df.format(new Date()))) {
            Calendar preDate = Calendar.getInstance();
            preDate.setTime(df.parse(endDate));
            preDate.add(Calendar.DATE, -1);
            startDate = df.format(preDate.getTime());
        }
@ -1186,12 +1324,14 @@ public class StatisticsEsService {
                }
                JSONObject json = countResult.get(range);
                //因为上述时间集提前一天  但是前端是显示当前时间,所以这里给调整回去
                if (range.equals(df.format(temp.getTime()))) {
                /*if (range.equals(df.format(temp.getTime()))) {
                    json.put("range", endDate);
                }
                }*/
                if (json != null) {
                    long amount = saveModel.getResult2().longValue();
                    double num = saveModel.getResult1();
                    json.put("amount", amount);
                    json.put("num",num);
                }
            }

+ 71 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorVo.java

@ -0,0 +1,71 @@
package com.yihu.jw.entity.base.doctor;
/**
 * @author zmk
 * 医生服务配置VO类
 * Created at 2019/12/10
 */
public class BaseDoctorVo {
    /**
     * id
     */
    private String doctorId;
    /**
     * 医生简介
     */
    private String introduce;
    /**
     * 医生专长
     */
    private String expertise;
    /**
     * 专病门诊
     */
    private String specialDisease;
    /**
     * 咨询方式
     */
    private String outpatientType;
    public String getDoctorId() {
        return doctorId;
    }
    public void setDoctorId(String doctorId) {
        this.doctorId = doctorId;
    }
    public String getIntroduce() {
        return introduce;
    }
    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }
    public String getExpertise() {
        return expertise;
    }
    public void setExpertise(String expertise) {
        this.expertise = expertise;
    }
    public String getSpecialDisease() {
        return specialDisease;
    }
    public void setSpecialDisease(String specialDisease) {
        this.specialDisease = specialDisease;
    }
    public String getOutpatientType() {
        return outpatientType;
    }
    public void setOutpatientType(String outpatientType) {
        this.outpatientType = outpatientType;
    }
}

+ 55 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/DoctorSpecialDiseaseDo.java

@ -0,0 +1,55 @@
package com.yihu.jw.entity.base.doctor;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * @author zmk
 * 医生专病关联实体
 * Created at 2019/12/10
 */
@Entity
@Table(name = "wlyy_doctor_special_disease")
public class DoctorSpecialDiseaseDo extends IntegerIdentityEntity {
    /**
     * 医生id
     */
    private String doctorCode;
    /**
     * 医生的专病门诊
     */
    private String diseaseName;
    /**
     * 关联专病code
     */
    private String diseaseCode;
    @Column(name = "doctor_code")
    public String getDoctorCode() {
        return doctorCode;
    }
    public void setDoctorCode(String doctorCode) {
        this.doctorCode = doctorCode;
    }
    @Column(name = "disease_name")
    public String getDiseaseName() {
        return diseaseName;
    }
    public void setDiseaseName(String diseaseName) {
        this.diseaseName = diseaseName;
    }
    @Column(name = "disease_code")
    public String getDiseaseCode() {
        return diseaseCode;
    }
    public void setDiseaseCode(String diseaseCode) {
        this.diseaseCode = diseaseCode;
    }
}

+ 12 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -641,4 +641,16 @@ public class BaseHospitalRequestMapping {
        public static final String doctorTotal = "/doctorTotal";
        public static final String doctorStatictisExcel = "/doctorStatictisExcel";
    }
    /**
     * 医生服务配置
     */
    public static class DoctorSetting extends Basic {
        public static final String PREFIX  = "/doctor/setting";
        public static final String queryList  = "/queryList";
        public static final String queryById  = "/queryById";
        public static final String update  = "/update";
        public static final String updateStatus  = "/updateStatus";
    }
}

+ 0 - 4
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/base/BaseInfoEndpoint.java

@ -5,7 +5,6 @@ import com.yihu.jw.area.service.BaseStreetService;
import com.yihu.jw.dict.service.BaseDictJobTitleService;
import com.yihu.jw.dict.service.HospitalDeptService;
import com.yihu.jw.doctor.service.BaseDoctorHosService;
import com.yihu.jw.doctor.service.BaseDoctorService;
import com.yihu.jw.entity.base.area.BaseCityDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
@ -45,9 +44,6 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private BaseDoctorHosService baseDoctorHosService;
    @Autowired
    private BaseDoctorService baseDoctorInfoService;
    @Autowired
    private BaseOrgInfoService baseOrgInfoService;

+ 92 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/config/DoctorServiceEndPoint.java

@ -0,0 +1,92 @@
package com.yihu.jw.hospital.endpoint.config;
import com.yihu.jw.doctor.service.BaseDoctorService;
import com.yihu.jw.entity.base.doctor.BaseDoctorVo;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * @author zmk
 * @vsrsion 1.0
 * Created at 2019/12/9
 */
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.DoctorSetting.PREFIX)
@Api(tags = "互联网医院后台医生服务配置", description = "互联网医院后台医生服务配置")
public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
    @Autowired
    private BaseDoctorService baseDoctorService;
    @GetMapping(value = BaseHospitalRequestMapping.DoctorSetting.queryList)
    @ApiOperation(value = "获取分页列表")
    public Envelop queryList(
            @ApiParam(name = "city", value = "市区")
            @RequestParam(value = "city", required = false) String city,
            @ApiParam(name = "hospital", value = "机构")
            @RequestParam(value = "hospital", required = false) String hospital,
            @ApiParam(name = "status", value = "状态")
            @RequestParam(value = "status", required = false) String status,
            @ApiParam(name = "name", value = "科室或病种名称")
            @RequestParam(value = "name", required = false) String name,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "pageSize", value = "页码", required = true, defaultValue = "10")
            @RequestParam(value = "pageSize") int pageSize) throws Exception {
        return baseDoctorService.queryList(city,hospital,status,name,page,pageSize);
    }
    @GetMapping(value = BaseHospitalRequestMapping.DoctorSetting.queryById)
    @ApiOperation(value = "根据医生id查询详情")
    public Envelop queryById(
            @ApiParam(name = "doctorId", value = "医生id")
            @RequestParam(value = "doctorId", required = true) String doctorId)throws Exception{
        Object object = baseDoctorService.queryById(doctorId);
        if (null != object){
            return success("查询成功",object);
        }
        return failed("查询失败");
    }
    @PostMapping(value = BaseHospitalRequestMapping.DoctorSetting.update)
    @ApiOperation(value = "修改医生服务配置")
    public Envelop update(
            @ApiParam(name = "baseDoctorVo", value = "JSON数据", required = true)
            @RequestParam(value = "baseDoctorVo") String baseDoctorVo)throws Exception{
        JSONObject jsonObject = JSONObject.fromObject(baseDoctorVo);
        Boolean update = baseDoctorService.update(jsonObject);
        if (!update){
            return failed("保存失败,参数不可为空");
        }
        return success("保存成功");
    }
    @GetMapping(value = BaseHospitalRequestMapping.DoctorSetting.updateStatus)
    @ApiOperation(value = "修改医生状态")
    public Envelop updateStatus(
            @ApiParam(name = "doctorId", value = "状态")
            @RequestParam(value = "doctorId", required = true) String doctorId,
            @ApiParam(name = "status", value = "状态")
            @RequestParam(value = "status", required = true) String status)throws Exception{
        baseDoctorService.updateStatus(doctorId,status);
        return success("修改成功");
    }
}

+ 16 - 4
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/SysDictEndpoint.java

@ -3,7 +3,6 @@ package com.yihu.jw.hospital.endpoint.consult;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.service.consult.SysDictService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
@ -12,7 +11,6 @@ import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
@ -40,7 +38,7 @@ public class SysDictEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = "/create")
    @ApiOperation(value = "新增&修改功能业务字典", notes = "互联网医院功能业务字典及开关设置表")
    public Envelop createSysDict(
            @ApiParam(name = "json_data", value = "JSON数据", required = true, defaultValue = "15")
            @ApiParam(name = "json_data", value = "JSON数据", required = true)
            @RequestParam(value = "json_data") String jsonData )  throws Exception {
        int flag = -1;
@ -89,7 +87,6 @@ public class SysDictEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "dictName", value = "字典名称", defaultValue = "")
            @RequestParam(value = "dictName", required = false) String dictName ) throws Exception {
        ListEnvelop listEnvelop = new ListEnvelop();
        List<WlyyHospitalSysDictDO>  wlyyHospitalSysDictDOS = new ArrayList<WlyyHospitalSysDictDO>();
        wlyyHospitalSysDictDOS = sysDictService.findByHospitalAndDictName(hospital,dictName);
        Map res = new HashMap();
@ -141,5 +138,20 @@ public class SysDictEndpoint extends EnvelopRestEndpoint {
    public com.alibaba.fastjson.JSONObject getUserAgent() {
        return super.getUserAgent();
    }
    @GetMapping(value = "/findByHosAndDict")
    @ApiOperation(value = "根据医院和字典名查询")
    public Envelop findByHosAndDict(
            @ApiParam(name = "hospital", value = "医院编码", required = true)
            @RequestParam(value = "hospital", required = true) String hospital,
            @ApiParam(name = "dictName", value = "字典名称", required = true)
            @RequestParam(value = "dictName", required = true) String dictName ) throws Exception {
        List<Map<String, Object>> list = sysDictService.findByHosAndDict(hospital, dictName);
        return success("查询成功",list);
    }
}

+ 30 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/SysDictService.java

@ -2,7 +2,10 @@ package com.yihu.jw.hospital.service.consult;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dao.consult.SysDictDao;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import net.sf.json.JSONObject;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -11,8 +14,11 @@ import java.util.Map;
@Service
public class SysDictService {
    @Autowired
    private SysDictDao sysDictDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    /**
     * 新增&更新社区医生邀请专家配置
@ -80,4 +86,28 @@ public class SysDictService {
    }
    public List<Map<String, Object>> findByHosAndDict(String hospital, String dictName){
        Map<String,Object> params = new HashedMap();
        String sql ="SELECT " +
                " a.id AS \"id\", " +
                " a.dict_name AS \"dictName\", " +
                " a.dict_code AS \"dictCode\", " +
                " a.dict_value AS \"dictValue\" " +
                " FROM " +
                " wlyy_hospital_sys_dict a " +
                " WHERE 1=1 ";
        if(StringUtils.isNotBlank(hospital)){
            sql+=" AND a.hospital =:hospital";
            params.put("hospital",hospital);
        }
        if(StringUtils.isNotBlank(dictName)){
            sql+=" AND a.dict_name =:dictName";
            params.put("dictName",dictName);
        }
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params);
        return  list;
    }
}