Files
zentao/src/main/resources/mapper/ZtStoryExpandMapper.xml
T
2026-07-22 15:53:16 +08:00

49 lines
2.5 KiB
XML

<?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" />
<result column="product_person" property="productPerson" />
<result column="develop_person" property="developPerson" />
<result column="test_person" property="testPerson" />
</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>