问题反馈对接oa以及一堆bug

This commit is contained in:
2025-02-12 16:35:12 +08:00
parent a30c53996e
commit cbbc785b74
92 changed files with 3374 additions and 397 deletions

View File

@ -139,9 +139,20 @@
<select id="myBugPageList" resultType="com.sa.zentao.dao.ZtBugDTO">
SELECT * from zt_bug
SELECT s.*,pt.name productName from zt_bug s left join zt_product pt on s.product = pt.id
WHERE 1=1
<if test="qo.startDate !=null">
and s.openedDate <![CDATA[>=]]> #{qo.startDate}
</if>
<if test="qo.endDate !=null">
and s.openedDate <![CDATA[<=]]> #{qo.endDate}
</if>
<if test="qo.productName != null and qo.productName != '' ">
and pt.name like concat('%', #{qo.productName}, '%')
</if>
<if test="qo.objIds != null and qo.objIds.size() > 0">
and id in

View File

@ -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>

View File

@ -14,5 +14,9 @@
SELECT * from zt_projectstory WHERE project = #{id}
</select>
<select id="prdList" resultType="com.sa.zentao.entity.ZtProjectstory">
SELECT * from zt_projectstory WHERE story = #{id}
</select>
</mapper>

View File

@ -98,8 +98,7 @@
</if>
<if test="qo.searchVal != null and qo.searchVal == 'DGB' ">
and s.stage = 'verified'
and s.ys_flag =1
and s.stage = 'verified' and s.ys_flag =1
</if>
<if test="qo.searchVal != null and qo.searchVal == 'BGZ' ">
and s.status = '11'
@ -119,8 +118,9 @@
</if>
<if test="qo.searchVal != null and qo.searchVal == 'DYS' ">
and s.stage = 'verified'
and s.ys_flag =0
and ( s.stage = 'released'
and s.ys_flag =0)
or (s.stage = 'verified' and s.ys_flag =2)
</if>
<if test="qo.id != null ">
@ -174,12 +174,28 @@
select s.*,sp.spec ,sp.verify,sp.files from (zt_story s,zt_projectstory ps ) left join zt_storyspec sp on s.id = sp.story
select s.*,sp.spec ,sp.verify,sp.files,pt.name productName from (zt_story s,zt_projectstory ps ) left join zt_storyspec sp on s.id = sp.story
left join zt_storyreview v on s.id = v.story and s.version = v.version
left join zt_projectstory pstory on s.id = pstory.story and pstory.execution =0
left join zt_project pj on pstory.project = pj.id
left join zt_product pt on s.product = pt.id
WHERE s.id = ps.story
<if test="qo.startDate !=null">
and s.openedDate <![CDATA[>=]]> #{qo.startDate}
</if>
<if test="qo.endDate !=null">
and s.openedDate <![CDATA[<=]]> #{qo.endDate}
</if>
<if test="qo.productName != null and qo.productName != '' ">
and pt.name like concat('%', #{qo.productName}, '%')
</if>
<if test="qo.project != null ">
and ps.project =#{qo.project}
</if>
@ -227,8 +243,7 @@
</if>
<if test="qo.searchVal == 'DGB' ">
and s.stage = 'verified'
and s.ys_flag =1
and s.stage = 'verified' and s.ys_flag =1
</if>
<if test="qo.searchVal == 'BGZ' ">
and s.status = '11'
@ -248,8 +263,10 @@
</if>
<if test="qo.searchVal == 'DYS' ">
and s.stage = 'verified'
and s.ys_flag =0
and ( s.stage = 'released'
and s.ys_flag =0)
or (s.stage = 'verified' and s.ys_flag =2)
</if>
<if test="qo.searchVal != null and qo.searchVal == 'YWGB' ">
and s.status ='closed'
@ -310,6 +327,16 @@
</if>
<if test="qo.objIds != null and qo.objIds.size() > 0">
and s.id in
<foreach collection="qo.objIds" item="id" index="index"
open="(" close=")" separator=",">
#{id}
</foreach>
</if>
group by s.id
<choose>
@ -408,8 +435,9 @@
</if>
<if test="qo.searchVal == 'DYS' ">
and s.stage = 'verified'
and s.ys_flag =0
and ( s.stage = 'released'
and s.ys_flag =0)
or (s.stage = 'verified' and s.ys_flag =2)
</if>
<if test="qo.searchVal != null and qo.searchVal == 'YWGB' ">
and s.status ='closed'
@ -436,7 +464,8 @@
</select>
<select id="myStoryPageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
select s.*,sp.spec ,sp.verify,sp.files from zt_story s left join zt_storyspec sp on s.id = sp.story
select s.*,sp.spec ,sp.verify,sp.files ,pt.name productName from zt_story s left join zt_storyspec sp on s.id = sp.story
left join zt_product pt on s.product = pt.id
left join zt_storyreview v on s.id = v.story and s.version = v.version
WHERE 1=1
@ -446,8 +475,22 @@
open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test="qo.startDate !=null">
and s.openedDate <![CDATA[>=]]> #{qo.startDate}
</if>
<if test="qo.endDate !=null">
and s.openedDate <![CDATA[<=]]> #{qo.endDate}
</if>
<if test="qo.productName != null and qo.productName != '' ">
and pt.name like concat('%', #{qo.productName}, '%')
</if>
<if test="qo.project != null ">
and ps.project =#{qo.project}
</if>
@ -494,9 +537,9 @@
</if>
<if test="qo.searchVal == 'DGB' ">
and s.stage = 'verified'
and s.ys_flag =1
and s.stage = 'verified' and s.ys_flag =1
</if>
<if test="qo.searchVal == 'BGZ' ">
and s.status = '11'
</if>
@ -515,14 +558,26 @@
</if>
<if test="qo.searchVal == 'DYS' ">
and s.stage = 'verified'
and s.ys_flag =0
and ( s.stage = 'released'
and s.ys_flag =0)
or (s.stage = 'verified' and s.ys_flag =2)
</if>
<if test="qo.searchVal != null and qo.searchVal == 'YWGB' ">
and s.status ='closed'
and closedBy =#{qo.userName}
</if>
<if test="qo.objIds != null and qo.objIds.size() > 0">
and s.id in
<foreach collection="qo.objIds" item="id" index="index"
open="(" close=")" separator=",">
#{id}
</foreach>
</if>
group by s.id
<choose>

View File

@ -70,7 +70,32 @@
</resultMap>
<select id="pageList" resultType="com.sa.zentao.dao.ZtStoryUserDTO">
SELECT * from zt_story_user s WHERE 1=1
SELECT s.*,pt.name productName from zt_story_user s LEFT JOIN zt_product pt on s.product = pt.id WHERE 1=1
<if test="qo.productIds != null and qo.productIds.size() > 0">
and s.product in
<foreach collection="qo.productIds" item="id" index="index"
open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test="qo.startDate !=null">
and s.openedDate <![CDATA[>=]]> #{qo.startDate}
</if>
<if test="qo.endDate !=null">
and s.openedDate <![CDATA[<=]]> #{qo.endDate}
</if>
<if test="qo.productName != null and qo.productName != '' ">
and pt.name like concat('%', #{qo.productName}, '%')
</if>
<if test="qo.searchVal == 'ALL' ">

View File

@ -59,9 +59,28 @@
</resultMap>
<select id="taskPageList" resultType="com.sa.zentao.dao.ZtTaskDTO">
select * from zt_task s
select s.*,pt.name productName from zt_task s left join zt_project project on s.project = project.id
left join zt_product pt on s.product = pt.id
where 1= 1
<if test="qo.startDate !=null">
and s.openedDate <![CDATA[>=]]> #{qo.startDate}
</if>
<if test="qo.endDate !=null">
and s.openedDate <![CDATA[<=]]> #{qo.endDate}
</if>
<if test="qo.projectList != null and qo.projectList.size() > 0">
and s.project in
<foreach collection="qo.projectList" item="id" index="index"
open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test="qo.objIds != null and qo.objIds.size() > 0">
and s.id in
<foreach collection="qo.objIds" item="id" index="index"