|
@@ -54,7 +54,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
54
|
54
|
<if test="hours != null "> and r.hours = #{hours}</if>
|
55
|
55
|
</where>
|
56
|
56
|
</select>
|
57
|
|
-
|
|
57
|
+
|
|
58
|
+ <select id="selectCmcResourceListBelow" parameterType="CmcResource" resultMap="CmcResourceResult">
|
|
59
|
+ SELECT r.resource_id, r.uploader, r.upload_dept, r.title, r.source_path, r.type, r.field_id, r.upload_time, r.hours
|
|
60
|
+ FROM cmc_resource AS r
|
|
61
|
+ LEFT JOIN sys_user AS u ON u.user_id = r.uploader
|
|
62
|
+ LEFT JOIN sys_dept AS d ON d.dept_id = r.upload_dept
|
|
63
|
+ RIGHT JOIN (
|
|
64
|
+ SELECT rf2.field_id FROM
|
|
65
|
+ ( SELECT rf1.field_id AS sub_field_id, rf1.parent_id AS sub_parent_id, rf0.field_id, rf0.parent_id
|
|
66
|
+ FROM cmc_resource_field AS rf0
|
|
67
|
+ LEFT JOIN cmc_resource_field AS rf1 ON rf1.parent_id = rf0.field_id
|
|
68
|
+ WHERE rf0.field_id = #{fieldId} OR rf1.field_id = #{fieldId} ) AS rf3
|
|
69
|
+ RIGHT JOIN cmc_resource_field AS rf2 ON rf2.parent_id = rf3.sub_field_id
|
|
70
|
+ WHERE rf3.sub_field_id = #{fieldId} OR rf2.field_id = #{fieldId} OR rf3.field_id = #{fieldId}
|
|
71
|
+ ) as tree on tree.field_id = r.field_id
|
|
72
|
+ <where>
|
|
73
|
+ r.resource_id is not null
|
|
74
|
+ <if test="uploader != null "> and r.uploader = #{uploader}</if>
|
|
75
|
+ <if test="uploadDept != null "> and r.upload_dept = #{uploadDept}</if>
|
|
76
|
+ <if test="title != null and title != ''"> and r.title like concat('%', #{title}, '%')</if>
|
|
77
|
+ <if test="sourcePath != null and sourcePath != ''"> and r.source_path = #{sourcePath}</if>
|
|
78
|
+ <if test="type != null and type != ''"> and r.type = #{type}</if>
|
|
79
|
+ <if test="uploadTime != null "> and r.upload_time = #{uploadTime}</if>
|
|
80
|
+ <if test="hours != null "> and r.hours = #{hours}</if>
|
|
81
|
+ </where>
|
|
82
|
+ </select>
|
|
83
|
+
|
58
|
84
|
<select id="selectCmcResourceByResourceId" parameterType="Integer" resultMap="CmcResourceResult">
|
59
|
85
|
<include refid="selectCmcResourceVo"/>
|
60
|
86
|
where resource_id = #{resourceId}
|