业务,实验室负责人存的是用逗号拼接起来的用户ids,前台高级查询传过来用户的用户名
SELECT * FROM( SELECT t.laboratory_id, t.dept_id, t.lab_name, t.lab_abb, t.manager_user_ids, t.telephone, t.status, t.location, t.scale, t.ask, t.content, t.create_user, t.create_date, t.update_user, t.update_date, substring_index( substring_index( t.manager_user_ids, ',', b.help_topic_id + 1 ), ',',- 1 ) as manager_user_id FROM base_laboratory t JOIN mysql.help_topic b ON b.help_topic_id < ( length( t.manager_user_ids ) - length( REPLACE ( t.manager_user_ids, ',', '' ) ) + 1 ) ) t LEFT JOIN sys_user su on t.manager_user_id = su.user_id WHERE su.`name` like '%谭%'