|
|
@@ -553,10 +553,10 @@
|
|
|
tmc.last_follow_status as "lastFollowStatus",
|
|
|
tmc.last_follow_time as "lastFollowTime"
|
|
|
from dkic_b.t_mst_customer as tmc
|
|
|
- inner join dkic_b.t_mst_org tmo on tmc.org_id = tmo.org_id
|
|
|
- inner join dkic_b.t_mst_staff tms on tmc.staff_id = tms.staff_id
|
|
|
- inner join dkic_b.t_mst_staff as reportstaff on tmc.report_staff = reportstaff.staff_id
|
|
|
- inner join dkic_b.t_mst_sale_channel tmsc on tmc.channel_id = tmsc.channel_id
|
|
|
+ left join dkic_b.t_mst_org tmo on tmc.org_id = tmo.org_id
|
|
|
+ left join dkic_b.t_mst_staff tms on tmc.staff_id = tms.staff_id
|
|
|
+ left join dkic_b.t_mst_staff as reportstaff on tmc.report_staff = reportstaff.staff_id
|
|
|
+ left join dkic_b.t_mst_sale_channel tmsc on tmc.channel_id = tmsc.channel_id
|
|
|
left join dkic_b.t_mst_dictionary_data tmdd on tmc.cus_from = tmdd.data_id
|
|
|
where tmc.flg_valid
|
|
|
AND tmc.cp_id = #{cpId}
|
|
|
@@ -1022,8 +1022,8 @@
|
|
|
'供应商' as "objTypeName",
|
|
|
1 as "objType",
|
|
|
tms.flg_valid as "flgValid",
|
|
|
- null as "phone",
|
|
|
- null as "addressFull"
|
|
|
+ tms.contact_phone as "phone",
|
|
|
+ tms.return_address as "addressFull"
|
|
|
from dkic_b.t_mst_supplier tms
|
|
|
<where >
|
|
|
<if test="flgValid">
|
|
|
@@ -1035,6 +1035,13 @@
|
|
|
<if test="objName != null and objName != ''">
|
|
|
AND tms.sup_name LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
</if>
|
|
|
+ <if test="searchText != null and searchText != ''">
|
|
|
+ AND (
|
|
|
+ tms.sup_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tms.contact_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tms.return_address LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
</where>
|
|
|
union all
|
|
|
select cus.cus_id as "objId",
|
|
|
@@ -1056,11 +1063,19 @@
|
|
|
<if test="objName != null and objName != ''">
|
|
|
AND cus.cus_name LIKE concat('%',my_ex.likequery(#{objName}),'%')
|
|
|
</if>
|
|
|
- <if test="flgValid">
|
|
|
- AND cus.flgValid
|
|
|
+ <if test="searchText != null and searchText != ''">
|
|
|
+ AND ( cus.cus_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or cus.cus_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or cus.address_full LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ )
|
|
|
</if>
|
|
|
</where>
|
|
|
) tt
|
|
|
+ <where>
|
|
|
+ <if test="objType != null and objType != ''">
|
|
|
+ AND tt.objType = #{objType}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
@@ -1087,6 +1102,13 @@
|
|
|
<if test="objName != null and objName != ''">
|
|
|
AND tms.sup_name LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
</if>
|
|
|
+ <if test="searchText != null and searchText != ''">
|
|
|
+ AND (
|
|
|
+ tms.sup_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tms.contact_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tms.return_address LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
</where>
|
|
|
union all
|
|
|
select cus.cus_id as "objId",
|
|
|
@@ -1108,8 +1130,19 @@
|
|
|
<if test="objName != null and objName != ''">
|
|
|
AND cus.cus_name LIKE concat('%',my_ex.likequery(#{objName}),'%')
|
|
|
</if>
|
|
|
+ <if test="searchText != null and searchText != ''">
|
|
|
+ AND ( cus.cus_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or cus.cus_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or cus.address_full LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
</where>
|
|
|
) tt
|
|
|
+ <where>
|
|
|
+ <if test="objType != null and objType != ''">
|
|
|
+ AND tt.objType = #{objType}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
|
|
|
|