拉黑好友数

master
wyj2080 6 years ago
parent c17e20f8dc
commit 9729b6fe09

@ -3,7 +3,6 @@ package com.kiisoo.ic.customer.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.kiisoo.ic.customer.bean.OpCustomerDTO;
import com.kiisoo.ic.customer.entity.*; import com.kiisoo.ic.customer.entity.*;
import com.kiisoo.ic.customer.mapper.OpCustomerDOMapper; import com.kiisoo.ic.customer.mapper.OpCustomerDOMapper;
import com.kiisoo.ic.customer.mapper.OpVipDOMapper; import com.kiisoo.ic.customer.mapper.OpVipDOMapper;
@ -109,9 +108,7 @@ public class CustomerViewService {
//好友总数(去重) //好友总数(去重)
Long validCustomerCount = opCustomerDOMapper.selectCustomerCount(shopIds, VALID, null, null); Long validCustomerCount = opCustomerDOMapper.selectCustomerCount(shopIds, VALID, null, null);
//删除拉黑数 //删除拉黑数
QueryWrapper<PoiCustomerContactDataStat> wrapper = new QueryWrapper<>(); Long validDeleteCustomerCount = poiCustomerContactDataStatMapper.selectDeleteCustomer(shopIds).stream()
wrapper.in("store_id", shopIds).le("stat_time", selectEndTime).ge("stat_time", selectStartTime);
Long validDeleteCustomerCount = poiCustomerContactDataStatMapper.selectList(wrapper).stream()
.filter(contactDO -> contactDO.getNegativeFeedbackCnt() != null) .filter(contactDO -> contactDO.getNegativeFeedbackCnt() != null)
.map(PoiCustomerContactDataStat::getNegativeFeedbackCnt).mapToLong(a -> a).sum(); .map(PoiCustomerContactDataStat::getNegativeFeedbackCnt).mapToLong(a -> a).sum();
//会员总数 //会员总数

@ -2,10 +2,15 @@ package com.kiisoo.ic.generalize.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kiisoo.ic.generalize.entity.PoiCustomerContactDataStat; import com.kiisoo.ic.generalize.entity.PoiCustomerContactDataStat;
import com.kiisoo.ic.generalize.entity.PrivilageOrganizationalMember; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
@Repository @Repository
public interface PoiCustomerContactDataStatMapper extends BaseMapper<PoiCustomerContactDataStat> { public interface PoiCustomerContactDataStatMapper extends BaseMapper<PoiCustomerContactDataStat> {
/**
* list
*/
List<PoiCustomerContactDataStat> selectDeleteCustomer(@Param("shopIds")List<Long> shopIds);
} }

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.kiisoo.ic.generalize.mapper.PoiCustomerContactDataStatMapper">
<!--拉黑-->
<select id="selectDeleteCustomer" resultType="com.kiisoo.ic.generalize.entity.PoiCustomerContactDataStat">
select id as id, store_id as storeId, region_id as regionId, negative_feedback_cnt as negativeFeedbackCnt,
new_contact_cnt as newContactCnt, stat_time as statTime, create_time as createTime
from poi_customer_contact_data_stat t1 where stat_time =
(select max(stat_time) from poi_customer_contact_data_stat t2 where t1.store_id=t2.store_id)
and t1.store_id in
<foreach collection="shopIds" separator="," item="item" index="index" close=")" open="(">
#{item}
</foreach>
</select>
</mapper>
Loading…
Cancel
Save