Browse Source

高龄补贴统计

19266 2 years ago
parent
commit
54fecccf59

+ 180 - 0
package-lock.json

@@ -0,0 +1,180 @@
+{
+  "name": "mz-cloud",
+  "lockfileVersion": 2,
+  "requires": true,
+  "packages": {
+    "": {
+      "dependencies": {
+        "file-saver": "^2.0.5",
+        "xlsx": "^0.18.5"
+      }
+    },
+    "node_modules/adler-32": {
+      "version": "1.3.1",
+      "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz",
+      "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==",
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/cfb": {
+      "version": "1.2.2",
+      "resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz",
+      "integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==",
+      "dependencies": {
+        "adler-32": "~1.3.0",
+        "crc-32": "~1.2.0"
+      },
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/codepage": {
+      "version": "1.15.0",
+      "resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz",
+      "integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==",
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/crc-32": {
+      "version": "1.2.2",
+      "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz",
+      "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==",
+      "bin": {
+        "crc32": "bin/crc32.njs"
+      },
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/file-saver": {
+      "version": "2.0.5",
+      "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz",
+      "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA=="
+    },
+    "node_modules/frac": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz",
+      "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==",
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/ssf": {
+      "version": "0.11.2",
+      "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz",
+      "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==",
+      "dependencies": {
+        "frac": "~1.1.2"
+      },
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/wmf": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz",
+      "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==",
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/word": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz",
+      "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==",
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/xlsx": {
+      "version": "0.18.5",
+      "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz",
+      "integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==",
+      "dependencies": {
+        "adler-32": "~1.3.0",
+        "cfb": "~1.2.1",
+        "codepage": "~1.15.0",
+        "crc-32": "~1.2.1",
+        "ssf": "~0.11.2",
+        "wmf": "~1.0.1",
+        "word": "~0.3.0"
+      },
+      "bin": {
+        "xlsx": "bin/xlsx.njs"
+      },
+      "engines": {
+        "node": ">=0.8"
+      }
+    }
+  },
+  "dependencies": {
+    "adler-32": {
+      "version": "1.3.1",
+      "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz",
+      "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A=="
+    },
+    "cfb": {
+      "version": "1.2.2",
+      "resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz",
+      "integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==",
+      "requires": {
+        "adler-32": "~1.3.0",
+        "crc-32": "~1.2.0"
+      }
+    },
+    "codepage": {
+      "version": "1.15.0",
+      "resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz",
+      "integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA=="
+    },
+    "crc-32": {
+      "version": "1.2.2",
+      "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz",
+      "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ=="
+    },
+    "file-saver": {
+      "version": "2.0.5",
+      "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz",
+      "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA=="
+    },
+    "frac": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz",
+      "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA=="
+    },
+    "ssf": {
+      "version": "0.11.2",
+      "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz",
+      "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==",
+      "requires": {
+        "frac": "~1.1.2"
+      }
+    },
+    "wmf": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz",
+      "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw=="
+    },
+    "word": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz",
+      "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA=="
+    },
+    "xlsx": {
+      "version": "0.18.5",
+      "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz",
+      "integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==",
+      "requires": {
+        "adler-32": "~1.3.0",
+        "cfb": "~1.2.1",
+        "codepage": "~1.15.0",
+        "crc-32": "~1.2.1",
+        "ssf": "~0.11.2",
+        "wmf": "~1.0.1",
+        "word": "~0.3.0"
+      }
+    }
+  }
+}

+ 6 - 0
package.json

@@ -0,0 +1,6 @@
+{
+  "dependencies": {
+    "file-saver": "^2.0.5",
+    "xlsx": "^0.18.5"
+  }
+}

+ 18 - 0
ruoyi-modules/mz-business-btgl/src/main/java/com/ruoyi/business/domain/ZwywBtglGlbtTj.java

