Просмотр исходного кода

Merge branch 'release_toaliyun_real_2022_init' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real_2022_init

release_toaliyun_real
winter 4 лет назад
Родитель
Сommit
07acce1bfa
10 измененных файлов: 229 добавлений и 69 удалений
  1. +156
    -69
      mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserDataController.java
  2. +3
    -0
      mallinkService/src/main/java/com/iformall/mapper/TtCUserMapper.java
  3. +3
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCUserMapper.java
  4. +3
    -0
      mallinkService/src/main/java/com/iformall/service/cuser/CUserServiceApapter.java
  5. +6
    -0
      mallinkService/src/main/java/com/iformall/service/cuser/tt/TtBUserServiceAdapter.java
  6. +6
    -0
      mallinkService/src/main/java/com/iformall/service/cuser/tt/TtCUserServiceAdapter.java
  7. +6
    -0
      mallinkService/src/main/java/com/iformall/service/cuser/wx/WxBUserServiceAdapter.java
  8. +6
    -0
      mallinkService/src/main/java/com/iformall/service/cuser/wx/WxCUserServiceAdapter.java
  9. +20
    -0
      mallinkService/src/main/resources/mapper/TtCUserMapper.xml
  10. +20
    -0
      mallinkService/src/main/resources/mapper/WxCUserMapper.xml

+ 156
- 69
mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserDataController.java Просмотреть файл

@@ -68,12 +68,17 @@ public class WxCUserDataController extends BaseController {
// List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity);
WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto();
dto.updateTenantInfo(tenantEntity);
long allCount = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto);
Calendar c = Calendar.getInstance();
c.add(Calendar.DAY_OF_YEAR, -29);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
Date today = c.getTime();
dto.setStartTime(c.getTime());
List<UserStructureVo> list = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCountData(dto);
Map<String,Long> countDate = new HashMap<>();
for (UserStructureVo vo:list) {
countDate.put(vo.getName(),vo.getCount());
}

long todayCount = 0;
long yesterdayCount = 0;
@@ -83,17 +88,12 @@ public class WxCUserDataController extends BaseController {

for (int i = 29, sortNum = 0; i >= 0; i--) {
c.clear();
c.setTime(today);
c.setTime(new Date());
c.add(Calendar.DAY_OF_YEAR, -i);
dto.setStartTime(c.getTime());
c.add(Calendar.DAY_OF_YEAR, 1);
dto.setEndTime(c.getTime());
long count = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto);
UserStructureVo vo = new UserStructureVo();

vo.setName(new SimpleDateFormat("MM/dd").format(dto.getStartTime()));
vo.setName(new SimpleDateFormat("MM/dd").format(c.getTime()));
vo.setSortNum(sortNum++);
vo.setCount(count);
vo.setCount(countDate.get(vo.getName())==null?0:countDate.get(vo.getName()));
if (i <= 7) {
UserStructureVo vow = new UserStructureVo();
vow.setSortNum(vo.getSortNum());
@@ -128,33 +128,76 @@ public class WxCUserDataController extends BaseController {
weekPercentage = nf.format(count.doubleValue() / new Double(dayOfWeekCount).doubleValue());
}
Map<String, Object> map = new HashMap<>();
map.put("allCount", allCount);//会员总数
map.put("todayCount", todayCount);//今日新增会员数
map.put("weekVos", weekVos);//月用户增加数列表
map.put("weekVos", weekVos);//周用户增加数列表
map.put("monthVos", monthVos);//月用户增加数列表
map.put("dayPercentage", dayPercentage);//日环比
map.put("weekPercentage", weekPercentage); //周同比
map.put("weekPercentage", weekPercentage);//周同比

return new ResultData(map);
}

@GetMapping("findUserAddCount")
@ApiOperation("查询用户增长 总数,今日,近一周")
@SystemControllerLog(description = "会员首页-报表数据-查询用户增长")
public ResultData findUserAddCount(Integer plat) {
logger.debug("[" + getIpAddr() + "] WxCUserDataController::findUserAddCount");
if(plat == null){
plat = EnumAppPlat.WX.getCode();
}
TenantEntity tenantEntity = getTenantInfo();
if(StringUtils.isBlank(tenantEntity.getTenantId())){
//todo 集团版查询数据待重构
return new ResultData("集团版查询数据待重构");
}
// List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity);
WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto();
dto.updateTenantInfo(tenantEntity);
long allCount = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto);
Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
dto.setStartTime(c.getTime());
long todayCount = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto);
c.add(Calendar.DAY_OF_YEAR, -7);
dto.setStartTime(c.getTime());
long weekCount = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto);

