select tbl01.*, 
       if( ifnull(i11.timh1, 0)=0, tbl01.timh1_1, ifnull(i11.timh1, 0)) as timh1, 
       if( ifnull(i11.timh2, 0)=0, tbl01.timh2_1, ifnull(i11.timh2, 0)) as timh2, 
       if( ifnull(i11.timh3, 0)=0, tbl01.timh3_1, ifnull(i11.timh3, 0)) as timh3, 
       if( ifnull(i11.timh4, 0)=0, tbl01.timh4_1, ifnull(i11.timh4, 0)) as timh4 
       
from (
        {peg_str1}
     ) as tbl01
LEFT JOIN i11 ON i11.p01='{pub_arr1[2]}'
              && i11.p02='{pub_arr1[7]}';
     