mitao
1 天以前 3e35dfd20aeef3473c4a07578724a955b91c4d09
bug修改
2个文件已修改
21 ■■■■ 已修改文件
ruoyi-system/src/main/java/com/ruoyi/system/query/AssetMainPageQuery.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/AssetMainMapper.xml 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/AssetMainPageQuery.java
@@ -27,6 +27,9 @@
    @ApiModelProperty("关键字(资产名称/资产编码)")
    private String keyword;
    @ApiModelProperty("使用部门")
    private String useDeptOrLocation;
    @ApiModelProperty("所属部门ID,前端不传")
    private Integer deptId;
}
ruoyi-system/src/main/resources/mapper/system/AssetMainMapper.xml
@@ -47,7 +47,8 @@
    <!-- 分页查询:审批通过的资产列表(关联审批记录、资产类型与部门) -->
    <select id="selectApprovedAssetPage" resultType="com.ruoyi.system.vo.asset.AssetMainPageVO">
        SELECT
            am.id AS id,
            DISTINCT
            am.id,
            am.asset_code AS assetCode,
            am.asset_name AS assetName,
            at.type_name AS assetTypeName,
@@ -80,7 +81,7 @@
            AND IFNULL(am.is_borrowed, 0) = 0
            AND ( oaa.id IS NULL OR oaa.approval_status != 0 )
            <if test="query != null and query.assetTypeId != null">
                AND am.asset_type_id = #{query.assetTypeId}
                AND (am.asset_type_id = #{query.assetTypeId} OR FIND_IN_SET(#{query.assetTypeId},at.parent_id))
            </if>
            <if test="query != null and query.ownershipDeptId != null">
                AND am.ownership_dept_id = #{query.ownershipDeptId}
@@ -95,11 +96,17 @@
            <if test="query.deptId != null">
                AND (od.id = #{query.deptId} OR FIND_IN_SET(#{query.deptId}, od.parent_id))
            </if>
            <if test="query.useDeptOrLocation!=null and query.useDeptOrLocation!=''">
                AND ((ud.dept_name LIKE CONCAT('%',#{query.useDeptOrLocation}, '%') AND am.address_type = 0)
                OR (am.warehouse_name LIKE CONCAT('%',#{query.useDeptOrLocation}, '%') AND am.address_type = 1)
                OR (am.address LIKE CONCAT('%',#{query.useDeptOrLocation}, '%') AND am.address_type = 2))
            </if>
        </where>
        ORDER BY COALESCE(oas.storage_time, DATE(am.create_time)) DESC, am.id DESC
    </select>
    <select id="getAssetPageList" resultType="com.ruoyi.system.vo.asset.AssetMainPageVO">
        SELECT
        DISTINCT
        am.*,
        at.type_name AS assetTypeName,
        od.dept_name AS ownershipDeptName,
@@ -127,7 +134,7 @@
            AND IFNULL(aaa.disabled, 0) = 0
            AND aaa.approval_status = 2 AND aaa.approval_id = '${@com.ruoyi.system.emums.ApprovalTypeEnum@IN_STOCK.getCode()}'
            <if test="query != null and query.assetTypeId != null">
                AND am.asset_type_id = #{query.assetTypeId}
                AND (am.asset_type_id = #{query.assetTypeId} OR FIND_IN_SET(#{query.assetTypeId},at.parent_id))
            </if>
            <if test="query != null and query.ownershipDeptId != null">
                AND am.ownership_dept_id = #{query.ownershipDeptId}
@@ -142,6 +149,11 @@
            <if test="query.deptId != null">
                AND (od.id = #{query.deptId} OR FIND_IN_SET(#{query.deptId}, od.parent_id))
            </if>
            <if test="query.useDeptOrLocation!=null and query.useDeptOrLocation!=''">
                AND ((ud.dept_name LIKE CONCAT('%',#{query.useDeptOrLocation}, '%') AND am.address_type = 0)
                OR (am.warehouse_name LIKE CONCAT('%',#{query.useDeptOrLocation}, '%') AND am.address_type = 1)
                OR (am.address LIKE CONCAT('%',#{query.useDeptOrLocation}, '%') AND am.address_type = 2))
            </if>
        </where>
        ORDER BY COALESCE(oas.storage_time, DATE(am.create_time)) DESC, am.id DESC
    </select>