Map<String, Object> map = new HashMap<>();
map.put("allCount", allCount);// 用户总数
map.put("todayCount", todayCount);// 今日新增用户
map.put("weekCount", weekCount);// 近一周新增用户
return new ResultData(map);
}

long weekVosCount = 0l;
for (UserStructureVo us:weekVos) {
weekVosCount += us.getCount();
@GetMapping("findBasicUserAddCount")
@ApiOperation("查询会员增长 总数,今日,近一周")
@SystemControllerLog(description = "会员首页-报表数据-查询会员增长")
public ResultData findBasicUserAddCount() {
logger.debug("[" + getIpAddr() + "] WxCUserDataController::findBasicUserAddCount");
TenantEntity tenantEntity = getTenantInfo();
if(StringUtils.isBlank(tenantEntity.getTenantId())){
//todo 集团版查询数据待重构
return new ResultData("集团版查询数据待重构");
}
map.put("weekVosCount", weekVosCount); //周新增会员

//自然增长
//String startdate = DateUtils.getTimeBefore(30, new Date());
//String systemTime = DateUtils.getSystemTime("yyyy-MM-dd");
//Date startDate = DateUtils.getDateFromString(startdate + " 00:00:00","yyyy-MM-dd HH:mm:ss").getTime();
//Date endDate = DateUtils.getDateFromString(systemTime + " 23:59:59","yyyy-MM-dd HH:mm:ss").getTime();
WxCUserBasicInfoDto wxCUserBasicInfoDto = new WxCUserBasicInfoDto();
wxCUserBasicInfoDto.updateTenantInfo(tenantEntity);
wxCUserBasicInfoDto.setStartTime(null);
wxCUserBasicInfoDto.setEndTime(null);
map.put("growCount", wxCUserBasicInfoService.findGrowUserCount(tenantEntity));
//全部导入的
map.put("importCount", wxCUserBasicInfoService.findImportUserCount(tenantEntity));
//全部
map.put("allHistoryUserCount", wxCUserBasicInfoService.findCount(wxCUserBasicInfoDto));
// List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity);
WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto();
dto.updateTenantInfo(tenantEntity);
long allCount = wxCUserBasicInfoService.findCount(dto);
Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
dto.setStartTime(c.getTime());
long todayCount = wxCUserBasicInfoService.findCount(dto);
c.add(Calendar.DAY_OF_YEAR, -7);
dto.setStartTime(c.getTime());
long weekCount = wxCUserBasicInfoService.findCount(dto);;

Map<String, Object> map = new HashMap<>();
map.put("allCount", allCount);// 会员总数
map.put("todayCount", todayCount);// 今日新增会员
map.put("weekCount", weekCount);// 近一周新增会员
return new ResultData(map);
}

@@ -171,7 +214,7 @@ public class WxCUserDataController extends BaseController {
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
Date endTime = c.getTime();
c.add(Calendar.DAY_OF_YEAR, -30);
c.add(Calendar.DAY_OF_YEAR, -28);
Date startTime = c.getTime();
params.put("startTime", startTime);
params.put("endTime", endTime);
@@ -191,15 +234,8 @@ public class WxCUserDataController extends BaseController {
List<UserStructureVo> weekVos = new ArrayList<>();//每周uv
List<UserStructureVo> monthVos = new ArrayList<>();//每月uv

//今日活跃数
String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
params.put("startTime",today+" 00:00:00");
params.put("endTime",today+" 23:59:59");
long todayVisitCount = wxUserVisitService.queryVisitUv(params);

long yesterdayCount = 0;//昨天活跃数
long beforeYesterdayCount = 0;//前天活跃数
long thisMonthCount = 0;//月总数
long dayOfWeekCount = 0;//上周周x数
for (int i = 29, sortNum = 0; i >= 0; i--) {
c.clear();
@@ -237,7 +273,6 @@ public class WxCUserDataController extends BaseController {

}
monthVos.add(vo);
thisMonthCount += vo.getCount();
}

NumberFormat nf = NumberFormat.getPercentInstance();
@@ -253,49 +288,68 @@ public class WxCUserDataController extends BaseController {
weekPercentage = nf.format(count.doubleValue() / new Double(dayOfWeekCount).doubleValue());
}
Map<String, Object> mapVo = new HashMap<>();
mapVo.put("yesterdayCount", yesterdayCount);//昨日活跃数
mapVo.put("thisMonthCount", thisMonthCount);//近一个月活跃数
// mapVo.put("yesterdayCount", yesterdayCount);//昨日活跃数
// mapVo.put("thisMonthCount", thisMonthCount);//近一个月活跃数
mapVo.put("weekVos", weekVos);//周活跃数列表
mapVo.put("monthVos", monthVos);//月活跃数列表
mapVo.put("dayPercentage", dayPercentage);//日环比
mapVo.put("weekPercentage", weekPercentage); //周同比
return new ResultData(mapVo);
}

mapVo.put("todayVisitCount", todayVisitCount); //今日活跃数
long weekVosCount = 0l;
for (UserStructureVo us:weekVos) {
weekVosCount += us.getCount();
@ApiOperation("查询微信用户活跃数量 昨日活跃,近一周活跃,近一月活跃")
@GetMapping("findUserVisitCount")
@SystemControllerLog(description = "会员首页-报表数据-查询微信用户活跃数量")
public ResultData findUserVisitCount() {
logger.debug("[" + getIpAddr() + "] WxCUserDataController::findUserVisitCount");
TenantEntity tenantEntity = getTenantInfo();
HashMap<String, Object> params = new HashMap<>();
Calendar c = Calendar.getInstance();
c.add(Calendar.DAY_OF_YEAR, -1);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
params.put("startTime", c.getTime());
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
mapVo.put("weekVosCount", weekVosCount);//周活跃数总数
//昨日活跃数
long yesterdayCount = wxUserVisitService.queryVisitUv(params);
//近一周活跃
c.add(Calendar.DAY_OF_YEAR, -6);
params.put("startTime", c.getTime());
long weekCount = wxUserVisitService.queryVisitUv(params);
//近一月活跃
c.add(Calendar.DAY_OF_YEAR, -22);
params.put("startTime", c.getTime());
long monthCount = wxUserVisitService.queryVisitUv(params);

Map<String, Object> mapVo = new HashMap<>();
mapVo.put("yesterdayCount", yesterdayCount);//昨日活跃数
mapVo.put("weekCount", weekCount);//周活跃数总数
mapVo.put("monthCount", monthCount);//近一个月活跃数
return new ResultData(mapVo);
}

@ApiOperation("查询用户消费金额")
@GetMapping("findUserAmountData")
@SystemControllerLog(description = "会员首页-报表数据-查询用户消费金额")
public ResultData findUserAmountData(Integer plat) {
public ResultData findUserAmountData() {
logger.debug("[" + getIpAddr() + "] WxCUserDataController::findUserAmountData");
if(plat == null){
plat = EnumAppPlat.WX.getCode();
}
TenantEntity tenantEntity = getTenantInfo();
if(StringUtils.isBlank(tenantEntity.getTenantId())){
//todo 集团版查询数据待重构
return new ResultData("集团版查询数据待重构");
}
Calendar c = Calendar.getInstance();
Date today = c.getTime();
c.add(Calendar.DAY_OF_YEAR, 1);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
Date endTime = c.getTime();//明天0点
c.add(Calendar.DAY_OF_YEAR, -30);//三十天前
Date startTime = c.getTime();
List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity);
WxCouponOrder wxCouponOrder = new WxCouponOrder();
wxCouponOrder.updateTenantInfo(tenantEntity);
wxCouponOrder.setStartTime(startTime);
wxCouponOrder.setEndTime(endTime);
int thisMonthCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys);//月消费金额
c.clear();
c.setTime(endTime);
Date eTime = c.getTime();
Date eTime = c.getTime();//明天0点

c.add(Calendar.DAY_OF_YEAR, -30);
Date sTime = c.getTime();
List<CUserDateAmountVo> datas = wxCouponOrderService.queryPriceTotalGroup(tenantEntity, sTime, eTime);
@@ -356,10 +410,6 @@ public class WxCUserDataController extends BaseController {
weekPercentage = nf.format(count.doubleValue() / new Double(dayOfWeekCount).doubleValue());
}
Map<String, Object> map = new HashMap<>();
DecimalFormat df = new DecimalFormat("0.00");
map.put("todayCount", df.format((float) todayCount / 100));//今日消费金额
String thisMonthCountStr = df.format((float) thisMonthCount / 100);
map.put("thisMonthCount", thisMonthCountStr);//近一个月消费金额数
map.put("dayPercentage", dayPercentage);//日环比
map.put("weekPercentage", weekPercentage); //周同比
map.put("weekVos", weekVos);//一周金额列表
@@ -367,6 +417,43 @@ public class WxCUserDataController extends BaseController {
return new ResultData(map);
}

@ApiOperation("查询用户消费金额 今日,周,月")
@GetMapping("findUserConsumeAmount")
@SystemControllerLog(description = "会员首页-报表数据-查询用户消费金额")
public ResultData findUserConsumeAmount() {
logger.debug("[" + getIpAddr() + "] WxCUserDataController::findUserConsumeAmount");
TenantEntity tenantEntity = getTenantInfo();
if(StringUtils.isBlank(tenantEntity.getTenantId())){
//todo 集团版查询数据待重构
return new ResultData("集团版查询数据待重构");
}
Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity);
WxCouponOrder wxCouponOrder = new WxCouponOrder();
wxCouponOrder.updateTenantInfo(tenantEntity);
wxCouponOrder.setStartTime(c.getTime());
//今日消费金额
int todayCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys);
//周交易金额
c.add(Calendar.DAY_OF_YEAR, -7);
wxCouponOrder.setStartTime(c.getTime());
int weekCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys);
//月交易金额
c.add(Calendar.DAY_OF_YEAR, -22);
wxCouponOrder.setStartTime(c.getTime());
int monthCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys);

Map<String, Object> map = new HashMap<>();
DecimalFormat df = new DecimalFormat("0.00");
map.put("todayCount", df.format((float) todayCount / 100));//今日消费金额
map.put("weekCount", df.format((float) weekCount / 100));//近一周消费金额
map.put("monthCount", df.format((float) monthCount / 100));//近一个月消费金额数
return new ResultData(map);
}


}



+ 3
- 0
mallinkService/src/main/java/com/iformall/mapper/TtCUserMapper.java Просмотреть файл

@@ -5,6 +5,7 @@ import com.iformall.domain.dto.WxCUserBasicInfoDto;
import com.iformall.domain.po.tt.TtCUser;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.UserCountVo;
import com.iformall.domain.vo.UserStructureVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@@ -42,4 +43,6 @@ public interface TtCUserMapper extends CommonMapper<TtCUser, Long> {
List<String> findOpenIdList(@Param("userId")Long userId, @Param("tenantId")String tenantId);

List<String> findTokenList(@Param("id")Long id,@Param("userId")Long userId, @Param("tenantId")String tenantId);

List<UserStructureVo> findCountData(WxCUserBasicInfoDto dto);
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCUserMapper.java Просмотреть файл

@@ -7,6 +7,7 @@ import com.iformall.domain.dto.WxCUserBasicInfoDto;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.UserCountVo;
import com.iformall.domain.vo.UserStructureVo;
import org.apache.ibatis.annotations.Param;

public interface WxCUserMapper extends CommonMapper<WxCUser, Long> {
@@ -42,4 +43,6 @@ public interface WxCUserMapper extends CommonMapper<WxCUser, Long> {
List<String> findOpenIdList(@Param("userId")Long userId, @Param("tenantId")String tenantId);

List<String> findTokenList(@Param("id")Long id,@Param("userId")Long userId, @Param("tenantId")String tenantId);

List<UserStructureVo> findCountData(WxCUserBasicInfoDto dto);
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/cuser/CUserServiceApapter.java Просмотреть файл

@@ -8,6 +8,7 @@ import com.iformall.domain.po.WxCUserFrom;
import com.iformall.domain.po.base.BaseCUserEntity;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.UserCountVo;
import com.iformall.domain.vo.UserStructureVo;

import java.util.List;

@@ -49,4 +50,6 @@ public interface CUserServiceApapter {
void actionAfterLogin(CUser user);

String updateQrCode(CUser user);

List<UserStructureVo> findCountData(WxCUserBasicInfoDto dto);
}

+ 6
- 0
mallinkService/src/main/java/com/iformall/service/cuser/tt/TtBUserServiceAdapter.java Просмотреть файл

@@ -10,6 +10,7 @@ import com.iformall.domain.po.*;
import com.iformall.domain.po.base.BaseCUserEntity;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.UserCountVo;
import com.iformall.domain.vo.UserStructureVo;
import com.iformall.douyin.miniapp.api.TtMaService;
import com.iformall.enums.EnumAppPlat;
import com.iformall.exception.MallinkException;
@@ -264,6 +265,11 @@ public class TtBUserServiceAdapter extends BasicCUserService implements CUserSer
return null;
}

@Override
public List<UserStructureVo> findCountData(WxCUserBasicInfoDto dto) {
return null;
}

private TtMaService getTtMaService(WxAppinfo wxAppinfo, Boolean isFmOpen) {
TtMaService ttMaService = maUtil.getTtappService(wxAppinfo);
if (StringUtils.isBlank(wxAppinfo.getAccessToken())) {


+ 6
- 0
mallinkService/src/main/java/com/iformall/service/cuser/tt/TtCUserServiceAdapter.java Просмотреть файл

@@ -12,6 +12,7 @@ import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.po.tt.TtCUser;
import com.iformall.domain.po.base.BaseCUserEntity;
import com.iformall.domain.vo.UserCountVo;
import com.iformall.domain.vo.UserStructureVo;
import com.iformall.douyin.miniapp.api.TtMaService;
import com.iformall.enums.EnumAppPlat;
import com.iformall.enums.EnumAssignTagsTrigger;
@@ -338,6 +339,11 @@ public class TtCUserServiceAdapter extends BasicCUserService implements CUserSer
return userL.getQrCode();
}

@Override
public List<UserStructureVo> findCountData(WxCUserBasicInfoDto dto) {
return ttCUserMapper.findCountData(dto);
}

private TtMaService getTtMaService(WxAppinfo wxAppinfo, Boolean isFmOpen) {
TtMaService ttMaService = maUtil.getTtappService(wxAppinfo);
if (StringUtils.isBlank(wxAppinfo.getAccessToken())) {


+ 6
- 0
mallinkService/src/main/java/com/iformall/service/cuser/wx/WxBUserServiceAdapter.java Просмотреть файл

@@ -11,6 +11,7 @@ import com.iformall.domain.po.*;
import com.iformall.domain.po.base.BaseCUserEntity;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.UserCountVo;
import com.iformall.domain.vo.UserStructureVo;
import com.iformall.enums.EnumAppPlat;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxBuserMapper;
@@ -264,6 +265,11 @@ public class WxBUserServiceAdapter extends BasicCUserService implements CUserSer
return null;
}

@Override
public List<UserStructureVo> findCountData(WxCUserBasicInfoDto dto) {
return null;
}

private WxMaService getWxMaService(WxAppinfo wxAppinfo, Boolean isFmOpen) {
WxMaService wxMaService = null;
if (isFmOpen) {


+ 6
- 0
mallinkService/src/main/java/com/iformall/service/cuser/wx/WxCUserServiceAdapter.java Просмотреть файл

@@ -11,6 +11,7 @@ import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.po.tt.TtCUser;
import com.iformall.domain.vo.UserCountVo;
import com.iformall.domain.vo.UserStructureVo;
import com.iformall.enums.EnumAppPlat;
import com.iformall.enums.EnumAssignTagsTrigger;
import com.iformall.enums.EnumYesOrNo;
@@ -346,6 +347,11 @@ public class WxCUserServiceAdapter extends BasicCUserService implements CUserSer
return userL.getQrCode();
}

@Override
public List<UserStructureVo> findCountData(WxCUserBasicInfoDto dto) {
return wxCUserMapper.findCountData(dto);
}

private WxMaService getWxMaService(WxAppinfo wxAppinfo, Boolean isFmOpen) {
WxMaService wxMaService = null;
if (isFmOpen) {


+ 20
- 0
mallinkService/src/main/resources/mapper/TtCUserMapper.xml Просмотреть файл

@@ -325,6 +325,26 @@

</select>

<select id="findCountData" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="com.iformall.domain.vo.UserStructureVo">
select DATE_FORMAT(create_date,'%m-%d') as name,count(id) count
from tt_c_user
where `tenant_id` = #{tenantId}
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != sex ">
and gender =#{sex}
</if>
<if test=" null != startTime ">
and create_date &gt;= #{startTime}
</if>
<if test=" null != endTime">
and create_date &lt; #{endTime}
</if>
group by name

</select>

<select id="findCountHistory" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="com.iformall.domain.vo.UserCountVo">
select count(id) as incCount,
<if test="1 == reportType ">


+ 20
- 0
mallinkService/src/main/resources/mapper/WxCUserMapper.xml Просмотреть файл

@@ -327,6 +327,26 @@

</select>

<select id="findCountData" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="com.iformall.domain.vo.UserStructureVo">
select DATE_FORMAT(create_date,'%m-%d') as name,count(id) count
from wx_c_user
where `tenant_id` = #{tenantId}
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != sex ">
and gender =#{sex}
</if>
<if test=" null != startTime ">
and create_date &gt;= #{startTime}
</if>
<if test=" null != endTime">
and create_date &lt; #{endTime}
</if>
group by name

</select>

<select id="findCountHistory" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="com.iformall.domain.vo.UserCountVo">
select count(id) as incCount,
<if test="1 == reportType ">


Загрузка…
Отмена
Сохранить