全连接 左连接 区别?
单输入框多条件查询 子查询
(查询添加关注的联系人)
传入参数 :keyword :userId
--------------------
--getFollowContactByNameselect *,get_first_pinyin_char(contact_name) as py from crm_contact g
left join crm_customer s on g.customer_id = s.customer_id
where g.deleteflag <> 'Y'
and (exists (select 1 from crm_contact_follow fc where fc.contact_id = g.contact_id and fc.system_user_id = :userId))
<#if keyword?? && keyword != "">
and (g.contact_name like :keyword
or g.contact_sex like :keyword
or g.contact_email like :keyword
or g.contact_mobile like :keyword
or g.contact_qq like :keyword
or g.contact_duties like :keyword
or g.contact_address like :keyword)
</#if>
order by py
<