private FinderSchema createWorkloadSchema() {
    FinderSchema schema = new FinderSchema();
    schema.setCode(WORKLOAD_SCHEMA);
    schema.setTitle("医生工作量统计");
    schema.setRelativePath("admin/hcrm/workload/list");

    FinderDataSet finderDataSet = new FinderDataSet("HCRM_WORKLOAD_SET");
    schema.setFinderDataSet(finderDataSet);

    FinderColumn column = new FinderColumn();

    column.setLabel("主键");
    column.setColumn("pk");
    column.setName("pk");
    column.setType(DataType.String);
    column.setPkey(true);
    column.setVisible(false);
    schema.addColumn(column);

    column = new FinderColumn();
    column.setLabel("住院医生");
    column.setColumn("DOCTOR_NAME");
    column.setName("DOCTOR_NAME");
    column.setType(DataType.String);
    column.setVisible(true);
    column.setWidth(300);
    schema.addColumn(column);

    column = new FinderColumn();
    column.setLabel("住院天数");
    column.setColumn("DOCTOR_DAYS");
    column.setName("DOCTOR_DAYS");
    column.setType(DataType.Integer);
    column.setVisible(true);
    column.setWidth(200);
    schema.addColumn(column);

    column = new FinderColumn();
    column.setLabel("住院人数");
    column.setColumn("DOCTOR_COUNTS");
    column.setName("DOCTOR_COUNTS");
    column.setType(DataType.Integer);
    column.setVisible(true);
    column.setWidth(200);
    schema.addColumn(column);

    FinderDetailView detailView = new FinderDetailView();
    detailView.setCode("patientdetail");
    detailView.setLabel("回访明细");
    detailView.setHref("admin/hcrm/workload/detail");
    schema.addDetailView(detailView);

    schema.setEnableFilter(true);

    return schema;
  }
  private FinderSchema createPatientSchema() {
    FinderSchema schema = new FinderSchema();
    schema.setCode(PATIENT_SCHEMA);
    schema.setTitle("病人管理");
    schema.setRelativePath("admin/hcrm/patient/list");

    FinderDataSet finderDataSet = new FinderDataSet("HCRM_PATIENT_SET2");
    schema.setFinderDataSet(finderDataSet);

    FinderParam param = null;
    FinderColumn column = new FinderColumn();

    column.setLabel("编号");
    column.setColumn("id");
    column.setName("id");
    column.setType(DataType.Long);
    column.setPkey(true);
    column.setVisible(false);
    schema.addColumn(column);

    column = new FinderColumn();
    column.setLabel("住院号");
    column.setColumn("HOSPITALNUMBER");
    column.setName("HOSPITALNUMBER");
    column.setType(DataType.String);
    column.setVisible(true);
    column.setWidth(100);
    schema.addColumn(column);

    param = new FinderParam(column, null);
    param.setEnableSearch(true);
    param.setEnableFilter(true);
    param.setDefaultCriteriaType(CriteriaType.Contains);
    param.setFieldControl(FieldControl.Text);
    schema.addParam(param);

    column = new FinderColumn();
    column.setLabel("姓名");
    column.setColumn("USERNAME");
    column.setName("USERNAME");
    column.setType(DataType.String);
    column.setVisible(true);
    column.setWidth(50);
    schema.addColumn(column);

    param = new FinderParam(column, null);
    param.setEnableSearch(true);
    param.setEnableFilter(true);
    param.setDefaultCriteriaType(CriteriaType.Contains);
    param.setFieldControl(FieldControl.Text);
    schema.addParam(param);

    column = new FinderColumn();
    column.setLabel("性别");
    column.setColumn("SEX");
    column.setName("SEX");
    column.setType(DataType.String);
    column.setVisible(true);
    column.setWidth(50);
    schema.addColumn(column);

    column = new FinderColumn();
    column.setLabel("电话");
    column.setColumn("TELEPHONE");
    column.setName("TELEPHONE");
    column.setType(DataType.String);
    column.setVisible(true);
    column.setWidth(100);
    schema.addColumn(column);

    param = new FinderParam(column, null);
    param.setEnableSearch(true);
    param.setEnableFilter(true);
    param.setDefaultCriteriaType(CriteriaType.Contains);
    param.setFieldControl(FieldControl.Text);
    schema.addParam(param);

    column = new FinderColumn();
    column.setLabel("手机");
    column.setColumn("MOBILE");
    column.setName("MOBILE");
    column.setType(DataType.String);
    column.setVisible(true);
    column.setWidth(100);
    schema.addColumn(column);

    param = new FinderParam(column, null);
    param.setEnableSearch(true);
    param.setEnableFilter(true);
    param.setDefaultCriteriaType(CriteriaType.Contains);
    param.setFieldControl(FieldControl.Text);
    schema.addParam(param);

    column = new FinderColumn();
    column.setLabel("科室");
    column.setColumn("DEPARTMENT");
    column.setName("DEPARTMENT");
    column.setType(DataType.String);
    column.setVisible(true);
    column.setWidth(100);
    schema.addColumn(column);

    param = new FinderParam(column, null);
    param.setEnableSearch(true);
    param.setEnableFilter(true);
    param.setDefaultCriteriaType(CriteriaType.Contains);
    param.setFieldControl(FieldControl.Text);
    schema.addParam(param);

    column = new FinderColumn();
    column.setLabel("病种");
    column.setColumn("DISEASE");
    column.setName("DISEASE");
    column.setType(DataType.String);
    column.setVisible(true);
    column.setWidth(50);
    schema.addColumn(column);

    param = new FinderParam(column, null);
    param.setEnableSearch(true);
    param.setEnableFilter(true);
    param.setDefaultCriteriaType(CriteriaType.Contains);
    param.setFieldControl(FieldControl.Text);
    schema.addParam(param);

    column = new FinderColumn();
    column.setLabel("出院诊断");
    column.setColumn("DISCHARGEDIAGNOSIS");
    column.setName("DISCHARGEDIAGNOSIS");
    column.setType(DataType.String);
    column.setVisible(false);
    column.setWidth(1);
    schema.addColumn(column);

    param = new FinderParam(column, null);
    param.setEnableSearch(true);
    param.setEnableFilter(true);
    param.setDefaultCriteriaType(CriteriaType.Contains);
    param.setFieldControl(FieldControl.Text);
    schema.addParam(param);

    column = new FinderColumn();
    column.setLabel("入院时间");
    column.setColumn("ADMISSIONTIME");
    column.setName("ADMISSIONTIME");
    column.setType(DataType.Date);
    column.setFormat(Configuration.getPatternDate());
    column.setVisible(true);
    column.setWidth(80);
    schema.addColumn(column);

    param = new FinderParam(column, null);
    param.setEnableSearch(true);
    param.setEnableFilter(true);
    param.setDefaultCriteriaType(CriteriaType.AfterThan);
    param.setFieldControl(FieldControl.Date);
    schema.addParam(param);

    column = new FinderColumn();
    column.setLabel("出院时间");
    column.setColumn("DISCHARGETIME");
    column.setName("DISCHARGETIME");
    column.setType(DataType.Date);
    column.setFormat(Configuration.getPatternDate());
    column.setVisible(true);
    column.setWidth(80);
    schema.addColumn(column);

    param = new FinderParam(column, null);
    param.setEnableSearch(true);
    param.setEnableFilter(true);
    param.setDefaultCriteriaType(CriteriaType.AfterThan);
    param.setFieldControl(FieldControl.Date);
    schema.addParam(param);

    column = new FinderColumn();
    column.setLabel("住院天数");
    column.setColumn("DAYS");
    column.setName("DAYS");
    column.setType(DataType.Integer);
    column.setVisible(true);
    column.setWidth(50);
    schema.addColumn(column);

    column = new FinderColumn();
    column.setLabel("住院医生");
    column.setColumn("RESIDENTDOCTOR");
    column.setName("RESIDENTDOCTOR");
    column.setType(DataType.String);
    column.setVisible(true);
    column.setWidth(100);
    schema.addColumn(column);

    param = new FinderParam(column, null);
    param.setEnableSearch(true);
    param.setEnableFilter(true);
    param.setDefaultCriteriaType(CriteriaType.Contains);
    param.setFieldControl(FieldControl.Text);
    schema.addParam(param);

    FinderAction action = new FinderAction();
    action.setLabel("新增病人");
    action.setHref("admin/hcrm/patient/create");
    action.setTarget("dialog::{title: '新增病人', width:'680',height:'620'}");
    schema.addAction(action);

    action = new FinderAction();
    action.setLabel("编辑病人");
    action.setHref("admin/hcrm/patient/edit");
    action.setTarget("dialog::{title: '编辑病人', width:'680',height:'620'}");
    action.setMaxRowSelected(1);
    action.setMinRowSelected(1);
    schema.addAction(action);

    action = new FinderAction();
    action.setLabel("删除病人");
    action.setHref("admin/hcrm/patient/delete");
    action.setConfirm("您确定删除该病人吗?");
    action.setTarget("command");
    action.setMinRowSelected(1);
    schema.addAction(action);

    FinderDetailView detailView = new FinderDetailView();
    detailView.setCode("patientdetail");
    detailView.setLabel("回访明细");
    detailView.setHref("admin/hcrm/patient/detail");
    schema.addDetailView(detailView);

    schema.setEnableFilter(true);
    schema.setEnableSearch(true);
    return schema;
  }