Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

yeshijie 3 years ago
parent
commit
bd840f052d

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DevicePatientHealthIndex.java

@ -35,7 +35,7 @@ public class DevicePatientHealthIndex extends IdEntity {
	private String value6;
	// 睡前
	private String value7;
	// 健康指标类型(1血糖,2血压,3体重/身高/BMI,4腰围,5心率)
	// 健康指标类型(1血糖,2血压,3体重/身高/BMI,4腰围,5心率,6体温)
	private Integer type;
	// 记录时间

+ 99 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/exam/ChildrenExaminationRecordDO.java

@ -0,0 +1,99 @@
package com.yihu.jw.entity.care.exam;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Bing on 2021/5/18.
 */
@Entity
@Table(name="base_children_examination_record")
public class ChildrenExaminationRecordDO extends UuidIdentityEntityWithCreateTime {
    private String patient;//居民id
    private String type; //1机构体检 2居家自检
    private Date examTime; //体检时间
    private String orgCode; //体检机构
    private String orgName; //机构名称
    private String monthAge;//月龄
    private String height;//身高
    private String weight;//体重
    private String headCircumference;//头围
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+08:00")
    public Date getExamTime() {
        return examTime;
    }
    public void setExamTime(Date examTime) {
        this.examTime = examTime;
    }
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    public String getMonthAge() {
        return monthAge;
    }
    public void setMonthAge(String monthAge) {
        this.monthAge = monthAge;
    }
    public String getHeight() {
        return height;
    }
    public void setHeight(String height) {
        this.height = height;
    }
    public String getWeight() {
        return weight;
    }
    public void setWeight(String weight) {
        this.weight = weight;
    }
    public String getHeadCircumference() {
        return headCircumference;
    }
    public void setHeadCircumference(String headCircumference) {
        this.headCircumference = headCircumference;
    }
}

+ 11 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/exam/ChildrenExaminationRecordDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.care.dao.exam;
import com.yihu.jw.entity.care.exam.ChildrenExaminationRecordDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Bing on 2021/5/18.
 */
public interface ChildrenExaminationRecordDao extends PagingAndSortingRepository<ChildrenExaminationRecordDO,String>,JpaSpecificationExecutor<ChildrenExaminationRecordDO> {
}

+ 1 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/DoctorEndpoint.java

@ -106,9 +106,7 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "orgType",defaultValue = "1,2") String orgType
    ){
        try {
            if (orgType.equals("3")&&StringUtils.isBlank(doctorId)){
                return ListEnvelop.getError("参数错误");
            }
            return ListEnvelop.getSuccess("查询成功", doctorService.getOrgList(doctorId,orgType));
        }catch (Exception e){
            e.printStackTrace();

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doorCoach/DoctorDoorCoachOrderController.java

@ -332,7 +332,7 @@ public class DoctorDoorCoachOrderController extends BaseController {
            @ApiParam(value = "角色0、医生,1、管理员", name = "isManage",required = false)
            @RequestParam(value = "isManage", required = false) String isManage,
            @ApiParam(value = "发起类型(1本人发起 2家人待预约 3医生代预约)", name = "type")
            @RequestParam(value = "type", required = false,defaultValue = "1") Integer type,
            @RequestParam(value = "type", required = false) Integer type,
            @ApiParam(value = "页码", name = "page",defaultValue = "1",required = true)
            @RequestParam(value = "page", required = true) Integer page,
            @ApiParam(value = "每页数目", name = "pageSize",defaultValue = "10",required = true)

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doorCoach/PatientDoorCoachOrderController.java

@ -153,7 +153,7 @@ public class PatientDoorCoachOrderController extends EnvelopRestEndpoint {
            @ApiParam(value = "居民ID", name = "patient",required = false)
            @RequestParam(value = "patient", required = false) String patient,
            @ApiParam(value = "发起类型(1本人发起 2家人待预约 3医生代预约)", name = "type")
            @RequestParam(value = "type", required = false,defaultValue = "1") Integer type,
            @RequestParam(value = "type", required = false) Integer type,
            @ApiParam(value = "页码", name = "page",defaultValue = "1",required = true)
            @RequestParam(value = "page", required = true) Integer page,
            @ApiParam(value = "每页数目", name = "pageSize",defaultValue = "10",required = true)

+ 81 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/ChildrenExaminationEndpoint.java

@ -0,0 +1,81 @@
package com.yihu.jw.care.endpoint.patient;
import com.yihu.jw.care.service.exam.ChildrenExaminationService;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * Created by Bing on 2021/5/18.
 */
@RestController
@RequestMapping("patient/examationRecord")
@Api(description = "儿童体检")
public class ChildrenExaminationEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private ChildrenExaminationService examinationService;
    @PostMapping("newRecord")
    @ApiOperation("居民居家自建记录添加")
    public ObjEnvelop newRecord(@ApiParam(name="patient",value ="儿童id")
                                @RequestParam(value = "patient",required = true)String patient,
                                @ApiParam(name="examTime",value ="体检日期 yyyy-mm-dd")
                                @RequestParam(value = "examTime",required = false)String examTime,
                                @ApiParam(name="monthAge",value ="月龄")
                                @RequestParam(value = "monthAge",required = false)String monthAge,
                                @ApiParam(name="height",value ="身高")
                                @RequestParam(value = "height",required = false)String height,
                                @ApiParam(name="weight",value ="体重")
                                @RequestParam(value = "weight",required = false)String weight,
                                @ApiParam(name="headCircumference",value ="头围")
                                @RequestParam(value = "headCircumference",required = false)String headCircumference){
        try {
            return ObjEnvelop.getSuccess("新建成功",examinationService.newRecord(patient,examTime,monthAge,height,weight,headCircumference)) ;
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("新建记录失败");
        }
    }
    @GetMapping("getRecordDetailById")
    @ApiOperation("获取居民体检详情")
    public ObjEnvelop getRecordDetailById(@ApiParam(name="recordId",value ="体检id")
                                           @RequestParam(value = "recordId",required = true)String recordId){
        try {
            return ObjEnvelop.getSuccess("查询成功",examinationService.getRecordDetailById(recordId));
        }catch (Exception e){
            e.printStackTrace();;
            return ObjEnvelop.getError("查询失败");
        }
    }
    @GetMapping("getRecordList")
    @ApiOperation("获取居民体检记录")
    public PageEnvelop getRecordList(@ApiParam(name="patient",value ="儿童id")
                                     @RequestParam(value = "patient",required = true)String patient,
                                     @ApiParam(name="type",value = "体检类型 1机构体检 2居家自检")
                                     @RequestParam(value = "type",required = false)String type,
                                     @ApiParam(name="orgCode",value = "体检机构")
                                     @RequestParam(value = "orgCode",required = false)String orgCode,
                                     @ApiParam(name="startTime",value = "yyyy-MM-dd hh:mm:ss")
                                     @RequestParam(value = "startTime",required = false)String startTime,
                                     @ApiParam(name="endTime",value = "yyyy-MM-dd hh:mm:ss")
                                     @RequestParam(value = "endTime",required = false)String endTime,
                                     @ApiParam(name = "page")
                                     @RequestParam(value = "page",defaultValue = "1")int page,
                                     @ApiParam(name = "size")
                                     @RequestParam(value = "size",defaultValue = "15")int size){
        try {
            return examinationService.getRecordList(patient,type,orgCode,startTime,endTime,page,size);
        }catch (Exception e){
            e.printStackTrace();
            return PageEnvelop.getError("查询失败");
        }
    }
}

+ 36 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PatientEndpoint.java

@ -10,6 +10,7 @@ import com.yihu.jw.care.service.patient.CarePatientService;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.restmodel.ResponseContant;
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.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
@ -185,4 +186,39 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
    }
    @GetMapping(value = "getTeacherOrgList")
    @ApiOperation(value = "居民端-教育机构列表")
    public ListEnvelop getTeacherOrgList (
            @ApiParam(name = "patient", value = "患者code", required = true)
            @RequestParam(value = "patient",required = true) String patient){
        try{
            return ListEnvelop.getSuccess("查询成功",patientService.getTeacherOrgList(patient));
        }catch (Exception e){
            e.printStackTrace();
            return ListEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "getTeacherList")
    @ApiOperation(value = "居民端通讯录-教育医生")
    public PageEnvelop getTeacherList(
            @ApiParam(name = "patient", value = "患者code", required = true)
            @RequestParam(value = "patient",required = true) String patient,
            @ApiParam(name = "orgCode", value = "orgCode")
            @RequestParam(value = "orgCode") String orgCode,
            @ApiParam(name = "deptCode", value = "deptCode")
            @RequestParam(value = "deptCode",required = false) String deptCode,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size
    ){
        try {
            return patientService.getTeacherList(patient,orgCode,deptCode,page,size);
        }catch (Exception e){
            e.printStackTrace();
            return PageEnvelop.getError("查询失败");
        }
    }
}

+ 42 - 8
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doctor/CareDoctorService.java

@ -1,6 +1,7 @@
package com.yihu.jw.care.service.doctor;
import com.alibaba.fastjson.JSONObject;
import com.sun.xml.internal.rngom.parse.host.Base;
import com.yihu.jw.care.service.role.RoleService;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
@ -131,10 +132,40 @@ public class CareDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    public List<Map<String,Object>> getOrgList(String doctorId,String orgType){
        List<Map<String,Object>> result = new ArrayList<>();
        String sql ="SELECT org.code org_code,org.`name`,org.type from base_org org  where  org.del=1 ";
        if (orgType.equals("3")){
            sql= " SELECT org.code org_code,org.`name`,org.type from base_org org,base_doctor_hospital dh  where dh.org_code = org.code " +
                    "and  org.del=1 and dh.del=1 and doctor_code='"+doctorId+"' and org.type=3 GROUP BY org.`code` ";
        BaseDoctorDO doctorDO = baseDoctorDao.findById(doctorId);
        if (doctorDO==null){
            return new ArrayList<>();
        }
        //教师角色登录时为本机构科室列表,点击展开人员列表
        //助老员角色登录时为本机构科室列表,点击展开人员列表
        Integer doctorLevel = doctorDO.getLevel();
        Integer doctorOrgType =0 ;
        boolean isSearchDoctorOrgType=false;
        if (3==doctorLevel){//教师
            doctorOrgType=4;
            if ("4".equals(orgType)){
                isSearchDoctorOrgType=true;
            }
        }
        if (2==doctorLevel) {//助老员
            doctorOrgType=3;
            if ("3".equals(orgType)){
                isSearchDoctorOrgType=true;
            }
        }
        String sql ="select org.code from base_doctor_hospital dh inner join base_org org on dh.org_code = org.code " +
                "and dh.doctor_code='"+doctorId+"' and org.type='"+doctorOrgType+"' ORDER BY dh.create_time desc limit 1";
        List<String> doctorOrg = jdbcTemplate.queryForList(sql,String.class);
        sql ="SELECT org.code org_code,org.`name`,org.type from base_org org  where  org.del=1 ";
        if (orgType.equals("3")){//养老
            sql= " SELECT org.code org_code,org.`name`,org.type from base_org org where  " +
                    "  org.del=1  and org.type=3 " ;
            if (isSearchDoctorOrgType&&doctorOrg.size()>0){
                sql += " and org.code = '"+doctorOrg.get(0)+"' ";
            }
            sql += " GROUP BY org.`code` ";
        }
        else if (orgType.equals("1,2")){//医疗机构
           sql+=" and org.type in(1,2) ";
@ -142,6 +173,7 @@ public class CareDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        else {
            sql+=" and org.type='"+orgType+"' ";
        }
        sql+=" ORDER BY org.`code` asc";
        List<Map<String,Object>> tmpList = jdbcTemplate.queryForList(sql);
@ -158,14 +190,16 @@ public class CareDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    public JSONObject getOrgDoctor(String orgCode,String deptCode,int page,int size){
        JSONObject result = new JSONObject();
        String count = "select count(Distinct doc.id)\n" +
                "from base_doctor_hospital dh,dict_hospital_dept dict,base_doctor doc where  dh.doctor_code = doc.id  " +
                "and dh.dept_code = dict.`code` and dh.org_code = dict.org_code and dh.del=1 and dh.org_code='"+orgCode+"' " ;
                " from base_doctor_hospital dh INNER JOIN base_doctor doc on dh.doctor_code = doc.id  " +
                " and dh.del=1 LEFT JOIN " +
                " dict_hospital_dept dict on dh.dept_code = dict.`code` and dh.org_code = dict.org_code where dh.org_code='"+orgCode+"' ";
        if (StringUtils.isNotBlank(deptCode)){
            count+=" and dict.code='"+deptCode+"' ";
        }
        String sql = "select dh.org_code,dh.org_name,doc.id,doc.name,doc.mobile,doc.photo,dict.code deptCode,dict.name deptName,dh.doctor_duty_code job,dh.doctor_duty_name jobName\n" +
                "from base_doctor_hospital dh,dict_hospital_dept dict,base_doctor doc where  dh.doctor_code = doc.id  " +
                "and dh.dept_code = dict.`code` and dh.org_code = dict.org_code and dh.del=1 and dh.org_code='"+orgCode+"' ";
                " from base_doctor_hospital dh INNER JOIN base_doctor doc on dh.doctor_code = doc.id  " +
                " and dh.del=1 LEFT JOIN " +
                " dict_hospital_dept dict on dh.dept_code = dict.`code` and dh.org_code = dict.org_code where dh.org_code='"+orgCode+"' ";
        if (StringUtils.isNotBlank(deptCode)){
            sql+=" and dict.code='"+deptCode+"' ";
        }

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/DoctorDoorCoachOrderService.java

@ -220,7 +220,7 @@ public class DoctorDoorCoachOrderService {
        //获取医生代预约记录
        if(type != null && type == 3 ){
            sql += " and o.type = " + type + " and o.proxy_patient = '" + doctorCode + "'";
        }else{
        }else if (type!=null){
            sql += " and o.type = " + type +" ";
        }
        if(StringUtils.isNotBlank(doctorCode)){

+ 3 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/PatientDoorCoachOrderService.java

@ -1205,8 +1205,9 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
            sql+=" and o.doctor_name like '%"+serverDoctorName+"%'";
        }
        //获取医生代预约记录
        sql += " and o.type = " + type +" ";
        if (type!=null){
            sql += " and o.type = " + type +" ";
        }
        if(org.apache.commons.lang.StringUtils.isNotBlank(patientId)){
            sql += " and o.patient= '"+patientId+"' ";

+ 69 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/exam/ChildrenExaminationService.java

@ -0,0 +1,69 @@
package com.yihu.jw.care.service.exam;
import com.yihu.jw.care.dao.exam.ChildrenExaminationRecordDao;
import com.yihu.jw.entity.care.exam.ChildrenExaminationRecordDO;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
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.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by Bing on 2021/5/18.
 */
@Service
public class ChildrenExaminationService extends BaseJpaService<ChildrenExaminationRecordDO, ChildrenExaminationRecordDao> {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private ChildrenExaminationRecordDao childrenExaminationRecordDao;
    public ChildrenExaminationRecordDO newRecord(String patient,String examTime,String monthAge,String height,String weight,String headCircumference){
        ChildrenExaminationRecordDO recordDO = new ChildrenExaminationRecordDO();
        recordDO.setType("2");//居家自检
        recordDO.setPatient(patient);
        Date recordDate = DateUtil.strToDate(examTime);
        recordDO.setExamTime(recordDate);
        recordDO.setMonthAge(monthAge);
        recordDO.setHeight(height);
        recordDO.setWeight(weight);
        recordDO.setHeadCircumference(headCircumference);
        this.save(recordDO);
        return recordDO;
    }
    public ChildrenExaminationRecordDO getRecordDetailById(String recordId){
        return childrenExaminationRecordDao.findOne(recordId);
    }
    public PageEnvelop getRecordList(String patient,String type,String orgCode,String startTime,String endTime,int page,int size){
        page=page>0?page-1:0;
        String sql = "select id,patient,type,exam_time examTime,org_code orgCode,org_name orgName,month_age monthAge,height,weight, " +
                "head_circumference headCircumference,create_time createTime from base_children_examination_record where patient ='"+patient+"' ";
        String sqlCount = "select count(id) from base_children_examination_record where patient ='"+patient+"' ";
        String sqlCondition=" ";
        if (StringUtils.isNotBlank(type)){
            sqlCondition += " and type='"+type+"' ";
        }
        if (StringUtils.isNotBlank(orgCode)){
            sqlCondition += " and org_code='"+orgCode+"' ";
        }
        if (StringUtils.isNotBlank(startTime)){
            sqlCondition += " and exam_time>='"+startTime+"' ";
        }
        if (StringUtils.isNotBlank(endTime)){
            sqlCondition += " and exam_time<='"+endTime+"' ";
        }
        Long count = jdbcTemplate.queryForObject(sqlCount+sqlCondition,Long.class);
        sqlCondition +=" order by exam_time,create_time desc limit "+(page*size)+","+size;
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql+sqlCondition);
        return PageEnvelop.getSuccessListWithPage("查询成功",list,page,size,count);
    }
}

+ 51 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/CarePatientService.java

@ -20,6 +20,7 @@ import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.stereotype.Service;
@ -224,4 +225,54 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        saveDoctorPwlimitDate(id);*/
        return true;
    }
    public List<Map<String,Object>> getTeacherOrgList(String patient){
        String sql = "select Distinct sor.org_code,org.name from base_course_sales_order_record sor " +
                "INNER JOIN base_org org on sor.org_code = org.code " +
                "where sor.patient ='"+patient+"' and sor.`status` =3 " +
                "UNION " +
                "select DISTINCT rsr.org_code,org.name from base_recruit_students_record rsr INNER JOIN  " +
                "base_org org on rsr.org_code = org.`code` and org.del=1 " +
                "where rsr.patient='"+patient+"' and rsr.del<>0 and rsr.`status` = 3";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
    /**
     *
     * @param patient
     * @param orgCode
     * @param deptCode
     * @param page
     * @param size
     * @return
     * 居民教育通讯录:购买课程的老师+入学机构的所有老师
     */
    public PageEnvelop getTeacherList(String patient,String orgCode,String deptCode,int page,int size){
        page = page>0?page-1:0;
        String sqlCount = "select count(DISTINCT doc.id) ";
        String sql=" select dh.org_code,dh.org_name,doc.id,doc.name,doc.mobile,doc.photo,dict.code deptCode,dict.name deptName, " +
                " dh.doctor_duty_code job,dh.doctor_duty_name jobName ";
        String sqlCondition = " from  " +
                "(select Distinct bc.doctor doctor,sor.org_code from base_course_sales_order_record sor INNER JOIN base_course bc on " +
                "sor.course_id = bc.id and bc.del=1 " +
                "where sor.patient ='"+patient+"'  and sor.`status` =3   GROUP BY bc.doctor  " +//购入课程
                "UNION " +
                "select DISTINCT dh.doctor_code doctor,rsr.org_code from base_recruit_students_record rsr INNER JOIN  " +
                "base_org org on rsr.org_code = org.`code` and org.del=1 INNER JOIN base_doctor_hospital dh on rsr.org_code = dh.org_code " +
                "and dh.del =1  " +
                "where rsr.patient='"+patient+"' and rsr.del<>0  and rsr.`status` = 3 GROUP BY dh.doctor_code " +//入学机构
                ")A INNER JOIN base_doctor_hospital dh on A.doctor =dh.doctor_code and a.org_code = dh.org_code " +
                "INNER JOIN base_doctor doc on dh.doctor_code = doc.id LEFT JOIN dict_hospital_dept dict on dh.dept_code = dict.`code` " +
                "and dh.org_code = dict.org_code and dh.del=1 where 1=1 ";
        if (StringUtils.isNotBlank(orgCode)){
            sqlCondition += " and dh.org_code = '"+orgCode+"' ";
        }
        if (StringUtils.isNotBlank(deptCode)){
            sqlCondition +=" and dict.code='"+deptCode+"' ";
        }
        Long cont = jdbcTemplate.queryForObject(sqlCount+sqlCondition,Long.class);
        sqlCondition +=" GROUP BY doc.id limit "+page*size+","+size;
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql+sqlCondition);
        return PageEnvelop.getSuccessListWithPage("查询成功",list,page,size,cont);
    }
}