修改统计

This commit is contained in:
haozq 2025-01-17 18:28:43 +08:00
parent a11fc6f2e4
commit 25a1a8e683
2 changed files with 21 additions and 5 deletions

View File

@ -109,8 +109,8 @@ public class HomeIndexServiceImpl implements HomeIndexService {
log.info("数据概览-应付款金额{}", Thread.currentThread().getName());
IndexVo indexVo = mapper.getNoPayMoney(dto);
List<Object> dataList = new ArrayList<>(2);
dataList.add(0, 0.0);
dataList.add(1, 0);
dataList.add(0, indexVo.getMoney());
dataList.add(1, indexVo.getNum());
return dataList;
});
fList = future.get();

View File

@ -205,13 +205,29 @@
SELECT count(csp.plan_id) num,sum(csp.money) money
from car_slt_plan csp
left join car_slt_apply sla on csp.slt_id=sla.id
<where>
where sla.id is not null
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
AND DATE_FORMAT(sla.create_time,'%Y-%m-%d') BETWEEN #{params.startTime} AND #{params.endTime}
</if>
</where>
</select>
<select id="getNoPayMoney" resultType="com.bonus.gzcar.business.backstage.entity.IndexVo">
SELECT sum(a.money),sum(a.num)
from (
SELECT sum(cpo.money) money ,0 num
from car_plan_out cpo
left join car_slt_details csd on csd.out_id=cpo.id
where csd.id is null AND cpo.status=1
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
AND DATE_FORMAT(cpo.create_time,'%Y-%m-%d') BETWEEN #{params.startTime} AND #{params.endTime}
</if>
union ALL
SELECT 0,count(DISTINCT cpo.apply_id) num
from car_plan_out cpo
left join car_slt_details csp on cpo.id=csp.out_id
where csp.id is null AND cpo.status=1
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
AND DATE_FORMAT(cpo.create_time,'%Y-%m-%d') BETWEEN #{params.startTime} AND #{params.endTime}
</if>
)a
</select>
</mapper>