refactor: 去掉message_task中的username字段,字段名以下划线分割
This commit is contained in:
parent
ff5a52d966
commit
d2b1473c71
|
@ -12,11 +12,9 @@ public class MessageTask implements Serializable {
|
|||
|
||||
private String event;
|
||||
|
||||
private String userid;
|
||||
private String userId;
|
||||
|
||||
private String username;
|
||||
|
||||
private String tasktype;
|
||||
private String taskType;
|
||||
|
||||
private String webhook;
|
||||
|
||||
|
|
|
@ -314,213 +314,143 @@ public class MessageTaskExample {
|
|||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUseridIsNull() {
|
||||
addCriterion("userId is null");
|
||||
public Criteria andUserIdIsNull() {
|
||||
addCriterion("user_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUseridIsNotNull() {
|
||||
addCriterion("userId is not null");
|
||||
public Criteria andUserIdIsNotNull() {
|
||||
addCriterion("user_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUseridEqualTo(String value) {
|
||||
addCriterion("userId =", value, "userid");
|
||||
public Criteria andUserIdEqualTo(String value) {
|
||||
addCriterion("user_id =", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUseridNotEqualTo(String value) {
|
||||
addCriterion("userId <>", value, "userid");
|
||||
public Criteria andUserIdNotEqualTo(String value) {
|
||||
addCriterion("user_id <>", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUseridGreaterThan(String value) {
|
||||
addCriterion("userId >", value, "userid");
|
||||
public Criteria andUserIdGreaterThan(String value) {
|
||||
addCriterion("user_id >", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUseridGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("userId >=", value, "userid");
|
||||
public Criteria andUserIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("user_id >=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUseridLessThan(String value) {
|
||||
addCriterion("userId <", value, "userid");
|
||||
public Criteria andUserIdLessThan(String value) {
|
||||
addCriterion("user_id <", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUseridLessThanOrEqualTo(String value) {
|
||||
addCriterion("userId <=", value, "userid");
|
||||
public Criteria andUserIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("user_id <=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUseridLike(String value) {
|
||||
addCriterion("userId like", value, "userid");
|
||||
public Criteria andUserIdLike(String value) {
|
||||
addCriterion("user_id like", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUseridNotLike(String value) {
|
||||
addCriterion("userId not like", value, "userid");
|
||||
public Criteria andUserIdNotLike(String value) {
|
||||
addCriterion("user_id not like", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUseridIn(List<String> values) {
|
||||
addCriterion("userId in", values, "userid");
|
||||
public Criteria andUserIdIn(List<String> values) {
|
||||
addCriterion("user_id in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUseridNotIn(List<String> values) {
|
||||
addCriterion("userId not in", values, "userid");
|
||||
public Criteria andUserIdNotIn(List<String> values) {
|
||||
addCriterion("user_id not in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUseridBetween(String value1, String value2) {
|
||||
addCriterion("userId between", value1, value2, "userid");
|
||||
public Criteria andUserIdBetween(String value1, String value2) {
|
||||
addCriterion("user_id between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUseridNotBetween(String value1, String value2) {
|
||||
addCriterion("userId not between", value1, value2, "userid");
|
||||
public Criteria andUserIdNotBetween(String value1, String value2) {
|
||||
addCriterion("user_id not between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUsernameIsNull() {
|
||||
addCriterion("userName is null");
|
||||
public Criteria andTaskTypeIsNull() {
|
||||
addCriterion("task_type is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUsernameIsNotNull() {
|
||||
addCriterion("userName is not null");
|
||||
public Criteria andTaskTypeIsNotNull() {
|
||||
addCriterion("task_type is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUsernameEqualTo(String value) {
|
||||
addCriterion("userName =", value, "username");
|
||||
public Criteria andTaskTypeEqualTo(String value) {
|
||||
addCriterion("task_type =", value, "taskType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUsernameNotEqualTo(String value) {
|
||||
addCriterion("userName <>", value, "username");
|
||||
public Criteria andTaskTypeNotEqualTo(String value) {
|
||||
addCriterion("task_type <>", value, "taskType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUsernameGreaterThan(String value) {
|
||||
addCriterion("userName >", value, "username");
|
||||
public Criteria andTaskTypeGreaterThan(String value) {
|
||||
addCriterion("task_type >", value, "taskType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUsernameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("userName >=", value, "username");
|
||||
public Criteria andTaskTypeGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("task_type >=", value, "taskType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUsernameLessThan(String value) {
|
||||
addCriterion("userName <", value, "username");
|
||||
public Criteria andTaskTypeLessThan(String value) {
|
||||
addCriterion("task_type <", value, "taskType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUsernameLessThanOrEqualTo(String value) {
|
||||
addCriterion("userName <=", value, "username");
|
||||
public Criteria andTaskTypeLessThanOrEqualTo(String value) {
|
||||
addCriterion("task_type <=", value, "taskType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUsernameLike(String value) {
|
||||
addCriterion("userName like", value, "username");
|
||||
public Criteria andTaskTypeLike(String value) {
|
||||
addCriterion("task_type like", value, "taskType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUsernameNotLike(String value) {
|
||||
addCriterion("userName not like", value, "username");
|
||||
public Criteria andTaskTypeNotLike(String value) {
|
||||
addCriterion("task_type not like", value, "taskType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUsernameIn(List<String> values) {
|
||||
addCriterion("userName in", values, "username");
|
||||
public Criteria andTaskTypeIn(List<String> values) {
|
||||
addCriterion("task_type in", values, "taskType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUsernameNotIn(List<String> values) {
|
||||
addCriterion("userName not in", values, "username");
|
||||
public Criteria andTaskTypeNotIn(List<String> values) {
|
||||
addCriterion("task_type not in", values, "taskType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUsernameBetween(String value1, String value2) {
|
||||
addCriterion("userName between", value1, value2, "username");
|
||||
public Criteria andTaskTypeBetween(String value1, String value2) {
|
||||
addCriterion("task_type between", value1, value2, "taskType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUsernameNotBetween(String value1, String value2) {
|
||||
addCriterion("userName not between", value1, value2, "username");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTasktypeIsNull() {
|
||||
addCriterion("taskType is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTasktypeIsNotNull() {
|
||||
addCriterion("taskType is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTasktypeEqualTo(String value) {
|
||||
addCriterion("taskType =", value, "tasktype");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTasktypeNotEqualTo(String value) {
|
||||
addCriterion("taskType <>", value, "tasktype");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTasktypeGreaterThan(String value) {
|
||||
addCriterion("taskType >", value, "tasktype");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTasktypeGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("taskType >=", value, "tasktype");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTasktypeLessThan(String value) {
|
||||
addCriterion("taskType <", value, "tasktype");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTasktypeLessThanOrEqualTo(String value) {
|
||||
addCriterion("taskType <=", value, "tasktype");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTasktypeLike(String value) {
|
||||
addCriterion("taskType like", value, "tasktype");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTasktypeNotLike(String value) {
|
||||
addCriterion("taskType not like", value, "tasktype");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTasktypeIn(List<String> values) {
|
||||
addCriterion("taskType in", values, "tasktype");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTasktypeNotIn(List<String> values) {
|
||||
addCriterion("taskType not in", values, "tasktype");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTasktypeBetween(String value1, String value2) {
|
||||
addCriterion("taskType between", value1, value2, "tasktype");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTasktypeNotBetween(String value1, String value2) {
|
||||
addCriterion("taskType not between", value1, value2, "tasktype");
|
||||
public Criteria andTaskTypeNotBetween(String value1, String value2) {
|
||||
addCriterion("task_type not between", value1, value2, "taskType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,247 +1,228 @@
|
|||
<?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="io.metersphere.base.mapper.MessageTaskMapper">
|
||||
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.MessageTask">
|
||||
<id column="id" jdbcType="VARCHAR" property="id"/>
|
||||
<result column="type" jdbcType="VARCHAR" property="type"/>
|
||||
<result column="event" jdbcType="VARCHAR" property="event"/>
|
||||
<result column="userId" jdbcType="VARCHAR" property="userid"/>
|
||||
<result column="userName" jdbcType="VARCHAR" property="username"/>
|
||||
<result column="taskType" jdbcType="VARCHAR" property="tasktype"/>
|
||||
<result column="webhook" jdbcType="VARCHAR" property="webhook"/>
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="("
|
||||
separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.MessageTask">
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="event" jdbcType="VARCHAR" property="event" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="task_type" jdbcType="VARCHAR" property="taskType" />
|
||||
<result column="webhook" jdbcType="VARCHAR" property="webhook" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
AND ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
AND ${criterion.condition} #{criterion.value} AND #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
AND ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="("
|
||||
separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, `type`, event, userId, userName, taskType, webhook
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="io.metersphere.base.domain.MessageTaskExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
AND ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
AND ${criterion.condition} #{criterion.value} AND #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
AND ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from message_task
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from message_task
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from message_task
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, `type`, event, user_id, task_type, webhook
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="io.metersphere.base.domain.MessageTaskExample" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<if test="distinct">
|
||||
DISTINCT
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
FROM message_task
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
ORDER BY ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM message_task
|
||||
WHERE id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
DELETE FROM message_task
|
||||
WHERE id = #{id,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.MessageTaskExample">
|
||||
delete from message_task
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.MessageTask">
|
||||
insert into message_task (id, `type`, event,
|
||||
userId, userName, taskType,
|
||||
webhook)
|
||||
values (#{id,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{event,jdbcType=VARCHAR},
|
||||
#{userid,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{tasktype,jdbcType=VARCHAR},
|
||||
#{webhook,jdbcType=VARCHAR})
|
||||
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.MessageTaskExample">
|
||||
DELETE FROM message_task
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.MessageTask">
|
||||
INSERT INTO message_task (id, `type`, event,
|
||||
user_id, task_type, webhook
|
||||
)
|
||||
VALUES (#{id,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{event,jdbcType=VARCHAR},
|
||||
#{userId,jdbcType=VARCHAR}, #{taskType,jdbcType=VARCHAR}, #{webhook,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.MessageTask">
|
||||
insert into message_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type`,
|
||||
</if>
|
||||
<if test="event != null">
|
||||
event,
|
||||
</if>
|
||||
<if test="userid != null">
|
||||
userId,
|
||||
</if>
|
||||
<if test="username != null">
|
||||
userName,
|
||||
</if>
|
||||
<if test="tasktype != null">
|
||||
taskType,
|
||||
</if>
|
||||
<if test="webhook != null">
|
||||
webhook,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="event != null">
|
||||
#{event,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userid != null">
|
||||
#{userid,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="username != null">
|
||||
#{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tasktype != null">
|
||||
#{tasktype,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="webhook != null">
|
||||
#{webhook,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="io.metersphere.base.domain.MessageTaskExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from message_task
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update message_task
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
`type` = #{record.type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.event != null">
|
||||
event = #{record.event,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.userid != null">
|
||||
userId = #{record.userid,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.username != null">
|
||||
userName = #{record.username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.tasktype != null">
|
||||
taskType = #{record.tasktype,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.webhook != null">
|
||||
webhook = #{record.webhook,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause"/>
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update message_task
|
||||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.MessageTask">
|
||||
INSERT INTO message_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type`,
|
||||
</if>
|
||||
<if test="event != null">
|
||||
event,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="taskType != null">
|
||||
task_type,
|
||||
</if>
|
||||
<if test="webhook != null">
|
||||
webhook,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="event != null">
|
||||
#{event,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="taskType != null">
|
||||
#{taskType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="webhook != null">
|
||||
#{webhook,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="io.metersphere.base.domain.MessageTaskExample" resultType="java.lang.Long">
|
||||
SELECT count(*) FROM message_task
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
UPDATE message_task
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
`type` = #{record.type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.event != null">
|
||||
event = #{record.event,jdbcType=VARCHAR},
|
||||
userId = #{record.userid,jdbcType=VARCHAR},
|
||||
userName = #{record.username,jdbcType=VARCHAR},
|
||||
taskType = #{record.tasktype,jdbcType=VARCHAR},
|
||||
webhook = #{record.webhook,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause"/>
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.MessageTask">
|
||||
update message_task
|
||||
<set>
|
||||
<if test="type != null">
|
||||
`type` = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="event != null">
|
||||
event = #{event,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userid != null">
|
||||
userId = #{userid,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="username != null">
|
||||
userName = #{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tasktype != null">
|
||||
taskType = #{tasktype,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="webhook != null">
|
||||
webhook = #{webhook,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.MessageTask">
|
||||
update message_task
|
||||
set `type` = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.taskType != null">
|
||||
task_type = #{record.taskType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.webhook != null">
|
||||
webhook = #{record.webhook,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
UPDATE message_task
|
||||
SET id = #{record.id,jdbcType=VARCHAR},
|
||||
`type` = #{record.type,jdbcType=VARCHAR},
|
||||
event = #{record.event,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
task_type = #{record.taskType,jdbcType=VARCHAR},
|
||||
webhook = #{record.webhook,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.MessageTask">
|
||||
UPDATE message_task
|
||||
<set>
|
||||
<if test="type != null">
|
||||
`type` = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="event != null">
|
||||
event = #{event,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="taskType != null">
|
||||
task_type = #{taskType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="webhook != null">
|
||||
webhook = #{webhook,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.MessageTask">
|
||||
UPDATE message_task
|
||||
SET `type` = #{type,jdbcType=VARCHAR},
|
||||
event = #{event,jdbcType=VARCHAR},
|
||||
userId = #{userid,jdbcType=VARCHAR},
|
||||
userName = #{username,jdbcType=VARCHAR},
|
||||
taskType = #{tasktype,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
task_type = #{taskType,jdbcType=VARCHAR},
|
||||
webhook = #{webhook,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
WHERE id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
|
@ -92,10 +92,9 @@ public class NoticeService {
|
|||
MessageTask message = new MessageTask();
|
||||
message.setId(UUID.randomUUID().toString());
|
||||
message.setEvent(n);
|
||||
message.setTasktype(list.getTaskType());
|
||||
message.setUserid(m);
|
||||
message.setTaskType(list.getTaskType());
|
||||
message.setUserId(m);
|
||||
message.setType(list.getType());
|
||||
message.setUsername("a");
|
||||
message.setWebhook(list.getWebhook());
|
||||
messageTaskMapper.insert(message);
|
||||
});
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
create table message_task
|
||||
(
|
||||
id varchar(255) not null,
|
||||
type varchar(255) not null comment '消息类型',
|
||||
event varchar(255) not null comment '通知事件类型',
|
||||
userId varchar(500) not null comment '接收人id',
|
||||
userName varchar(500) not null comment '接收人姓名',
|
||||
taskType varchar(255) not null,
|
||||
webhook varchar(255) not null comment 'webhook地址',
|
||||
constraint message_manage_pk
|
||||
primary key (id)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
CREATE TABLE IF NOT EXISTS message_task (
|
||||
id varchar(50) NOT NULL,
|
||||
type varchar(50) NOT NULL COMMENT '消息类型',
|
||||
event varchar(255) NOT NULL COMMENT '通知事件类型',
|
||||
user_id varchar(50) NOT NULL COMMENT '接收人id',
|
||||
task_type varchar(64) NOT NULL,
|
||||
webhook varchar(255) NOT NULL COMMENT 'webhook地址',
|
||||
CONSTRAINT message_manage_pk
|
||||
PRIMARY KEY (id)
|
||||
)
|
||||
ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4;
|
Loading…
Reference in New Issue