|
@@ -18,7 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
18
|
18
|
<result property="unit" column="unit" />
|
19
|
19
|
<result property="price" column="price" />
|
20
|
20
|
<result property="coefficient" column="coefficient" />
|
21
|
|
- <result property="performance" column="performance" />
|
|
21
|
+ <result property="producePerformance" column="produce_performance" />
|
|
22
|
+ <result property="managePerformance" column="manage_performance" />
|
22
|
23
|
<result property="performanceMonth" column="performance_month" />
|
23
|
24
|
<result property="remark" column="remark" />
|
24
|
25
|
<association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
|
|
@@ -38,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
38
|
39
|
|
39
|
40
|
<sql id="selectCmcPerformanceStaffVo">
|
40
|
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,
|
41
|
|
- ps.coefficient, ps.performance, ps.performance_month, ps.remark from cmc_performance_staff as ps
|
|
42
|
+ ps.coefficient, ps.produce_performance, ps.manage_performance, ps.performance_month, ps.remark from cmc_performance_staff as ps
|
42
|
43
|
left join cmc_project as p on p.project_id = ps.project_id
|
43
|
44
|
left join sys_user as u on u.user_id = ps.user_id
|
44
|
45
|
</sql>
|
|
@@ -55,11 +56,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
55
|
56
|
<if test="workload != null "> and ps.workload = #{workload}</if>
|
56
|
57
|
<if test="unit != null and unit != ''"> and ps.unit = #{unit}</if>
|
57
|
58
|
<if test="coefficient != null "> and ps.coefficient = #{coefficient}</if>
|
58
|
|
- <if test="performance != null "> and ps.performance = #{performance}</if>
|
|
59
|
+ <if test="producePerformance != null "> and ps.produce_performance = #{producePerformance}</if>
|
59
|
60
|
<if test="performanceMonth != null "> and Month(ps.performance_month) = Month(#{performanceMonth})</if>
|
60
|
61
|
</where>
|
61
|
62
|
</select>
|
62
|
|
-
|
|
63
|
+
|
|
64
|
+ <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.performance_month
|
|
66
|
+ from
|
|
67
|
+ (select sum(ps.produce_performance) as produce_performance, u.nick_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
|
|
68
|
+ left join sys_user as u on u.user_id = ps.user_id
|
|
69
|
+ left join sys_user_post as up on u.user_id = up.user_id
|
|
70
|
+ left join sys_post as p on p.post_id = up.post_id
|
|
71
|
+ where p.post_name != '主任' and p.post_name != '副主任' and ps.performance_id = #{param1} and u.dept_id = #{param2}
|
|
72
|
+ group by user_id) as t1,
|
|
73
|
+ (select sum(ps.produce_performance) as produce_performance, u.nick_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
|
|
74
|
+ left join sys_user as u on u.user_id = ps.user_id
|
|
75
|
+ left join sys_user_post as up on u.user_id = up.user_id
|
|
76
|
+ left join sys_post as p on p.post_id = up.post_id
|
|
77
|
+ where p.post_name = '主任' and ps.performance_id = '1' and u.dept_id = 111
|
|
78
|
+ group by user_id) as t2
|
|
79
|
+ union all
|
|
80
|
+ select avg(t1.produce_performance) * 1.2 as manage_performance, t2.produce_performance, t2.user_id, t2.performance_month
|
|
81
|
+ from
|
|
82
|
+ (select sum(ps.produce_performance) as produce_performance, u.nick_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
|
|
83
|
+ left join sys_user as u on u.user_id = ps.user_id
|
|
84
|
+ left join sys_user_post as up on u.user_id = up.user_id
|
|
85
|
+ left join sys_post as p on p.post_id = up.post_id
|
|
86
|
+ where p.post_name != '主任' and p.post_name != '副主任' and ps.performance_id = #{param1} and u.dept_id = #{param2}
|
|
87
|
+ group by user_id) as t1,
|
|
88
|
+ (select sum(ps.produce_performance) as produce_performance, u.nick_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
|
|
89
|
+ left join sys_user as u on u.user_id = ps.user_id
|
|
90
|
+ left join sys_user_post as up on u.user_id = up.user_id
|
|
91
|
+ left join sys_post as p on p.post_id = up.post_id
|
|
92
|
+ where p.post_name = '副主任' and ps.performance_id = '1' and u.dept_id = 111
|
|
93
|
+ group by user_id) as t2
|
|
94
|
+ union all
|
|
95
|
+ select ps.produce_performance * 0 as manage_performance, sum(ps.produce_performance) as produce_performance, ps.user_id, ps.performance_month from cmc_performance_staff as ps
|
|
96
|
+ left join sys_user as u on u.user_id = ps.user_id
|
|
97
|
+ left join sys_user_post as up on u.user_id = up.user_id
|
|
98
|
+ left join sys_post as p on p.post_id = up.post_id
|
|
99
|
+ where p.post_name != '主任' and p.post_name != '副主任' and ps.performance_id = #{param1} and u.dept_id = #{param2}
|
|
100
|
+ group by user_id
|
|
101
|
+ </select>
|
|
102
|
+
|
63
|
103
|
<select id="selectCmcPerformanceStaffByPerformanceStaffId" parameterType="Long" resultMap="CmcPerformanceStaffResult">
|
64
|
104
|
<include refid="selectCmcPerformanceStaffVo"/>
|
65
|
105
|
where performance_staff_id = #{performanceStaffId}
|
|
@@ -78,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
78
|
118
|
<if test="unit != null">unit,</if>
|
79
|
119
|
<if test="price != null">price,</if>
|
80
|
120
|
<if test="coefficient != null">coefficient,</if>
|
81
|
|
- <if test="performance != null">performance,</if>
|
|
121
|
+ <if test="producePerformance != null">produce_performance,</if>
|
82
|
122
|
<if test="performanceMonth != null">performance_month,</if>
|
83
|
123
|
<if test="remark != null">remark,</if>
|
84
|
124
|
</trim>
|
|
@@ -93,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
93
|
133
|
<if test="unit != null">#{unit},</if>
|
94
|
134
|
<if test="price != null">#{price},</if>
|
95
|
135
|
<if test="coefficient != null">#{coefficient},</if>
|
96
|
|
- <if test="performance != null">#{performance},</if>
|
|
136
|
+ <if test="producePerformance != null">#{produce_performance},</if>
|
97
|
137
|
<if test="performanceMonth != null">#{performanceMonth},</if>
|
98
|
138
|
<if test="remark != null">#{remark},</if>
|
99
|
139
|
</trim>
|
|
@@ -112,7 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
112
|
152
|
<if test="unit != null">unit = #{unit},</if>
|
113
|
153
|
<if test="price != null">price = #{price},</if>
|
114
|
154
|
<if test="coefficient != null">coefficient = #{coefficient},</if>
|
115
|
|
- <if test="performance != null">performance = #{performance},</if>
|
|
155
|
+ <if test="producePerformance != null">produce_performance = #{producePerformance},</if>
|
116
|
156
|
<if test="performanceMonth != null">performance_month = #{performanceMonth},</if>
|
117
|
157
|
<if test="remark != null">remark = #{remark},</if>
|
118
|
158
|
</trim>
|