select e.id, e.organ_code, e.organ_name, e.location, e.address, e.accuracy, e.dimension, e.is_organ, e.contact_person, e.contact_number, e.website_url, e.login_logo, e.login_background, e.creater_user_id, e.creater_time, e.update_user_id, e.update_time, e.status, e.data_status,u.user_id,(select r.role_id from sys_role r where r.role_key=e.organ_code ) as role_id from ti_enterprise_info e left join sys_user u on e.organ_code = u.organ_code
select e.id, e.organ_code, e.organ_name, e.location, e.address, e.accuracy, e.dimension, e.is_organ,e.login_title, e.contact_person, e.contact_number, e.website_url, e.login_logo, e.login_background, e.creater_user_id, e.creater_time, e.update_user_id, e.update_time, e.status, e.data_status,u.user_id,(select r.role_id from sys_role r where r.role_key=e.organ_code ) as role_id from ti_enterprise_info e left join sys_user u on e.organ_code = u.organ_code
<where>
<iftest="organCode != null and organCode != ''"> and e.organ_code = #{organCode}</if>
<iftest="organName != null and organName != ''"> and e.organ_name like concat('%', #{organName}, '%')</if>