浏览代码

[Report] Re-write sub-sql (project fee) for financial status report

master
cyril.tsui 1 天前
父节点
当前提交
f024f4926c
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. +6
    -2
      src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt

+ 6
- 2
src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt 查看文件

@@ -2252,7 +2252,7 @@ open class ReportService(
+ " and pe.issueDate >= :startMonth and pe.issueDate <= :endMonth " + " and pe.issueDate >= :startMonth and pe.issueDate <= :endMonth "
+ " group by projectId " + " group by projectId "
+ " ), " + " ), "
+ " cte_fee as ( "
/* + " cte_fee as ( "
+ " select IFNULL(sum(mp.amount),0) as expectedTotalFee, p.id as projectId " + " select IFNULL(sum(mp.amount),0) as expectedTotalFee, p.id as projectId "
+ " from milestone_payment mp " + " from milestone_payment mp "
+ " left join milestone m on mp.milestoneId = m.id " + " left join milestone m on mp.milestoneId = m.id "
@@ -2263,7 +2263,11 @@ open class ReportService(
+ " and mp.`date` >= :startMonth and mp.`date` <= :endMonth " + " and mp.`date` >= :startMonth and mp.`date` <= :endMonth "
+ " and p.teamLead = :teamLeadId" + " and p.teamLead = :teamLeadId"
+ " group by p.id" + " group by p.id"
+ " ) "
+ " ) "*/
+ " cte_fee as ( "
+ " select ifnull(p.expectedTotalFee, 0) as expectedTotalFee, p.id as projectId "
+ " from project p "
+ ")"
+ " select p.code, p.name, p.description, c.name as client, IFNULL(s2.name, \"N/A\") as subsidiary, concat(t.code, \' - \', t.name) as teamLead, " + " select p.code, p.name, p.description, c.name as client, IFNULL(s2.name, \"N/A\") as subsidiary, concat(t.code, \' - \', t.name) as teamLead, "
+ " concat(t.code, \' - \', s.staffId, \' - \', s.name) as subTeamLead," + " concat(t.code, \' - \', s.staffId, \' - \', s.name) as subTeamLead,"
+ " p.planStart , p.planEnd ," + " p.planStart , p.planEnd ,"


正在加载...
取消
保存