
SELECT *
FROM API_BANK_LIST
WHERE BANK_COUNTRY = 'MONGOLIA'

SELECT *
FROM API_BANK_LIST_MASTER
WHERE  BANK_COUNTRY = 'MONGOLIA'

SELECT *
FROM agentMaster

--MONGOLIA, BANK DEPOSIT
INSERT INTO API_BANK_LIST
SELECT 394488, 'Trade and Development Bank of Mongolia', '040000', 'MGO394684', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 2, 1, 'NEW MON BANK', NULL, 'BANK DEPOSIT', GETDATE(), NULL UNION ALL
SELECT 394488, 'Khan Bank', '050000', 'MGO394685', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 2, 1, 'NEW MON BANK', NULL, 'BANK DEPOSIT', GETDATE(), NULL UNION ALL
SELECT 394488, 'Golomt Bank', 'GMT', 'MGO394686', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 2, 1, 'NEW MON BANK', NULL, 'BANK DEPOSIT', GETDATE(), NULL UNION ALL
SELECT 394488, 'The State Bank', '340000', 'MGO394687', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 2, 1, 'NEW MON BANK', NULL, 'BANK DEPOSIT', GETDATE(), NULL UNION ALL
SELECT 394488, 'Xac Bank', '320000', 'MGO394688', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 2, 1, 'NEW MON BANK', NULL, 'BANK DEPOSIT', GETDATE(), NULL UNION ALL
SELECT 394488, 'Chinggis Bank', '330000', 'MGO394690', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 2, 1, 'NEW MON BANK', NULL, 'BANK DEPOSIT', GETDATE(), NULL UNION ALL
SELECT 394488, 'Capitron Bank of Mongolia', '300000', 'MGO394691', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 2, 1, 'NEW MON BANK', NULL, 'BANK DEPOSIT', GETDATE(), NULL UNION ALL
SELECT 394488, 'National Investment Bank', '290000', 'MGO394692', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 2, 1, 'NEW MON BANK', NULL, 'BANK DEPOSIT', GETDATE(), NULL UNION ALL
SELECT 394488, 'Arig Bank', '210000', 'MGO394693', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 2, 1, 'NEW MON BANK', NULL, 'BANK DEPOSIT', GETDATE(), NULL UNION ALL
SELECT 394488, 'Bogd Bank', '380000', 'MGO394695', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 2, 1, 'NEW MON BANK', NULL, 'BANK DEPOSIT', GETDATE(), NULL UNION ALL
SELECT 394488, 'TransBank of Mongolia', '900000', 'MGO394696', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 2, 1, 'NEW MON BANK', NULL, 'BANK DEPOSIT', GETDATE(), NULL UNION ALL
SELECT 394488, 'Development Bank', '190000', 'MGO394697', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 2, 1, 'NEW MON BANK', NULL, 'BANK DEPOSIT', GETDATE(), NULL UNION ALL
SELECT 394488, 'MobiFinance NBFI', 'MGO394713', 'MGO394713', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 13, 1, 'NEW MON BANK', NULL, 'MOBILE WALLET', GETDATE(), NULL UNION ALL
SELECT 394488, 'Ard Credit NBFI', 'MGO394714', 'MGO394714', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 13, 1, 'NEW MON BANK', NULL, 'MOBILE WALLET', GETDATE(), NULL UNION ALL
SELECT 394488, 'Hi payment solution LLC', 'MGO394715', 'MGO394715', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 13, 1, 'NEW MON BANK', NULL, 'MOBILE WALLET', GETDATE(), NULL  UNION ALL
SELECT 394488, 'The State Bank 3.0', 'MGOCASH', 'MGO394747', NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 2, 1, 'NEW MON BANK', NULL, 'BANK DEPOSIT', GETDATE(), NULL  

select * from API_BANK_LIST where api_partner_id='394488' and jme_bank_code='NEW MON BANK'
update API_BANK_LIST set jme_bank_code ='IME000'+CAST(BANK_ID AS VARCHAR) , API_PARTNER_ID='394488'  where  jme_bank_code='NEW MON BANK'

--INSERT INTO API_BANK_LIST
--SELECT 394475, 'Mongolia Wallet', 'MGOWLT', NULL, NULL, NULL, NULL, NULL, NULL, 'MNT', 'MONGOLIA', 13, 1, 'NEW MON WALLET', NULL, 'MOBILE WALLET', GETDATE(), NULL


select * from API_BANK_LIST where api_partner_id='394488' and jme_bank_code='NEW MON WALLET'
update API_BANK_LIST set jme_bank_code ='IME000'+CAST(BANK_ID AS VARCHAR)  where api_partner_id='394488' and jme_bank_code='NEW MON WALLET'




INSERT INTO API_BANK_LIST_MASTER
SELECT BANK_NAME, JME_BANK_CODE, NULL, NULL, NULL, NULL, NULL, SUPPORT_CURRENCY, BANK_COUNTRY, PAYMENT_TYPE_ID, 1, NULL, NULL, NULL
FROM API_BANK_LIST WHERE api_partner_id='394488'


--update remitTran set tranStatus='Payment', payStatus='Unpaid' where controlNo= dbo.encryptDb('213036867')