TYPE=VIEW
query=select `la`.`acc_no` AS `acc_no`,`la`.`name` AS `name`,`li`.`issue_date` AS `issue_date`,`li`.`loan_amt` AS `loan_amt`,concat(`li`.`ins_type`,\' [ \',`li`.`duration`,`li`.`duration_type`,\' ]\') AS `ist_type`,round((`li`.`loan_amt` / `li`.`loan_inst`),0) AS `inst_ant`,`li`.`imst_date` AS `due_date`,round(if((`li`.`tdate` <= `li`.`fianl_date`),0,`li`.`clear_amt`),0) AS `od_amt`,`li`.`clear_amt` AS `clear_amt`,round(if((`li`.`tdate` <= `li`.`fianl_date`),0,(((`li`.`clear_amt` * (`li`.`od_days` / 365)) * (`li`.`od_int` / 100)) + ((`li`.`clear_amt` * (`li`.`cc_days` / 365)) * (`li`.`cc_int` / 100)))),0) AS `od_int_a`,round(if((`li`.`tdate` <= `li`.`fianl_date`),((`li`.`clear_amt` * (`li`.`days` / 365)) * (`li`.`cc_int` / 100)),0),0) AS `cc_int_a`,if((timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) < 21),`li`.`clear_amt`,0) AS `standard`,if(((timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) >= 21) and (timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) < 36)),`li`.`clear_amt`,0) AS `sub_standard`,0 AS `r_value`,if(((timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) >= 36) and (timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) < 48)),`li`.`clear_amt`,0) AS `d1`,if(((timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) >= 48) and (timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) < 72)),`li`.`clear_amt`,0) AS `d2`,if((timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) >= 72),`li`.`clear_amt`,0) AS `d3`,0 AS `unsecure`,0 AS `loss`,`li`.`days` AS `days` from (`co-operativebank-mitrachak`.`loan_inf` `li` join `co-operativebank-mitrachak`.`loan_account` `la`) where ((`la`.`acc_no` = `li`.`acc_no`) and (`li`.`clear_amt` >= 0) and (`li`.`clear_amt` <> 0)) group by `li`.`acc_no`
md5=de7f86f3317aff4bd66e275635dd94b1
updatable=0
algorithm=0
definer_user=root
definer_host=localhost
suid=1
with_check_option=0
timestamp=2019-05-30 04:21:37
create-version=1
source=select  `la`.`acc_no`  AS  `acc_no` ,\n `la`.`name`  AS  `name` ,\n `li`.`issue_date`  AS  `issue_date` ,\n `li`.`loan_amt`  AS  `loan_amt` ,\nconcat(  `li`.`ins_type` ,  \' [ \',  `li`.`duration` ,  `li`.`duration_type` ,  \' ]\'  )  AS  `ist_type` ,\nround( (  `li`.`loan_amt`  /  `li`.`loan_inst`  ), 0  )  AS  `inst_ant` ,\n `li`.`imst_date`  AS  `due_date` ,\nround( if( (  `li`.`tdate`  <=  `li`.`fianl_date`  ), 0,  `li`.`clear_amt`  ) , 0  )  AS  `od_amt` ,\n `li`.`clear_amt`  AS  `clear_amt` ,\nround( if( (  `li`.`tdate`  <=  `li`.`fianl_date`  ), 0, ( ( (  `li`.`clear_amt`  * (  `li`.`od_days`  /365  )  )  * (  `li`.`od_int`  /100  )  )  + ( (  `li`.`clear_amt`  * (  `li`.`cc_days`  /365  )  )  * (  `li`.`cc_int`  /100  )  ) ) ),\n0 ) AS  `od_int_a` ,\nround( if( (  `li`.`tdate`  <=  `li`.`fianl_date`  ), ( (  `li`.`clear_amt`  * (  `li`.`days`  /365  )  )  * (  `li`.`cc_int`  /100  )  ) ,\n0 ),\n0 ) AS  `cc_int_a` ,\nif( ( timestampdiff(  MONTH ,  `li`.`issue_date` ,  `li`.`tdate`  )  <21  ) ,\n `li`.`clear_amt` ,\n0 ) AS  `standard` ,\nif( ( ( timestampdiff(  MONTH ,  `li`.`issue_date` ,  `li`.`tdate`  )  >=21  )  and ( timestampdiff(  MONTH ,  `li`.`issue_date` ,  `li`.`tdate`  )  <36 ) ),\n `li`.`clear_amt` ,\n0 ) AS  `sub_standard` ,\n0 AS  `r_value` ,\nif( ( ( timestampdiff(  MONTH ,  `li`.`issue_date` ,  `li`.`tdate`  )  >=36  )  and ( timestampdiff(  MONTH ,  `li`.`issue_date` ,  `li`.`tdate`  )  <48 ) ),\n `li`.`clear_amt` ,\n0 ) AS  `d1` ,\nif( ( ( timestampdiff(  MONTH ,  `li`.`issue_date` ,  `li`.`tdate`  )  >=48  )  and ( timestampdiff(  MONTH ,  `li`.`issue_date` ,  `li`.`tdate`  )  <72 ) ),\n `li`.`clear_amt` ,\n0 ) AS  `d2` ,\nif( ( timestampdiff(  MONTH ,  `li`.`issue_date` ,  `li`.`tdate`  )  >=72  ) ,\n `li`.`clear_amt` ,\n0 ) AS  `d3` ,\n0 AS  `unsecure` ,\n0 AS  `loss` ,\n `li`.`days`  AS  `days`  from (  `co-operativebank-mitrachak`.`loan_inf`  `li`  join  `co-operativebank-mitrachak`.`loan_account`  `la`  ) where ( (  `la`.`acc_no`  =  `li`.`acc_no`  ) and (  `li`.`clear_amt`  >=0 ) and (  `li`.`clear_amt`  <>0 ) ) group  by  `li`.`acc_no`
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `la`.`acc_no` AS `acc_no`,`la`.`name` AS `name`,`li`.`issue_date` AS `issue_date`,`li`.`loan_amt` AS `loan_amt`,concat(`li`.`ins_type`,\' [ \',`li`.`duration`,`li`.`duration_type`,\' ]\') AS `ist_type`,round((`li`.`loan_amt` / `li`.`loan_inst`),0) AS `inst_ant`,`li`.`imst_date` AS `due_date`,round(if((`li`.`tdate` <= `li`.`fianl_date`),0,`li`.`clear_amt`),0) AS `od_amt`,`li`.`clear_amt` AS `clear_amt`,round(if((`li`.`tdate` <= `li`.`fianl_date`),0,(((`li`.`clear_amt` * (`li`.`od_days` / 365)) * (`li`.`od_int` / 100)) + ((`li`.`clear_amt` * (`li`.`cc_days` / 365)) * (`li`.`cc_int` / 100)))),0) AS `od_int_a`,round(if((`li`.`tdate` <= `li`.`fianl_date`),((`li`.`clear_amt` * (`li`.`days` / 365)) * (`li`.`cc_int` / 100)),0),0) AS `cc_int_a`,if((timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) < 21),`li`.`clear_amt`,0) AS `standard`,if(((timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) >= 21) and (timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) < 36)),`li`.`clear_amt`,0) AS `sub_standard`,0 AS `r_value`,if(((timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) >= 36) and (timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) < 48)),`li`.`clear_amt`,0) AS `d1`,if(((timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) >= 48) and (timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) < 72)),`li`.`clear_amt`,0) AS `d2`,if((timestampdiff(MONTH,`li`.`issue_date`,`li`.`tdate`) >= 72),`li`.`clear_amt`,0) AS `d3`,0 AS `unsecure`,0 AS `loss`,`li`.`days` AS `days` from (`co-operativebank-mitrachak`.`loan_inf` `li` join `co-operativebank-mitrachak`.`loan_account` `la`) where ((`la`.`acc_no` = `li`.`acc_no`) and (`li`.`clear_amt` >= 0) and (`li`.`clear_amt` <> 0)) group by `li`.`acc_no`
