mitao
昨天 7c0a8a91ae6d1c684e7a358929f4bd04f3f4bfe8
ruoyi-system/src/main/resources/mapper/system/OaApprovalApplicationStorageMapper.xml
@@ -17,4 +17,34 @@
        id, approval_application_id, title, asset_type_id, storage_type, storage_time
    </sql>
    <!-- 分页查询:资产入库申请列表(关联审批记录与资产类型) -->
    <select id="selectApplicationStoragePage" resultType="com.ruoyi.system.vo.asset.OaApprovalApplicationStoragePageVO">
        SELECT
            oas.id                               AS id,
            aaa.dept_name                        AS deptName,
            aaa.application_code                 AS applicationCode,
            oas.title                            AS title,
            CASE WHEN at2.level = 2 THEN at1.type_name ELSE at2.type_name END AS firstAssetTypeName,
            CASE WHEN at2.level = 2 THEN at2.type_name ELSE NULL END         AS secondAssetTypeName,
            aaa.applicant_name                   AS applicantName,
            oas.storage_time                     AS storageTime,
            oas.storage_type                     AS storageType,
            aaa.approval_status                  AS approvalStatus
        FROM oa_approval_application_storage oas
                 INNER JOIN oa_approval_applications aaa ON aaa.id = oas.approval_application_id
                 LEFT JOIN asset_type at2 ON at2.id = oas.asset_type_id
                 LEFT JOIN asset_type at1 ON at1.id = (CASE WHEN at2.level = 2 THEN at2.parent_id ELSE at2.id END)
        <where>
            AND aaa.disabled = 0
            <if test="query != null and query.keyword != null and query.keyword != ''">
                AND (
                oas.title LIKE CONCAT('%', #{query.keyword}, '%')
                OR  aaa.application_code LIKE CONCAT('%', #{query.keyword}, '%')
                OR  aaa.dept_name LIKE CONCAT('%', #{query.keyword}, '%')
                )
            </if>
        </where>
        ORDER BY oas.storage_time DESC, oas.id DESC
    </select>
</mapper>