需求接口完善
This commit is contained in:
@@ -39,6 +39,16 @@ public class TestProjectController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询需求详情
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/projectDetail")
|
||||
public AjaxResult projectDetail(@RequestBody IDQO qo) {
|
||||
return success(testProjectService.selectTestProjectById(qo.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增需求
|
||||
*/
|
||||
|
||||
@@ -26,5 +26,12 @@ public interface TestProjectMapper {
|
||||
* @return
|
||||
*/
|
||||
int deleteTestProjectById(Long id);
|
||||
|
||||
/**
|
||||
* 根据id查询需求详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
TestProject selectTestProjectById(Long id);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,4 +31,11 @@ public interface ITestProjectService {
|
||||
* @return
|
||||
*/
|
||||
public int deleteTestProjectById(Long id);
|
||||
|
||||
/**
|
||||
* 查询需求详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public TestProject selectTestProjectById(Long id);
|
||||
}
|
||||
|
||||
@@ -53,4 +53,14 @@ public class TestProjectServiceImpl implements ITestProjectService {
|
||||
return testProjectMapper.deleteTestProjectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询需求详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public TestProject selectTestProjectById(Long id) {
|
||||
return testProjectMapper.selectTestProjectById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,43 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.test.test.mapper.TestProjectMapper">
|
||||
|
||||
<resultMap type="TestProject" id="TestProjectResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="serialNumber" column="serial_number"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="outline" column="outline"/>
|
||||
<result property="detail" column="detail"/>
|
||||
<result property="priority" column="priority"/>
|
||||
<result property="estimatedTime" column="estimated_time"/>
|
||||
<result property="source" column="source"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="manager" column="manager"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="version" column="version"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTestProjectVo">
|
||||
SELECT id,
|
||||
serial_number,
|
||||
name,
|
||||
outline,
|
||||
detail,
|
||||
priority,
|
||||
estimated_time,
|
||||
source,
|
||||
type,
|
||||
status,
|
||||
manager,
|
||||
create_time,
|
||||
update_time,
|
||||
version,
|
||||
del_flag
|
||||
FROM test_project
|
||||
</sql>
|
||||
|
||||
<insert id="insertTestProject" parameterType="testProject" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO test_project (
|
||||
<trim prefix="" suffix="" suffixOverrides=",">
|
||||
@@ -68,27 +105,32 @@
|
||||
tp.del_flag
|
||||
FROM test_project tp
|
||||
LEFT JOIN sys_user su ON su.user_id = tp.manager
|
||||
where 1=1
|
||||
<if test="serialNumber != null and serialNumber != ''">
|
||||
AND serial_number LIKE concat('%', #{serialNumber}, '%')
|
||||
</if>
|
||||
<if test="outline != null and outline != ''">
|
||||
AND outline LIKE concat('%', #{outline}, '%')
|
||||
</if>
|
||||
<if test="startCreateTime != null">
|
||||
AND DATE_FORMAT(IFNULL(tp.create_time,''),'%Y%m%d') <![CDATA[ >= ]]> DATE_FORMAT(#{startCreateTime},'%Y%m%d')
|
||||
</if>
|
||||
<if test="endCreateTime != null">
|
||||
AND DATE_FORMAT(IFNULL(tp.create_time,''),'%Y%m%d') <![CDATA[ <= ]]> DATE_FORMAT(#{endCreateTime},'%Y%m%d')
|
||||
</if>
|
||||
<if test="manager != null and manager != ''">
|
||||
AND manager = #{manager}
|
||||
</if>
|
||||
<if test="priority != null and priority != ''">
|
||||
AND priority = #{priority}
|
||||
</if>
|
||||
<if test="status !=null and status != ''">
|
||||
AND tp.status = #{status}
|
||||
</if>
|
||||
where 1=1
|
||||
<if test="serialNumber != null and serialNumber != ''">
|
||||
AND serial_number LIKE concat('%', #{serialNumber}, '%')
|
||||
</if>
|
||||
<if test="outline != null and outline != ''">
|
||||
AND outline LIKE concat('%', #{outline}, '%')
|
||||
</if>
|
||||
<if test="startCreateTime != null">
|
||||
AND DATE_FORMAT(IFNULL(tp.create_time,''),'%Y%m%d') <![CDATA[ >= ]]> DATE_FORMAT(#{startCreateTime},'%Y%m%d')
|
||||
</if>
|
||||
<if test="endCreateTime != null">
|
||||
AND DATE_FORMAT(IFNULL(tp.create_time,''),'%Y%m%d') <![CDATA[ <= ]]> DATE_FORMAT(#{endCreateTime},'%Y%m%d')
|
||||
</if>
|
||||
<if test="manager != null and manager != ''">
|
||||
AND manager = #{manager}
|
||||
</if>
|
||||
<if test="priority != null and priority != ''">
|
||||
AND priority = #{priority}
|
||||
</if>
|
||||
<if test="status !=null and status != ''">
|
||||
AND tp.status = #{status}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectTestProjectById" parameterType="Long" resultMap="TestProjectResult">
|
||||
<include refid="selectTestProjectVo"/>
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user