USE obpm2 ;
INSERT INTO obpm2.identity_user(id,created_time,name,telephone,tenant_user_id,note,idnum,we_chat_json )
SELECT DISTINCT t.ID,t.created_time,t.name,t.telephone,t.id as tenant_user_id,null as note,c.number ,null
FROM obpm2.tenant_users t join obpm2.tenant_user_credentials c on c.tenant_user_id =t.id and c.credential_type =0
where t.created_time >'2023-03-01' and t.id not  in (select cc.tenant_user_id from obpm2.identity_user cc);

INSERT INTO `obpm2`.`identity_principals`(`id`, `created_time`, `last_login_time`, `last_status_changed_time`, `last_updated_time`, `status`, `identity_user_id`)
SELECT
    ID,created_time ,created_time ,created_time ,created_time ,0,id
FROM obpm2.tenant_users WHERE ID IN ('0aKAfFBJ',
                                     '0fmSNRHa',
                                     '1GIU8D1x',
                                     '1MTYygMY',
                                     '3iNdDDnP',
                                     '3Kfga1fj',
                                     '3kzkVXVr',
                                     '4fmtL5ow',
                                     '5jb26jmL',
                                     '6pnadOVk',
                                     '7b45QGdF',
                                     '8VILQckT',
                                     '9cuYIaBY',
                                     'a46rTFwj',
                                     'aG07IaQy',
                                     'aNiPtJ8G',
                                     'aR3qaEnY',
                                     'azcbNxLl',
                                     'B71Hyj4u',
                                     'bDH4qNOU',
                                     'bHWcDbjO',
                                     'bi65DVx3',
                                     'BjP7oorY',
                                     'BMIKfTho',
                                     'BtJtLNx4',
                                     'bvWxASDa',
                                     'CcAazs2s',
                                     'cerbDoUy',
                                     'CJLxmXTr',
                                     'CmHoJsta',
                                     'CoQqv4tv',
                                     'cWGxedx3',
                                     'Dau5cKa9',
                                     'DLAweHjW',
                                     'E8SthPHf',
                                     'EmsViOps',
                                     'EoB2rZCt',
                                     'F0DvXIYC',
                                     'FcGmJL4J',
                                     'fGSmxacR',
                                     'FUZqucqW',
                                     'ghWRm4fo',
                                     'gUohd0tD',
                                     'Hbh1wRxU',
                                     'HhdYIjuj',
                                     'HJ3Gel2J',
                                     'HrKo1qhW',
                                     'HUFABSYm',
                                     'HyC11gIW',
                                     'IZc6Ys46',
                                     'j1S2ABY6',
                                     'JUYwfwrl',
                                     'Jxa8sxKS',
                                     'K1VSBFI3',
                                     'KgPFINmb',
                                     'kQTTwkIT',
                                     'Ku7Sob7K',
                                     'KyK7fesg',
                                     'M4HnBRWv',
                                     'm5UTuH3y',
                                     'MeR8rQ14',
                                     'Mt83K3I1',
                                     'NEVfHs24',
                                     'nOJPpQCc',
                                     'NqPl91QY',
                                     'oEXgJzzU',
                                     'oV2GUeFf',
                                     'p8SHQ5JY',
                                     'PK46wpdH',
                                     'ptZlJFS4',
                                     'q7h30wUT',
                                     'qe80N1In',
                                     'qeeVUmPF',
                                     'QIJncri4',
                                     'qQnFIdwV',
                                     'qRZqNUpa',
                                     'rAmda4SW',
                                     'rb5tdtMG',
                                     'REA9hKue',
                                     'RJgra2Sl',
                                     'rKLubFGc',
                                     'S8IBWEZ0',
                                     'sD59aBxY',
                                     'szUrr1LD',
                                     'tR9twn77',
                                     'tU8LHlKJ',
                                     'tXKrfehm',
                                     'U4GXDeSJ',
                                     'uCdw3R7R',
                                     'UtANAqck',
                                     'Vzc0OUKB',
                                     'vZY8VDxT',
                                     'wHWKJPbh',
                                     'wlXRdSLu',
                                     'wskzGL0p',
                                     'X2SxKv9e',
                                     'XLxHl0RE',
                                     'xQaq2Uwh',
                                     'YG9XFMvA',
                                     'ykW0xslv',
                                     'YrGz7yYR',
                                     'YWg0bROT',
                                     'Zae9a3Fh',
                                     'ZAz6sQ3V',
                                     'zLQp3zHX');


use obpm2 ;