|
@@ -18,7 +18,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
18
|
18
|
<association property="uploadUser" javaType="SysUser" resultMap="UploadUserResult" />
|
19
|
19
|
<association property="dept" javaType="SysDept" resultMap="SysDeptResult" />
|
20
|
20
|
<association property="resourceField" javaType="CmcResourceField" resultMap="CmcResourceFieldResult" />
|
21
|
|
- <association property="train" javaType="CmcTrain" resultMap="CmcTrainResult" />
|
22
|
21
|
</resultMap>
|
23
|
22
|
|
24
|
23
|
<resultMap type="SysUser" id="UploadUserResult">
|
|
@@ -36,23 +35,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
36
|
35
|
<result property="field" column="field" />
|
37
|
36
|
</resultMap>
|
38
|
37
|
|
39
|
|
- <resultMap type="CmcTrain" id="CmcTrainResult">
|
40
|
|
- <result property="trainId" column="train_id" />
|
41
|
|
- <result property="name" column="name" />
|
42
|
|
- </resultMap>
|
43
|
|
-
|
44
|
38
|
<sql id="selectCmcResourceVo">
|
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
|
+ 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
|
46
|
40
|
left join sys_user as u on u.user_id = r.uploader
|
47
|
41
|
left join sys_dept as d on d.dept_id = r.upload_dept
|
48
|
42
|
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
|
50
|
43
|
</sql>
|
51
|
44
|
|
52
|
45
|
<select id="selectCmcResourceList" parameterType="CmcResource" resultMap="CmcResourceResult">
|
53
|
46
|
<include refid="selectCmcResourceVo"/>
|
54
|
|
- <where>
|
55
|
|
- <if test="trainId != null "> and r.train_id = #{trainId}</if>
|
|
47
|
+ <where>
|
56
|
48
|
<if test="uploader != null "> and r.uploader = #{uploader}</if>
|
57
|
49
|
<if test="uploadDept != null "> and r.upload_dept = #{uploadDept}</if>
|
58
|
50
|
<if test="title != null and title != ''"> and r.title like concat('%', #{title}, '%')</if>
|