| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | int updateByUniqueCodeStateAndTime(@Param("updateTime")DateTime updateTime,@Param("uniqueCode")String uniqueCode, @Param("state")Integer stateOne, @Param("offsetDay")DateTime dateTime); |
| | | |
| | | BigDecimal selectProfitByStateAndDateTimeAndUniqueCode(@Param("state")Integer state, @Param("DateTime")DateTime DateTime, @Param("uniqueCode")String uniqueCode); |
| | | BigDecimal selectProfitByStateAndDateTimeAndUniqueCode(@Param("state")Integer state, @Param("date") Date DateTime, @Param("uniqueCode")String uniqueCode); |
| | | } |
| | |
| | | |
| | | MallMoneyFlow selectOneByOrderNoAndMemberId(@Param("rechargeNo")String rechargeNo, @Param("memberId")Long memberId); |
| | | |
| | | BigDecimal selectAmountByFlowtypeAndType(@Param("memberId")Long memberId,@Param("flowType")Integer flowType, @Param("type")Integer type, @Param("status")Integer status); |
| | | BigDecimal selectAmountByFlowtypeAndType(@Param("memberId")Long memberId,@Param("flowType")Integer flowType, |
| | | @Param("type")Integer type, @Param("status")Integer status, |
| | | @Param("dateDay") Date DateTime,@Param("dateMonth") Date dateMonth); |
| | | } |
| | |
| | | public FebsResponse leaderProfit() { |
| | | MallMember loginUser = LoginUserUtil.getLoginUser(); |
| | | ApiLeaderProfitVo apiLeaderProfitVo = new ApiLeaderProfitVo(); |
| | | // BigDecimal TotalProfit = mallLeaderAchieveMapper.selectProfitByStateAndDateTimeAndUniqueCode(null,null,loginUser.getInviteId()).setScale(2,BigDecimal.ROUND_DOWN); |
| | | // apiLeaderProfitVo.setTotalProfit(TotalProfit); |
| | | BigDecimal todayProfit = mallLeaderAchieveMapper.selectProfitByStateAndDateTimeAndUniqueCode(2,DateUtil.date(),loginUser.getInviteId()).setScale(2,BigDecimal.ROUND_DOWN); |
| | | |
| | | BigDecimal totalProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(),MoneyFlowTypeEnum.LEADERACHIEVE.getValue(),null,null,null); |
| | | apiLeaderProfitVo.setTotalProfit(totalProfit); |
| | | BigDecimal todayProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(), |
| | | MoneyFlowTypeEnum.LEADERACHIEVE.getValue(), |
| | | null,DateUtil.date(), |
| | | null); |
| | | apiLeaderProfitVo.setTodayProfit(todayProfit); |
| | | |
| | | BigDecimal monthProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(), |
| | | MoneyFlowTypeEnum.LEADERACHIEVE.getValue(), |
| | | null,null, |
| | | DateUtil.date()); |
| | | apiLeaderProfitVo.setMonthProfit(monthProfit); |
| | | BigDecimal waitProfit = mallLeaderAchieveMapper.selectProfitByStateAndDateTimeAndUniqueCode(1,null,loginUser.getInviteId()).setScale(2,BigDecimal.ROUND_DOWN); |
| | | apiLeaderProfitVo.setWaitProfit(waitProfit); |
| | | BigDecimal totalProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(),MoneyFlowTypeEnum.LEADERACHIEVE.getValue(),null); |
| | | apiLeaderProfitVo.setTotalProfit(totalProfit); |
| | | |
| | | return new FebsResponse().success().data(apiLeaderProfitVo); |
| | | } |
| | | |
| | |
| | | <if test="state!=null and state!=''"> |
| | | and a.state = #{state} |
| | | </if> |
| | | <if test="DateTime!=null and DateTime!=''"> |
| | | and date_format(a.CREATED_TIME, '%Y-%m-%d') = date_format(#{DateTime}, '%Y-%m-%d') |
| | | <if test="date!=null"> |
| | | and date_format(a.CREATED_TIME, '%Y-%m-%d') = date_format(#{date}, '%Y-%m-%d') |
| | | </if> |
| | | <if test="uniqueCode!=null and uniqueCode!=''"> |
| | | and a.unique_code = #{uniqueCode} |
| | |
| | | </select> |
| | | |
| | | <select id="selectAmountByFlowtypeAndType" resultType="java.math.BigDecimal"> |
| | | select ifnull(sum(amount),0) from mall_money_flow |
| | | select ifnull(sum(a.amount),0) from mall_money_flow a |
| | | <where> |
| | | a.member_id = #{memberId} |
| | | <if test="flowType!=null and flowType!=''"> |
| | |
| | | <if test="status!=null and status!=''"> |
| | | and a.status = #{status} |
| | | </if> |
| | | <if test="dateDay!=null"> |
| | | and date_format(a.created_time, '%Y-%m-%d') = date_format(#{dateDay}, '%Y-%m-%d') |
| | | </if> |
| | | <if test="dateMonth!=null"> |
| | | and date_format(a.created_time, '%Y-%m-%d') = date_format(#{dateMonth}, '%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.service.*; |
| | | import cc.mrbird.febs.mall.vo.ApiLeaderProfitVo; |
| | | import cc.mrbird.febs.pay.model.WxGenerateQrCodeDto; |
| | | import cc.mrbird.febs.pay.service.IXcxPayService; |
| | | import cc.mrbird.febs.rabbit.consumer.AgentConsumer; |
| | |
| | | } |
| | | |
| | | } |
| | | @Autowired |
| | | private MallMoneyFlowMapper mallMoneyFlowMapper; |
| | | |
| | | @Test |
| | | public void testAddress(){ |
| | | MallOrderInfo orderInfo = mallOrderInfoMapper.selectOrderDetailsById(266L); |
| | | System.out.println(orderInfo.getLeaderLatitude()); |
| | | MallMember loginUser = mallMemberMapper.selectById(47L); |
| | | BigDecimal totalProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(),MoneyFlowTypeEnum.LEADERACHIEVE.getValue(),null,null,null); |
| | | BigDecimal todayProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(), |
| | | MoneyFlowTypeEnum.LEADERACHIEVE.getValue(), |
| | | null,DateUtil.date(), |
| | | null); |
| | | |
| | | BigDecimal monthProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(), |
| | | MoneyFlowTypeEnum.LEADERACHIEVE.getValue(), |
| | | null,null, |
| | | DateUtil.date()); |
| | | BigDecimal waitProfit = mallLeaderAchieveMapper.selectProfitByStateAndDateTimeAndUniqueCode(1,null,loginUser.getInviteId()).setScale(2,BigDecimal.ROUND_DOWN); |
| | | System.out.println(todayProfit +";"); |
| | | System.out.println(waitProfit +";"); |
| | | System.out.println(totalProfit +";"); |
| | | System.out.println(monthProfit +";"); |
| | | } |
| | | |
| | | public static void main(String[] args) { |