| @@ -43,6 +43,9 @@ public class SysWxFanStatistics extends BaseEntity | ||||
|     @Excel(name = "微信号") | ||||
|     private String wxAccount; | ||||
|  | ||||
|     @Excel(name = "微信绑定手机号") | ||||
|     private String wxPhone; | ||||
|  | ||||
|     /** 进粉时间 */ | ||||
|     @JsonFormat(pattern = "yyyy-MM-dd") | ||||
|     @Excel(name = "进粉时间", width = 30, dateFormat = "yyyy-MM-dd") | ||||
|   | ||||
| @@ -22,6 +22,10 @@ public class ExportFanStatisticsResponse { | ||||
|     @Excel(name = "微信号") | ||||
|     private String wxAccount; | ||||
|  | ||||
|     //手机号 | ||||
|     @Excel(name = "手机号") | ||||
|     private String wxPhone; | ||||
|  | ||||
|     //进粉量、 | ||||
|     @Excel(name = "进粉量") | ||||
|     private Integer fanNum; | ||||
|   | ||||
| @@ -1,16 +1,16 @@ | ||||
| package com.stdiet.custom.mapper; | ||||
|  | ||||
| import java.util.List; | ||||
| import com.stdiet.custom.domain.SysWxFanStatistics; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * 进粉统计Mapper接口 | ||||
|  * | ||||
|  * @author xiezhijun | ||||
|  * @date 2021-02-03 | ||||
|  */ | ||||
| public interface SysWxFanStatisticsMapper | ||||
| { | ||||
| public interface SysWxFanStatisticsMapper { | ||||
|     /** | ||||
|      * 查询进粉统计 | ||||
|      * | ||||
| @@ -66,8 +66,11 @@ public interface SysWxFanStatisticsMapper | ||||
|  | ||||
|     /** | ||||
|      * 查询总进粉数量 | ||||
|      * | ||||
|      * @param sysWxFanStatistics | ||||
|      * @return | ||||
|      */ | ||||
|     public int selectFanNumCount(SysWxFanStatistics sysWxFanStatistics); | ||||
|  | ||||
|     public List<SysWxFanStatistics> exportStatisticsList(SysWxFanStatistics sysWxFanStatistics); | ||||
| } | ||||
| @@ -82,4 +82,6 @@ public interface ISysWxFanStatisticsService | ||||
|      * @return | ||||
|      */ | ||||
|     public int selectFanNumCount(SysWxFanStatistics sysWxFanStatistics); | ||||
|  | ||||
|     List<SysWxFanStatistics> exportStatisticsList(SysWxFanStatistics sysWxFanStatistics); | ||||
| } | ||||
| @@ -144,4 +144,9 @@ public class SysWxFanStatisticsServiceImpl implements ISysWxFanStatisticsService | ||||
|     public int selectFanNumCount(SysWxFanStatistics sysWxFanStatistics){ | ||||
|         return sysWxFanStatisticsMapper.selectFanNumCount(sysWxFanStatistics); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public List<SysWxFanStatistics> exportStatisticsList(SysWxFanStatistics sysWxFanStatistics) { | ||||
|         return sysWxFanStatisticsMapper.exportStatisticsList(sysWxFanStatistics); | ||||
|     } | ||||
| } | ||||
| @@ -21,6 +21,7 @@ | ||||
|         <result property="account" column="account"></result> | ||||
|         <result property="saleGroup" column="sale_group"></result> | ||||
|         <result property="wxNickName" column="wx_nick_name"></result> | ||||
|         <result property="wxPhone" column="wx_phone"></result> | ||||
|         <result property="wxAccount" column="wx_account"></result> | ||||
|     </resultMap> | ||||
|  | ||||
| @@ -56,6 +57,20 @@ | ||||
|  | ||||
|     </select> | ||||
|  | ||||
|     <select id="exportStatisticsList" parameterType="SysWxFanStatistics" resultMap="SysWxFanStatisticsResult"> | ||||
|         SELECT sale_group_id, su.nick_name AS user_name, cn.dict_label AS account,  wsa.wx_account, wsa.wx_phone, IF(ISNULL(wfs.fan_num),0,wfs.fan_num) AS fan_num FROM sys_wx_distribution wd | ||||
|         LEFT JOIN ( | ||||
|             SELECT wx_id, fan_num FROM sys_wx_fan_statistics | ||||
|             <if test="fanStartTime != null and fanEndTime != null"> | ||||
|                 WHERE fan_time >= #{fanStartTime} AND #{fanEndTime} >= fan_time | ||||
|             </if> | ||||
|         ) AS wfs ON wd.wechat_account = wfs.wx_id | ||||
|         LEFT JOIN (SELECT id, wx_account, wx_phone FROM sys_wx_sale_account) AS wsa ON wd.wechat_account = wsa.id | ||||
|         LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'fan_channel') AS cn ON cn.dict_value = wd.account_id | ||||
|         LEFT JOIN sys_user AS su ON su.user_id = wd.user_id | ||||
|         ORDER BY wd.sale_group_id, wd.user_id ASC | ||||
|     </select> | ||||
|  | ||||
|     <!-- 查询总进粉数量 --> | ||||
|     <select id="selectFanNumCount" parameterType="SysWxFanStatistics" resultType="int"> | ||||
|         select ifnull(sum(swfs.fan_num),0) from sys_wx_fan_statistics swfs | ||||
|   | ||||
		Reference in New Issue
	
	Block a user