Files
saas-houduan/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/RmAgentManagementMapper.xml
T

150 lines
9.2 KiB
XML

<?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.RmAgentManagementMapper">
<resultMap type="RmAgentManagement" id="RmAgentManagementResult">
<result property="id" column="id" />
<result property="hardwareSn" column="hardware_sn" />
<result property="resourceName" column="resource_name" />
<result property="internalIp" column="internal_ip" />
<result property="status" column="status" />
<result property="agentVersion" column="agent_version" />
<result property="method" column="method" />
<result property="scheduledUpdateTime" column="scheduled_update_time" />
<result property="fileUrlType" column="file_url_type" />
<result property="fileUrl" column="file_url" />
<result property="fileDirectory" column="file_directory" />
<result property="lastUpdateResult" column="last_update_result" />
<result property="lastUpdateTime" column="last_update_time" />
<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="selectRmAgentManagementVo">
select id, hardware_sn, resource_name, internal_ip, status, agent_version, method, scheduled_update_time, file_url_type, file_url, file_directory, last_update_result, last_update_time, create_time, update_time, create_by, update_by from rm_agent_management
</sql>
<select id="selectRmAgentManagementList" parameterType="RmAgentManagement" resultMap="RmAgentManagementResult">
<include refid="selectRmAgentManagementVo"/>
<where>
<if test="hardwareSn != null and hardwareSn != ''"> and hardware_sn = #{hardwareSn}</if>
<if test="resourceName != null and resourceName != ''"> and resource_name like concat('%', #{resourceName}, '%')</if>
<if test="internalIp != null and internalIp != ''"> and internal_ip = #{internalIp}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="agentVersion != null and agentVersion != ''"> and agent_version = #{agentVersion}</if>
<if test="method != null "> and method = #{method}</if>
<if test="scheduledUpdateTime != null and scheduledUpdateTime != ''"> and scheduled_update_time = #{scheduledUpdateTime}</if>
<if test="fileUrlType != null "> and file_url_type = #{fileUrlType}</if>
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
<if test="fileDirectory != null and fileDirectory != ''"> and file_directory = #{fileDirectory}</if>
<if test="lastUpdateResult != null and lastUpdateResult != ''"> and last_update_result = #{lastUpdateResult}</if>
<if test="lastUpdateTime != null "> and last_update_time = #{lastUpdateTime}</if>
<if test="queryName != null and queryName != '' "> and (resource_name like concat('%', #{resourceName}, '%') or internal_ip = #{internalIp})</if>
</where>
</select>
<select id="selectRmAgentManagementById" parameterType="Long" resultMap="RmAgentManagementResult">
<include refid="selectRmAgentManagementVo"/>
where id = #{id}
</select>
<insert id="insertRmAgentManagement" parameterType="RmAgentManagement" useGeneratedKeys="true" keyProperty="id">
insert into rm_agent_management
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="hardwareSn != null and hardwareSn != ''">hardware_sn,</if>
<if test="resourceName != null and resourceName != ''">resource_name,</if>
<if test="internalIp != null">internal_ip,</if>
<if test="status != null and status != ''">status,</if>
<if test="agentVersion != null">agent_version,</if>
<if test="method != null">method,</if>
<if test="scheduledUpdateTime != null">scheduled_update_time,</if>
<if test="fileUrlType != null">file_url_type,</if>
<if test="fileUrl != null">file_url,</if>
<if test="fileDirectory != null">file_directory,</if>
<if test="lastUpdateResult != null">last_update_result,</if>
<if test="lastUpdateTime != null">last_update_time,</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="hardwareSn != null and hardwareSn != ''">#{hardwareSn},</if>
<if test="resourceName != null and resourceName != ''">#{resourceName},</if>
<if test="internalIp != null">#{internalIp},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="agentVersion != null">#{agentVersion},</if>
<if test="method != null">#{method},</if>
<if test="scheduledUpdateTime != null">#{scheduledUpdateTime},</if>
<if test="fileUrlType != null">#{fileUrlType},</if>
<if test="fileUrl != null">#{fileUrl},</if>
<if test="fileDirectory != null">#{fileDirectory},</if>
<if test="lastUpdateResult != null">#{lastUpdateResult},</if>
<if test="lastUpdateTime != null">#{lastUpdateTime},</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="updateRmAgentManagement" parameterType="RmAgentManagement">
update rm_agent_management
<trim prefix="SET" suffixOverrides=",">
<if test="hardwareSn != null and hardwareSn != ''">hardware_sn = #{hardwareSn},</if>
<if test="resourceName != null and resourceName != ''">resource_name = #{resourceName},</if>
<if test="internalIp != null">internal_ip = #{internalIp},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="agentVersion != null">agent_version = #{agentVersion},</if>
<if test="method != null">method = #{method},</if>
<if test="scheduledUpdateTime != null">scheduled_update_time = #{scheduledUpdateTime},</if>
<if test="fileUrlType != null">file_url_type = #{fileUrlType},</if>
<if test="fileUrl != null">file_url = #{fileUrl},</if>
<if test="fileDirectory != null">file_directory = #{fileDirectory},</if>
<if test="lastUpdateResult != null">last_update_result = #{lastUpdateResult},</if>
<if test="lastUpdateTime != null">last_update_time = #{lastUpdateTime},</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>
<update id="updateRmAgentManagementBySn" parameterType="RmAgentManagement">
update rm_agent_management
<trim prefix="SET" suffixOverrides=",">
<if test="resourceName != null and resourceName != ''">resource_name = #{resourceName},</if>
<if test="internalIp != null">internal_ip = #{internalIp},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="agentVersion != null">agent_version = #{agentVersion},</if>
<if test="method != null">method = #{method},</if>
<if test="scheduledUpdateTime != null">scheduled_update_time = #{scheduledUpdateTime},</if>
<if test="fileUrlType != null">file_url_type = #{fileUrlType},</if>
<if test="fileUrl != null">file_url = #{fileUrl},</if>
<if test="fileDirectory != null">file_directory = #{fileDirectory},</if>
<if test="lastUpdateResult != null">last_update_result = #{lastUpdateResult},</if>
<if test="lastUpdateTime != null">last_update_time = #{lastUpdateTime},</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 hardware_sn = #{hardwareSn}
</update>
<delete id="deleteRmAgentManagementById" parameterType="Long">
delete from rm_agent_management where id = #{id}
</delete>
<delete id="deleteRmAgentManagementByIds" parameterType="String">
delete from rm_agent_management where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>