From 19251fb5596415bfa83c51b8ed130ecbb31644ce Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期一, 09 十月 2023 18:31:30 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PlayPai --- cloud-server-account/src/main/resources/mapper/TAppUserMapper.xml | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 180 insertions(+), 0 deletions(-) diff --git a/cloud-server-account/src/main/resources/mapper/TAppUserMapper.xml b/cloud-server-account/src/main/resources/mapper/TAppUserMapper.xml index f713086..5599921 100644 --- a/cloud-server-account/src/main/resources/mapper/TAppUserMapper.xml +++ b/cloud-server-account/src/main/resources/mapper/TAppUserMapper.xml @@ -93,4 +93,184 @@ </if> </where> </select> + + + <select id="getYearUserCount" resultType="com.dsh.account.vo.entity.YearData"> + select IFNULL(count(*),0) AS yearCount,DATE_FORMAT(insertTime,'%Y') AS `year` from t_app_user + <where> + <if test="dto.cityCode != null and dto.cityCode != ''"> + AND cityCode = #{dto.cityCode} + </if> + <if test="dto.isVip != null"> + AND isVip = #{dto.isVip} + </if> + <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> + AND insertType = 2 + AND addUserId = #{dto.operatorId} + </if> + <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> + AND insertType = 3 + AND addUserId = #{dto.storeId} + </if> + </where> + GROUP BY DATE_FORMAT(insertTime,'%Y') + </select> + <select id="getMonthUserCount" resultType="com.dsh.account.vo.entity.MonthData"> + select IFNULL(count(*),0) AS monthCount,DATE_FORMAT(insertTime,'%Y%m') AS `month` from t_app_user + <where> + <if test="dto.cityCode != null and dto.cityCode != ''"> + AND cityCode = #{dto.cityCode} + </if> + <if test="dto.isVip != null"> + AND isVip = #{dto.isVip} + </if> + <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> + AND insertType = 2 + AND addUserId = #{dto.operatorId} + </if> + <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> + AND insertType = 3 + AND addUserId = #{dto.storeId} + </if> + </where> + GROUP BY DATE_FORMAT(insertTime,'%Y%m') + </select> + <select id="getWeekUserCount4" resultType="com.dsh.account.vo.entity.WeekData"> + select IFNULL(count(*),0) AS weekCount,4 AS `week` from t_app_user + <where> + <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''"> + AND insertTime between #{dto.startTime} and #{dto.endTime} + </if> + <if test="dto.cityCode != null and dto.cityCode != ''"> + AND cityCode = #{dto.cityCode} + </if> + <if test="dto.isVip != null"> + AND isVip = #{dto.isVip} + </if> + <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> + AND insertType = 2 + AND addUserId = #{dto.operatorId} + </if> + <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> + AND insertType = 3 + AND addUserId = #{dto.storeId} + </if> + </where> + </select> + + <select id="getWeekUserCount3" resultType="com.dsh.account.vo.entity.WeekData"> + select IFNULL(count(*),0) AS weekCount,3 AS `week` from t_app_user + <where> + <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''"> + AND insertTime between #{dto.startTime} and #{dto.endTime} + </if> + <if test="dto.cityCode != null and dto.cityCode != ''"> + AND cityCode = #{dto.cityCode} + </if> + <if test="dto.isVip != null"> + AND isVip = #{dto.isVip} + </if> + <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> + AND insertType = 2 + AND addUserId = #{dto.operatorId} + </if> + <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> + AND insertType = 3 + AND addUserId = #{dto.storeId} + </if> + </where> + </select> + + <select id="getWeekUserCount2" resultType="com.dsh.account.vo.entity.WeekData"> + select IFNULL(count(*),0) AS weekCount,2 AS `week` from t_app_user + <where> + <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''"> + AND insertTime between #{dto.startTime} and #{dto.endTime} + </if> + <if test="dto.cityCode != null and dto.cityCode != ''"> + AND cityCode = #{dto.cityCode} + </if> + <if test="dto.isVip != null"> + AND isVip = #{dto.isVip} + </if> + <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> + AND insertType = 2 + AND addUserId = #{dto.operatorId} + </if> + <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> + AND insertType = 3 + AND addUserId = #{dto.storeId} + </if> + </where> + </select> + + <select id="getWeekUserCount1" resultType="com.dsh.account.vo.entity.WeekData"> + select IFNULL(count(*),0) AS weekCount,1 AS `week` from t_app_user + <where> + <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''"> + AND insertTime between #{dto.startTime} and #{dto.endTime} + </if> + <if test="dto.cityCode != null and dto.cityCode != ''"> + AND cityCode = #{dto.cityCode} + </if> + <if test="dto.isVip != null"> + AND isVip = #{dto.isVip} + </if> + <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> + AND insertType = 2 + AND addUserId = #{dto.operatorId} + </if> + <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> + AND insertType = 3 + AND addUserId = #{dto.storeId} + </if> + </where> + </select> + + <select id="getDayUserCount" resultType="com.dsh.account.vo.entity.DayData"> + select IFNULL(count(*),0) AS dayCount,DATE_FORMAT(insertTime,'%Y-%m-%d') AS `day` from t_app_user + <where> + <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''"> + AND insertTime between #{dto.startTime} and #{dto.endTime} + </if> + <if test="dto.cityCode != null and dto.cityCode != ''"> + AND cityCode = #{dto.cityCode} + </if> + <if test="dto.isVip != null"> + AND isVip = #{dto.isVip} + </if> + <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> + AND insertType = 2 + AND addUserId = #{dto.operatorId} + </if> + <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> + AND insertType = 3 + AND addUserId = #{dto.storeId} + </if> + </where> + GROUP BY DATE_FORMAT(insertTime,'%Y-%m-%d') + </select> + <select id="groupCityInfo" resultType="com.dsh.account.vo.GroupCityInfoVO"> + select IFNULL(count(*),0) AS userCount,cityCode,city from t_app_user + <where> + <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''"> + AND insertTime between #{dto.startTime} and #{dto.endTime} + </if> + <if test="dto.cityCode != null and dto.cityCode != ''"> + AND cityCode = #{dto.cityCode} + </if> + <if test="dto.isVip != null"> + AND isVip = #{dto.isVip} + </if> + <if test="dto.insertType != null and dto.insertType == 2 and dto.operatorId != null"> + AND insertType = 2 + AND addUserId = #{dto.operatorId} + </if> + <if test="dto.insertType != null and dto.insertType == 3 and dto.storeId != null"> + AND insertType = 3 + AND addUserId = #{dto.storeId} + </if> + </where> + GROUP BY cityCode + </select> </mapper> -- Gitblit v1.7.1