@@ -20,21 +20,39 @@ public class ZwywBtglGlbtTj extends BaseEntity {
     private String bfzrsE;//80-89岁补发总人数
     private String bfzrsN;//90-99岁补发总人数
     private String bfzrsH;//100岁以上补发总人数
+
     private String stzjeE;//省厅80-89岁发放总额
     private String stzjeN;//省厅90-99岁发放总额
     private String stzjeH;//省厅100岁以上发放总额
+
+    private String stbfzrsE;//省厅80-89岁补发总人数
+    private String stbfzrsN;//省厅90-99岁补发总人数
+    private String stbfzrsH;//省厅100岁以上补发人数
+
     private String stbfzjeE;//省厅80-89岁补发总额
     private String stbfzjeN;//省厅90-99岁补发总额
     private String stbfzjeH;//省厅100岁以上补发总额
+
+    private String sjbfzrsE;//市级80-89岁补发总人数
+    private String sjbfzrsN;//市级90-99岁补发总人数
+    private String sjbfzrsH;//市级100岁以上补发人数
+
     private String sjzjeE;//市级80-89岁发放总额
     private String sjzjeN;//市级90-99岁发放总额
     private String sjzjeH;//市级100岁以上发放总额
+
     private String sjbfzjeE;//市级80-89岁补发总额
     private String sjbfzjeN;//市级90-99岁补发总额
     private String sjbfzjeH;//市级100岁以上补发总额
+
     private String qxzjeE;//区县80-89岁发放总额
     private String qxzjeN;//区县90-99岁发放总额
     private String qxzjeH;//区县100岁以上发放总额
+
+    private String qxbfzrsE;//市级80-89岁补发总人数
+    private String qxbfzrsN;//市级90-99岁补发总人数
+    private String qxbfzrsH;//市级100岁以上补发人数
+
     private String qxbfzjeE;//区县80-89岁补发总额
     private String qxbfzjeN;//区县90-99岁补发总额
     private String qxbfzjeH;//区县100岁以上补发总额

+ 48 - 2
ruoyi-modules/mz-business-btgl/src/main/java/com/ruoyi/business/service/impl/ZwywBtglGlbtTjServiceImpl.java

@@ -50,19 +50,37 @@ public class ZwywBtglGlbtTjServiceImpl implements IZwywBtglGlbtTjService {
                 zwywBtglGlbtTj.setStzjeE(zwywBtglGlbtTj2.getStzjeE());
                 zwywBtglGlbtTj.setStzjeN(zwywBtglGlbtTj2.getStzjeN());
                 zwywBtglGlbtTj.setStzjeH(zwywBtglGlbtTj2.getStzjeH());
+
+                zwywBtglGlbtTj.setStbfzrsE(zwywBtglGlbtTj2.getStbfzrsE());
+                zwywBtglGlbtTj.setStbfzrsN(zwywBtglGlbtTj2.getStbfzrsN());
+                zwywBtglGlbtTj.setStbfzrsH(zwywBtglGlbtTj2.getStbfzrsH());
+
+                zwywBtglGlbtTj.setStbfzjeE(zwywBtglGlbtTj2.getStbfzjeE());
+                zwywBtglGlbtTj.setStbfzjeN(zwywBtglGlbtTj2.getStbfzjeN());
+                zwywBtglGlbtTj.setStbfzjeH(zwywBtglGlbtTj2.getStbfzjeH());
+
                 zwywBtglGlbtTj.setSjzjeE(zwywBtglGlbtTj3.getSjzjeE());
                 zwywBtglGlbtTj.setSjzjeN(zwywBtglGlbtTj3.getSjzjeN());
                 zwywBtglGlbtTj.setSjzjeH(zwywBtglGlbtTj3.getSjzjeH());
+
+                zwywBtglGlbtTj.setSjbfzrsE(zwywBtglGlbtTj3.getSjbfzrsE());
+                zwywBtglGlbtTj.setSjbfzrsN(zwywBtglGlbtTj3.getSjbfzrsN());
+                zwywBtglGlbtTj.setSjbfzrsH(zwywBtglGlbtTj3.getSjbfzrsH());
+
+                zwywBtglGlbtTj.setSjbfzjeE(zwywBtglGlbtTj3.getSjbfzjeE());
+                zwywBtglGlbtTj.setSjbfzjeN(zwywBtglGlbtTj3.getSjbfzjeN());
+                zwywBtglGlbtTj.setSjbfzjeH(zwywBtglGlbtTj3.getSjbfzjeH());
+
                 newList.add(zwywBtglGlbtTj);
                 list.addAll(newList);
             }
 
         }else{
             SysDept dept=zwywBtglGlbtTjMapper.selectDeptListByCode(code.substring(0,2)+"0000000000");
-            stMap.put("stDeptId",dept.getDeptId());
+            stMap.put("deptId",dept.getDeptId().toString());
             stlist= zwywBtglGlbtTjMapper.stglbtTj(stMap);
             SysDept sjdept=zwywBtglGlbtTjMapper.selectDeptListByCode(code.substring(0,4)+"00000000");
-            sjMap.put("stDeptId",sjdept.getDeptId());
+            sjMap.put("deptId",sjdept.getDeptId().toString());
             sjlist=zwywBtglGlbtTjMapper.sjglbtTj(sjMap);
             qxlist=zwywBtglGlbtTjMapper.qxglbtTj(map);
             for(int i=0;i<stlist.size();i++){
@@ -78,12 +96,40 @@ public class ZwywBtglGlbtTjServiceImpl implements IZwywBtglGlbtTjService {
                 zwywBtglGlbtTj.setStzjeE(zwywBtglGlbtTj2.getStzjeE());
                 zwywBtglGlbtTj.setStzjeN(zwywBtglGlbtTj2.getStzjeN());
                 zwywBtglGlbtTj.setStzjeH(zwywBtglGlbtTj2.getStzjeH());
+
+                zwywBtglGlbtTj.setStbfzrsE(zwywBtglGlbtTj2.getStbfzrsE());
+                zwywBtglGlbtTj.setStbfzrsN(zwywBtglGlbtTj2.getStbfzrsN());
+                zwywBtglGlbtTj.setStbfzrsH(zwywBtglGlbtTj2.getStbfzrsH());
+
+                zwywBtglGlbtTj.setStbfzjeE(zwywBtglGlbtTj2.getStbfzjeE());
+                zwywBtglGlbtTj.setStbfzjeN(zwywBtglGlbtTj2.getStbfzjeN());
+                zwywBtglGlbtTj.setStbfzjeH(zwywBtglGlbtTj2.getStbfzjeH());
+
+
                 zwywBtglGlbtTj.setSjzjeE(zwywBtglGlbtTj3.getSjzjeE());
                 zwywBtglGlbtTj.setSjzjeN(zwywBtglGlbtTj3.getSjzjeN());
                 zwywBtglGlbtTj.setSjzjeH(zwywBtglGlbtTj3.getSjzjeH());
+
+                zwywBtglGlbtTj.setSjbfzrsE(zwywBtglGlbtTj3.getSjbfzrsE());
+                zwywBtglGlbtTj.setSjbfzrsN(zwywBtglGlbtTj3.getSjbfzrsN());
+                zwywBtglGlbtTj.setSjbfzrsH(zwywBtglGlbtTj3.getSjbfzrsH());
+
+                zwywBtglGlbtTj.setSjbfzjeE(zwywBtglGlbtTj3.getSjbfzjeE());
+                zwywBtglGlbtTj.setSjbfzjeN(zwywBtglGlbtTj3.getSjbfzjeN());
+                zwywBtglGlbtTj.setSjbfzjeH(zwywBtglGlbtTj3.getSjbfzjeH());
+
                 zwywBtglGlbtTj.setQxzjeE(zwywBtglGlbtTj4.getQxzjeE());
                 zwywBtglGlbtTj.setQxzjeN(zwywBtglGlbtTj4.getQxzjeN());
                 zwywBtglGlbtTj.setQxzjeH(zwywBtglGlbtTj4.getQxzjeH());
+
+                zwywBtglGlbtTj.setQxbfzrsE(zwywBtglGlbtTj4.getQxbfzrsE());
+                zwywBtglGlbtTj.setQxbfzrsN(zwywBtglGlbtTj4.getQxbfzrsN());
+                zwywBtglGlbtTj.setQxbfzrsH(zwywBtglGlbtTj4.getQxbfzrsH());
+
+                zwywBtglGlbtTj.setQxbfzjeE(zwywBtglGlbtTj4.getQxbfzjeE());
+                zwywBtglGlbtTj.setQxbfzjeN(zwywBtglGlbtTj4.getQxbfzjeN());
+                zwywBtglGlbtTj.setQxbfzjeH(zwywBtglGlbtTj4.getQxbfzjeH());
+
                 newList.add(zwywBtglGlbtTj);
                 list.addAll(newList);
             }

+ 87 - 39
ruoyi-modules/mz-business-btgl/src/main/resources/mapper/business/ZwywBtglGlbtTjMapper.xml

@@ -5,39 +5,51 @@
 <mapper namespace="com.ruoyi.business.mapper.ZwywBtglGlbtTjMapper">
 
     <resultMap type="ZwywBtglGlbtTj" id="ZwywBtglGlbtTjResult">
-        <result property="ffName"    column="ffName"    />
-        <result property="zrsE"    column="zrsE"    />
-        <result property="zrsN"    column="zrsN"    />
-        <result property="zrsH"    column="zrsH"    />
-        <result property="bfzrsE"    column="bfzrsE"    />
-        <result property="bfzrsN"    column="bfzrsN"    />
-        <result property="bfzrsH"    column="bfzrsH"    />
-        <result property="stzjeE"    column="stzjeE"    />
-        <result property="stzjeN"    column="stzjeN"    />
-        <result property="stzjeH"    column="stzjeH"    />
-        <result property="stbfzjeE"    column="stbfzjeE"    />
-        <result property="stbfzjeN"    column="stbfzjeN"    />
-        <result property="stbfzjeH"    column="stbfzjeH"    />
-        <result property="sjzjeN"    column="sjzjeN"    />
-        <result property="sjzjeH"    column="sjzjeH"    />
-        <result property="sjbfzjeE"    column="sjbfzjeE"    />
-        <result property="sjbfzjeN"    column="sjbfzjeN"    />
-        <result property="sjbfzjeH"    column="sjbfzjeH"    />
-        <result property="qxzjeE"    column="qxzjeE"    />
-        <result property="qxzjeN"    column="qxzjeN"    />
-        <result property="qxzjeH"    column="qxzjeH"    />
-        <result property="qxbfzjeE"    column="qxbfzjeE"    />
-        <result property="qxbfzjeN"    column="qxbfzjeN"    />
-        <result property="qxbfzjeH"    column="qxbfzjeH"    />
+        <result property="ffName" column="ffName"/>
+        <result property="zrsE" column="zrsE"/>
+        <result property="zrsN" column="zrsN"/>
+        <result property="zrsH" column="zrsH"/>
+        <result property="bfzrsE" column="bfzrsE"/>
+        <result property="bfzrsN" column="bfzrsN"/>
+        <result property="bfzrsH" column="bfzrsH"/>
+        <result property="stzjeE" column="stzjeE"/>
+        <result property="stzjeN" column="stzjeN"/>
+        <result property="stzjeH" column="stzjeH"/>
+        <result property="stbfzjeE" column="stbfzjeE"/>
+        <result property="stbfzjeN" column="stbfzjeN"/>
+        <result property="stbfzjeH" column="stbfzjeH"/>
+        <result property="sjzjeN" column="sjzjeN"/>
+        <result property="sjzjeH" column="sjzjeH"/>
+        <result property="sjbfzjeE" column="sjbfzjeE"/>
+        <result property="sjbfzjeN" column="sjbfzjeN"/>
+        <result property="sjbfzjeH" column="sjbfzjeH"/>
+        <result property="qxzjeE" column="qxzjeE"/>
+        <result property="qxzjeN" column="qxzjeN"/>
+        <result property="qxzjeH" column="qxzjeH"/>
+        <result property="qxbfzjeE" column="qxbfzjeE"/>
+        <result property="qxbfzjeN" column="qxbfzjeN"/>
+        <result property="qxbfzjeH" column="qxbfzjeH"/>
     </resultMap>
 
     <select id="stglbtTj" parameterType="Map" resultMap="ZwywBtglGlbtTjResult">
         SELECT
         sum( t3.zje ) AS zje,
         t3.xzqh,
-        sum( CASE WHEN age &gt;= 80 AND age &lt;= 89 and create_unit=#{deptId} THEN zje ELSE 0 END ) AS stzjeE,
-        sum( CASE WHEN age &gt;= 90 AND age &lt;= 99 and create_unit=#{deptId} THEN zje ELSE 0 END ) AS stzjeN,
-        sum( CASE WHEN age &gt;= 100 AND create_unit=#{deptId} THEN zje ELSE 0 END ) AS stzjeH,
+        sum( CASE WHEN age &gt;= 80 AND age &lt;= 89 and create_unit=#{deptId} THEN sffje ELSE 0 END ) AS stzjeE,
+        sum( CASE WHEN age &gt;= 90 AND age &lt;= 99 and create_unit=#{deptId} THEN sffje ELSE 0 END ) AS stzjeN,
+        sum( CASE WHEN age &gt;= 100 AND create_unit=#{deptId} THEN sffje ELSE 0 END ) AS stzjeH,
+
+        sum( CASE WHEN age &gt;= 80 AND age &lt;= 89 and sbfje &lt;&gt; 0 and create_unit=#{deptId} THEN 1 ELSE 0 END ) AS
+        stbfzrsE,
+        sum( CASE WHEN age &gt;= 90 AND age &lt;= 99 and sbfje &lt;&gt; 0 and create_unit=#{deptId} THEN 1 ELSE 0 END ) AS
+        stbfzrsN,
+        sum( CASE WHEN age &gt;= 100 and sbfje &lt;&gt; 0 AND create_unit=#{deptId} THEN 1 ELSE 0 END ) AS stbfzrsH,
+
+        sum( CASE WHEN age &gt;= 80 AND age &lt;= 89 and create_unit=#{deptId} THEN sbfje ELSE 0 END ) AS stbfzjeE,
+        sum( CASE WHEN age &gt;= 90 AND age &lt;= 99 and create_unit=#{deptId} THEN sbfje ELSE 0 END ) AS stbfzjeN,
+        sum( CASE WHEN age &gt;= 100 AND create_unit=#{deptId} THEN sbfje ELSE 0 END ) AS stbfzjeH,
+
+
         ( SELECT dept_name FROM sys_dept WHERE location_code = t3.ffdq ) AS ffName,
         t3.zrs
         FROM
@@ -49,6 +61,8 @@
         t4.ffdq,
         t4.zrs,
         t1.create_unit,
+        t1.sffje,
+        t1.sbfje,
         TIMESTAMPDIFF(
         YEAR,
         STR_TO_DATE( t2.csrq, '%Y%m%d' ),
@@ -58,10 +72,10 @@
         zwyw_btgl_glbtmx t1
         JOIN zwyw_btgl_glbt t2 ON t1.glbt_id = t2.id
         JOIN zwyw_btgl_glbtqd t4 ON t1.glbtqd_id = t4.id
-<!--        where t1.create_unit in (select dept_id from sys_dept where location_code =#{para1})-->
-<!--          <if test="para2!=null">-->
-<!--              and t4.ffdq like CONCAT (SUBSTR( #{para2}, 1, 6 ),'%')-->
-<!--          </if>-->
+        <!--        where t1.create_unit in (select dept_id from sys_dept where location_code =#{para1})-->
+        <!--          <if test="para2!=null">-->
+        <!--              and t4.ffdq like CONCAT (SUBSTR( #{para2}, 1, 6 ),'%')-->
+        <!--          </if>-->
         ) t3
         GROUP BY
         t3.xzqh
@@ -71,9 +85,21 @@
         SELECT
         sum( t3.zje ) AS zje,
         t3.xzqh,
-        sum( CASE WHEN age &gt;= 80 AND age &lt;= 89 and create_unit=#{deptId} THEN zje ELSE 0 END ) AS sjzjeE,
-        sum( CASE WHEN age &gt;= 90 AND age &lt;= 99 and create_unit=#{deptId} THEN zje ELSE 0 END ) AS sjzjeN,
-        sum( CASE WHEN age &gt;= 100 AND create_unit=#{deptId} THEN zje ELSE 0 END ) AS sjzjeH,
+        sum( CASE WHEN age &gt;= 80 AND age &lt;= 89 and create_unit=#{deptId} THEN cffje ELSE 0 END ) AS sjzjeE,
+        sum( CASE WHEN age &gt;= 90 AND age &lt;= 99 and create_unit=#{deptId} THEN cffje ELSE 0 END ) AS sjzjeN,
+        sum( CASE WHEN age &gt;= 100 AND create_unit=#{deptId} THEN cffje ELSE 0 END ) AS sjzjeH,
+
+        sum( CASE WHEN age &gt;= 80 AND age &lt;= 89 and cbfje &lt;&gt; 0 and create_unit=#{deptId} THEN 1 ELSE 0 END ) AS
+        sjbfzrsE,
+        sum( CASE WHEN age &gt;= 90 AND age &lt;= 99 and cbfje &lt;&gt; 0 and create_unit=#{deptId} THEN 1 ELSE 0 END ) AS
+        sjbfzrsN,
+        sum( CASE WHEN age &gt;= 100 and cbfje &lt;&gt; 0 AND create_unit=#{deptId} THEN 1 ELSE 0 END ) AS sjbfzrsH,
+
+        sum( CASE WHEN age &gt;= 80 AND age &lt;= 89 and create_unit=#{deptId} THEN cbfje ELSE 0 END ) AS sjbfzjeE,
+        sum( CASE WHEN age &gt;= 90 AND age &lt;= 99 and create_unit=#{deptId} THEN cbfje ELSE 0 END ) AS sjbfzjeN,
+        sum( CASE WHEN age &gt;= 100 AND create_unit=#{deptId} THEN cbfje ELSE 0 END ) AS sjbfzjeH,
+
+
         ( SELECT dept_name FROM sys_dept WHERE location_code = t3.ffdq ) AS ffName,
         t3.zrs
         FROM
@@ -85,6 +111,8 @@
         t4.ffdq,
         t4.zrs,
         t1.create_unit,
+        t1.cffje,
+        t1.cbfje,
         TIMESTAMPDIFF(
         YEAR,
         STR_TO_DATE( t2.csrq, '%Y%m%d' ),
@@ -103,13 +131,25 @@
         t3.xzqh
     </select>
 
-    <select id="qxglbtTj" parameterType="Map" resultType="Map">
+    <select id="qxglbtTj" parameterType="Map"  resultMap="ZwywBtglGlbtTjResult">
         SELECT
         sum( t3.zje ) AS zje,
         t3.xzqh,
-        sum( CASE WHEN age &gt;= 80 AND age &lt;= 89 and create_unit=#{para1} THEN zje ELSE 0 END ) AS qxzjeE,
-        sum( CASE WHEN age &gt;= 90 AND age &lt;= 99 and create_unit=#{para1} THEN zje ELSE 0 END ) AS qxzjeN,
-        sum( CASE WHEN age &gt;= 100 AND create_unit=#{para1} THEN zje ELSE 0 END ) AS qxzjeH,
+        sum( CASE WHEN age &gt;= 80 AND age &lt;= 89 and create_unit=#{deptId} THEN qffje ELSE 0 END ) AS qxzjeE,
+        sum( CASE WHEN age &gt;= 90 AND age &lt;= 99 and create_unit=#{deptId} THEN qffje ELSE 0 END ) AS qxzjeN,
+        sum( CASE WHEN age &gt;= 100 AND create_unit=#{deptId} THEN qffje ELSE 0 END ) AS qxzjeH,
+
+        sum( CASE WHEN age &gt;= 80 AND age &lt;= 89 and qbfje &lt;&gt; 0 and create_unit=#{deptId} THEN 1 ELSE 0 END
+        ) AS qxbfzrsE,
+        sum( CASE WHEN age &gt;= 90 AND age &lt;= 99 and qbfje &lt;&gt; 0 and create_unit=#{deptId} THEN 1 ELSE 0 END
+        ) AS qxbfzrsN,
+        sum( CASE WHEN age &gt;= 100 and qbfje &lt;&gt; 0 AND create_unit=#{deptId} THEN 1 ELSE 0 END ) AS qxbfzrsH,
+
+        sum( CASE WHEN age &gt;= 80 AND age &lt;= 89 and create_unit=#{deptId} THEN qbfje ELSE 0 END ) AS qxbfzjeE,
+        sum( CASE WHEN age &gt;= 90 AND age &lt;= 99 and create_unit=#{deptId} THEN qbfje ELSE 0 END ) AS qxbfzjeN,
+        sum( CASE WHEN age &gt;= 100 AND create_unit=#{deptId} THEN qbfje ELSE 0 END ) AS qxbfzjeH,
+
+
         ( SELECT dept_name FROM sys_dept WHERE location_code = t3.ffdq ) AS ffName,
         t3.zrs
         FROM
@@ -121,6 +161,8 @@
         t4.ffdq,
         t4.zrs,
         t1.create_unit,
+        t1.qffje,
+        t1.qbfje,
         TIMESTAMPDIFF(
         YEAR,
         STR_TO_DATE( t2.csrq, '%Y%m%d' ),
@@ -130,12 +172,18 @@
         zwyw_btgl_glbtmx t1
         JOIN zwyw_btgl_glbt t2 ON t1.glbt_id = t2.id
         JOIN zwyw_btgl_glbtqd t4 ON t1.glbtqd_id = t4.id
+        <!--        where t1.create_unit in (select dept_id from sys_dept where location_code =#{para1})-->
+        <!--          <if test="para2!=null">-->
+        <!--              and t4.ffdq like CONCAT (SUBSTR( #{para2}, 1, 6 ),'%')-->
+        <!--          </if>-->
         ) t3
         GROUP BY
         t3.xzqh
     </select>
     <select id="selectDeptListByCode" resultType="com.ruoyi.system.api.domain.SysDept" parameterType="String">
-        select * from sys_dept where location_code=#{code}
+        select *
+        from sys_dept
+        where location_code = #{code}
     </select>
 
 </mapper>

+ 225 - 0
ruoyi-ui/src/api/business/btgl/Export2Excel.js

@@ -0,0 +1,225 @@
+/* eslint-disable */
+import { saveAs } from 'file-saver'
+import * as XLSX from 'xlsx'
+
+function generateArray(table) {
+  var out = [];
+  var rows = table.querySelectorAll('tr');
+  var ranges = [];
+  for (var R = 0; R < rows.length; ++R) {
+    var outRow = [];
+    var row = rows[R];
+    var columns = row.querySelectorAll('td');
+    for (var C = 0; C < columns.length; ++C) {
+      var cell = columns[C];
+      var colspan = cell.getAttribute('colspan');
+      var rowspan = cell.getAttribute('rowspan');
+      var cellValue = cell.innerText;
+      if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
+
+      //Skip ranges
+      ranges.forEach(function (range) {
+        if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
+          for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
+        }
+      });
+
+      //Handle Row Span
+      if (rowspan || colspan) {
+        rowspan = rowspan || 1;
+        colspan = colspan || 1;
+        ranges.push({
+          s: {
+            r: R,
+            c: outRow.length
+          },
+          e: {
+            r: R + rowspan - 1,
+            c: outRow.length + colspan - 1
+          }
+        });
+      };
+
+      //Handle Value
+      outRow.push(cellValue !== "" ? cellValue : null);
+
+      //Handle Colspan
+      if (colspan)
+        for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
+    }
+    out.push(outRow);
+  }
+  return [out, ranges];
+};
+
+function datenum(v, date1904) {
+  if (date1904) v += 1462;
+  var epoch = Date.parse(v);
+  return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
+}
+
+function sheet_from_array_of_arrays(data, opts) {
+  var ws = {};
+  var range = {
+    s: {
+      c: 10000000,
+      r: 10000000
+    },
+    e: {
+      c: 0,
+      r: 0
+    }
+  };
+  for (var R = 0; R != data.length; ++R) {
+    for (var C = 0; C != data[R].length; ++C) {
+      if (range.s.r > R) range.s.r = R;
+      if (range.s.c > C) range.s.c = C;
+      if (range.e.r < R) range.e.r = R;
+      if (range.e.c < C) range.e.c = C;
+      var cell = {
+        v: data[R][C]
+      };
+      if (cell.v == null) continue;
+      var cell_ref = XLSX.utils.encode_cell({
+        c: C,
+        r: R
+      });
+
+      if (typeof cell.v === 'number') cell.t = 'n';
+      else if (typeof cell.v === 'boolean') cell.t = 'b';
+      else if (cell.v instanceof Date) {
+        cell.t = 'n';
+        cell.z = XLSX.SSF._table[14];
+        cell.v = datenum(cell.v);
+      }
+      else cell.t = 's';
+      ws[cell_ref] = cell;
+    }
+  }
+  if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
+  return ws;
+}
+
+function Workbook() {
+  if (!(this instanceof Workbook)) return new Workbook();
+  this.SheetNames = [];
+  this.Sheets = {};
+}
+
+function s2ab(s) {
+  var buf = new ArrayBuffer(s.length);
+  var view = new Uint8Array(buf);
+  for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
+  return buf;
+}
+
+export function export_table_to_excel(id) {
+  var theTable = document.getElementById(id);
+  var oo = generateArray(theTable);
+  var ranges = oo[1];
+
+  /* original data */
+  var data = oo[0];
+  var ws_name = "SheetJS";
+
+  var wb = new Workbook(),
+    ws = sheet_from_array_of_arrays(data);
+
+  /* add ranges to worksheet */
+  // ws['!cols'] = ['apple', 'banan'];
+  ws['!merges'] = ranges;
+
+  /* add worksheet to workbook */
+  wb.SheetNames.push(ws_name);
+  wb.Sheets[ws_name] = ws;
+
+  var wbout = XLSX.write(wb, {
+    bookType: 'xlsx',
+    bookSST: false,
+    type: 'binary'
+  });
+
+  saveAs(new Blob([s2ab(wbout)], {
+    type: "application/octet-stream"
+  }), "test.xlsx")
+}
+// 对此方法进行修改,如下:
+export function export_json_to_excel({
+                                       multiHeader2 = [],	// 第一行表头
+                                       multiHeader = [], // 第二行表头
+                                       header,	// 第三行表头
+                                       data,
+                                       filename, //文件名
+                                       merges = [], // 合并
+                                       autoWidth = true,
+                                       bookType = 'xlsx'
+                                     } = {}) {
+  /* original data */
+  filename = filename || '列表';
+  data = [...data]
+  data.unshift(header);
+
+  for (let i = multiHeader2.length - 1; i > -1; i--) {
+    data.unshift(multiHeader2[i])
+  }
+
+  for (let i = multiHeader.length - 1; i > -1; i--) {
+    data.unshift(multiHeader[i])
+  }
+
+  var ws_name = "SheetJS";
+  var wb = new Workbook(),
+    ws = sheet_from_array_of_arrays(data);
+
+  if (merges.length > 0) {
+    if (!ws['!merges']) ws['!merges'] = [];
+    merges.forEach(item => {
+      ws['!merges'].push(XLSX.utils.decode_range(item))
+    })
+  }
+
+  if (autoWidth) {
+    /*设置worksheet每列的最大宽度*/
+    const colWidth = data.map(row => row.map(val => {
+      /*先判断是否为null/undefined*/
+      if (val == null) {
+        return {
+          'wch': 10
+        };
+      }
+      /*再判断是否为中文*/
+      else if (val.toString().charCodeAt(0) > 255) {
+        return {
+          'wch': val.toString().length * 2
+        };
+      } else {
+        return {
+          'wch': val.toString().length
+        };
+      }
+    }))
+    /*以第一行为初始值*/
+    let result = colWidth[0];
+    for (let i = 1; i < colWidth.length; i++) {
+      for (let j = 0; j < colWidth[i].length; j++) {
+        if (result[j]['wch'] < colWidth[i][j]['wch']) {
+          result[j]['wch'] = colWidth[i][j]['wch'];
+        }
+      }
+    }
+    ws['!cols'] = result;
+  }
+
+  /* add worksheet to workbook */
+  wb.SheetNames.push(ws_name);
+  wb.Sheets[ws_name] = ws;
+
+  var wbout = XLSX.write(wb, {
+    bookType: bookType,
+    bookSST: false,
+    type: 'binary'
+  });
+  saveAs(new Blob([s2ab(wbout)], {
+    type: "application/octet-stream"
+  }), `${filename}.${bookType}`);
+}

File diff suppressed because it is too large
+ 319 - 33
ruoyi-ui/src/views/business/btgl/glbttj/index.vue


+ 3 - 3
ruoyi-ui/src/views/search/xxtj/xmsbtj/index.vue

@@ -156,8 +156,8 @@ import {getstatisticaldata} from '@/api/system/dict/type'
 import { decryptData_ECB, decryptRowData_ECB } from "@/api/tool/sm4";
 
 export default {
-  name: 'Yljgtj',
-  dicts: ['TJ0015'],
+  name: 'Xmsbtj',
+  dicts: ['TJ017'],
   computed: {
     ...mapState(['user']),
     ...mapGetters(['level'])
@@ -189,7 +189,7 @@ export default {
       activeName2: '1',
       activeName2o: ['1','1','1','1','1'],
       queryParams: {
-        dictType: 'TJ015',
+        dictType: 'TJ017',
         para1: '1',
         para2: null,
         para3: '1',