测试计划相关接口
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
package com.test.test.controller;
|
||||
|
||||
import com.test.common.annotation.Log;
|
||||
import com.test.common.core.controller.BaseController;
|
||||
import com.test.common.core.domain.AjaxResult;
|
||||
import com.test.common.core.page.TableDataInfo;
|
||||
import com.test.common.enums.BusinessType;
|
||||
import com.test.test.domain.TestPlan;
|
||||
import com.test.test.domain.qo.IDQO;
|
||||
import com.test.test.domain.qo.TestPlanAddQO;
|
||||
import com.test.test.domain.qo.TestPlanListQO;
|
||||
import com.test.test.domain.vo.TestPlanListVO;
|
||||
import com.test.test.service.ITestPlanService;
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 测试计划controller
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/test/testPlan")
|
||||
public class TestPlanController extends BaseController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ITestPlanService testPlanService;
|
||||
|
||||
/**
|
||||
* 查询测试计划列表
|
||||
*/
|
||||
@GetMapping("/testPlanList")
|
||||
public TableDataInfo planList(@Validated TestPlanListQO qo) {
|
||||
startPage();
|
||||
List<TestPlanListVO> list = testPlanService.getPlanList(qo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增测试计划
|
||||
*/
|
||||
@Log(title = "测试计划", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/addPlan")
|
||||
public AjaxResult addPlan(@RequestBody TestPlanAddQO testPlanAddQO) {
|
||||
return toAjax(testPlanService.insertTestPlan(testPlanAddQO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除测试计划
|
||||
*/
|
||||
@Log(title = "测试计划", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/deletePlan")
|
||||
public AjaxResult deletePlan(@RequestBody IDQO qo) {
|
||||
TestPlan testPlan = testPlanService.selectTestPlanById(qo.getId());
|
||||
testPlan.setDelFlag("1");
|
||||
return toAjax(testPlanService.updateTestPlan(testPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取测试计划详细信息
|
||||
*/
|
||||
@PostMapping("/planDetail")
|
||||
public AjaxResult getInfo(@RequestBody IDQO qo) {
|
||||
return success(testPlanService.selectTestPlanById(qo.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改测试计划
|
||||
*/
|
||||
@Log(title = "测试计划", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/updatePlan")
|
||||
public AjaxResult edit(@RequestBody TestPlan testPlan) {
|
||||
return toAjax(testPlanService.updateTestPlan(testPlan));
|
||||
}
|
||||
}
|
||||
56
test-test/src/main/java/com/test/test/domain/TestPlan.java
Normal file
56
test-test/src/main/java/com/test/test/domain/TestPlan.java
Normal file
@@ -0,0 +1,56 @@
|
||||
package com.test.test.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.test.common.annotation.Excel;
|
||||
import com.test.common.core.domain.BaseEntity;
|
||||
import java.util.Date;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 测试计划实例表 test_plan
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class TestPlan extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 3214537838879582503L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 测试计划编码 */
|
||||
@Excel(name = "测试计划编码")
|
||||
private String serialNumber;
|
||||
|
||||
/** 测试计划名称 */
|
||||
@Excel(name = "测试计划名称")
|
||||
private String name;
|
||||
|
||||
/** 状态(0,未开始,1,进行中,2,已完成,3,已终止) */
|
||||
@Excel(name = "状态(0,未开始,1,进行中,2,已完成,3,已终止)")
|
||||
private String status;
|
||||
|
||||
/** 负责人 */
|
||||
@Excel(name = "负责人")
|
||||
private String manager;
|
||||
|
||||
/** 测试计划开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "测试计划开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
|
||||
/** 测试计划结束时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "测试计划结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
|
||||
/** 版本 */
|
||||
@Excel(name = "版本")
|
||||
private String version;
|
||||
|
||||
/** 0,正常,1,删除 */
|
||||
private String delFlag;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.test.test.domain.qo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.test.common.core.domain.BaseEntity;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 测试计划新增请求QO
|
||||
*
|
||||
* @author pfl
|
||||
*/
|
||||
@Data
|
||||
public class TestPlanAddQO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 3693196640830164441L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 测试计划id */
|
||||
private Long planId;
|
||||
|
||||
/** 测试计划编码 */
|
||||
private String serialNumber;
|
||||
|
||||
/** 测试计划名称 */
|
||||
private String name;
|
||||
|
||||
/** 状态(0,未开始,1,进行中,2,已完成,3,已终止) */
|
||||
private String status;
|
||||
|
||||
/** 负责人 */
|
||||
private String manager;
|
||||
|
||||
/** 测试计划开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
|
||||
/** 测试计划结束时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
|
||||
/** 版本 */
|
||||
private String version;
|
||||
|
||||
/** 0,正常,1,删除 */
|
||||
private String delFlag;
|
||||
|
||||
/** 关联需求id */
|
||||
private Long projectId;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.test.test.domain.qo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 查询测试计划列表请求参数qo
|
||||
*
|
||||
* @author pfl
|
||||
*/
|
||||
@Data
|
||||
public class TestPlanListQO implements Serializable {
|
||||
|
||||
|
||||
private static final long serialVersionUID = -1058615526393949211L;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String manager;
|
||||
|
||||
/**
|
||||
* 测试计划名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 测试计划开始时间起始时间
|
||||
*/
|
||||
private Date startPlanTime;
|
||||
|
||||
/**
|
||||
* 测试计划开始时间结束时间
|
||||
*/
|
||||
private Date endPlanTime;
|
||||
|
||||
/**
|
||||
* 测试计划截止时间起始时间
|
||||
*/
|
||||
private Date startDeadline;
|
||||
|
||||
/**
|
||||
* 测试计划截止时间结束时间
|
||||
*/
|
||||
private Date endDeadline;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.test.test.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.test.common.annotation.Excel;
|
||||
import com.test.common.core.domain.BaseEntity;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TestPlanListVO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 7768851691630986105L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 测试计划编码 */
|
||||
@Excel(name = "测试计划编码")
|
||||
private String serialNumber;
|
||||
|
||||
/** 测试计划名称 */
|
||||
@Excel(name = "测试计划名称")
|
||||
private String name;
|
||||
|
||||
/** 状态(0,未开始,1,进行中,2,已完成,3,已终止) */
|
||||
@Excel(name = "状态(0,未开始,1,进行中,2,已完成,3,已终止)")
|
||||
private String status;
|
||||
|
||||
/** 负责人 */
|
||||
@Excel(name = "负责人")
|
||||
private String manager;
|
||||
|
||||
/** 测试计划开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "测试计划开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
|
||||
/** 测试计划结束时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "测试计划结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
|
||||
/** 版本 */
|
||||
@Excel(name = "版本")
|
||||
private String version;
|
||||
|
||||
/** 0,正常,1,删除 */
|
||||
private String delFlag;
|
||||
|
||||
/** 缺陷数量 */
|
||||
@Excel(name = "缺陷数量")
|
||||
private String defectNum;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.test.test.mapper;
|
||||
|
||||
import com.test.test.domain.TestPlan;
|
||||
import com.test.test.domain.qo.TestPlanListQO;
|
||||
import com.test.test.domain.vo.TestPlanListVO;
|
||||
import java.util.List;
|
||||
|
||||
public interface TestPlanMapper {
|
||||
|
||||
/**
|
||||
* 查询测试计划列表
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
List<TestPlanListVO> selectTestPlanList(TestPlanListQO qo);
|
||||
|
||||
/**
|
||||
* 新增测试计划
|
||||
* @param testPlan
|
||||
* @return
|
||||
*/
|
||||
int insertTestPlan(TestPlan testPlan);
|
||||
|
||||
/**
|
||||
* 根据id查询测试计划
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
TestPlan selectTestPlanById(Long id);
|
||||
|
||||
/**
|
||||
* 修改测试计划
|
||||
* @param testPlan
|
||||
* @return
|
||||
*/
|
||||
int updateTestPlan(TestPlan testPlan);
|
||||
|
||||
/**
|
||||
* 根据序列号查询测试计划id
|
||||
* @param serialNumber
|
||||
* @return
|
||||
*/
|
||||
Long selectPlanId(String serialNumber);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.test.test.mapper;
|
||||
|
||||
import com.test.test.domain.qo.TestPlanAddQO;
|
||||
|
||||
public interface TestProjectPlanMapper {
|
||||
|
||||
/**
|
||||
* 新增测试计划需求关联
|
||||
* @param testPlanAddQO
|
||||
* @return
|
||||
*/
|
||||
int insertTestProjectPlan(TestPlanAddQO testPlanAddQO);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.test.test.service;
|
||||
|
||||
import com.test.test.domain.TestPlan;
|
||||
import com.test.test.domain.qo.TestPlanAddQO;
|
||||
import com.test.test.domain.qo.TestPlanListQO;
|
||||
import com.test.test.domain.vo.TestPlanListVO;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 测试计划Service接口
|
||||
*
|
||||
* @author pfl
|
||||
*/
|
||||
public interface ITestPlanService {
|
||||
|
||||
|
||||
/**
|
||||
* 查询测试计划列表
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
List<TestPlanListVO> getPlanList(TestPlanListQO qo);
|
||||
|
||||
/**
|
||||
* 新增测试计划
|
||||
* @param testPlanAddQO
|
||||
* @return
|
||||
*/
|
||||
public int insertTestPlan(TestPlanAddQO testPlanAddQO);
|
||||
|
||||
/**
|
||||
* 查询测试计划详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public TestPlan selectTestPlanById(Long id);
|
||||
|
||||
/**
|
||||
* 修改测试计划
|
||||
* @param testPlan
|
||||
* @return
|
||||
*/
|
||||
public int updateTestPlan(TestPlan testPlan);
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.test.test.service.impl;
|
||||
|
||||
import com.test.common.utils.DateUtils;
|
||||
import com.test.common.utils.bean.BeanUtils;
|
||||
import com.test.test.domain.TestPlan;
|
||||
import com.test.test.domain.qo.TestPlanAddQO;
|
||||
import com.test.test.domain.qo.TestPlanListQO;
|
||||
import com.test.test.domain.vo.TestPlanListVO;
|
||||
import com.test.test.mapper.TestPlanMapper;
|
||||
import com.test.test.mapper.TestProjectPlanMapper;
|
||||
import com.test.test.service.ITestPlanService;
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 测试计划Service实现类
|
||||
*
|
||||
* @author pfl
|
||||
*/
|
||||
@Service
|
||||
public class TestPlanServiceImpl implements ITestPlanService {
|
||||
|
||||
@Resource
|
||||
private TestPlanMapper testPlanMapper;
|
||||
|
||||
@Resource
|
||||
private TestProjectPlanMapper testProjectPlanMapper;
|
||||
|
||||
/**
|
||||
* 查询测试计划列表
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<TestPlanListVO> getPlanList(TestPlanListQO qo) {
|
||||
return testPlanMapper.selectTestPlanList(qo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增测试计划
|
||||
* @param testPlanAddQO
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertTestPlan(TestPlanAddQO testPlanAddQO) {
|
||||
TestPlan testPlan = new TestPlan();
|
||||
BeanUtils.copyProperties(testPlanAddQO,testPlan);
|
||||
testPlan.setCreateTime(DateUtils.getNowDate());
|
||||
testPlan.setDelFlag("0");
|
||||
testPlan.setStatus("0");
|
||||
// 新增测试计划
|
||||
testPlanMapper.insertTestPlan(testPlan);
|
||||
testPlanAddQO.setCreateTime(DateUtils.getNowDate());
|
||||
Long planId = testPlanMapper.selectPlanId(testPlanAddQO.getSerialNumber());
|
||||
testPlanAddQO.setPlanId(planId);
|
||||
testPlanAddQO.setDelFlag("0");
|
||||
//新增测试计划需求关联表
|
||||
return testProjectPlanMapper.insertTestProjectPlan(testPlanAddQO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询测试计划详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public TestPlan selectTestPlanById(Long id) {
|
||||
return testPlanMapper.selectTestPlanById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改测试计划
|
||||
* @param testPlan
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int updateTestPlan(TestPlan testPlan) {
|
||||
testPlan.setUpdateTime(DateUtils.getNowDate());
|
||||
return testPlanMapper.updateTestPlan(testPlan);
|
||||
}
|
||||
}
|
||||
131
test-test/src/main/resources/mapper/test/TestPlanMapper.xml
Normal file
131
test-test/src/main/resources/mapper/test/TestPlanMapper.xml
Normal file
@@ -0,0 +1,131 @@
|
||||
<?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.test.test.mapper.TestPlanMapper">
|
||||
|
||||
<resultMap type="TestPlan" id="TestPlanResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="serialNumber" column="serial_number"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="manager" column="manager"/>
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<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="selectTestPlanVo">
|
||||
SELECT id,
|
||||
serial_number,
|
||||
name,
|
||||
status,
|
||||
manager,
|
||||
start_time,
|
||||
end_time,
|
||||
create_time,
|
||||
update_time,
|
||||
version,
|
||||
del_flag
|
||||
FROM test_plan
|
||||
</sql>
|
||||
|
||||
<insert id="insertTestPlan" parameterType="testPlan">
|
||||
insert into test_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="serialNumber != null and serialNumber != ''">serial_number,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="manager != null and manager != ''">manager,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="version != null">version,</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="serialNumber != null and serialNumber != ''">#{serialNumber},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="manager != null and manager != ''">#{manager},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="version != null">#{version},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTestPlan" parameterType="TestPlan">
|
||||
update test_plan
|
||||
<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="status != null and status != ''">status = #{status},</if>
|
||||
<if test="manager != null and manager != ''">manager = #{manager},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</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>
|
||||
|
||||
<select id="selectTestPlanList" parameterType="TestPlanListQO" resultType="TestPlanListVO">
|
||||
SELECT
|
||||
tp.id,
|
||||
tp.serial_number AS serialNumber,
|
||||
tp.name,
|
||||
tp.status,
|
||||
su.user_name AS manager,
|
||||
tp.start_time AS startTime,
|
||||
tp.end_time AS endTime,
|
||||
tp.version,
|
||||
(
|
||||
SELECT COUNT(1) FROM test_plan_defect tpd
|
||||
WHERE tpd.plan_id = tp.id
|
||||
AND tpd.del_flag = '0'
|
||||
) AS defectNum
|
||||
FROM test_plan tp
|
||||
LEFT JOIN sys_user su ON su.user_id = tp.manager
|
||||
where 1=1
|
||||
AND tp.del_flag = '0'
|
||||
<if test="status != null and status != ''">
|
||||
AND tp.status = #{status}
|
||||
</if>
|
||||
<if test="manager != null and manager != ''">
|
||||
AND tp.manager = #{manager}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND tp.name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="startPlanTime != null">
|
||||
AND DATE_FORMAT(IFNULL(tp.start_time,''),'%Y%m%d') <![CDATA[ >= ]]> DATE_FORMAT(#{startPlanTime},'%Y%m%d')
|
||||
</if>
|
||||
<if test="endPlanTime != null">
|
||||
AND DATE_FORMAT(IFNULL(tp.start_time,''),'%Y%m%d') <![CDATA[ <= ]]> DATE_FORMAT(#{endPlanTime},'%Y%m%d')
|
||||
</if>
|
||||
<if test="startDeadline != null">
|
||||
AND DATE_FORMAT(IFNULL(tp.end_time,''),'%Y%m%d') <![CDATA[ >= ]]> DATE_FORMAT(#{startDeadline},'%Y%m%d')
|
||||
</if>
|
||||
<if test="endDeadline != null">
|
||||
AND DATE_FORMAT(IFNULL(tp.end_time,''),'%Y%m%d') <![CDATA[ <= ]]> DATE_FORMAT(#{endDeadline},'%Y%m%d')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectTestPlanById" parameterType="Long" resultMap="TestPlanResult">
|
||||
<include refid="selectTestPlanVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectPlanId" resultType="Long">
|
||||
select id from test_plan where serial_number = #{serialNumber} and del_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -127,6 +127,7 @@
|
||||
FROM test_project tp
|
||||
LEFT JOIN sys_user su ON su.user_id = tp.manager
|
||||
where 1=1
|
||||
AND tp.del_flag = '0'
|
||||
<if test="serialNumber != null and serialNumber != ''">
|
||||
AND serial_number LIKE concat('%', #{serialNumber}, '%')
|
||||
</if>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?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.test.test.mapper.TestProjectPlanMapper">
|
||||
|
||||
<insert id="insertTestProjectPlan" parameterType="testPlanAddQO">
|
||||
insert into test_project_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null and projectId != ''">project_id,</if>
|
||||
<if test="planId != null and planId != ''">plan_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="version != null">version,</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null and projectId != ''">#{projectId},</if>
|
||||
<if test="planId != null and planId != ''">#{planId},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="version != null">#{version},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user