推广部分大改
This commit is contained in:
@@ -135,7 +135,7 @@ public interface MerchantOrderMapper extends BaseMapper<MerchantOrder> {
|
||||
Double queryMerchantOrderEnterFeeByTime(Map map);
|
||||
|
||||
Double queryMerchantOrderShareMoneyByTime(Map map);
|
||||
|
||||
BigDecimal queryMerchantOrderMoneyByTime(Map map);
|
||||
/**
|
||||
*
|
||||
* queryMerchantOrderPageShuju:(最新统计订单方法). <br/>
|
||||
@@ -235,6 +235,7 @@ public interface MerchantOrderMapper extends BaseMapper<MerchantOrder> {
|
||||
"WHERE merchantCode = #{merchantCode} AND createDate = #{date} AND `status` IN (1, 2)")
|
||||
Map<String, Object> getConsumeFee(@Param("merchantCode") String merchantCode, @Param("date") String date);
|
||||
|
||||
|
||||
Map<String, Object> querySumCount(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
@@ -427,5 +428,23 @@ public interface MerchantOrderMapper extends BaseMapper<MerchantOrder> {
|
||||
|
||||
@Select("SELECT * FROM tb_pluss_merchant_order WHERE mercOrderNo = #{mercOrderNo} limit 1")
|
||||
MerchantOrder getByMercOrderNo(String mercOrderNo);
|
||||
@Select("SELECT count(0)\n" +
|
||||
"FROM tb_pluss_merchant_order mo\n" +
|
||||
"LEFT JOIN tb_pluss_user_app ua ON ua.merchantCode = mo.merchantCode\n" +
|
||||
"WHERE\n" +
|
||||
" ua.userId = #{userId} ")
|
||||
Integer getCountUser(@Param("userId") Long userId);
|
||||
|
||||
@Select("SELECT IFNULL(SUM(consumeFee - refundAmt),0) FROM tb_pluss_merchant_order WHERE merchantCode=#{merchantCode} AND `status` = 1")
|
||||
BigDecimal getAmountData(@Param("merchantCode") String merchantCode);
|
||||
|
||||
/**
|
||||
* 昨日收款
|
||||
* @param startDate
|
||||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT IFNULL(SUM(consumeFee - refundAmt),0) FROM tb_pluss_merchant_order WHERE merchantCode=#{merchantCode} AND `status` = 1 AND transDt >= #{startDate} AND transDt <= #{endDate}")
|
||||
BigDecimal getPlatformAmtYestday(@Param("merchantCode") String merchantCode,@Param("startDate") Date startDate, @Param("endDate") Date endDate);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package cn.pluss.platform.mapper;
|
||||
|
||||
import cn.pluss.platform.dto.MerchantFeeDTO;
|
||||
import cn.pluss.platform.entity.MerchantChannelStatus;
|
||||
import cn.pluss.platform.entity.MerchantProfit;
|
||||
import cn.pluss.platform.vo.MerchantProfitVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -67,5 +69,64 @@ public interface MerchantProfitMapper extends BaseMapper<MerchantProfit> {
|
||||
|
||||
|
||||
Map<String, BigDecimal> getProfitAmtCount(MerchantProfit condition);
|
||||
|
||||
/**
|
||||
* 今日收益
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT\n" +
|
||||
"\tsum( t.price ) \n" +
|
||||
"FROM\n" +
|
||||
"\ttb_pluss_merchant_profit t \n" +
|
||||
"WHERE\n" +
|
||||
"\tt.type = 5 \n" +
|
||||
"\tAND t.userId = #{userId} \n" +
|
||||
"\tAND date_format( `t`.`createDt`, '%Y-%m-%d' ) = date_format(( curdate() - INTERVAL 0 DAY ), '%Y-%m-%d' );")
|
||||
BigDecimal getTodaySum(@Param("userId")String userId);
|
||||
|
||||
/**
|
||||
* 直属商户交易金额
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT\n" +
|
||||
"\tsum( o.consumeFee ) \n" +
|
||||
"FROM\n" +
|
||||
"\ttb_pluss_merchant_order o\n" +
|
||||
"\tLEFT JOIN tb_pluss_merchant_base_info b ON o.merchantCode = b.merchantCode\n" +
|
||||
"\tLEFT JOIN tb_pluss_user_promotion p ON b.userId = p.user_id \n" +
|
||||
"WHERE\n" +
|
||||
"\to.`status` = 1 \n" +
|
||||
"\tAND p.parent_user_id = #{userId}")
|
||||
BigDecimal getConsumeFee(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 团队总交易金额
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getConsumeFeeTeam(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 团队总交易金额(今日)
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
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);
|
||||
|
||||
@Select("SELECT\n" +
|
||||
"\tcount(*) \n" +
|
||||
"FROM\n" +
|
||||
"\ttb_pluss_user_promotion \n" +
|
||||
"WHERE\n" +
|
||||
"\tparent_user_id = #{userId}\n" +
|
||||
"\tAND type_code = #{typeCode}")
|
||||
Integer getCountChild( @Param("userId") Long userId,@Param("typeCode") String typeCod);
|
||||
|
||||
List<MerchantChannelStatus> getChannelStatus(@Param("merchantCode") String merchantCode);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ public interface UserAppMapper extends BaseMapper<UserApp> {
|
||||
MerchSummaryVO selectBillCountAndTotalFee(@Param("condition") MerchSearchDTO condition);
|
||||
|
||||
Integer queryUserAppPageCount(Map<String, Object> map);
|
||||
Integer queryUserPageCount(Map<String, Object> map);
|
||||
|
||||
List<UserInfoVO> queryUserInfoVOPage(Map<String, Object> map);
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@@ -31,4 +32,14 @@ public interface UserPromotionMapper extends BaseMapper<UserPromotion> {
|
||||
"WHERE\n" +
|
||||
"\tP.user_id = #{userId}")
|
||||
UserPromotion selectByUserId(@Param("userId") String userId);
|
||||
|
||||
UserPromotion selectByPrimaryKey(Long userId);
|
||||
@Select("select max(current_fee) from tb_pluss_user_promotion where parent_user_id=#{id}")
|
||||
BigDecimal selectMaxFeeByUserId(@Param("id")String id);
|
||||
@Select(" select *\n" +
|
||||
" from tb_pluss_user_promotion\n" +
|
||||
" where user_id = #{userId}" +
|
||||
" limit 1 ")
|
||||
UserPromotion getOne(@Param("userId") Long userId);
|
||||
int updateByPrimaryKey(UserPromotion record);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user