[
  {
    "metadata": {
      "companyCode": "COSM"
    },
    "data": [
      {
        "code": "Z_TOUS",
        "label": "Tous les salariés",
        "displayOrder": 0,
        "isActive": true
      },
      {
        "code": "EQP",
        "label": "Mon équipe",
        "generatedSqlQuery": "\"PE\".\"USR_RESP\" ='<-LISEUR->'",
        "displayOrder": 10,
        "isActive": true
      },
      {
        "code": "EQP+",
        "label": "Mon équipe et moi-même",
        "generatedSqlQuery": "\"PE\".\"USR_RESP\" = '<-LISEUR->' OR ID_INDIV IN( SELECT FK_INDIV FROM USR_INFOS WHERE ID_USR = '<-LISEUR->')",
        "displayOrder": 20,
        "isActive": true
      },
      {
        "code": "RSP2",
        "label": "Responsable 2 niveaux ",
        "generatedSqlQuery": "\"PE\".\"USR_RESP\" ='<-LISEUR->' OR \"PE\".\"ID_INDIV\" IN (SELECT \"PE2\".\"ID_INDIV\" FROM \"GT_HUMAIN\" \"PE2\"WHERE \"PE2\".USR_RESP IN ( SELECT \"ID_USR\" FROM \"USR_INFOS\" WHERE \"FK_INDIV\" IN (SELECT \"ID_INDIV\" FROM \"GT_HUMAIN\" \"PE3\" WHERE \"PE3\".\"USR_RESP\" ='<-LISEUR->')))",
        "displayOrder": 30,
        "isActive": true
      },
      {
        "code": "EQP2",
        "label": "Mon équipe N-2 (sans rsp N-1)",
        "generatedSqlQuery": "\"PE\".\"ID_INDIV\" IN (SELECT \"PE2\".\"ID_INDIV\" FROM \"GT_HUMAIN\" \"PE2\" WHERE \"PE2\".\"USR_RESP\" IN (SELECT \"ID_USR\" FROM \"USR_INFOS\" WHERE \"FK_INDIV\" IN (SELECT \"PE3\".\"ID_INDIV\" FROM \"GT_HUMAIN\" \"PE3\" WHERE \"PE3\".\"USR_RESP\" = '<-LISEUR->')) OR \"PE2\".\"USR_RESP\" IN (SELECT \"ID_USR\" FROM \"USR_INFOS\" WHERE \"FK_INDIV\" IN (SELECT \"PE4\".\"ID_INDIV\" FROM \"GT_HUMAIN\" \"PE4\" WHERE \"PE4\".\"USR_RESP\" IN (SELECT \"ID_USR\" FROM \"USR_INFOS\" WHERE \"FK_INDIV\" IN (SELECT \"PE5\".\"ID_INDIV\" FROM \"GT_HUMAIN\" \"PE5\" WHERE \"PE5\".\"USR_RESP\" = '<-LISEUR->')))))",
        "displayOrder": 40,
        "isActive": true
      },
      {
        "code": "RSPTA",
        "label": "Responsable d'une tâche",
        "generatedSqlQuery": "\"PE\".\"FK_TACHE\" IN (SELECT \"ID_TACHE\" FROM \"GT_TACHES\" WHERE \"ID_RESP\"='<-LISEUR->')",
        "displayOrder": 50,
        "isActive": true
      },
      {
        "code": "SALRSP",
        "label": "Salariés avec le même responsable que moi",
        "generatedSqlQuery": "\"PE\".\"USR_RESP\" = '<-IDEM_RESP->'",
        "displayOrder": 60,
        "isActive": true
      },
      {
        "code": "SALETS",
        "label": "Salariés avec le même établissement que moi",
        "generatedSqlQuery": "\"PE\".\"FK_ETABLIS\" = ‘<-IDEM_ETAB->’",
        "displayOrder": 70,
        "isActive": true
      },
      {
        "code": "SALERSP",
        "label": "Mes collègues et mon responsable",
        "generatedSqlQuery": "\"PE\".\"USR_RESP\" = '<-IDEM_RESP->' OR ID_INDIV IN (SELECT FK_INDIV FROM USR_INFOS WHERE ID_USR = '<-IDEM_RESP->')",
        "displayOrder": 80,
        "isActive": true
      },
      {
        "code": "SALBADNO",
        "label": "Salariés sans badge",
        "generatedSqlQuery": "NOT EXISTS (SELECT * FROM GT_BAD_IND WHERE FK_INDIV = ID_INDIV AND <-DT-CTX-SEC-> BETWEEN DEB_DTSEC AND FIN_DTSEC)"
      }
    ]
  }
]