-- ========================================
-- 06-connect-to-open-insurances.sql
-- Conectar los 420 agentes a Open Insurances (786)
-- ========================================

SET @parent_agent_id = 786;  -- Open Insurances viejo
SET @parent_agreement_id = (SELECT id FROM agreement WHERE agent_id = 786 LIMIT 1);
SET @agency_level_id = (SELECT COALESCE(MAX(id), 0) + 1 FROM agency_level);

-- Conectar agente 1000 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1000
  AND cs.agreement_id = 968
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1001 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1001
  AND cs.agreement_id = 969
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1002 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1002
  AND cs.agreement_id = 970
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1003 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1003
  AND cs.agreement_id = 971
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1004 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1004
  AND cs.agreement_id = 972
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1005 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1005
  AND cs.agreement_id = 973
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1006 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1006
  AND cs.agreement_id = 974
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1007 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1007
  AND cs.agreement_id = 975
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1008 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1008
  AND cs.agreement_id = 976
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1009 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1009
  AND cs.agreement_id = 977
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1010 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1010
  AND cs.agreement_id = 978
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1011 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1011
  AND cs.agreement_id = 979
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1012 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1012
  AND cs.agreement_id = 980
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1013 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1013
  AND cs.agreement_id = 981
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1014 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1014
  AND cs.agreement_id = 982
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1015 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1015
  AND cs.agreement_id = 983
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1016 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1016
  AND cs.agreement_id = 984
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1017 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1017
  AND cs.agreement_id = 985
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1018 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1018
  AND cs.agreement_id = 986
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1019 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1019
  AND cs.agreement_id = 987
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1020 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1020
  AND cs.agreement_id = 988
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1021 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1021
  AND cs.agreement_id = 989
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1022 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1022
  AND cs.agreement_id = 990
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1023 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1023
  AND cs.agreement_id = 991
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1024 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1024
  AND cs.agreement_id = 992
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1025 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1025
  AND cs.agreement_id = 993
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1026 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1026
  AND cs.agreement_id = 994
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1027 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1027
  AND cs.agreement_id = 995
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1028 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1028
  AND cs.agreement_id = 996
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1029 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1029
  AND cs.agreement_id = 997
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1030 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1030
  AND cs.agreement_id = 998
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1031 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1031
  AND cs.agreement_id = 999
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1032 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1032
  AND cs.agreement_id = 1000
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1033 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1033
  AND cs.agreement_id = 1001
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1034 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1034
  AND cs.agreement_id = 1002
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1035 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1035
  AND cs.agreement_id = 1003
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1036 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1036
  AND cs.agreement_id = 1004
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1037 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1037
  AND cs.agreement_id = 1005
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1038 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1038
  AND cs.agreement_id = 1006
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1039 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1039
  AND cs.agreement_id = 1007
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1040 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1040
  AND cs.agreement_id = 1008
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1041 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1041
  AND cs.agreement_id = 1009
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1042 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1042
  AND cs.agreement_id = 1010
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1043 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1043
  AND cs.agreement_id = 1011
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1044 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1044
  AND cs.agreement_id = 1012
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1045 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1045
  AND cs.agreement_id = 1013
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1046 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1046
  AND cs.agreement_id = 1014
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1047 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1047
  AND cs.agreement_id = 1015
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1048 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1048
  AND cs.agreement_id = 1016
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1049 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1049
  AND cs.agreement_id = 1017
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1050 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1050
  AND cs.agreement_id = 1018
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1051 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1051
  AND cs.agreement_id = 1019
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1052 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1052
  AND cs.agreement_id = 1020
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1053 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1053
  AND cs.agreement_id = 1021
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1054 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1054
  AND cs.agreement_id = 1022
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1055 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1055
  AND cs.agreement_id = 1023
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1056 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1056
  AND cs.agreement_id = 1024
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1057 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1057
  AND cs.agreement_id = 1025
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1058 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1058
  AND cs.agreement_id = 1026
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1059 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1059
  AND cs.agreement_id = 1027
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1060 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1060
  AND cs.agreement_id = 1028
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1061 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1061
  AND cs.agreement_id = 1029
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1062 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1062
  AND cs.agreement_id = 1030
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1063 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1063
  AND cs.agreement_id = 1031
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1064 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1064
  AND cs.agreement_id = 1032
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1065 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1065
  AND cs.agreement_id = 1033
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1066 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1066
  AND cs.agreement_id = 1034
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1067 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1067
  AND cs.agreement_id = 1035
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1068 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1068
  AND cs.agreement_id = 1036
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1069 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1069
  AND cs.agreement_id = 1037
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1070 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1070
  AND cs.agreement_id = 1038
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1071 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1071
  AND cs.agreement_id = 1039
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1072 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1072
  AND cs.agreement_id = 1040
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1073 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1073
  AND cs.agreement_id = 1041
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1074 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1074
  AND cs.agreement_id = 1042
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1075 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1075
  AND cs.agreement_id = 1043
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1076 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1076
  AND cs.agreement_id = 1044
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1077 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1077
  AND cs.agreement_id = 1045
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1078 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1078
  AND cs.agreement_id = 1046
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1079 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1079
  AND cs.agreement_id = 1047
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1080 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1080
  AND cs.agreement_id = 1048
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1081 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1081
  AND cs.agreement_id = 1049
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1082 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1082
  AND cs.agreement_id = 1050
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1083 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1083
  AND cs.agreement_id = 1051
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1084 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1084
  AND cs.agreement_id = 1052
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1085 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1085
  AND cs.agreement_id = 1053
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1086 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1086
  AND cs.agreement_id = 1054
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1087 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1087
  AND cs.agreement_id = 1055
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1088 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1088
  AND cs.agreement_id = 1056
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1089 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1089
  AND cs.agreement_id = 1057
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1090 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1090
  AND cs.agreement_id = 1058
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1091 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1091
  AND cs.agreement_id = 1059
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1092 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1092
  AND cs.agreement_id = 1060
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1093 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1093
  AND cs.agreement_id = 1061
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1094 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1094
  AND cs.agreement_id = 1062
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1095 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1095
  AND cs.agreement_id = 1063
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1096 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1096
  AND cs.agreement_id = 1064
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1097 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1097
  AND cs.agreement_id = 1065
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1098 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1098
  AND cs.agreement_id = 1066
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1099 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1099
  AND cs.agreement_id = 1067
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1100 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1100
  AND cs.agreement_id = 1068
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1101 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1101
  AND cs.agreement_id = 1069
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1102 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1102
  AND cs.agreement_id = 1070
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1103 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1103
  AND cs.agreement_id = 1071
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1104 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1104
  AND cs.agreement_id = 1072
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1105 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1105
  AND cs.agreement_id = 1073
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1106 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1106
  AND cs.agreement_id = 1074
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1107 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1107
  AND cs.agreement_id = 1075
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1108 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1108
  AND cs.agreement_id = 1076
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1109 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1109
  AND cs.agreement_id = 1077
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1110 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1110
  AND cs.agreement_id = 1078
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1111 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1111
  AND cs.agreement_id = 1079
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1112 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1112
  AND cs.agreement_id = 1080
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1113 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1113
  AND cs.agreement_id = 1081
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1114 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1114
  AND cs.agreement_id = 1082
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1115 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1115
  AND cs.agreement_id = 1083
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1116 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1116
  AND cs.agreement_id = 1084
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1117 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1117
  AND cs.agreement_id = 1085
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1118 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1118
  AND cs.agreement_id = 1086
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1119 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1119
  AND cs.agreement_id = 1087
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1120 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1120
  AND cs.agreement_id = 1088
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1121 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1121
  AND cs.agreement_id = 1089
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1122 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1122
  AND cs.agreement_id = 1090
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1123 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1123
  AND cs.agreement_id = 1091
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1124 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1124
  AND cs.agreement_id = 1092
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1125 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1125
  AND cs.agreement_id = 1093
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1126 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1126
  AND cs.agreement_id = 1094
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1127 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1127
  AND cs.agreement_id = 1095
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1128 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1128
  AND cs.agreement_id = 1096
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1129 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1129
  AND cs.agreement_id = 1097
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1130 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1130
  AND cs.agreement_id = 1098
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1131 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1131
  AND cs.agreement_id = 1099
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1132 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1132
  AND cs.agreement_id = 1100
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1133 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1133
  AND cs.agreement_id = 1101
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1134 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1134
  AND cs.agreement_id = 1102
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1135 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1135
  AND cs.agreement_id = 1103
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1136 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1136
  AND cs.agreement_id = 1104
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1137 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1137
  AND cs.agreement_id = 1105
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1138 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1138
  AND cs.agreement_id = 1106
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1139 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1139
  AND cs.agreement_id = 1107
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1140 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1140
  AND cs.agreement_id = 1108
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1141 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1141
  AND cs.agreement_id = 1109
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1142 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1142
  AND cs.agreement_id = 1110
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1143 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1143
  AND cs.agreement_id = 1111
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1144 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1144
  AND cs.agreement_id = 1112
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1145 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1145
  AND cs.agreement_id = 1113
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1146 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1146
  AND cs.agreement_id = 1114
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1147 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1147
  AND cs.agreement_id = 1115
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1148 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1148
  AND cs.agreement_id = 1116
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1149 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1149
  AND cs.agreement_id = 1117
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1150 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1150
  AND cs.agreement_id = 1118
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1151 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1151
  AND cs.agreement_id = 1119
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1152 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1152
  AND cs.agreement_id = 1120
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1153 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1153
  AND cs.agreement_id = 1121
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1154 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1154
  AND cs.agreement_id = 1122
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1155 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1155
  AND cs.agreement_id = 1123
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1156 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1156
  AND cs.agreement_id = 1124
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1157 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1157
  AND cs.agreement_id = 1125
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1158 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1158
  AND cs.agreement_id = 1126
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1159 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1159
  AND cs.agreement_id = 1127
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1160 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1160
  AND cs.agreement_id = 1128
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1161 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1161
  AND cs.agreement_id = 1129
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1162 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1162
  AND cs.agreement_id = 1130
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1163 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1163
  AND cs.agreement_id = 1131
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1164 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1164
  AND cs.agreement_id = 1132
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1165 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1165
  AND cs.agreement_id = 1133
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1166 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1166
  AND cs.agreement_id = 1134
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1167 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1167
  AND cs.agreement_id = 1135
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1168 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1168
  AND cs.agreement_id = 1136
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1169 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1169
  AND cs.agreement_id = 1137
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1170 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1170
  AND cs.agreement_id = 1138
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1171 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1171
  AND cs.agreement_id = 1139
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1172 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1172
  AND cs.agreement_id = 1140
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1173 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1173
  AND cs.agreement_id = 1141
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1174 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1174
  AND cs.agreement_id = 1142
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1175 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1175
  AND cs.agreement_id = 1143
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1176 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1176
  AND cs.agreement_id = 1144
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1177 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1177
  AND cs.agreement_id = 1145
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1178 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1178
  AND cs.agreement_id = 1146
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1179 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1179
  AND cs.agreement_id = 1147
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1180 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1180
  AND cs.agreement_id = 1148
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1181 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1181
  AND cs.agreement_id = 1149
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1182 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1182
  AND cs.agreement_id = 1150
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1183 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1183
  AND cs.agreement_id = 1151
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1184 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1184
  AND cs.agreement_id = 1152
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1185 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1185
  AND cs.agreement_id = 1153
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1186 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1186
  AND cs.agreement_id = 1154
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1187 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1187
  AND cs.agreement_id = 1155
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1188 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1188
  AND cs.agreement_id = 1156
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1189 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1189
  AND cs.agreement_id = 1157
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1190 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1190
  AND cs.agreement_id = 1158
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1191 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1191
  AND cs.agreement_id = 1159
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1192 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1192
  AND cs.agreement_id = 1160
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1193 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1193
  AND cs.agreement_id = 1161
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1194 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1194
  AND cs.agreement_id = 1162
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1195 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1195
  AND cs.agreement_id = 1163
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1196 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1196
  AND cs.agreement_id = 1164
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1197 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1197
  AND cs.agreement_id = 1165
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1198 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1198
  AND cs.agreement_id = 1166
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1199 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1199
  AND cs.agreement_id = 1167
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1200 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1200
  AND cs.agreement_id = 1168
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1201 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1201
  AND cs.agreement_id = 1169
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1202 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1202
  AND cs.agreement_id = 1170
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1203 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1203
  AND cs.agreement_id = 1171
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1204 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1204
  AND cs.agreement_id = 1172
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1205 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1205
  AND cs.agreement_id = 1173
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1206 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1206
  AND cs.agreement_id = 1174
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1207 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1207
  AND cs.agreement_id = 1175
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1208 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1208
  AND cs.agreement_id = 1176
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1209 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1209
  AND cs.agreement_id = 1177
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1210 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1210
  AND cs.agreement_id = 1178
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1211 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1211
  AND cs.agreement_id = 1179
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1212 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1212
  AND cs.agreement_id = 1180
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1213 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1213
  AND cs.agreement_id = 1181
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1214 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1214
  AND cs.agreement_id = 1182
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1215 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1215
  AND cs.agreement_id = 1183
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1216 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1216
  AND cs.agreement_id = 1184
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1217 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1217
  AND cs.agreement_id = 1185
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1218 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1218
  AND cs.agreement_id = 1186
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1219 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1219
  AND cs.agreement_id = 1187
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1220 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1220
  AND cs.agreement_id = 1188
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1221 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1221
  AND cs.agreement_id = 1189
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1222 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1222
  AND cs.agreement_id = 1190
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1223 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1223
  AND cs.agreement_id = 1191
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1224 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1224
  AND cs.agreement_id = 1192
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1225 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1225
  AND cs.agreement_id = 1193
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1226 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1226
  AND cs.agreement_id = 1194
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1227 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1227
  AND cs.agreement_id = 1195
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1228 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1228
  AND cs.agreement_id = 1196
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1229 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1229
  AND cs.agreement_id = 1197
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1230 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1230
  AND cs.agreement_id = 1198
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1231 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1231
  AND cs.agreement_id = 1199
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1232 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1232
  AND cs.agreement_id = 1200
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1233 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1233
  AND cs.agreement_id = 1201
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1234 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1234
  AND cs.agreement_id = 1202
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1235 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1235
  AND cs.agreement_id = 1203
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1236 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1236
  AND cs.agreement_id = 1204
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1237 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1237
  AND cs.agreement_id = 1205
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1238 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1238
  AND cs.agreement_id = 1206
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1239 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1239
  AND cs.agreement_id = 1207
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1240 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1240
  AND cs.agreement_id = 1208
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1241 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1241
  AND cs.agreement_id = 1209
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1242 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1242
  AND cs.agreement_id = 1210
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1243 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1243
  AND cs.agreement_id = 1211
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1244 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1244
  AND cs.agreement_id = 1212
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1245 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1245
  AND cs.agreement_id = 1213
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1246 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1246
  AND cs.agreement_id = 1214
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1247 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1247
  AND cs.agreement_id = 1215
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1248 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1248
  AND cs.agreement_id = 1216
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1249 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1249
  AND cs.agreement_id = 1217
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1250 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1250
  AND cs.agreement_id = 1218
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1251 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1251
  AND cs.agreement_id = 1219
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1252 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1252
  AND cs.agreement_id = 1220
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1253 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1253
  AND cs.agreement_id = 1221
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1254 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1254
  AND cs.agreement_id = 1222
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1255 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1255
  AND cs.agreement_id = 1223
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1256 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1256
  AND cs.agreement_id = 1224
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1257 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1257
  AND cs.agreement_id = 1225
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1258 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1258
  AND cs.agreement_id = 1226
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1259 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1259
  AND cs.agreement_id = 1227
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1260 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1260
  AND cs.agreement_id = 1228
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1261 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1261
  AND cs.agreement_id = 1229
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1262 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1262
  AND cs.agreement_id = 1230
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1263 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1263
  AND cs.agreement_id = 1231
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1264 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1264
  AND cs.agreement_id = 1232
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1265 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1265
  AND cs.agreement_id = 1233
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1266 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1266
  AND cs.agreement_id = 1234
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1267 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1267
  AND cs.agreement_id = 1235
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1268 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1268
  AND cs.agreement_id = 1236
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1269 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1269
  AND cs.agreement_id = 1237
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1270 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1270
  AND cs.agreement_id = 1238
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1271 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1271
  AND cs.agreement_id = 1239
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1272 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1272
  AND cs.agreement_id = 1240
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1273 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1273
  AND cs.agreement_id = 1241
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1274 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1274
  AND cs.agreement_id = 1242
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1275 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1275
  AND cs.agreement_id = 1243
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1276 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1276
  AND cs.agreement_id = 1244
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1277 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1277
  AND cs.agreement_id = 1245
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1278 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1278
  AND cs.agreement_id = 1246
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1279 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1279
  AND cs.agreement_id = 1247
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1280 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1280
  AND cs.agreement_id = 1248
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1281 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1281
  AND cs.agreement_id = 1249
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1282 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1282
  AND cs.agreement_id = 1250
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1283 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1283
  AND cs.agreement_id = 1251
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1284 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1284
  AND cs.agreement_id = 1252
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1285 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1285
  AND cs.agreement_id = 1253
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1286 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1286
  AND cs.agreement_id = 1254
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1287 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1287
  AND cs.agreement_id = 1255
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1288 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1288
  AND cs.agreement_id = 1256
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1289 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1289
  AND cs.agreement_id = 1257
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1290 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1290
  AND cs.agreement_id = 1258
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1291 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1291
  AND cs.agreement_id = 1259
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1292 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1292
  AND cs.agreement_id = 1260
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1293 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1293
  AND cs.agreement_id = 1261
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1294 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1294
  AND cs.agreement_id = 1262
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1295 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1295
  AND cs.agreement_id = 1263
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1296 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1296
  AND cs.agreement_id = 1264
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1297 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1297
  AND cs.agreement_id = 1265
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1298 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1298
  AND cs.agreement_id = 1266
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1299 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1299
  AND cs.agreement_id = 1267
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1300 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1300
  AND cs.agreement_id = 1268
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1301 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1301
  AND cs.agreement_id = 1269
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1302 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1302
  AND cs.agreement_id = 1270
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1303 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1303
  AND cs.agreement_id = 1271
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1304 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1304
  AND cs.agreement_id = 1272
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1305 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1305
  AND cs.agreement_id = 1273
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1306 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1306
  AND cs.agreement_id = 1274
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1307 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1307
  AND cs.agreement_id = 1275
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1308 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1308
  AND cs.agreement_id = 1276
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1309 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1309
  AND cs.agreement_id = 1277
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1310 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1310
  AND cs.agreement_id = 1278
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1311 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1311
  AND cs.agreement_id = 1279
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1312 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1312
  AND cs.agreement_id = 1280
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1313 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1313
  AND cs.agreement_id = 1281
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1314 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1314
  AND cs.agreement_id = 1282
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1315 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1315
  AND cs.agreement_id = 1283
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1316 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1316
  AND cs.agreement_id = 1284
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1317 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1317
  AND cs.agreement_id = 1285
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1318 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1318
  AND cs.agreement_id = 1286
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1319 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1319
  AND cs.agreement_id = 1287
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1320 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1320
  AND cs.agreement_id = 1288
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1321 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1321
  AND cs.agreement_id = 1289
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1322 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1322
  AND cs.agreement_id = 1290
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1323 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1323
  AND cs.agreement_id = 1291
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1324 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1324
  AND cs.agreement_id = 1292
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1325 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1325
  AND cs.agreement_id = 1293
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1326 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1326
  AND cs.agreement_id = 1294
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1327 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1327
  AND cs.agreement_id = 1295
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1328 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1328
  AND cs.agreement_id = 1296
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1329 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1329
  AND cs.agreement_id = 1297
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1330 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1330
  AND cs.agreement_id = 1298
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1331 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1331
  AND cs.agreement_id = 1299
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1332 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1332
  AND cs.agreement_id = 1300
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1333 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1333
  AND cs.agreement_id = 1301
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1334 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1334
  AND cs.agreement_id = 1302
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1335 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1335
  AND cs.agreement_id = 1303
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1336 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1336
  AND cs.agreement_id = 1304
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1337 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1337
  AND cs.agreement_id = 1305
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1338 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1338
  AND cs.agreement_id = 1306
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1339 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1339
  AND cs.agreement_id = 1307
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1340 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1340
  AND cs.agreement_id = 1308
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1341 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1341
  AND cs.agreement_id = 1309
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1342 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1342
  AND cs.agreement_id = 1310
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1343 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1343
  AND cs.agreement_id = 1311
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1344 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1344
  AND cs.agreement_id = 1312
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1345 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1345
  AND cs.agreement_id = 1313
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1346 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1346
  AND cs.agreement_id = 1314
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1347 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1347
  AND cs.agreement_id = 1315
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1348 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1348
  AND cs.agreement_id = 1316
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1349 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1349
  AND cs.agreement_id = 1317
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1350 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1350
  AND cs.agreement_id = 1318
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1351 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1351
  AND cs.agreement_id = 1319
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1352 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1352
  AND cs.agreement_id = 1320
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1353 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1353
  AND cs.agreement_id = 1321
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1354 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1354
  AND cs.agreement_id = 1322
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1355 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1355
  AND cs.agreement_id = 1323
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1356 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1356
  AND cs.agreement_id = 1324
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1357 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1357
  AND cs.agreement_id = 1325
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1358 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1358
  AND cs.agreement_id = 1326
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1359 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1359
  AND cs.agreement_id = 1327
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1360 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1360
  AND cs.agreement_id = 1328
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1361 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1361
  AND cs.agreement_id = 1329
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1362 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1362
  AND cs.agreement_id = 1330
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1363 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1363
  AND cs.agreement_id = 1331
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1364 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1364
  AND cs.agreement_id = 1332
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1365 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1365
  AND cs.agreement_id = 1333
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1366 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1366
  AND cs.agreement_id = 1334
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1367 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1367
  AND cs.agreement_id = 1335
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1368 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1368
  AND cs.agreement_id = 1336
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1369 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1369
  AND cs.agreement_id = 1337
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1370 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1370
  AND cs.agreement_id = 1338
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1371 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1371
  AND cs.agreement_id = 1339
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1372 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1372
  AND cs.agreement_id = 1340
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1373 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1373
  AND cs.agreement_id = 1341
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1374 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1374
  AND cs.agreement_id = 1342
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1375 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1375
  AND cs.agreement_id = 1343
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1376 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1376
  AND cs.agreement_id = 1344
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1377 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1377
  AND cs.agreement_id = 1345
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1378 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1378
  AND cs.agreement_id = 1346
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1379 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1379
  AND cs.agreement_id = 1347
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1380 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1380
  AND cs.agreement_id = 1348
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1381 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1381
  AND cs.agreement_id = 1349
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1382 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1382
  AND cs.agreement_id = 1350
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1383 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1383
  AND cs.agreement_id = 1351
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1384 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1384
  AND cs.agreement_id = 1352
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1385 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1385
  AND cs.agreement_id = 1353
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1386 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1386
  AND cs.agreement_id = 1354
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1387 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1387
  AND cs.agreement_id = 1355
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1388 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1388
  AND cs.agreement_id = 1356
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1389 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1389
  AND cs.agreement_id = 1357
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1390 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1390
  AND cs.agreement_id = 1358
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1391 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1391
  AND cs.agreement_id = 1359
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1392 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1392
  AND cs.agreement_id = 1360
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1393 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1393
  AND cs.agreement_id = 1361
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1394 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1394
  AND cs.agreement_id = 1362
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1395 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1395
  AND cs.agreement_id = 1363
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1396 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1396
  AND cs.agreement_id = 1364
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1397 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1397
  AND cs.agreement_id = 1365
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1398 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1398
  AND cs.agreement_id = 1366
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1399 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1399
  AND cs.agreement_id = 1367
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1400 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1400
  AND cs.agreement_id = 1368
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1401 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1401
  AND cs.agreement_id = 1369
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1402 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1402
  AND cs.agreement_id = 1370
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1403 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1403
  AND cs.agreement_id = 1371
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1404 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1404
  AND cs.agreement_id = 1372
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1405 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1405
  AND cs.agreement_id = 1373
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1406 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1406
  AND cs.agreement_id = 1374
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1407 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1407
  AND cs.agreement_id = 1375
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1408 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1408
  AND cs.agreement_id = 1376
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1409 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1409
  AND cs.agreement_id = 1377
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1410 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1410
  AND cs.agreement_id = 1378
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1411 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1411
  AND cs.agreement_id = 1379
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1412 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1412
  AND cs.agreement_id = 1380
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1413 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1413
  AND cs.agreement_id = 1381
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1414 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1414
  AND cs.agreement_id = 1382
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1415 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1415
  AND cs.agreement_id = 1383
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1416 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1416
  AND cs.agreement_id = 1384
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1417 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1417
  AND cs.agreement_id = 1385
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1418 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1418
  AND cs.agreement_id = 1386
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;

-- Conectar agente 1419 → Open Insurances (786)
INSERT INTO agency_level (id, commercial_structure_id, general_agent_id, agreement_id, created_at, updated_at)
SELECT @agency_level_id,
       cs.id,
       @parent_agent_id,
       @parent_agreement_id,
       NOW(),
       NOW()
FROM commercial_structure cs
WHERE cs.general_agent_id = 1419
  AND cs.agreement_id = 1387
LIMIT 1;

SET @agency_level_id = @agency_level_id + 1;
