|
@@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
24
|
24
|
<result property="remark" column="remark" />
|
25
|
25
|
<association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
|
26
|
26
|
<association property="user" javaType="SysUser" resultMap="SysUserResult" />
|
|
27
|
+ <association property="dept" javaType="SysDept" resultMap="SysDeptResult" />
|
27
|
28
|
</resultMap>
|
28
|
29
|
|
29
|
30
|
<resultMap type="SysUser" id="SysUserResult">
|
|
@@ -37,11 +38,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
37
|
38
|
<result property="projectName" column="project_name" />
|
38
|
39
|
</resultMap>
|
39
|
40
|
|
|
41
|
+ <resultMap type="SysDept" id="SysDeptResult">
|
|
42
|
+ <result property="deptId" column="dept_id" />
|
|
43
|
+ <result property="deptName" column="dept_name" />
|
|
44
|
+ </resultMap>
|
|
45
|
+
|
40
|
46
|
<sql id="selectCmcPerformanceStaffVo">
|
41
|
|
- select ps.performance_staff_id, ps.performance_id, ps.project_id, p.project_number, p.project_name, ps.user_id, u.nick_name, ps.work_type, ps.content, ps.scale_grade, ps.workload, ps.unit, ps.price,
|
|
47
|
+ select ps.performance_staff_id, ps.performance_id, ps.project_id, p.project_number, p.project_name, ps.user_id, u.nick_name, d.dept_name, ps.work_type, ps.content, ps.scale_grade, ps.workload, ps.unit, ps.price,
|
42
|
48
|
ps.coefficient, ps.produce_performance, ps.manage_performance, ps.performance_month, ps.remark from cmc_performance_staff as ps
|
43
|
49
|
left join cmc_project as p on p.project_id = ps.project_id
|
44
|
50
|
left join sys_user as u on u.user_id = ps.user_id
|
|
51
|
+ left join sys_dept as d on d.dept_id = u.dept_id
|
45
|
52
|
</sql>
|
46
|
53
|
|
47
|
54
|
<select id="selectCmcPerformanceStaffList" parameterType="CmcPerformanceStaff" resultMap="CmcPerformanceStaffResult">
|
|
@@ -62,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
62
|
69
|
</select>
|
63
|
70
|
|
64
|
71
|
<select id="selectMonthPerformanceList" parameterType="String" resultMap="CmcPerformanceStaffResult">
|
65
|
|
- select avg(t1.produce_performance) * 1.6 as manage_performance, t2.produce_performance, t2.user_id, t2.nick_name, t2.dept_name, t2.performance_month
|
|
72
|
+ select cast(avg(t1.produce_performance) * 1.6 as decimal(10,2)) as manage_performance, t2.produce_performance, t2.user_id, t2.nick_name, t2.dept_name, t2.performance_month
|
66
|
73
|
from
|
67
|
74
|
(select sum(ps.produce_performance) as produce_performance, u.nick_name, d.dept_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
|
68
|
75
|
left join sys_user as u on u.user_id = ps.user_id
|
|
@@ -79,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
79
|
86
|
where p.post_name = '主任' and ps.performance_id = #{param1} and u.dept_id = #{param2}
|
80
|
87
|
group by user_id) as t2
|
81
|
88
|
union all
|
82
|
|
- select avg(t1.produce_performance) * 1.2 as manage_performance, t2.produce_performance, t2.user_id, t2.nick_name, t2.dept_name, t2.performance_month
|
|
89
|
+ select cast(avg(t1.produce_performance) * 1.2 as decimal(10,2)) as manage_performance, t2.produce_performance, t2.user_id, t2.nick_name, t2.dept_name, t2.performance_month
|
83
|
90
|
from
|
84
|
91
|
(select sum(ps.produce_performance) as produce_performance, u.nick_name, d.dept_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
|
85
|
92
|
left join sys_user as u on u.user_id = ps.user_id
|