私海列表

This commit is contained in:
苏竹红
2023-06-16 10:09:44 +08:00
parent 0ad84af01f
commit a6a6093dd9
11 changed files with 282 additions and 36 deletions

View File

@@ -3,6 +3,7 @@ package com.cool.store.dao;
import com.cool.store.dto.partner.PartnerBlackListDTO;
import com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO;
import com.cool.store.dto.partner.StageCountDTO;
import com.cool.store.dto.partner.*;
import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.mapper.HyPartnerLineInfoMapper;
import com.github.pagehelper.PageInfo;
@@ -12,6 +13,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@@ -111,8 +114,8 @@ public class HyPartnerLineInfoDAO {
}
public PageInfo<PartnerBlackListDTO> getBlackList( String keyWord, String intentArea , Integer acceptAdjustType){
return hyPartnerLineInfoMapper.getBlackList(keyWord,intentArea,acceptAdjustType);
public PageInfo<PartnerBlackListDTO> getBlackList( String userNameKeyword,String phoneKeyword, String intentArea , Integer acceptAdjustType){
return hyPartnerLineInfoMapper.getBlackList(userNameKeyword,phoneKeyword,intentArea,acceptAdjustType);
}
@@ -123,6 +126,17 @@ public class HyPartnerLineInfoDAO {
return hyPartnerLineInfoMapper.joinAndRemoveBlack(lineId,status,joinReason,removeReason);
}
public PageInfo<PublicSeaLineDTO> getPublicSeaLineList( String userNameKeyword, String phoneKeyword, String intentArea, Integer acceptAdjustType, Date updateStartTime, Date updateEndTime, List<String> userIdList){
return hyPartnerLineInfoMapper.getPublicSeaLineList(userNameKeyword,phoneKeyword,intentArea,acceptAdjustType,updateStartTime,updateEndTime,userIdList);
}
public List<HyPartnerLineInfoDO> getPartnerLastLine(List<String> partnerIdList){
if (CollectionUtils.isEmpty(partnerIdList)){
return new ArrayList<>();
}
return hyPartnerLineInfoMapper.getPartnerLastLine(partnerIdList);
}
public HyPartnerLineInfoDO getByPartnerId(String partnerId){
if (StringUtils.isEmpty(partnerId)){
return null;
@@ -131,4 +145,11 @@ public class HyPartnerLineInfoDAO {
}
public List<LineCountDTO> getFollowCountList( List<String> partnerIdList){
if (CollectionUtils.isEmpty(partnerIdList)){
return new ArrayList<>();
}
return hyPartnerLineInfoMapper.getFollowCountList(partnerIdList);
}
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.mapper;
import com.cool.store.dto.partner.*;
import com.cool.store.dto.partner.PartnerBlackListDTO;
import com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO;
import com.cool.store.dto.partner.StageCountDTO;
@@ -7,6 +8,7 @@ import com.cool.store.entity.HyPartnerLineInfoDO;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
@@ -107,12 +109,14 @@ public interface HyPartnerLineInfoMapper {
/**
* 查询黑名单列表
* @param keyWord
* @param userNameKeyword
* @param phoneKeyword
* @param intentArea
* @param acceptAdjustType
* @return
*/
PageInfo<PartnerBlackListDTO> getBlackList(@Param("keyWord") String keyWord,
PageInfo<PartnerBlackListDTO> getBlackList(@Param("userNameKeyword") String userNameKeyword,
@Param("phoneKeyword") String phoneKeyword,
@Param("intentArea") String intentArea ,
@Param("acceptAdjustType") Integer acceptAdjustType);
@@ -133,4 +137,37 @@ public interface HyPartnerLineInfoMapper {
HyPartnerLineInfoDO getByPartnerId(@Param("partnerId") String partnerId);
/**
* 查询公海线索
* @param userNameKeyword
* @param phoneKeyword
* @param intentArea
* @param acceptAdjustType
* @param updateStartTime
* @param updateEndTime
* @param userIdList
* @return
*/
PageInfo<PublicSeaLineDTO> getPublicSeaLineList(@Param("userNameKeyword") String userNameKeyword,
@Param("phoneKeyword") String phoneKeyword,
@Param("intentArea") String intentArea,
@Param("acceptAdjustType") Integer acceptAdjustType,
@Param("updateStartTime") Date updateStartTime,
@Param("updateEndTime") Date updateEndTime,
@Param("userIdList") List<String> userIdList);
/**
* 查询对应的加盟商最近线索
* @param partnerIdList
* @return
*/
List<HyPartnerLineInfoDO> getPartnerLastLine(@Param("partnerIdList") List<String> partnerIdList);
/**
* 加盟商跟进次数
* @param partnerIdList
* @return
*/
List<LineCountDTO> getFollowCountList(@Param("partnerIdList") List<String> partnerIdList);
}

View File

@@ -357,8 +357,11 @@
from hy_partner_line_info a inner join hy_partner_user_info b where a.partner_id = b.partner_id
where deleted = 0
and line_status = 3
<if test="keyWord!=null and keyWord !=''">
and (b.username like concat('%', #{keyWord}, '%') or b.mobile like concat('%', #{keyWord}, '%'))
<if test="userNameKeyword!=null and userNameKeyword !=''">
and b.username like concat('%', #{userNameKeyword}, '%')
</if>
<if test="phoneKeyword!=null and phoneKeyword !=''">
and b.mobile like concat('%', #{phoneKeyword}, '%')
</if>
<if test="intentArea!=null and intentArea!=''">
and b.want_shop_area = #{intentArea}
@@ -391,4 +394,60 @@
where partner_id = #{partnerId}
</select>
<select id="getPublicSeaLineList" resultType="com.cool.store.dto.partner.PublicSeaLineDTO">
select
a.create_time as createTime,
b.partner_id as partner_id,
b.mobile as mobile,
b.username as userName,
b.want_shop_area as wantShopArea,
b.accept_adjust_type as acceptAdjustType
FROM hy_partner_line_info a inner JOIN hy_partner_user_info b on a.partner_id = b.partner_id
where a.line_status = 1
<if test="userNameKeyword!=null and userNameKeyword!=''">
and b.username like concat('%',#{userNameKeyword},'%')
</if>
<if test="phoneKeyword!=null and phoneKeyword!=''">
and b.mobile like concat('%',#{phoneKeyword},'%')
</if>
<if test="intentArea!=null and intentArea!=''">
and b.want_shop_area = #{intentArea}
</if>
<if test="acceptAdjustType!=null">
and b.accept_adjust_type = #{acceptAdjustType}
</if>
<if test="updateStartTime!=null and updateEndTime!=''">
and a.update_time BETWEEN #{updateStartTime} and #{updateEndTime}
</if>
<if test="userIdList!=null and userIdList.size>0">
<foreach collection="userIdList" item="userId" open="and a.investment_manager in (" close=")" separator=",">
#{userId}
</foreach>
</if>
</select>
<select id="getPartnerLastLine" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"></include>
FROM hy_partner_line_info h1
WHERE h1.create_time = (
SELECT MAX(h2.create_time)
FROM hy_partner_line_info h2
WHERE h1.partner_id = h2.partner_id
<if test="partnerIdList!=null and partnerIdList.size>0">
<foreach collection="partnerIdList" item="partnerId" open="and h1.partner_id in (" close=")" separator=",">
#{partnerId}
</foreach>
</if>
)
</select>
<select id="getFollowCountList" resultType="com.cool.store.dto.partner.LineCountDTO">
SELECT partner_id, COUNT(1) AS num_of_leads
FROM hy_partner_line_info
GROUP BY partner_id;
</select>
</mapper>