select_theme_sql+=" and ((person_id = '"+person_id+"') or ( id in (select theme_id from t_ai_teaching_model_theme_scope where check_flag = 1 and is_deleted = 0 and permission_type = 1 and ((scope_type = 1 and scope_value = '"+city_id+"') or (scope_type = 2 and scope_value = '"+area_id+"') or (scope_type = 3 and scope_value = '"+bureau_id+"') or (scope_type = 4 and scope_value = '"+person_id+"')))))"
elifscope_type==1:
select_theme_sql+=" and id in (select theme_id from t_ai_teaching_model_theme_scope where check_flag = 1 and is_deleted = 0 and scope_type = 1 and scope_value = '"+city_id+"' and permission_type = 1)"
elifscope_type==2:
select_theme_sql+=" and id in (select theme_id from t_ai_teaching_model_theme_scope where check_flag = 1 and is_deleted = 0 and scope_type = 2 and scope_value = '"+area_id+"' and permission_type = 1)"
elifscope_type==3:
select_theme_sql+=" and id in (select theme_id from t_ai_teaching_model_theme_scope where check_flag = 1 and is_deleted = 0 and scope_type = 3 and scope_value = '"+bureau_id+"' and permission_type = 1)"
elifscope_type==4:
select_theme_sql+=" and id in (select theme_id from t_ai_teaching_model_theme_scope where check_flag = 1 and is_deleted = 0 and scope_type = 4 and scope_value = '"+person_id+"' and permission_type = 1)"
elifscope_type==5:
select_theme_sql+=" and person_id = '"+person_id+"'"
# 拼接查询SQL语句
select_theme_sql:str=" SELECT * FROM t_ai_teaching_model_theme WHERE is_deleted = 0 and person_id = '"+person_id+"'"
ifstage_id!=-1:
select_theme_sql+=" and stage_id = "+str(stage_id)
select_theme_sql+=" and ((person_id = '"+person_id+"') or ( id in (select theme_id from t_ai_teaching_model_theme_scope where check_flag = 1 and is_deleted = 0 and ((scope_type = 1 and scope_value = '"+city_id+"') or (scope_type = 2 and scope_value = '"+area_id+"') or (scope_type = 3 and scope_value = '"+bureau_id+"') or (scope_type = 4 and scope_value = '"+person_id+"')))))"
ifstage_id!=-1:
select_theme_sql+=" and stage_id = "+str(stage_id)
ifsubject_id!=-1:
select_theme_sql+=" and subject_id = "+str(subject_id)
select_theme_sql:str=f" select {column_str} from t_ai_teaching_model_theme t1, t_ai_teaching_model_theme_scope t2 where t1.is_deleted = 0 and t2.is_deleted = 0 and t1.id = t2.theme_id and t2.created_by = '{person_id}'"
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.