| | |
| | | + " from com_mng_population_community_tags as cmpct where community_id = #{communityId}") |
| | | ComMngPopulationTotalVO getPopulationTotalByAdmin(@Param("communityId") Long communityId); |
| | | |
| | | @Select("select count(id) as populationTotal," |
| | | + "IFNULL((select count(id) from com_mng_population_house where community_id = cmp.act_id),0) as houseTotal, " |
| | | + "IFNULL((select count(id) from com_mng_real_company where community_id = cmp.act_id),0) as companyTotal, " |
| | | + "IFNULL((select count(village_id) from com_mng_village where community_id = cmp.act_id),0) as villageTotal " |
| | | + " com_mng_population_community_tags as cmpct " + " where community_id = = #{communityId}") |
| | | @Select("select count(id) as populationTotal," + |
| | | "IFNULL((select count(id) from com_mng_population_house where community_id = cmpct.community_id),0) as houseTotal, " + |
| | | "IFNULL((select count(id) from com_mng_real_company where community_id = cmpct.community_id),0) as companyTotal, " + |
| | | "IFNULL((select count(village_id) from com_mng_village where community_id = cmpct.community_id),0) as villageTotal " + |
| | | " from com_mng_population_community_tags AS cmpct " + |
| | | " where cmpct.community_id = #{communityId}") |
| | | IndexBasicsStatisticsVO getScreenIndexByBasics(@Param("communityId") Long communityId); |
| | | |
| | | @Select("SELECT " + " IFNULL( NULL, 1 ) AS type, " + " count( cmpct.id ) AS sum " + "FROM " |
| | | + " com_mng_population_community_tags as cmpct " |
| | | + " left join com_mng_population as cmp on cmpct.population_id = cmp.id " + "WHERE " + " cmp.sex = 1 " |
| | | + " AND cmpct.community_id = #{communityId} UNION ALL " + "SELECT " + " IFNULL( NULL, 2 ) AS type, " |
| | | + " count( id ) AS sum " + "FROM " + " com_mng_population_community_tags as cmpct " |
| | | + " count( cmpct.id ) AS sum " + "FROM " + " com_mng_population_community_tags as cmpct " |
| | | + " left join com_mng_population as cmp on cmpct.population_id = cmp.id " + "WHERE " + " cmp.sex = 2 " |
| | | + " AND cmpct.community_id = #{communityId}") |
| | | List<IndexPopulationSexStatisticsVO> getScreenIndexByPopulationSex(@Param("communityId") Long communityId); |
| | |
| | | List<ComMngUserTagVO> getUserTagListByCommunityId(@Param("communityId") Long communityId); |
| | | |
| | | @Select("SELECT " + " count( id ) " + "FROM " + " com_mng_population_community_tags " + "WHERE " |
| | | + " label like concat('%',#{label},'%')") |
| | | Integer getSpecialStatisticsByLabel(@Param("label") String label); |
| | | + " community_id = #{communityId} and label like concat('%',#{label},'%')") |
| | | Integer getSpecialStatisticsByLabel(@Param("label") String label,@Param("communityId") Long communityId); |
| | | |
| | | @Select("<script> " + "SELECT " + " count( egd.id ) AS gridTotal, " |
| | | + " ( SELECT count( user_id ) FROM sys_user WHERE community_id = egd.grid_community_id AND type = 6 ) AS gridMemberTotal, " |
| | |
| | | @Select("SELECT " + "(SELECT COUNT(aa.age) FROM " |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) as aa where aa.age<= 16) as age16," |
| | | + "(SELECT COUNT(aa.age) FROM " |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 16 and aa.age<= 27) AS age27," |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 16 and aa.age<= 27) AS age27," |
| | | + "(SELECT COUNT(aa.age) FROM " |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 27 and aa.age<= 35) AS age35," |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 27 and aa.age<= 35) AS age35," |
| | | + "(SELECT COUNT(aa.age) FROM " |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 35 and aa.age<= 45) AS age45," |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 35 and aa.age<= 45) AS age45," |
| | | + "(SELECT COUNT(aa.age) FROM " |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 45 and aa.age<= 55) AS age55," |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 45 and aa.age<= 55) AS age55," |
| | | + "(SELECT COUNT(aa.age) FROM " |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 55) AS age55over") |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 55) AS age55over") |
| | | Map<String, Long> indexCountByAge(@Param("communityId") Long communityId); |
| | | |
| | | @Select("SELECT " + " id, " + " su.nick_name AS userName, " + " su.image_url, " + " caep.create_at, " |