| | |
| | | select count(id) from com_pb_service_team where is_reg = 2 and phone = #{phone} |
| | | </select> |
| | | |
| | | <select id="getUserStreetList" resultType="com.panzhihua.common.model.vos.community.IndexUserStreetVo"> |
| | | SELECT |
| | | street_id, |
| | | `name`,( |
| | | SELECT |
| | | count( user_id ) |
| | | FROM |
| | | sys_user AS su |
| | | LEFT JOIN com_act AS ca ON ca.community_id = su.community_id |
| | | WHERE |
| | | type = 1 |
| | | AND ca.street_id = cs.street_id |
| | | ) AS userNum |
| | | FROM |
| | | `com_street` AS cs |
| | | order by userNum desc |
| | | </select> |
| | | |
| | | <select id="getUserCommunityList" resultType="com.panzhihua.common.model.vos.community.IndexUserCommunityVo"> |
| | | SELECT |
| | | ca.community_id, |
| | | ca.`name`, |
| | | count( user_id ) as userNum |
| | | FROM |
| | | sys_user as su |
| | | left join com_act as ca on ca.community_id = su.community_id |
| | | WHERE |
| | | type = 1 |
| | | AND ca.street_id = #{streetId} |
| | | group by ca.community_id |
| | | order by userNum desc |
| | | </select> |
| | | |
| | | <select id="getUserCommunityExcelExport" resultType="com.panzhihua.common.model.vos.community.IndexUserStreetExcelExportVo"> |
| | | SELECT |
| | | cs.`name` AS streetName, |
| | | ca.`name` AS communityName, |
| | | ( |
| | | SELECT |
| | | count( user_id ) |
| | | FROM |
| | | sys_user AS su1 |
| | | LEFT JOIN com_act AS ca1 ON ca1.community_id = su1.community_id |
| | | WHERE |
| | | su1.type = 1 |
| | | AND su1.community_id IS NOT NULL |
| | | AND ca1.street_id = ca.street_id |
| | | ) AS streetNum, |
| | | count( user_id ) AS userNum |
| | | FROM |
| | | sys_user AS su |
| | | LEFT JOIN com_act AS ca ON ca.community_id = su.community_id |
| | | LEFT JOIN com_street AS cs ON cs.street_id = ca.street_id |
| | | WHERE |
| | | su.type = 1 |
| | | AND su.community_id IS NOT NULL |
| | | GROUP BY |
| | | ca.community_id |
| | | ORDER BY |
| | | ca.street_id DESC, |
| | | userNum DESC |
| | | </select> |
| | | |
| | | </mapper> |