| | |
| | | select t.* from ( |
| | | SELECT |
| | | a.`name`, |
| | | COUNT(u.user_id)num |
| | | COUNT(u.user_id)num, |
| | | (SELECT count( user_id ) FROM sys_user WHERE type = 1 and community_id = a.community_id |
| | | AND last_login_time > DATE_FORMAT( date_sub( SYSDATE(), INTERVAL 0 DAY ), '%Y-%m-%d 00:00:00')) as dayNum |
| | | FROM |
| | | com_act a |
| | | LEFT JOIN sys_user u ON a.community_id = u.community_id and u.type=1 |
| | | GROUP BY a.community_id)t ORDER BY t.num desc |
| | | </select> |
| | | |
| | | <select id="selectCommunityUserOrderMonth" resultType="com.panzhihua.service_user.model.dtos.DataKanbanDTO"> |
| | | select t.* from ( |
| | | SELECT |
| | | a.`name`, |
| | | COUNT(u.user_id)num, |
| | | (SELECT count( user_id ) FROM sys_user WHERE type = 1 and community_id = a.community_id |
| | | AND last_login_time > DATE_FORMAT( date_sub( SYSDATE(), INTERVAL 0 DAY ), '%Y-%m-%d 00:00:00')) as dayNum |
| | | FROM |
| | | com_act a |
| | | LEFT JOIN sys_user u ON a.community_id = u.community_id |
| | | and u.type=1 and u.create_at <![CDATA[ >= ]]> DATE_SUB(DATE_FORMAT(CURDATE(),'%Y-%m-%d 00:00:00'),INTERVAL 0 DAY) |
| | | GROUP BY a.community_id)t ORDER BY t.num desc |
| | | </select> |
| | | |
| | |
| | | com_act_activity a |
| | | WHERE |
| | | DATE_FORMAT( #{date1}, '%Y-%m-%d' )= DATE_FORMAT( a.create_at,'%Y-%m-%d') |
| | | </select> |
| | | |
| | | <select id="selectCommunityAddUserOrder" resultType="com.panzhihua.service_user.model.dtos.DataKanbanDTO"> |
| | | select count(user_id) as num, |
| | | (SELECT count( user_id ) FROM sys_user WHERE type = 1 |
| | | AND last_login_time <![CDATA[ >= ]]> DATE_FORMAT( #{date1}, '%Y-%m-%d 00:00:00') |
| | | AND last_login_time <![CDATA[ <= ]]> DATE_FORMAT( #{date1}, '%Y-%m-%d 23:59:59')) as dayNum from sys_user as su |
| | | where su.create_at <![CDATA[ >= ]]> DATE_SUB(DATE_FORMAT(#{date1},'%Y-%m-%d 00:00:00'),INTERVAL 0 DAY) |
| | | and su.create_at <![CDATA[ <= ]]> DATE_SUB(DATE_FORMAT(#{date1},'%Y-%m-%d 23:59:59'),INTERVAL 0 DAY) |
| | | and su.type = 1 |
| | | </select> |
| | | |
| | | <update id="gridMemberEditStatus"> |
| | |
| | | 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> |