|
@@ -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 >= 80 AND age <= 89 and create_unit=#{deptId} THEN zje ELSE 0 END ) AS stzjeE,
|
|
|
- sum( CASE WHEN age >= 90 AND age <= 99 and create_unit=#{deptId} THEN zje ELSE 0 END ) AS stzjeN,
|
|
|
- sum( CASE WHEN age >= 100 AND create_unit=#{deptId} THEN zje ELSE 0 END ) AS stzjeH,
|
|
|
+ sum( CASE WHEN age >= 80 AND age <= 89 and create_unit=#{deptId} THEN sffje ELSE 0 END ) AS stzjeE,
|
|
|
+ sum( CASE WHEN age >= 90 AND age <= 99 and create_unit=#{deptId} THEN sffje ELSE 0 END ) AS stzjeN,
|
|
|
+ sum( CASE WHEN age >= 100 AND create_unit=#{deptId} THEN sffje ELSE 0 END ) AS stzjeH,
|
|
|
+
|
|
|
+ sum( CASE WHEN age >= 80 AND age <= 89 and sbfje <> 0 and create_unit=#{deptId} THEN 1 ELSE 0 END ) AS
|
|
|
+ stbfzrsE,
|
|
|
+ sum( CASE WHEN age >= 90 AND age <= 99 and sbfje <> 0 and create_unit=#{deptId} THEN 1 ELSE 0 END ) AS
|
|
|
+ stbfzrsN,
|
|
|
+ sum( CASE WHEN age >= 100 and sbfje <> 0 AND create_unit=#{deptId} THEN 1 ELSE 0 END ) AS stbfzrsH,
|
|
|
+
|
|
|
+ sum( CASE WHEN age >= 80 AND age <= 89 and create_unit=#{deptId} THEN sbfje ELSE 0 END ) AS stbfzjeE,
|
|
|
+ sum( CASE WHEN age >= 90 AND age <= 99 and create_unit=#{deptId} THEN sbfje ELSE 0 END ) AS stbfzjeN,
|
|
|
+ sum( CASE WHEN age >= 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 >= 80 AND age <= 89 and create_unit=#{deptId} THEN zje ELSE 0 END ) AS sjzjeE,
|
|
|
- sum( CASE WHEN age >= 90 AND age <= 99 and create_unit=#{deptId} THEN zje ELSE 0 END ) AS sjzjeN,
|
|
|
- sum( CASE WHEN age >= 100 AND create_unit=#{deptId} THEN zje ELSE 0 END ) AS sjzjeH,
|
|
|
+ sum( CASE WHEN age >= 80 AND age <= 89 and create_unit=#{deptId} THEN cffje ELSE 0 END ) AS sjzjeE,
|
|
|
+ sum( CASE WHEN age >= 90 AND age <= 99 and create_unit=#{deptId} THEN cffje ELSE 0 END ) AS sjzjeN,
|
|
|
+ sum( CASE WHEN age >= 100 AND create_unit=#{deptId} THEN cffje ELSE 0 END ) AS sjzjeH,
|
|
|
+
|
|
|
+ sum( CASE WHEN age >= 80 AND age <= 89 and cbfje <> 0 and create_unit=#{deptId} THEN 1 ELSE 0 END ) AS
|
|
|
+ sjbfzrsE,
|
|
|
+ sum( CASE WHEN age >= 90 AND age <= 99 and cbfje <> 0 and create_unit=#{deptId} THEN 1 ELSE 0 END ) AS
|
|
|
+ sjbfzrsN,
|
|
|
+ sum( CASE WHEN age >= 100 and cbfje <> 0 AND create_unit=#{deptId} THEN 1 ELSE 0 END ) AS sjbfzrsH,
|
|
|
+
|
|
|
+ sum( CASE WHEN age >= 80 AND age <= 89 and create_unit=#{deptId} THEN cbfje ELSE 0 END ) AS sjbfzjeE,
|
|
|
+ sum( CASE WHEN age >= 90 AND age <= 99 and create_unit=#{deptId} THEN cbfje ELSE 0 END ) AS sjbfzjeN,
|
|
|
+ sum( CASE WHEN age >= 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 >= 80 AND age <= 89 and create_unit=#{para1} THEN zje ELSE 0 END ) AS qxzjeE,
|
|
|
- sum( CASE WHEN age >= 90 AND age <= 99 and create_unit=#{para1} THEN zje ELSE 0 END ) AS qxzjeN,
|
|
|
- sum( CASE WHEN age >= 100 AND create_unit=#{para1} THEN zje ELSE 0 END ) AS qxzjeH,
|
|
|
+ sum( CASE WHEN age >= 80 AND age <= 89 and create_unit=#{deptId} THEN qffje ELSE 0 END ) AS qxzjeE,
|
|
|
+ sum( CASE WHEN age >= 90 AND age <= 99 and create_unit=#{deptId} THEN qffje ELSE 0 END ) AS qxzjeN,
|
|
|
+ sum( CASE WHEN age >= 100 AND create_unit=#{deptId} THEN qffje ELSE 0 END ) AS qxzjeH,
|
|
|
+
|
|
|
+ sum( CASE WHEN age >= 80 AND age <= 89 and qbfje <> 0 and create_unit=#{deptId} THEN 1 ELSE 0 END
|
|
|
+ ) AS qxbfzrsE,
|
|
|
+ sum( CASE WHEN age >= 90 AND age <= 99 and qbfje <> 0 and create_unit=#{deptId} THEN 1 ELSE 0 END
|
|
|
+ ) AS qxbfzrsN,
|
|
|
+ sum( CASE WHEN age >= 100 and qbfje <> 0 AND create_unit=#{deptId} THEN 1 ELSE 0 END ) AS qxbfzrsH,
|
|
|
+
|
|
|
+ sum( CASE WHEN age >= 80 AND age <= 89 and create_unit=#{deptId} THEN qbfje ELSE 0 END ) AS qxbfzjeE,
|
|
|
+ sum( CASE WHEN age >= 90 AND age <= 99 and create_unit=#{deptId} THEN qbfje ELSE 0 END ) AS qxbfzjeN,
|
|
|
+ sum( CASE WHEN age >= 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>
|