龚焕茏
2024-09-03 123cf89ee4b76d1355b5bb9eaf70538c5264f18c
ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
@@ -207,4 +207,16 @@
        WHERE
            rn = 1;
    </select>
    <select id="selectLastOneByDept" resultType="java.util.Map">
        WITH temp AS (
            SELECT
                image_resource_security AS imageResourceSecurity,
                dept_id AS deptId,
                ROW_NUMBER() OVER(PARTITION BY dept_id ORDER BY create_time DESC, image_resource_security DESC) AS num
            FROM
                t_check_index_video
        )
        SELECT deptId, imageResourceSecurity FROM temp WHERE num = 1;
    </select>
</mapper>