融资编制报表修改
This commit is contained in:
parent
0358e37457
commit
82d188ac69
|
|
@ -35,7 +35,7 @@ public class PlanReportPlugin extends AbstractReportListDataPlugin {
|
|||
|
||||
//明细字段对应的字段名
|
||||
public static final Map<String, String> zdm = new HashMap() {{
|
||||
put("金融机构", "fbankcateid");
|
||||
put("金融机构", "fdetailext21");
|
||||
put("存量金融债务余额", "fdetailext12");
|
||||
put("有效授信(流贷)", "fdetailext13");
|
||||
put("提前还款", "fdetailext15");
|
||||
|
|
@ -123,18 +123,17 @@ public class PlanReportPlugin extends AbstractReportListDataPlugin {
|
|||
|
||||
JoinDataSet join = dangyueres.join(xiayueyueres, JoinType.FULL);
|
||||
DataSet finish = join.on("fbankcateid1", "fbankcateid").select(mergedFieldNames).finish();
|
||||
finish=finish.addField("(case when fbankcateid1!=null and fbankcateid1!=0 then fbankcateid1 else fbankcateid end)","shkd_jrjg");
|
||||
finish=finish.addField("(case when fbankcateid1!=null and fbankcateid1!=' ' then fbankcateid1 else fbankcateid end)","shkd_jrjg");
|
||||
DataSet dataSet_sum = DB.queryDataSet(this.getClass().getSimpleName(), DBRoute.of("fi"),
|
||||
"SELECT\n" +
|
||||
"fbankcateid AS bankcate,\n" +
|
||||
""+zdm.get("金融机构")+" AS bankcate,\n" +
|
||||
"SUM(fdetailext12) AS shkd_cljrzwye,\n" +
|
||||
"SUM(fdetailext13) AS shkd_yxsx\n" +
|
||||
"FROM\n" +
|
||||
"t_fpm_reportdatadetail\n" +
|
||||
"WHERE\n" +
|
||||
"fid = "+id+"\n" +
|
||||
"GROUP BY\n" +
|
||||
"fbankcateid");//财务云
|
||||
"GROUP BY "+zdm.get("金融机构")+" ");//财务云
|
||||
JoinDataSet join1 = finish.join(dataSet_sum, JoinType.LEFT);
|
||||
finish = join1.on("shkd_jrjg", "bankcate").select(finish.getRowMeta().getFieldNames(),new String[]{"shkd_cljrzwye", "shkd_yxsx"}).finish();
|
||||
//小计
|
||||
|
|
@ -161,7 +160,7 @@ public class PlanReportPlugin extends AbstractReportListDataPlugin {
|
|||
"SELECT\n" +
|
||||
"t1.fbillno as fbillno,\n" +
|
||||
" DATE_FORMAT(t4.fstartdate, '%Y%m') AS fstartdate_yyyyMM, -- 按照年月分组\n" +
|
||||
" t2.fbankcateid as fbankcateid, -- 金融机构\n" +
|
||||
" t2."+zdm.get("金融机构")+" as fbankcateid, -- 金融机构\n" +
|
||||
" SUM(t2."+zdm.get("存量金融债务余额")+") AS total_fdetailext12, -- 存量金融债务余额总和\n" +
|
||||
" SUM(t2."+zdm.get("有效授信(流贷)")+") AS total_fdetailext13, -- 有效授信总和(流贷)\n" +
|
||||
" SUM(t2."+zdm.get("提前还款")+") AS total_fdetailext15, -- 提前还款总和\n" +
|
||||
|
|
@ -178,7 +177,7 @@ public class PlanReportPlugin extends AbstractReportListDataPlugin {
|
|||
" t1.fid = "+id+" AND\n" +
|
||||
" t4.fstartdate>='"+start+"' AND\n" +
|
||||
" t4.fstartdate<='"+end+"' AND\n" +
|
||||
" t2.fbankcateid <> 0 \n");
|
||||
" t2."+zdm.get("金融机构")+" IS NOT NULL AND t2."+zdm.get("金融机构")+"!=' ' \n");
|
||||
|
||||
if (shkd_km != null) {
|
||||
sqlBuilder.append(" AND t3.fsubjectmemid = "+shkd_km.getLong("id")+" \n");
|
||||
|
|
@ -186,7 +185,7 @@ public class PlanReportPlugin extends AbstractReportListDataPlugin {
|
|||
|
||||
sqlBuilder.append("GROUP BY\n" +
|
||||
" DATE_FORMAT(t4.fstartdate, '%Y%m'), -- 直接在 GROUP BY 中使用原始表达式\n" +
|
||||
" t2.fbankcateid, -- 按照金融机构分组\n" +
|
||||
" t2."+zdm.get("金融机构")+", -- 按照金融机构分组\n" +
|
||||
" t1.fbillno");
|
||||
return sqlBuilder;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue