@ -76,6 +76,12 @@
<if test= "query.supplierId!=null and query.supplierId!=''" >
and bms_supplier_channel.`supplier_id` = #{query.supplierId} and bms_supplier_channel.`del_flag` = 0
</if>
<if test= "query.seachChannelIds!=null and query.seachChannelIds.size>0" >
and `bms_channel_point`.`channel_id` in
<foreach collection= "query.seachChannelIds" item = "selectId" index= "i" open= "(" close= ")" separator= "," >
#{selectId}
</foreach>
</if>
<if test= "query.id != null" > and `bms_channel_point`.`id` = #{query.id}</if>
<if test= "query.channelId != null" > and `bms_channel_point`.`channel_id` = #{query.channelId}</if>
<if test= "query.channelName != null and query.channelName != ''" > and `bms_channel_point`.`channel_name` like concat('%',#{query.channelName},'%') </if>
@ -279,13 +285,16 @@
<select id= "selectPointByUserIds" resultType= "com.qs.serve.modules.bms.entity.BmsChannelPoint" >
SELECT <include refid= "bmsChannelPointSql" /> FROM
( SELECT channel_id FROM `bms_supplier_channel`
( SELECT distinct channel_id FROM `bms_supplier_channel`
LEFT JOIN `his_user_supplier` ON `his_user_supplier`.supplier_id = bms_supplier_channel.supplier_id
where his_user_supplier.user_id in
<foreach collection= "userIds" item = "selectId" index= "i" open= "(" close= ")" separator= "," >
#{selectId}
</foreach>
<if test= "supplierId != null and supplierId != ''" > and bms_supplier_channel.supplier_id = #{supplierId}</if>
<if test= "query.seachSupplierName != null and query.seachSupplierName!=''" >
and `his_user_supplier`.`supplier_name` like concat('%',#{query.seachSupplierName},'%')
</if>
and `bms_supplier_channel`.`del_flag` = 0
GROUP BY channel_id
) tmp left join`bms_channel_point` `bms_channel_point` ON `tmp`.channel_id = bms_channel_point.`channel_id`
@ -313,13 +322,16 @@
</select>
<select id= "selectCountPointByUserIds" resultType= "java.lang.Long" >
SELECT count(1) FROM
( SELECT channel_id FROM `bms_supplier_channel`
( SELECT distinct channel_id FROM `bms_supplier_channel`
LEFT JOIN `his_user_supplier` ON `his_user_supplier`.supplier_id = bms_supplier_channel.supplier_id
where his_user_supplier.user_id in
<foreach collection= "userIds" item = "selectId" index= "i" open= "(" close= ")" separator= "," >
#{selectId}
</foreach>
<if test= "supplierId != null and supplierId != ''" > and bms_supplier_channel.supplier_id = #{supplierId}</if>
<if test= "query.seachSupplierName != null and query.seachSupplierName!=''" >
and `his_user_supplier`.`supplier_name` like concat('%',#{query.seachSupplierName},'%')
</if>
and `bms_supplier_channel`.`del_flag` = 0
GROUP BY channel_id
) tmp left join`bms_channel_point` `bms_channel_point` ON `tmp`.channel_id = bms_channel_point.`channel_id`