需求编辑接口bug修复

This commit is contained in:
pfl
2025-04-18 14:41:54 +08:00
parent c91a6183ba
commit 497ff672d1
7 changed files with 98 additions and 14 deletions

View File

@@ -66,4 +66,13 @@ public class TestProjectController extends BaseController {
public AjaxResult delProject(@RequestBody IDQO qo) {
return toAjax(testProjectService.deleteTestProjectById(qo.getId()));
}
/**
* 修改需求
*/
@Log(title = "需求", businessType = BusinessType.UPDATE)
@PostMapping("/editProject")
public AjaxResult editProject(@RequestBody TestProject testProject) {
return toAjax(testProjectService.updateTestProject(testProject));
}
}

View File

@@ -33,5 +33,12 @@ public interface TestProjectMapper {
* @return
*/
TestProject selectTestProjectById(Long id);
/**
* 更新需求
* @param testProject
* @return
*/
int updateTestProject(TestProject testProject);
}

View File

@@ -38,4 +38,11 @@ public interface ITestProjectService {
* @return
*/
public TestProject selectTestProjectById(Long id);
/**
* 修改需求
* @param testProject
* @return
*/
public int updateTestProject(TestProject testProject);
}

View File

@@ -63,4 +63,14 @@ public class TestProjectServiceImpl implements ITestProjectService {
return testProjectMapper.selectTestProjectById(id);
}
/**
* 修改需求
* @param testProject
* @return int
*/
@Override
public int updateTestProject(TestProject testProject) {
testProject.setUpdateTime(DateUtils.getNowDate());
return testProjectMapper.updateTestProject(testProject);
}
}

View File

@@ -81,6 +81,27 @@
)
</insert>
<update id="updateTestProject" parameterType="TestProject">
update test_project
<trim prefix="SET" suffixOverrides=",">
<if test="serialNumber != null and serialNumber != ''">serial_number = #{serialNumber},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="outline != null and outline != ''">outline = #{outline},</if>
<if test="detail != null and detail != ''">detail = #{detail},</if>
<if test="priority != null and priority != ''">priority = #{priority},</if>
<if test="estimatedTime != null">estimated_time = #{estimatedTime},</if>
<if test="source != null and source != ''">source = #{source},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="manager != null and manager != ''">manager = #{manager},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="version != null">version = #{version},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTestProjectById">
DELETE
FROM test_project