You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gysl/ruoyi-admin/src/main/resources/mapper/ZwStatsMapper.xml

53 lines
2.8 KiB

1 month ago
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.gysl.mapper.ZwStatsMapper">
<select id="allProject" resultType="com.ruoyi.gysl.entity.stats.AllProjectResponse">
SELECT COUNT(*) AS allProject,
ROUND(IFNULL(SUM(b.zjzmj), 0) / 10000, 2) AS allGrossArea,
IFNULL(SUM(CASE WHEN a.xzfl = 1 THEN 1 ELSE 0 END), 0) AS allBuilding1,
IFNULL(SUM(CASE WHEN a.xzfl = 2 THEN 1 ELSE 0 END), 0) AS allBuilding2,
IFNULL(SUM(CASE WHEN a.xzfl = 3 THEN 1 ELSE 0 END), 0) AS allBuilding3,-- 当前年度统计
COUNT(CASE WHEN YEAR ( a.create_time ) = YEAR ( CURRENT_DATE ()) THEN 1 END ) AS currentYearProject,
ROUND(
IFNULL(SUM(CASE WHEN YEAR ( a.create_time ) = YEAR ( CURRENT_DATE ()) THEN b.zjzmj END ), 0) /
10000,
2
) AS currentYearGrossArea,
IFNULL(
SUM(CASE WHEN a.xzfl = 1 AND YEAR ( a.create_time ) = YEAR ( CURRENT_DATE ()) THEN 1 ELSE 0 END ),
0
) AS currentYearBuilding1,
IFNULL(
SUM(CASE WHEN a.xzfl = 2 AND YEAR ( a.create_time ) = YEAR ( CURRENT_DATE ()) THEN 1 ELSE 0 END ),
0
) AS currentYearBuilding2
1 month ago
FROM gysl_basic_information a
LEFT JOIN gysl_plan_information b ON a.id = b.xm_id
1 month ago
</select>
<select id="ribbon" resultType="com.ruoyi.gysl.entity.stats.RibbonResponse">
SELECT count(*) AS count,ssgnq
FROM
1 month ago
gysl_basic_information
where ssgnq is not null
1 month ago
GROUP BY
ssgnq
</select>
<select id="investors" resultType="com.ruoyi.gysl.entity.stats.RibbonResponse">
SELECT count(*) AS count,nature
FROM
1 month ago
gysl_basic_information
1 month ago
GROUP BY
nature
</select>
1 month ago
<select id="zwNotice" resultType="com.ruoyi.docking.entity.SmartDeclaration">
select * from gysl_smart_declaration
where zw_id = #{userId} and is_read = 1
</select>
<select id="zwNoticeCount" resultType="java.lang.Integer">
1 month ago
select count(*) from gysl_smart_declaration
where zw_id = #{userId} and is_read = 1
1 month ago
</select>
1 month ago
</mapper>