Passing filter params to a sub query
In MySQL You can try a function

create function modul_id() returns INTEGER DETERMINISTIC NO SQL return @modul_id;
create view v (your select... where modul_id = modul_id()...);
select * from (select @modul_id:=14 modul_id) m, v;


not tested on your query...