月为单位 查用户

This commit is contained in:
wangw 2025-01-06 20:33:53 +08:00
parent d4183436e6
commit f13daaf01e
3 changed files with 13 additions and 6 deletions

View File

@ -43,7 +43,7 @@ public interface PayDetailsDao extends BaseMapper<PayDetails> {
int selectPayCount(Long userId);
Double instantselectSumPay(@Param("date") String date, @Param("userId") Long userId);
Double instantselectSumPay(@Param("startTime") String startTime,@Param("endTime") String endTime, @Param("userId") Long userId);
Double statisticsIncomeMoney(@Param("time") String time, @Param("flag") Integer flag, @Param("ordersType") Integer ordersType);

View File

@ -1,5 +1,6 @@
package com.sqx.modules.pay.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
@ -80,7 +81,9 @@ public class PayDetailsServiceImpl extends ServiceImpl<PayDetailsDao, PayDetails
@Override
public Double instantselectSumPay(String date, Long userId) {
return payDetailsDao.instantselectSumPay(date, userId);
return payDetailsDao.instantselectSumPay(
DateUtil.parse(date,"yyyy-MM")+"-00 00:00:00",
DateUtil.endOfMonth(DateUtil.parse(date)).toString(), userId);
}
@Override

View File

@ -141,10 +141,14 @@
order by d.pay_time desc
</select>
<select id="instantselectSumPay" resultType="Double">
select sum(money) from pay_details where 1=1
and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
and state=1 and user_id=#{userId}
</select>
select sum(money)
from pay_details
where 1 = 1
and create_time &gt; #{startTime}
and create_time &lt; #{endTime}
and state = 1
and user_id = #{userId}
</select>
<select id="selectUserMemberList" resultType="Map">