推广部分小修改
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package cn.pluss.platform.mapper;
|
||||
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.dto.MerchantFeeDTO;
|
||||
import cn.pluss.platform.entity.MerchantChannelStatus;
|
||||
import cn.pluss.platform.entity.MerchantProfit;
|
||||
import cn.pluss.platform.vo.DeviceGoodsVO;
|
||||
import cn.pluss.platform.vo.MerchantProfitVO;
|
||||
import cn.pluss.platform.vo.ProfitOrderVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -115,7 +118,7 @@ public interface MerchantProfitMapper extends BaseMapper<MerchantProfit> {
|
||||
BigDecimal getConsumeFeeTeamToday(@Param("userId") String userId);
|
||||
|
||||
List<MerchantProfitVO> getTeamList(@Param("typeCode") String typeCode, @Param("userId") Long userId,
|
||||
@Param("page") Integer page, @Param("size") Integer size, @Param("userName") String userName);
|
||||
@Param("userName") String userName);
|
||||
|
||||
@Select("SELECT\n" +
|
||||
"\tcount(*) \n" +
|
||||
@@ -128,5 +131,17 @@ public interface MerchantProfitMapper extends BaseMapper<MerchantProfit> {
|
||||
|
||||
List<MerchantChannelStatus> getChannelStatus(@Param("merchantCode") String merchantCode);
|
||||
|
||||
/**
|
||||
* 直属交易
|
||||
* @param userId
|
||||
* @param pageSize
|
||||
* @param offset
|
||||
* @return
|
||||
*/
|
||||
List<ProfitOrderVO> directlyOrder(@Param("userId") Long userId,@Param("pageSize") Integer pageSize,@Param("offset") Integer offset);
|
||||
/**
|
||||
* 团队交易
|
||||
*/
|
||||
List<ProfitOrderVO> teamOrder(@Param("userId") Long userId,@Param("pageSize") Integer pageSize,@Param("offset") Integer offset);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package cn.pluss.platform.mapper;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -16,6 +17,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.Data;
|
||||
import lombok.val;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
@@ -145,6 +147,7 @@ public interface UserAppMapper extends BaseMapper<UserApp> {
|
||||
* 获取指定进件状态的商户
|
||||
*/
|
||||
Integer selectUserAppWithChannelStatusCount(@Param(Constants.WRAPPER) Wrapper<UserApp> updateWrapper);
|
||||
Integer selectUserAppWithChannelStatusCountV2(@Param("userId") String userId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
/**
|
||||
* 获取指定进件状态的商户
|
||||
|
||||
@@ -248,17 +248,14 @@
|
||||
<select id="queryMerchantProfitPage" parameterType="java.util.Map"
|
||||
resultType="cn.pluss.platform.entity.MerchantProfit">
|
||||
SELECT
|
||||
u.loginName as childLoginName,
|
||||
u.trueName as childtrueName,
|
||||
p.type_code ,
|
||||
t.loginName as userLoginName,
|
||||
t.trueName as usertrueName,
|
||||
profit.*
|
||||
profit.*,
|
||||
ua.userType,
|
||||
bi.alias
|
||||
FROM
|
||||
tb_pluss_merchant_profit profit
|
||||
LEFT JOIN tb_pluss_user_promotion p ON profit.userId = p.parent_user_id
|
||||
LEFT JOIN tb_pluss_user_info u ON p.user_id = u.id
|
||||
left join tb_pluss_user_info t on profit.userId=t.id
|
||||
LEFT JOIN tb_pluss_merchant_order merchantOrder ON profit.orderNumber = merchantOrder.orderNumber
|
||||
LEFT JOIN tb_pluss_user_app ua ON ua.userId = profit.userId
|
||||
LEFT JOIN tb_pluss_merchant_base_info bi ON merchantOrder.merchantCode = bi.merchantCode
|
||||
<where>
|
||||
profit.userId=#{userId}
|
||||
<if test="id!= null">
|
||||
@@ -283,7 +280,7 @@
|
||||
and profit.merchantCode = #{merchantCode}
|
||||
</if>
|
||||
<if test="merchantName!= null">
|
||||
and profit.merchantName like CONCAT('%',#{merchantName},'%')
|
||||
and bi.alias like CONCAT('%',#{merchantName},'%')
|
||||
</if>
|
||||
<if test="consumeFee!= null">
|
||||
and profit.consumeFee = #{consumeFee}
|
||||
@@ -888,7 +885,7 @@
|
||||
</select>
|
||||
<select id="getConsumeFeeTeamToday" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
SUM(v.consumeFee)
|
||||
IFNULL(SUM(v.consumeFee),0)
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
@@ -904,6 +901,7 @@
|
||||
LEFT JOIN tb_pluss_merchant_order v ON v.merchantCode = b.merchantCode
|
||||
WHERE
|
||||
FIND_IN_SET( p.user_id, ID._ids )
|
||||
AND b.userId != #{userId}
|
||||
AND v.status = 1
|
||||
AND date_format( `v`.`transDt`, '%Y-%m-%d' ) = date_format(( curdate() - INTERVAL 0 DAY ), '%Y-%m-%d' )
|
||||
</select>
|
||||
@@ -923,7 +921,10 @@
|
||||
WHERE
|
||||
up.parent_user_id = #{userId}
|
||||
AND up.type_code = #{typeCode}
|
||||
order by ua.userId ASC limit #{page}, #{size}
|
||||
<if test="userName != null and userName != ''">
|
||||
AND ua.userName = #{userName}
|
||||
</if>
|
||||
order by ua.userId DESC
|
||||
</select>
|
||||
<select id="getChannelStatus" resultType="cn.pluss.platform.entity.MerchantChannelStatus">
|
||||
SELECT
|
||||
@@ -933,4 +934,52 @@
|
||||
WHERE merchantCode = #{merchantCode}
|
||||
|
||||
</select>
|
||||
<select id="directlyOrder" resultType="cn.pluss.platform.vo.ProfitOrderVO">
|
||||
SELECT
|
||||
v.merchantName,
|
||||
v.consumeFee,
|
||||
v.transDt,
|
||||
v.orderNumber
|
||||
FROM
|
||||
view_base_order v
|
||||
WHERE v.userId in (select p.user_id from tb_pluss_user_promotion p where p.parent_user_id= #{userId})
|
||||
order by v.id desc
|
||||
limit #{pageSize} offset #{offset}
|
||||
</select>
|
||||
<select id="teamOrder" resultType="cn.pluss.platform.vo.ProfitOrderVO">
|
||||
SELECT
|
||||
v.merchantName,
|
||||
v.consumeFee,
|
||||
v.transDt,
|
||||
v.orderNumber
|
||||
FROM
|
||||
view_base_order v
|
||||
WHERE
|
||||
v.userId IN (
|
||||
SELECT
|
||||
p.user_id
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
@ids AS _ids,
|
||||
( SELECT @ids := GROUP_CONCAT( user_id ) FROM tb_pluss_user_promotion WHERE FIND_IN_SET( parent_user_id, @ids ) ) AS cids,
|
||||
@l := @l + 1 AS LEVEL
|
||||
FROM
|
||||
tb_pluss_user_promotion,
|
||||
( SELECT @ids := #{userId}, @l := 0 ) b
|
||||
WHERE
|
||||
@ids IS NOT NULL
|
||||
) ID,
|
||||
tb_pluss_user_promotion p
|
||||
WHERE
|
||||
FIND_IN_SET( p.user_id, ID._ids )
|
||||
|
||||
ORDER BY
|
||||
user_id
|
||||
)
|
||||
and v.userId!=#{userId}
|
||||
ORDER BY
|
||||
v.id desc
|
||||
limit #{pageSize} offset #{offset}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -1666,4 +1666,15 @@
|
||||
left join tb_pluss_user_info ui on ua.userId = ui.id
|
||||
where ui.phone = #{phone} and userType not in ('agent_staff','staff') AND LENGTH(ui.phone) = 11
|
||||
</select>
|
||||
<select id="selectUserAppWithChannelStatusCountV2" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count(*)
|
||||
FROM
|
||||
tb_pluss_user_app ua
|
||||
LEFT JOIN tb_pluss_user_promotion up ON ua.userId = up.parent_user_id
|
||||
WHERE
|
||||
up.parent_user_id = #{userId}
|
||||
AND up.create_time <![CDATA[ >= ]]> #{startTime}
|
||||
AND up.create_time <![CDATA[ <= ]]> #{endTime}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user