| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 当周产生3单的新增用户概率
|
| | | * |
| | | * @param callback
|
| | | * @param channelArray
|
| | | * 渠道名称
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param orderNum
|
| | | * 订单数量
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getGoldTop")
|
| | | public void getGoldTop(String callback, Integer pageIndex, Integer pageSize, Integer type,
|
| | | PrintWriter out) {
|
| | | if (type == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("type不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | |
| | | |
| | | }
|
| | |
|
| | | |
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.vo.user.UserGoldCoinVO;
|
| | |
|
| | | public interface UserInfoCountMapper {
|
| | |
|
| | | /**
|
| | | * 统计用户累计获得金币,消耗金币
|
| | | * @param start
|
| | | * @param count
|
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | List<UserGoldCoinVO> listByUserGoldCoin(@Param("start")long start, @Param("count")int count, @Param("type")int type);
|
| | | } |
New file |
| | |
| | | <?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.yeshi.fanli.dao.mybatis.UserInfoCountMapper">
|
| | |
|
| | | <resultMap id="UserGoldCoinMapVO" type="com.yeshi.fanli.vo.user.UserGoldCoinVO">
|
| | | <result column="id" property="uid" jdbcType="BIGINT" />
|
| | | <result column="nick_name" property="nickName" jdbcType="VARCHAR" />
|
| | | <result column="portrait" property="portrait" jdbcType="VARCHAR" />
|
| | | <result column="goldCoin" property="goldCoin" jdbcType="INTEGER" />
|
| | | <result column="goldCoinTotal" property="goldCoinTotal" jdbcType="INTEGER" />
|
| | | </resultMap>
|
| | | |
| | | |
| | | <select id="listByUserGoldCoin" resultMap="UserGoldCoinMapVO">
|
| | | SELECT IFNULL(SUM(d.`td_money`),0) AS goldCoinTotal,u.`id`,u.`nick_name`,u.`portrait`
|
| | | FROM `yeshi_ec_integral_detail` d
|
| | | LEFT JOIN `yeshi_ec_user` u ON u.`id` = d.`td_uid`
|
| | | WHERE 1=1 |
| | | <if test="type = 1">AND d.`td_money`<![CDATA[>]]> 0</if>
|
| | | <if test="type = 2">AND d.`td_money`<![CDATA[<]]> 0</if>
|
| | | GROUP BY d.`td_uid`
|
| | | ORDER BY goldCoinTotal <if test="type = 1">DESC</if>
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | |
|
| | | </mapper>
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoCountMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.service.inter.count.UserInfoCountService;
|
| | | import com.yeshi.fanli.vo.user.UserGoldCoinVO;
|
| | |
|
| | | @Service
|
| | | public class UserInfoCountServiceImpl implements UserInfoCountService {
|
| | |
|
| | | @Resource
|
| | | private UserInfoMapper userInfoMapper;
|
| | | |
| | | @Resource
|
| | | private UserInfoCountMapper userInfoCountMapper;
|
| | |
|
| | |
|
| | | @Override
|
| | |
| | | return listObject;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<UserGoldCoinVO> listByUserGoldCoin(long start, int count, int type) {
|
| | | return userInfoCountMapper.listByUserGoldCoin(start, count, type);
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.vo.user.UserGoldCoinVO;
|
| | |
|
| | |
|
| | |
|
| | | public interface UserInfoCountService {
|
| | |
| | |
|
| | | public List<Object> getWeekBuyRate(String channel, String startTime, String endTime,
|
| | | Integer orderNum, List<String> dateList) throws Exception;
|
| | | |
| | | |
| | | /**
|
| | | * 统计用户金币情况
|
| | | * @param start
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | public List<UserGoldCoinVO> listByUserGoldCoin(long start, int count, int type);
|
| | | |
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.user;
|
| | |
|
| | | public class UserGoldCoinVO {
|
| | | // id
|
| | | private Long uid;
|
| | | // 昵称
|
| | | private String nickName;
|
| | | // 头像
|
| | | private String portrait;
|
| | |
|
| | | // 累计
|
| | | private int goldCoin;
|
| | | // 累计
|
| | | private int goldCoinTotal;
|
| | | // 消耗
|
| | | private int goldCoinConsume;
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public String getNickName() {
|
| | | return nickName;
|
| | | }
|
| | |
|
| | | public void setNickName(String nickName) {
|
| | | this.nickName = nickName;
|
| | | }
|
| | |
|
| | | public String getPortrait() {
|
| | | return portrait;
|
| | | }
|
| | |
|
| | | public void setPortrait(String portrait) {
|
| | | this.portrait = portrait;
|
| | | }
|
| | |
|
| | | public int getGoldCoin() {
|
| | | return goldCoin;
|
| | | }
|
| | |
|
| | | public void setGoldCoin(int goldCoin) {
|
| | | this.goldCoin = goldCoin;
|
| | | }
|
| | |
|
| | | public int getGoldCoinTotal() {
|
| | | return goldCoinTotal;
|
| | | }
|
| | |
|
| | | public void setGoldCoinTotal(int goldCoinTotal) {
|
| | | this.goldCoinTotal = goldCoinTotal;
|
| | | }
|
| | |
|
| | | public int getGoldCoinConsume() {
|
| | | return goldCoinConsume;
|
| | | }
|
| | |
|
| | | public void setGoldCoinConsume(int goldCoinConsume) {
|
| | | this.goldCoinConsume = goldCoinConsume;
|
| | | }
|
| | | }
|