说明:module 模块表里面存在bank_id、project_id,搜索框可通过模块名、项目名和银行名搜索。三者之间的关系是银行包含项目、项目包含模块。
SELECT m.* FROM module m
where
m.name LIKE concat('%',#{keyWord, jdbcType=VARCHAR},'%')
or m.bank_id in (select id from bank where bank_name like concat('%',#{keyWord, jdbcType=VARCHAR},'%'))
or m.project_id in (select id from project where name like concat('%',#{keyWord, jdbcType=VARCHAR},'%'))