You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bsdgy-server/src/main/resources/mapper/PoiCustomerContactDataStatD...

41 lines
1.9 KiB
XML

6 years ago
<?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, negative_feedback_cnt as negativeFeedbackCnt,
6 years ago
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>
<select id="selectSumAddCustomer" resultType="java.math.BigDecimal">
select
sum(new_contact_cnt) as newContactCnt
from poi_customer_contact_data_stat t1 where stat_time between
DATE_FORMAT(#{startDate},'%Y-%m-%d')
and DATE_FORMAT(#{endDate},'%Y-%m-%d')
and t1.store_id in
<foreach collection="shopIds" separator="," item="item" index="index" close=")" open="(">
#{item}
</foreach>
</select>
<select id="selectSumApplyCustomer" resultType="com.kiisoo.ic.analysis.bean.TableAnalysisDTO">
select
SUM(new_apply_cnt) as applyCustomer,
store_id as storeId
from poi_customer_contact_data_stat t1 where stat_time
between DATE_FORMAT(#{startDate},'%Y-%m-%d')
and DATE_FORMAT(#{endDate},'%Y-%m-%d')
and t1.store_id in
<foreach collection="shopIds" separator="," item="item" index="index" close=")" open="(">
#{item}
</foreach>
group by store_id having sum(new_contact_cnt) &lt;= #{count}
</select>
6 years ago
</mapper>