Bläddra i källkod

学习资料关联培训记录id

lamphua 1 månad sedan
förälder
incheckning
797992a4bf

+ 25
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcResource.java Visa fil

22
     /** 资料id */
22
     /** 资料id */
23
     private Integer resourceId;
23
     private Integer resourceId;
24
 
24
 
25
+    /** 培训名称 */
26
+    private Integer trainId;
27
+    private CmcTrain train;
28
+    @Excel(name = "培训名称")
29
+    private String name;
30
+
25
     /** 上传人 */
31
     /** 上传人 */
26
     private Long uploader;
32
     private Long uploader;
27
     @Excel(name = "上传人")
33
     @Excel(name = "上传人")
181
     {
187
     {
182
         return resourceField;
188
         return resourceField;
183
     }
189
     }
190
+    public void setTrainId(Integer trainId)
191
+    {
192
+        this.trainId = trainId;
193
+    }
194
+
195
+    public Integer getTrainId()
196
+    {
197
+        return trainId;
198
+    }
199
+    public void setTrain(CmcTrain train)
200
+    {
201
+        this.train = train;
202
+        this.name = train == null ? "" : train.getName();
203
+    }
204
+
205
+    public CmcTrain getTrain()
206
+    {
207
+        return train;
208
+    }
184
 
209
 
185
     @Override
210
     @Override
186
     public String toString() {
211
     public String toString() {

+ 13
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcResourceMapper.xml Visa fil

6
     
6
     
7
     <resultMap type="CmcResource" id="CmcResourceResult">
7
     <resultMap type="CmcResource" id="CmcResourceResult">
8
         <result property="resourceId"    column="resource_id"    />
8
         <result property="resourceId"    column="resource_id"    />
9
+        <result property="trainId"    column="train_id"    />
9
         <result property="uploader"    column="uploader"    />
10
         <result property="uploader"    column="uploader"    />
10
         <result property="uploadDept"    column="upload_dept"    />
11
         <result property="uploadDept"    column="upload_dept"    />
11
         <result property="title"    column="title"    />
12
         <result property="title"    column="title"    />
17
         <association property="uploadUser"    javaType="SysUser"         resultMap="UploadUserResult" />
18
         <association property="uploadUser"    javaType="SysUser"         resultMap="UploadUserResult" />
18
         <association property="dept"    javaType="SysDept"         resultMap="SysDeptResult" />
19
         <association property="dept"    javaType="SysDept"         resultMap="SysDeptResult" />
19
         <association property="resourceField"    javaType="CmcResourceField"         resultMap="CmcResourceFieldResult" />
20
         <association property="resourceField"    javaType="CmcResourceField"         resultMap="CmcResourceFieldResult" />
21
+        <association property="train"    javaType="CmcTrain"         resultMap="CmcTrainResult" />
20
     </resultMap>
22
     </resultMap>
21
 
23
 
22
     <resultMap type="SysUser" id="UploadUserResult">
24
     <resultMap type="SysUser" id="UploadUserResult">
34
         <result property="field"    column="field"    />
36
         <result property="field"    column="field"    />
35
     </resultMap>
37
     </resultMap>
36
 
38
 
39
+    <resultMap type="CmcTrain" id="CmcTrainResult">
40
+        <result property="trainId"    column="train_id"    />
41
+        <result property="name"    column="name"    />
42
+    </resultMap>
43
+
37
     <sql id="selectCmcResourceVo">
44
     <sql id="selectCmcResourceVo">
38
-        select r.resource_id, r.uploader, r.upload_dept, r.title, r.source_path, r.type, r.field_id, rf.field, r.upload_time, r.hours from cmc_resource as r
45
+        select r.resource_id, r.train_id, r.uploader, r.upload_dept, r.title, r.source_path, r.type, r.field_id, rf.field, r.upload_time, r.hours, t.name from cmc_resource as r
39
         left join sys_user as u on u.user_id = r.uploader
46
         left join sys_user as u on u.user_id = r.uploader
40
         left join sys_dept as d on d.dept_id = r.upload_dept
47
         left join sys_dept as d on d.dept_id = r.upload_dept
41
         left join cmc_resource_field as rf on rf.field_id = r.field_id
48
         left join cmc_resource_field as rf on rf.field_id = r.field_id
49
+        left join cmc_train as t on t.train_id = r.train_id
42
     </sql>
50
     </sql>
43
 
51
 
44
     <select id="selectCmcResourceList" parameterType="CmcResource" resultMap="CmcResourceResult">
52
     <select id="selectCmcResourceList" parameterType="CmcResource" resultMap="CmcResourceResult">
45
         <include refid="selectCmcResourceVo"/>
53
         <include refid="selectCmcResourceVo"/>
46
         <where>  
54
         <where>  
55
+            <if test="trainId != null "> and r.train_id = #{trainId}</if>
47
             <if test="uploader != null "> and r.uploader = #{uploader}</if>
56
             <if test="uploader != null "> and r.uploader = #{uploader}</if>
48
             <if test="uploadDept != null "> and r.upload_dept = #{uploadDept}</if>
57
             <if test="uploadDept != null "> and r.upload_dept = #{uploadDept}</if>
49
             <if test="title != null  and title != ''"> and r.title like concat('%', #{title}, '%')</if>
58
             <if test="title != null  and title != ''"> and r.title like concat('%', #{title}, '%')</if>
97
             <if test="fieldId != null">field_id,</if>
106
             <if test="fieldId != null">field_id,</if>
98
             <if test="uploadTime != null">upload_time,</if>
107
             <if test="uploadTime != null">upload_time,</if>
99
             <if test="hours != null">hours,</if>
108
             <if test="hours != null">hours,</if>
109
+            <if test="trainId != null">train_id,</if>
100
          </trim>
110
          </trim>
101
         <trim prefix="values (" suffix=")" suffixOverrides=",">
111
         <trim prefix="values (" suffix=")" suffixOverrides=",">
102
             <if test="uploader != null">#{uploader},</if>
112
             <if test="uploader != null">#{uploader},</if>
107
             <if test="fieldId != null">#{fieldId},</if>
117
             <if test="fieldId != null">#{fieldId},</if>
108
             <if test="uploadTime != null">#{uploadTime},</if>
118
             <if test="uploadTime != null">#{uploadTime},</if>
109
             <if test="hours != null">#{hours},</if>
119
             <if test="hours != null">#{hours},</if>
120
+            <if test="trainId != null">#{trainId},</if>
110
          </trim>
121
          </trim>
111
     </insert>
122
     </insert>
112
 
123
 
121
             <if test="fieldId != null">field_id = #{fieldId},</if>
132
             <if test="fieldId != null">field_id = #{fieldId},</if>
122
             <if test="uploadTime != null">upload_time = #{uploadTime},</if>
133
             <if test="uploadTime != null">upload_time = #{uploadTime},</if>
123
             <if test="hours != null">hours = #{hours},</if>
134
             <if test="hours != null">hours = #{hours},</if>
135
+            <if test="trainId != null">train_id = #{trainId},</if>
124
         </trim>
136
         </trim>
125
         where resource_id = #{resourceId}
137
         where resource_id = #{resourceId}
126
     </update>
138
     </update>

Loading…
Avbryt
Spara