资源模板以及资源策略模块方法和接口。
This commit is contained in:
@@ -0,0 +1,128 @@
|
||||
<?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.ruoyi.rocketmq.mapper.RmTemplateLinuxMapper">
|
||||
|
||||
<resultMap type="RmTemplateLinux" id="RmTemplateLinuxResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="templateId" column="template_id" />
|
||||
<result property="policyId" column="policy_id" />
|
||||
<result property="itemType" column="item_type" />
|
||||
<result property="metricKey" column="metric_key" />
|
||||
<result property="metricName" column="metric_name" />
|
||||
<result property="dataType" column="data_type" />
|
||||
<result property="monitorStatus" column="monitor_status" />
|
||||
<result property="collectionCycle" column="collection_cycle" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmTemplateLinuxVo">
|
||||
select id, template_id, policy_id, item_type, metric_key, metric_name, data_type, monitor_status, collection_cycle, create_time, update_time, create_by, update_by from rm_template_linux
|
||||
</sql>
|
||||
|
||||
<select id="selectRmTemplateLinuxList" parameterType="RmTemplateLinux" resultMap="RmTemplateLinuxResult">
|
||||
<include refid="selectRmTemplateLinuxVo"/>
|
||||
<where>
|
||||
<if test="templateId != null "> and template_id = #{templateId}</if>
|
||||
<if test="policyId != null "> and policy_id = #{policyId}</if>
|
||||
<if test="itemType != null and itemType != ''"> and item_type = #{itemType}</if>
|
||||
<if test="metricKey != null and metricKey != ''"> and metric_key = #{metricKey}</if>
|
||||
<if test="metricName != null and metricName != ''"> and metric_name like concat('%', #{metricName}, '%')</if>
|
||||
<if test="dataType != null and dataType != ''"> and data_type = #{dataType}</if>
|
||||
<if test="monitorStatus != null and monitorStatus != ''"> and monitor_status = #{monitorStatus}</if>
|
||||
<if test="collectionCycle != null and collectionCycle != ''"> and collection_cycle = #{collectionCycle}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmTemplateLinuxById" parameterType="Long" resultMap="RmTemplateLinuxResult">
|
||||
<include refid="selectRmTemplateLinuxVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmTemplateLinux" parameterType="RmTemplateLinux" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_template_linux
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="templateId != null">template_id,</if>
|
||||
<if test="policyId != null">policy_id,</if>
|
||||
<if test="itemType != null and itemType != ''">item_type,</if>
|
||||
<if test="metricKey != null and metricKey != ''">metric_key,</if>
|
||||
<if test="metricName != null and metricName != ''">metric_name,</if>
|
||||
<if test="dataType != null and dataType != ''">data_type,</if>
|
||||
<if test="monitorStatus != null">monitor_status,</if>
|
||||
<if test="collectionCycle != null">collection_cycle,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="templateId != null">#{templateId},</if>
|
||||
<if test="policyId != null">#{policyId},</if>
|
||||
<if test="itemType != null and itemType != ''">#{itemType},</if>
|
||||
<if test="metricKey != null and metricKey != ''">#{metricKey},</if>
|
||||
<if test="metricName != null and metricName != ''">#{metricName},</if>
|
||||
<if test="dataType != null and dataType != ''">#{dataType},</if>
|
||||
<if test="monitorStatus != null">#{monitorStatus},</if>
|
||||
<if test="collectionCycle != null">#{collectionCycle},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRmTemplateLinux" parameterType="RmTemplateLinux">
|
||||
update rm_template_linux
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="templateId != null">template_id = #{templateId},</if>
|
||||
<if test="policyId != null">policy_id = #{policyId},</if>
|
||||
<if test="itemType != null and itemType != ''">item_type = #{itemType},</if>
|
||||
<if test="metricKey != null and metricKey != ''">metric_key = #{metricKey},</if>
|
||||
<if test="metricName != null and metricName != ''">metric_name = #{metricName},</if>
|
||||
<if test="dataType != null and dataType != ''">data_type = #{dataType},</if>
|
||||
<if test="monitorStatus != null">monitor_status = #{monitorStatus},</if>
|
||||
<if test="collectionCycle != null">collection_cycle = #{collectionCycle},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRmTemplateLinuxById" parameterType="Long">
|
||||
delete from rm_template_linux where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmTemplateLinuxByIds" parameterType="String">
|
||||
delete from rm_template_linux where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<insert id="batchInsertRmTemplateLinux" parameterType="list">
|
||||
insert into rm_template_linux
|
||||
(template_id, policy_id, item_type, metric_key, metric_name, data_type,
|
||||
monitor_status, create_time, update_time, create_by, update_by)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.templateId},
|
||||
#{item.policyId},
|
||||
#{item.itemType},
|
||||
#{item.metricKey},
|
||||
#{item.metricName},
|
||||
#{item.dataType},
|
||||
#{item.monitorStatus},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.createBy},
|
||||
#{item.updateBy}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user