| | |
| | | <select id="selectCheckUnitId" resultType="Long"> |
| | | select check_unit_id from com_pb_member where phone = #{phone} limit 1 |
| | | </select> |
| | | <select id="userAnalysis" resultType="com.panzhihua.common.model.vos.user.UserProportion"> |
| | | select cs.area_code,cs.name as streetName,ac.name as communityName,count(su.user_id) as user from sys_user as su |
| | | left join com_act as ac on su.community_id=ac.community_id |
| | | left join com_street as cs on ac.street_id=cs.street_id |
| | | where su.community_id<>'' |
| | | and cs.area_code<>'' |
| | | <if test="range != null and range != ''"> |
| | | and su.create_at >= #{range} |
| | | </if> |
| | | <if test="type == 4"> |
| | | and cs.street_id=#{streetId} |
| | | group by su.community_id |
| | | </if> |
| | | <if test="type == 1"> |
| | | group by cs.area_code |
| | | </if> |
| | | <if test="type == 2"> |
| | | group by cs.street_id |
| | | </if> |
| | | <if test="type == 3"> |
| | | group by su.community_id |
| | | </if> |
| | | order by user desc |
| | | limit 10 |
| | | </select> |
| | | <select id="realUserCount" resultType="com.panzhihua.common.model.vos.user.RealUser"> |
| | | select cs.area_code as areaCode,cs.street_id,ac.name as communityName,cs.name as StreetName,count(su.user_id) as count from sys_user as su |
| | | left join com_act as ac on su.community_id=ac.community_id |
| | | left join com_street as cs on ac.street_id=cs.street_id |
| | | where su.community_id<>'' |
| | | and cs.area_code<>'' |
| | | and su.id_card<>'' |
| | | <if test="range != null and range != ''"> |
| | | and su.create_at >= #{range} |
| | | </if> |
| | | <if test="type == 4"> |
| | | and cs.street_id=#{streetId} |
| | | group by su.community_id |
| | | </if> |
| | | <if test="type == 1"> |
| | | group by cs.area_code |
| | | </if> |
| | | <if test="type == 2"> |
| | | group by cs.street_id |
| | | </if> |
| | | <if test="type == 3"> |
| | | group by su.community_id |
| | | </if> |
| | | order by count desc |
| | | limit 10 |
| | | </select> |
| | | <select id="streetUserCount" resultType="Integer"> |
| | | select count(user_id) from sys_user as su |
| | | left join com_act as ac on su.community_id=ac.community_id |
| | | left join com_street as cs on ac.street_id=cs.street_id |
| | | where su.community_id<>'' |
| | | and cs.area_code<>'' |
| | | and cs.street_id=#{id} |
| | | </select> |
| | | <select id="dataKanBanStreet" resultType="com.panzhihua.common.model.vos.IndexDataKanbanVO"> |
| | | SELECT |
| | | COUNT(user_id)allUser, |
| | | COUNT(case WHEN DATE_FORMAT(t.create_at,'%m-%d-%Y')=DATE_FORMAT(SYSDATE(),'%m-%d-%Y') then user_id else null end )addUser, |
| | | COUNT(case WHEN DATE_FORMAT(last_login_time,'%m-%d-%Y')=DATE_FORMAT(SYSDATE(),'%m-%d-%Y') then user_id else null end )activeDayUser, |
| | | (SELECT count(user_id) FROM sys_user t left join com_act t1 on t.community_id = t1.community_id WHERE t.type = 1 AND last_login_time > date_sub(SYSDATE(), INTERVAL 7 DAY))activeWeekUser |
| | | FROM |
| | | sys_user t LEFT JOIN com_act t1 on t.community_id = t1.community_id |
| | | where t.type=1 and t.community_id is not null |
| | | <if test="streetId != null"> |
| | | and t1.street_id=#{streetId} |
| | | </if> |
| | | </select> |
| | | <select id="getDailyAddAndActive" resultType="java.util.Map"> |
| | | select COUNT(case WHEN DATE_FORMAT(su.last_login_time,'%m-%d-%Y')=DATE_FORMAT(#{date},'%m-%d-%Y') then user_id else null end) as activeUser, |
| | | count(case WHEN DATE_FORMAT(su.create_at,'%m-%d-%Y')=DATE_FORMAT(#{date},'%m-%d-%Y') then user_id else null end ) as addUser |
| | | from sys_user as su |
| | | left join com_act as ac on su.community_id=ac.community_id |
| | | left join com_street as cs on ac.street_id=cs.street_id |
| | | where su.community_id<>'' |
| | | and cs.area_code<>'' |
| | | <if test="id != null"> |
| | | and cs.street_id=#{id} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |