问题反馈对接oa以及一堆bug
This commit is contained in:
@ -224,6 +224,220 @@
|
||||
|
||||
SELECT * from zt_project WHERE `name` = #{name} and type = 'sprint'
|
||||
|
||||
</select>
|
||||
<select id="selectPrdById" resultType="com.sa.zentao.dao.ZtProjectDTO">
|
||||
SELECT * from zt_project WHERE id = #{id} and type = 'sprint'
|
||||
</select>
|
||||
<select id="performanceCount" resultType="com.sa.zentao.dao.PerformanceDTO">
|
||||
SELECT
|
||||
`姓名` as userName,
|
||||
account,
|
||||
`天数` as days,
|
||||
`可用工时` as totalTime,
|
||||
`达标工时` as examineTime,
|
||||
`产出工时` as workTime,
|
||||
`分配总工时` as allocationTime,
|
||||
`工作饱和率` as saturation,
|
||||
`饱和率得分` as saturationScore,
|
||||
`逾期任务` as delayTask,
|
||||
`完成任务` as finishTask,
|
||||
`完成准时率` as finishPunctuality,
|
||||
`准时率得分` as punctualityScore,
|
||||
`线上严重bug` as seriousBug,
|
||||
`线上普通bug` as slightBug,
|
||||
`线上bug得分` bugScore ,
|
||||
if(account in ('chenlu', 'yanyanjie'), `线上bug得分` + `准时率得分` + 50, `饱和率得分`+ `线上bug得分` + `准时率得分` + 25 ) AS `score`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`姓名`,
|
||||
account,
|
||||
`天数`,
|
||||
`可用工时`,
|
||||
`达标工时`,
|
||||
`产出工时`,
|
||||
`分配总工时`,
|
||||
`工作饱和率`,
|
||||
|
||||
IF
|
||||
(
|
||||
`饱和率得分` > 40,
|
||||
40,
|
||||
IF
|
||||
|
||||
( `饱和率得分` <![CDATA[ < ]]> 0, 0, `饱和率得分` )) AS `饱和率得分`,
|
||||
`逾期任务`,
|
||||
`完成任务`,
|
||||
`完成准时率`,
|
||||
`准时率得分`,
|
||||
`线上严重bug`,
|
||||
`线上普通bug`,
|
||||
IF
|
||||
( `线上bug得分` <![CDATA[ < ]]> 0, 0, `线上bug得分` ) AS `线上bug得分`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`姓名`,
|
||||
account,
|
||||
`天数`,
|
||||
`可用工时`,
|
||||
`达标工时`,
|
||||
`产出工时`,
|
||||
`分配总工时`,
|
||||
`工作饱和率`,
|
||||
|
||||
IF
|
||||
(
|
||||
`工作饱和率` <![CDATA[ < ]]> 0.70,
|
||||
0,
|
||||
IF
|
||||
( `工作饱和率` <![CDATA[ < ]]> 0.9 , 40 - ( 0.9 - `工作饱和率` ) * 100 * 1, 40 )) `饱和率得分`,
|
||||
`逾期任务`,
|
||||
`完成任务`,
|
||||
`完成准时率`,
|
||||
IF
|
||||
(
|
||||
`完成准时率` <![CDATA[ < ]]> 0.80,
|
||||
0,
|
||||
IF
|
||||
( `完成准时率` <![CDATA[ < ]]> 1 , 25 - (1 - `完成准时率`) * 100 * 1, 25 )) `准时率得分`,
|
||||
`线上严重bug`,
|
||||
`线上普通bug`,
|
||||
IF
|
||||
( account in ('chenlu', 'yanyanjie'), if(`线上严重bug` = 0 AND `线上普通bug` = 0, 20, 20 - `线上严重bug` * 20 - `线上普通bug` * 5 ), if(`线上严重bug` = 0 AND `线上普通bug` = 0, 10, 10 - `线上严重bug` * 10 - `线上普通bug` * 3 )) `线上bug得分`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
*,
|
||||
IFNULL( `_线上严重bug`, 0 ) `线上严重bug`,
|
||||
IFNULL( `_线上普通bug`, 0 ) `线上普通bug`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
gs.nickname `姓名`,
|
||||
gs.account,
|
||||
SUM(
|
||||
IF
|
||||
|
||||
( gs.`hour` <![CDATA[ > ]]> 0, 1, 0 )) `天数`,
|
||||
SUM(
|
||||
IF
|
||||
( gs.`hour` <![CDATA[ > ]]> 0, 1, 0 ))* 1 `测试bug数量`,
|
||||
SUM(
|
||||
IF
|
||||
( gs.`hour` <![CDATA[ > ]]> 0, 1, 0 ))* 0.3 `开发bug数量`,
|
||||
SUM( gs.`hour` ) `可用工时`,
|
||||
SUM( gs.`hour` ) * 0.75 `达标工时`,
|
||||
ROUND( SUM( tc.estimate ), 2 ) `分配总工时`,
|
||||
ROUND( SUM( tc.consumed ), 2 ) `产出工时`,
|
||||
ROUND( SUM( tc.estimate )/ (SUM( gs.`hour` )*0.75), 2 ) `工作饱和率`,
|
||||
SUM( tc.yuqi_count ) `逾期任务` ,
|
||||
SUM( tc.finish_count ) `完成任务`,
|
||||
(1 - ROUND( SUM( tc.yuqi_count )/ SUM( tc.finish_count ) , 2 )) `完成准时率`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
md.mydate,
|
||||
u.nickname,
|
||||
u.account,
|
||||
if( a.apply_days IS NULL , 8 ,
|
||||
if(a.apply_days <![CDATA[ < ]]> 480,
|
||||
|
||||
ROUND((8 * 60 - a.apply_days) / 60, 2),0)
|
||||
)
|
||||
`hour`
|
||||
FROM
|
||||
my_date md
|
||||
LEFT JOIN zt_holiday h ON md.mydate BETWEEN h.`begin`
|
||||
AND h.`end`
|
||||
LEFT JOIN zt_user u ON 1 = 1
|
||||
LEFT JOIN os_system.it_approval a ON a.NAME = u.nickname
|
||||
AND md.mydate BETWEEN date( a.`apply_time_start` )
|
||||
AND date( a.`apply_time_end` )
|
||||
WHERE
|
||||
( md.mydayofweek IN ( 2, 3, 4, 5, 6 ) OR h.type = 'working' )
|
||||
AND ( h.id IS NULL OR h.type = 'working' )
|
||||
-- AND ( u.dept IN ( 24 ) OR u.account = 'songzhiling' )
|
||||
AND u.deleted = '0'
|
||||
|
||||
AND md.mydate <![CDATA[ >= ]]> date( #{startDate } )
|
||||
AND md.mydate <![CDATA[ < ]]> date(#{endDate } )
|
||||
ORDER BY
|
||||
u.nickname,
|
||||
md.mydate
|
||||
) gs
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
t.finishedBy,
|
||||
SUM( t.estimate ) estimate,
|
||||
SUM( t.consumed ) consumed,
|
||||
date( t.finishedDate ) `date`,
|
||||
count( t.id ) `finish_count`,
|
||||
SUM(
|
||||
IF
|
||||
( DATEDIFF(t.finishedDate, t.deadline) > 3 , 1, 0 )) `yuqi_count`
|
||||
FROM
|
||||
zt_task t
|
||||
WHERE
|
||||
t.deleted = '0'
|
||||
-- and t.openedBy in ('wangyuhang', 'liyuyan')
|
||||
-- AND t.finishedBy = 'guoshangyu'
|
||||
AND date( t.openedDate ) <![CDATA[ < ]]> date(#{endDate } )
|
||||
AND date(t.finishedDate) BETWEEN date(#{startDate } )
|
||||
AND date(#{endDate } )
|
||||
GROUP BY
|
||||
t.finishedBy,
|
||||
date( t.finishedDate )
|
||||
) tc ON tc.finishedBy = gs.account
|
||||
AND tc.date = gs.mydate
|
||||
WHERE
|
||||
gs.nickname NOT IN ( '王宇航', '徐申靓', '刘圣清' )
|
||||
GROUP BY
|
||||
gs.nickname
|
||||
) gsu
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
account1,
|
||||
sum( `_bug数量` ) AS `_bug数量`,
|
||||
sum( `_线上严重bug` ) AS `_线上严重bug`,
|
||||
sum( `_线上普通bug` ) AS `_线上普通bug`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
IFNULL(zb.resolvedBy,zb.assignedTo) `account1`,
|
||||
count( zb.id ) `_bug数量`,
|
||||
count(
|
||||
IF
|
||||
( zb.severity = 1, 1, NULL )) `_线上严重bug`,
|
||||
count(
|
||||
IF
|
||||
( zb.severity = 2, 1, NULL )) `_线上普通bug`
|
||||
FROM
|
||||
zt_bug zb
|
||||
WHERE
|
||||
(
|
||||
zb.severity IN ( 2, 1 ))
|
||||
AND IFNULL( zb.deadline, zb.openedDate ) BETWEEN date(#{startDate } )
|
||||
AND date(#{endDate } )
|
||||
GROUP BY
|
||||
IFNULL(zb.resolvedBy,zb.assignedTo)
|
||||
) zbjs
|
||||
GROUP BY
|
||||
zbjs.account1
|
||||
) zbu ON gsu.account = zbu.account1
|
||||
GROUP BY
|
||||
gsu.account
|
||||
) gzu
|
||||
GROUP BY
|
||||
account
|
||||
) gaaa
|
||||
GROUP BY
|
||||
account
|
||||
) zzzzz where account in ('jiangheng', 'guoshangyu', 'jinliang','songzhiling', 'yumengcheng','zhoulinfang','zhouxueli','chenlu','yanyanjie','chenhaidong')
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
Reference in New Issue
Block a user