xiangpei
2024-09-04 615af82c9ea47993e78b00e9c64e887e063474f8
ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
@@ -52,6 +52,7 @@
            <if test="keyTimingAccuracy != null "> and key_timing_accuracy = #{keyTimingAccuracy}</if>
            <if test="keyCommandImageOnline != null "> and key_command_image_online = #{keyCommandImageOnline}</if>
            <if test="imageResourceSecurity != null "> and image_resource_security = #{imageResourceSecurity}</if>
            <if test="params.publish != null  and params.publish != ''">and publish = #{params.publish}</if>
            <if test="deptIds != null ">and tciv.dept_id in
            <foreach collection="deptIds" separator="," open="(" close=")" item="deptId">
                #{deptId}
@@ -207,4 +208,16 @@
        WHERE
            rn = 1;
    </select>
    <select id="selectLastOneByDept" resultType="com.ycl.platform.domain.dto.ImageResourceDTO">
        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>