需求报表

This commit is contained in:
2026-04-24 14:58:24 +08:00
parent ea575012a8
commit 739e864699
20 changed files with 760 additions and 11 deletions
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sa.zentao.mapper.ZtStoryExpandMapper">
<resultMap id="BaseResultMap" type="com.sa.zentao.entity.ZtStoryExpand">
<result column="id" property="id" />
<result column="story_id" property="storyId" />
<result column="number_units" property="numberUnits" />
<result column="unit_business_complexity" property="unitBusinessComplexity" />
<result column="technical_complexity_coefficient" property="technicalComplexityCoefficient" />
<result column="ai_efficiency_coefficient" property="aiEfficiencyCoefficient" />
<result column="evaluation_time" property="evaluationTime" />
<result column="workload_index" property="workloadIndex" />
<result column="requirement_status" property="requirementStatus" />
<result column="requirement_completion_degree" property="requirementCompletionDegree" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="create_user" property="createUser" />
<result column="update_user" property="updateUser" />
<result column="story_title" property="storyTitle" />
<result column="create_user_nickname" property="createUserNickname" />
<result column="month_evaluation_time" property="monthEvaluationTime" />
</resultMap>
<select id="queryByMonthWithTitle" resultMap="BaseResultMap">
SELECT
e.*,
s.title AS story_title,
u.nickname AS create_user_nickname,
mw.evaluation_time AS month_evaluation_time
FROM
zt_story_expand e
LEFT JOIN zt_story s ON e.story_id = s.id
LEFT JOIN zt_product zp on s.product = zp.id
LEFT JOIN zt_project zpt on zp.program = zpt.id
LEFT JOIN zt_user u ON e.create_user = u.account
LEFT JOIN zt_story_month_workload mw ON mw.story_id = e.story_id AND mw.time = #{month}
WHERE
zpt.id = #{projectId}
AND (
DATE_FORMAT(e.create_time, '%Y-%m') = #{month}
OR mw.time = #{month}
)
</select>
</mapper>
+11 -3
View File
@@ -407,7 +407,11 @@
left join zt_project pj on pstory.project = pj.id
left join zt_product pt on s.product = pt.id
left join zt_projectstory ps on s.id = ps.story
left join zt_user zu on s.ys_user = zu.account
WHERE 1=1
<if test="qo.ysUser != null and qo.ysUser != '' ">
and zu.nickname like concat('%', #{qo.ysUser}, '%')
</if>
<if test="qo.pri != null and qo.pri != '' ">
and s.pri = #{qo.pri}
</if>
@@ -417,7 +421,9 @@
<if test="qo.title != null and qo.title != '' ">
and s.title like concat('%', #{qo.title}, '%')
</if>
<if test="qo.ysUser != null and qo.ysUser != '' ">
and s.nickname like concat('%', #{qo.ysUser}, '%')
</if>
<if test="qo.searchVal != null and qo.searchVal == 'WYS' ">
and s.ys_user = #{qo.userName}
</if>
@@ -932,7 +938,7 @@
from zt_story s
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
left join zt_user zu on s.ys_user = zu.account
<if test="qo.project != null or qo.execution != null">
left join zt_projectstory ps on s.id = ps.story
</if>
@@ -940,7 +946,9 @@
WHERE 1=1
<if test="qo.ysUser != null and qo.ysUser != '' ">
and zu.nickname like concat('%', #{qo.ysUser}, '%')
</if>
<if test="qo.testUser != null and qo.testUser != '' ">
and s.test_user like concat('%', #{qo.testUser}, '%')
</if>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sa.zentao.mapper.ZtStoryMonthWorkloadMapper">
<resultMap id="BaseResultMap" type="com.sa.zentao.entity.ZtStoryMonthWorkload">
<result column="id" property="id" />
<result column="time" property="time" />
<result column="workload" property="workload" />
<result column="create_user" property="createUser" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="update_user" property="updateUser" />
</resultMap>
</mapper>
@@ -141,7 +141,9 @@
s.old_status,
s.ys_user,
s.product_user,
pt.name productName from zt_story_user s LEFT JOIN zt_product pt on s.product = pt.id WHERE 1=1
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
@@ -228,6 +230,9 @@
<if test="qo.module != null and qo.module != '' ">
and s.module = #{qo.module}
</if>
<if test="qo.modules != null and qo.modules != '' ">
and FIND_IN_SET(s.module, #{qo.modules})
</if>
<if test="qo.productId != null ">
and s.product = #{qo.productId}
</if>