用户和全量私海列表sql更改

This commit is contained in:
陈伏伽
2023-10-19 16:15:13 +08:00
parent 98c01656d9
commit 82b63d6db0

View File

@@ -562,12 +562,30 @@
<if test="updateStartTime!=null and updateEndTime!=null"> <if test="updateStartTime!=null and updateEndTime!=null">
AND hpli.update_time BETWEEN #{updateStartTime} and #{updateEndTime} AND hpli.update_time BETWEEN #{updateStartTime} and #{updateEndTime}
</if> </if>
<if test="lineStartTime != null and lineEndTime != null">
AND hpli.create_time BETWEEN #{lineStartTime} and #{lineEndTime}
</if>
<if test="intentAreaName!=null and intentAreaName!=''"> <if test="intentAreaName!=null and intentAreaName!=''">
and hoai.area_path like concat('%/',#{intentAreaName},'/%') and hoai.area_path like concat('%/',#{intentAreaName},'/%')
</if> </if>
<if test="acceptAdjustType!=null"> <if test="acceptAdjustType!=null">
AND hpuinfo.accept_adjust_type = #{acceptAdjustType} AND hpuinfo.accept_adjust_type = #{acceptAdjustType}
</if> </if>
<if test="partnerName !=null and partnerName!=''">
AND hpuinfo.username like concat('%',#{partnerName},'%')
</if>
<if test="partnerMobile !=null and partnerMobile!=''">
AND hpuinfo.mobile like concat('%',#{partnerMobile},'%')
</if>
<if test="investmentManagerId !=null and investmentManagerId!=''">
AND hpli.investment_manager = #{investmentManagerId}
</if>
<if test="intentAreaId != null and intentAreaId !='' and intentAreaQueryType!=null and intentAreaQueryType='contains'">
AND hpuinfo.want_shop_area = #{intentAreaId}
</if>
<if test="intentAreaId != null and intentAreaId !='' and intentAreaQueryType!=null and intentAreaQueryType='notContains'">
AND hpuinfo.want_shop_area != #{intentAreaId}
</if>
<if test="storeKeyword!=null and storeKeyword!='' and storeKeywordType!=null and storeKeywordType=='storeCode'"> <if test="storeKeyword!=null and storeKeyword!='' and storeKeywordType!=null and storeKeywordType=='storeCode'">
AND hpuinfo.shop_code like concat('%',#{storeKeyword},'%') AND hpuinfo.shop_code like concat('%',#{storeKeyword},'%')
</if> </if>
@@ -585,16 +603,26 @@
#{userId} #{userId}
</foreach> </foreach>
</if> </if>
<if test="userPortraitIdList!=null and userPortraitIdList.size>0"> <if test="userPortraitIdList!=null and userPortraitIdList.size>0 and userPortraitQueryType!=null and userPortraitQueryType='contains'">
<foreach collection="userPortraitIdList" separator="or" open="and (" close=")" item="userPortraitId"> <foreach collection="userPortraitIdList" open="and bi.user_portrait in (" close=")" separator="," item="userPortraitId">
bi.user_portrait like concat("%,", #{userPortraitId}, ",%") #{userPortraitId}
</foreach> </foreach>
</if> </if>
<if test="userChannelIdList!=null and userChannelIdList.size>0"> <if test="userPortraitIdList!=null and userPortraitIdList.size>0 and userPortraitQueryType!=null and userPortraitQueryType='notContains'">
<foreach collection="userPortraitIdList" open="and bi.user_portrait not in (" close=")" separator="," item="userPortraitId">
#{userPortraitId}
</foreach>
</if>
<if test="userChannelIdList!=null and userChannelIdList.size>0 and userChannelQueryType!=null and userChannelQueryType='contains' ">
<foreach collection="userChannelIdList" open="and hpuinfo.user_channel_id in (" close=")" separator="," item="userChannelId"> <foreach collection="userChannelIdList" open="and hpuinfo.user_channel_id in (" close=")" separator="," item="userChannelId">
#{userChannelId} #{userChannelId}
</foreach> </foreach>
</if> </if>
<if test="userChannelIdList!=null and userChannelIdList.size>0 and userChannelQueryType!=null and userChannelQueryType='notContains' ">
<foreach collection="userChannelIdList" open="and hpuinfo.user_channel_id not in (" close=")" separator="," item="userChannelId">
#{userChannelId}
</foreach>
</if>
<if test="userIdList!=null and userIdList.size==0 and developmentManagerList!=null and developmentManagerList.size>0"> <if test="userIdList!=null and userIdList.size==0 and developmentManagerList!=null and developmentManagerList.size>0">
<foreach collection="developmentManagerList" item="developmentManager" open="and hpli.development_manager in (" close=")" separator=","> <foreach collection="developmentManagerList" item="developmentManager" open="and hpli.development_manager in (" close=")" separator=",">
#{developmentManager} #{developmentManager}