| | |
| | | <!-- 分页查询:审批通过的资产列表(关联审批记录、资产类型与部门) --> |
| | | <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, |
| | |
| | | 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} |
| | |
| | | <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, |
| | |
| | | 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} |
| | |
| | | <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> |