智慧保安后台管理-外网项目备份
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -1144,5 +1144,48 @@
        and tenant_id = #{tenantId} and phone = #{phone}
    </select>
    <!--按天查询 day 天未登录的人员ids集合信息-->
    <select id="getMoreDayNotLoginUser" resultType="java.lang.String">
        select bu.id from blade_user bu
        left join  (
            select user_id,max(create_time) as create_time from sys_login_record GROUP BY user_id
        )slr on bu.id = slr.user_id
         where bu.status = 1 and bu.is_deleted = 0 and bu.role_id = 1412226235153731586
         and DATE_SUB(CURDATE(), INTERVAL #{day} DAY) > date(bu.create_time)
         and DATE_SUB(CURDATE(), INTERVAL #{day} DAY) > date(slr.create_time)
    </select>
    <!--用户冻结操作-->
    <update id="updateFreeze">
        update blade_user set is_deleted = 1
        <choose>
            <when test="list!=null and list.size()>0">
                where id in
                <foreach collection="list" item="id" open="(" close=")" separator=",">
                    #{id}
                </foreach>
            </when>
            <otherwise>
                where id in ('')
            </otherwise>
        </choose>
    </update>
    <!--用户注销操作-->
    <update id="updateLogout">
        update blade_user set is_deleted = 1
        <choose>
            <when test="list!=null and list.size()>0">
                where id in
                <foreach collection="list" item="id" open="(" close=")" separator=",">
                    #{id}
                </foreach>
            </when>
            <otherwise>
                where id in ('')
            </otherwise>
        </choose>
    </update>
</mapper>