| | |
| | | ) or ta.shop_id = #{objectId} ) |
| | | </where> |
| | | </select> |
| | | <select id="getUserStatistics" resultType="com.ruoyi.account.vo.UserStatistics"> |
| | | SELECT |
| | | COUNT(*) AS totalUser, |
| | | SUM(CASE WHEN tau.user_type = 2 THEN 1 ELSE 0 END) AS shopUser, |
| | | SUM(CASE WHEN tau.vip_id <![CDATA[<]]> 4 THEN 1 ELSE 0 END) AS consumerUser, |
| | | SUM(CASE WHEN tau.vip_id = 1 THEN 1 ELSE 0 END) AS commonUser, |
| | | SUM(CASE WHEN tau.vip_id = 2 THEN 1 ELSE 0 END) AS goldUser, |
| | | SUM(CASE WHEN tau.vip_id = 3 THEN 1 ELSE 0 END) AS diamondUser, |
| | | SUM(CASE WHEN tau.vip_id <![CDATA[>]]> 3 THEN 1 ELSE 0 END) AS entrepreneurUser, |
| | | SUM(CASE WHEN tau.vip_id = 4 THEN 1 ELSE 0 END) AS proxyUser, |
| | | SUM(CASE WHEN tau.vip_id = 5 THEN 1 ELSE 0 END) AS agentUser, |
| | | SUM(CASE WHEN tau.vip_id = 6 THEN 1 ELSE 0 END) AS totalAgentUser, |
| | | SUM(CASE WHEN tau.vip_id = 7 THEN 1 ELSE 0 END) AS partnerUser |
| | | FROM |
| | | t_app_user tau |
| | | </select> |
| | | <select id="getUserStatisticsDetail" resultType="com.ruoyi.account.vo.UserStatisticsDetail"> |
| | | SELECT |
| | | SUM(tau.total_point) totalScore, |
| | | SUM(tau.shop_point) consumeScore, |
| | | SUM(tau.share_point) rebateScore, |
| | | SUM(tau.total_invite_point) inviteScore, |
| | | SUM(tau.total_register_point) registerScore, |
| | | SUM(tau.total_share_point+tau.total_sign_point+tau.total_hour_point) workScore, |
| | | SUM(tau.total_performance_point) achievementScore, |
| | | SUM(tau.total_distribution_amount) totalRebate, |
| | | SUM(tau.total_recharge_amount) totalRecharge, |
| | | SUM(tau.withdrawn_amount) totalWithdraw |
| | | FROM |
| | | t_app_user tau |
| | | <where> |
| | | <if test="null != userName and '' != userName"> |
| | | and tau.name like CONCAT('%',#{userName},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |