|
|
@@ -105,10 +105,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
sum(ub.order_total_consumption) shopConsume,
|
|
|
sum(ub.online_order_total_consumption) lineConsume,
|
|
|
sum(ub.integral_able) availablePoint
|
|
|
- from tb_user u
|
|
|
- join tb_user_business_role ub on u.id = ub.user_id
|
|
|
+ from tb_user_business_role ub
|
|
|
+ <if test="bo.id == null">
|
|
|
+ join tb_user u on u.id = ub.user_id
|
|
|
+ </if>
|
|
|
<include refid="whereByStatis"/>
|
|
|
<where>
|
|
|
+ <if test="bo.id != null">
|
|
|
+ and ub.user_id = #{bo.id}
|
|
|
+ </if>
|
|
|
<if test="bo.businessId != null">
|
|
|
and ub.business_id = #{bo.businessId}
|
|
|
</if>
|
|
|
@@ -117,8 +122,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="querySurplusQueueMoney" resultType="java.math.BigDecimal">
|
|
|
select sum(tsq.should_subsidy_amount - tsq.actual_subsidy_amount) from tb_subsidy_queue tsq
|
|
|
- join tb_user u on tsq.user_id = u.id
|
|
|
+ <if test="bo.id == null">
|
|
|
+ join tb_user u on tsq.user_id = u.id
|
|
|
+ </if>
|
|
|
where tsq.subsidy_status = 0
|
|
|
+ <if test="bo.id != null">
|
|
|
+ and tsq.user_id = #{bo.id}
|
|
|
+ </if>
|
|
|
<if test="bo.businessId != null">
|
|
|
and tsq.current_business_id = #{bo.businessId}
|
|
|
</if>
|
|
|
@@ -126,9 +136,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="querySubsidyMoney" resultType="com.ruoyi.user.domain.vo.UserStatisticsVo">
|
|
|
- select sum(tsq.should_subsidy_amount) shouldSubsidyMoney from tb_subsidy_queue tsq
|
|
|
- join tb_user u on tsq.user_id = u.id
|
|
|
+ select sum(tsq.should_subsidy_amount) shouldSubsidyMoney, sum(tsq.actual_subsidy_amount) alreadySubsidyMoney
|
|
|
+ from tb_subsidy_queue tsq
|
|
|
+ <if test="bo.id == null">
|
|
|
+ join tb_user u on tsq.user_id = u.id
|
|
|
+ </if>
|
|
|
<where>
|
|
|
+ <if test="bo.id != null">
|
|
|
+ and tsq.user_id = #{bo.id}
|
|
|
+ </if>
|
|
|
<if test="bo.businessId != null">
|
|
|
and tsq.current_business_id = #{bo.businessId}
|
|
|
</if>
|
|
|
@@ -136,6 +152,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<include refid="whereByStatis"/>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectBusinessPage" resultType="com.ruoyi.user.domain.vo.UserVo">
|
|
|
+ select u.*, ub.integral_able availablePoint from tb_user u
|
|
|
+ join tb_user_business_role ub on u.id = ub.user_id
|
|
|
+ where ub.business_id = #{bo.businessId}
|
|
|
+ <if test="bo.mobile != null and bo.mobile != ''">
|
|
|
+ and u.mobile like concat('%',#{bo.mobile},'%')
|
|
|
+ </if>
|
|
|
+ <if test="bo.nickname != null and bo.nickname != ''">
|
|
|
+ and u.nickname like concat('%',#{bo.nickname},'%')
|
|
|
+ </if>
|
|
|
+ <if test="bo.realName != null and bo.realName != ''">
|
|
|
+ and u.real_name like concat('%',#{bo.realName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="bo.createDayStart != null">
|
|
|
+ and u.create_time >= #{bo.createDayStart}
|
|
|
+ </if>
|
|
|
+ <if test="bo.createDayEnd != null">
|
|
|
+ and u.create_time <= #{bo.createDayEnd}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
<sql id="whereByStatis">
|
|
|
<where>
|
|
|
<if test="bo.mobile != null and bo.mobile != ''">
|