getting not the same results in sql query CTE and pyspark code

I have an sql query which I want to display in pyspark. but I don't get the same results in pyspark.

this is my pyspark code

te_ekf_df =

te_pcr_rate_df = te_pcr_rate_df.alias("pcr_rate_df_p")
te_ekf_df_e = te_ekf_df.alias("te_ekf_df_e")
pcr_rate_df_p = pcr_rate_df_p.withColumn('k_date', F.to_date('k_date', 'yyyy-MM-dd'))
te_ekf_df_e = te_ekf_df_e.withColumn('cr_date', F.to_date('cr_date', 'yyyy-MM-dd'))

pcr_rate_df_p = pcr_rate_df_p.join(te_ekf_df_e, on=[
        pcr_rate_df_p['t_code'] == te_ekf_df_e['t_code']], how='left')
        #pcr_rate_df_p['o_id'] == te_ekf_df_e['o_id'],
        #pcr_rate_df_p['k_date'] == te_ekf_df_e['cr_date']], how='left')

pcr_rate_df_p = pcr_rate_df_p.where(
        (F.col('pcr_rate_df_p.t_code') == 'AS04') &
        (F.col('pcr_rate_df_p.o_id') == '85-5') &
        (F.col('te_ekf_df_e.rt_value') == 0)
        'k_date', 'cr_date', 'pcr_rate_df_p.t_code', 'pcr_rate_df_p.o_id'
        F.sum(F.when(F.col('k_id') == 11201, F.col('value'))).alias('typ_1'),
        F.sum(F.when(F.col('k_id') == 11208, F.col('value'))).alias('typ_2'),
        F.sum(F.when(F.col('k_id') == 23201, F.col('value'))).alias('typ_3'),
        F.desc('k_date'), F.desc('cr_date'), F.col('t_code')

I have two tables that I join with each other. In the join condition I have removed the two 'on' conditions because I get no results for them. What am I doing wrong? I do not get any results for the columns type_2 and type_3. The value in column type_1 does not match either. Do I have to join at the end?

Here is my sql statement:

;with t1
as (select k_date, o_id, t_code, k_id, key_code, 
sum(value) as value
    from table1
    group by k_date, o_id, t_code, k_id, key_code)
    , t2
    as (select cr_date, o_id, t_code, k_id, rt_value, 
sum(value) as value
        from table2 
        where rt_value = 0
        group by cr_date, o_id, t_code, k_id, rt_value) 
select t1.k_date, t2.cr_date,  t1.o_id, t1.t_code, t1.key_code, t2.rt_value,
        sum(case when t1.k_id = 11201 then t1.value else null end) as typ_1,
        sum(case when t1.k_id = 11208 then t1.value else null end) as typ_2,
        sum(case when t2.k_id = 23201 then t2.value else null end) as typ_3
from t1
join t2
    on t1.o_id = t2.o_id
    and t1.t_code = t2.t_code
    and (split_part(t2.cr_date,' ',1))  = (split_part(t1.k_date,' ',1))
group by t1.k_date, t2.cr_date, t2.rt_value , t1.o_id, t1.t_code, t1.key_code 
order by t1.k_date desc, t2.cr_date desc, t2.rt_value , t1.o_id, t1.t_code, t1.key_code