无关风月
3 天以前 9d1a18030d8f82aa264d1378186eb00c31c9af20
ruoyi-system/src/main/resources/mapper/system/OaApprovalTodoMapper.xml
@@ -22,14 +22,24 @@
        id, application_id, application_code, flow_node_id, user_id, user_name, dept_id, sort_order, status, create_time, handle_time
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.model.OaApprovalTodo">
        select * from oa_approval_todo
        where 1=1
        SELECT *
        FROM oa_approval_todo t1
        WHERE t1.id = (
        SELECT t2.id
        FROM oa_approval_todo t2
        WHERE t2.application_id = t1.application_id
        AND t2.status = 0
        <if test="query.userId != null">
            and user_id = #{query.userId}
            AND t2.user_id = #{query.userId}
        </if>
        and status = 0
        group by application_id
        order by create_time desc
        ORDER BY t2.create_time DESC
        LIMIT 1
        )
        <if test="query.userId != null">
            AND t1.user_id = #{query.userId}
        </if>
        AND t1.status = 0
        ORDER BY t1.create_time DESC
    </select>
    <select id="pageListAudit" resultType="com.ruoyi.system.model.OaApprovalTodo">
        select * from oa_approval_todo