yanghui
2022-10-14 c6232cfc36e373f83f45c95d400e09466cc2a7d3
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml
@@ -709,6 +709,45 @@
        </if>
    </select>
    <select id="getDailyAdd" resultType="java.util.Map">
        SELECT DATE_FORMAT( su.create_at, '%Y-%m-%d' ) as createAt ,count(su.user_id) 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&lt;>''
        and cs.area_code&lt;>''
        and su.type = 1
        <if test="appId != null and appId != &quot;&quot;">
            and su.app_id = #{appId}
        </if>
        <if test="id != null">
            and cs.street_id=#{id}
        </if>
        <if test="areaCode != null">
            and cs.area_code=#{areaCode}
        </if>
        AND su.create_at > #{createAt} GROUP BY createAt
    </select>
    <select id="getActive" resultType="java.util.Map">
        SELECT DATE_FORMAT( su.last_login_time, '%Y-%m-%d' ) as createAt ,count(su.user_id) as activeUser     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&lt;>''
        and cs.area_code&lt;>''
        and su.type = 1
        <if test="appId != null and appId != &quot;&quot;">
            and su.app_id = #{appId}
        </if>
        <if test="id != null">
            and cs.street_id=#{id}
        </if>
        <if test="areaCode != null">
            and cs.area_code=#{areaCode}
        </if>
        AND su.last_login_time > #{lastLoginTime} GROUP BY createAt
    </select>
    <select id="selectStreetByAreaCode" resultType="com.panzhihua.common.model.vos.user.StreetVOS">
        select street_id as id,name as name from com_street where area_code=#{code} and app_id ='wx118de8a734d269f0'
    </select>