|
|
@@ -13,19 +13,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
13
|
13
|
<result property="workload" column="workload" />
|
|
14
|
14
|
<result property="finishTime" column="finish_time" />
|
|
15
|
15
|
<result property="remark" column="remark" />
|
|
|
16
|
+ <association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
|
|
|
17
|
+ </resultMap>
|
|
|
18
|
+
|
|
|
19
|
+ <resultMap type="CmcProject" id="CmcProjectResult">
|
|
|
20
|
+ <result property="projectId" column="project_id" />
|
|
|
21
|
+ <result property="projectNumber" column="project_number" />
|
|
|
22
|
+ <result property="projectName" column="project_name" />
|
|
16
|
23
|
</resultMap>
|
|
17
|
24
|
|
|
18
|
25
|
<sql id="selectCmcProjectWorkloadVo">
|
|
19
|
|
- select workload_id, project_id, content, scale, unit, workload, finish_time, remark from cmc_project_workload
|
|
|
26
|
+ select pw.workload_id, pw.project_id, pw.content, pw.scale, pw.unit, pw.workload, pw.finish_time, pw.remark, p.project_number, p.project_name from cmc_project_workload as pw
|
|
|
27
|
+ left join cmc_project as p on pw.project_id = p.project_id
|
|
20
|
28
|
</sql>
|
|
21
|
29
|
|
|
22
|
30
|
<select id="selectCmcProjectWorkloadList" parameterType="CmcProjectWorkload" resultMap="CmcProjectWorkloadResult">
|
|
23
|
31
|
<include refid="selectCmcProjectWorkloadVo"/>
|
|
24
|
32
|
<where>
|
|
25
|
|
- <if test="projectId != null and projectId != ''"> and project_id = #{projectId}</if>
|
|
26
|
|
- <if test="content != null and content != ''"> and content like concat('%', #{content}, '%')</if>
|
|
27
|
|
- <if test="scale != null and scale != ''"> and scale like concat('%', #{scale}, '%')</if>
|
|
28
|
|
- <if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
|
|
|
33
|
+ <if test="projectId != null and projectId != ''"> and pw.project_id = #{projectId}</if>
|
|
|
34
|
+ <if test="content != null and content != ''"> and pw.content like concat('%', #{content}, '%')</if>
|
|
|
35
|
+ <if test="scale != null and scale != ''"> and pw.scale like concat('%', #{scale}, '%')</if>
|
|
|
36
|
+ <if test="unit != null and unit != ''"> and pw.unit like concat('%', #{unit}, '%')</if>
|
|
29
|
37
|
<if test="workload != null and workload != ''"> and workload = #{workload}</if>
|
|
30
|
38
|
<if test="finishTime != null "> and finish_time like concat('%', #{finishTime}, '%')</if>
|
|
31
|
39
|
</where>
|