修改入库bug 资源管理模块bug
This commit is contained in:
+34
-15
@@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.RmResourceRegistrationMapper">
|
||||
|
||||
|
||||
<resultMap type="RmResourceRegistration" id="RmResourceRegistrationResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="hardwareSn" column="hardware_sn" />
|
||||
@@ -12,9 +12,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="ipAddress" column="ip_address" />
|
||||
<result property="resourcePort" column="resource_port" />
|
||||
<result property="otherPortName" column="other_port_name" />
|
||||
<result property="agentVersion" column="agent_version" />
|
||||
<result property="protocol" column="protocol" />
|
||||
<result property="resourceVersion" column="resource_version" />
|
||||
<result property="rwPermission" column="rw_permission" />
|
||||
<result property="snmpDetect" column="snmp_detect" />
|
||||
<result property="teamName" column="team_name" />
|
||||
<result property="snmpCollectAddr" column="snmp_collect_addr" />
|
||||
<result property="securityLevel" column="security_level" />
|
||||
<result property="encryption" column="encryption" />
|
||||
<result property="resourceUserName" column="resource_user_name" />
|
||||
@@ -34,24 +38,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmResourceRegistrationVo">
|
||||
select id, hardware_sn, resource_type, resource_name, ip_address, resource_port, other_port_name, protocol, resource_version, rw_permission, security_level, encryption, resource_user_name,resource_pwd, registration_status, online_status, description, customer_id, customer_name, service_number, create_time, update_time, creator_id, creator_name, updater_id, updater_name from rm_resource_registration
|
||||
select id, hardware_sn, resource_type, resource_name, ip_address, resource_port, other_port_name, agent_version, protocol, resource_version, rw_permission, snmp_detect, team_name, snmp_collect_addr, security_level, encryption, resource_user_name, resource_pwd, registration_status, online_status, description, customer_id, customer_name, service_number, create_time, update_time, creator_id, creator_name, updater_id, updater_name from rm_resource_registration
|
||||
</sql>
|
||||
|
||||
<select id="selectRmResourceRegistrationList" parameterType="RmResourceRegistration" resultMap="RmResourceRegistrationResult">
|
||||
<include refid="selectRmResourceRegistrationVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="hardwareSn != null and hardwareSn != ''"> and hardware_sn = #{hardwareSn}</if>
|
||||
<if test="resourceType != null and resourceType != ''"> and resource_type = #{resourceType}</if>
|
||||
<if test="resourceName != null and resourceName != ''"> and resource_name like concat('%', #{resourceName}, '%')</if>
|
||||
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
|
||||
<if test="resourcePort != null and resourcePort != ''"> and resource_port = #{resourcePort}</if>
|
||||
<if test="otherPortName != null and otherPortName != ''"> and other_port_name = #{otherPortName}</if>
|
||||
<if test="otherPortName != null and otherPortName != ''"> and other_port_name like concat('%', #{otherPortName}, '%')</if>
|
||||
<if test="agentVersion != null and agentVersion != ''"> and agent_version = #{agentVersion}</if>
|
||||
<if test="protocol != null and protocol != ''"> and protocol = #{protocol}</if>
|
||||
<if test="resourceVersion != null and resourceVersion != ''"> and resource_version = #{resourceVersion}</if>
|
||||
<if test="rwPermission != null and rwPermission != ''"> and rw_permission = #{rwPermission}</if>
|
||||
<if test="snmpDetect != null and snmpDetect != ''"> and snmp_detect = #{snmpDetect}</if>
|
||||
<if test="teamName != null and teamName != ''"> and team_name like concat('%', #{teamName}, '%')</if>
|
||||
<if test="snmpCollectAddr != null and snmpCollectAddr != ''"> and snmp_collect_addr = #{snmpCollectAddr}</if>
|
||||
<if test="securityLevel != null and securityLevel != ''"> and security_level = #{securityLevel}</if>
|
||||
<if test="encryption != null and encryption != ''"> and encryption = #{encryption}</if>
|
||||
<if test="resourceUserName != null and resourceUserName != ''"> and resource_user_name = #{resourceUserName}</if>
|
||||
<if test="resourceUserName != null and resourceUserName != ''"> and resource_user_name like concat('%', #{resourceUserName}, '%')</if>
|
||||
<if test="resourcePwd != null and resourcePwd != ''"> and resource_pwd = #{resourcePwd}</if>
|
||||
<if test="registrationStatus != null and registrationStatus != ''"> and registration_status = #{registrationStatus}</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''"> and online_status = #{onlineStatus}</if>
|
||||
@@ -64,17 +72,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updaterId != null "> and updater_id = #{updaterId}</if>
|
||||
<if test="updaterName != null and updaterName != ''"> and updater_name like concat('%', #{updaterName}, '%')</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectRmResourceRegistrationById" parameterType="Long" resultMap="RmResourceRegistrationResult">
|
||||
<include refid="selectRmResourceRegistrationVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="countBySn" parameterType="String">
|
||||
select count(1) from rm_resource_registration
|
||||
where hardware_sn = #{hardwareSn}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmResourceRegistration" parameterType="RmResourceRegistration" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_resource_registration
|
||||
@@ -85,9 +88,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="ipAddress != null">ip_address,</if>
|
||||
<if test="resourcePort != null">resource_port,</if>
|
||||
<if test="otherPortName != null">other_port_name,</if>
|
||||
<if test="agentVersion != null">agent_version,</if>
|
||||
<if test="protocol != null">protocol,</if>
|
||||
<if test="resourceVersion != null">resource_version,</if>
|
||||
<if test="rwPermission != null">rw_permission,</if>
|
||||
<if test="snmpDetect != null">snmp_detect,</if>
|
||||
<if test="teamName != null">team_name,</if>
|
||||
<if test="snmpCollectAddr != null">snmp_collect_addr,</if>
|
||||
<if test="securityLevel != null">security_level,</if>
|
||||
<if test="encryption != null">encryption,</if>
|
||||
<if test="resourceUserName != null">resource_user_name,</if>
|
||||
@@ -104,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="creatorName != null">creator_name,</if>
|
||||
<if test="updaterId != null">updater_id,</if>
|
||||
<if test="updaterName != null">updater_name,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="hardwareSn != null">#{hardwareSn},</if>
|
||||
<if test="resourceType != null">#{resourceType},</if>
|
||||
@@ -112,9 +119,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="ipAddress != null">#{ipAddress},</if>
|
||||
<if test="resourcePort != null">#{resourcePort},</if>
|
||||
<if test="otherPortName != null">#{otherPortName},</if>
|
||||
<if test="agentVersion != null">#{agentVersion},</if>
|
||||
<if test="protocol != null">#{protocol},</if>
|
||||
<if test="resourceVersion != null">#{resourceVersion},</if>
|
||||
<if test="rwPermission != null">#{rwPermission},</if>
|
||||
<if test="snmpDetect != null">#{snmpDetect},</if>
|
||||
<if test="teamName != null">#{teamName},</if>
|
||||
<if test="snmpCollectAddr != null">#{snmpCollectAddr},</if>
|
||||
<if test="securityLevel != null">#{securityLevel},</if>
|
||||
<if test="encryption != null">#{encryption},</if>
|
||||
<if test="resourceUserName != null">#{resourceUserName},</if>
|
||||
@@ -131,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="creatorName != null">#{creatorName},</if>
|
||||
<if test="updaterId != null">#{updaterId},</if>
|
||||
<if test="updaterName != null">#{updaterName},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRmResourceRegistration" parameterType="RmResourceRegistration">
|
||||
@@ -143,9 +154,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="ipAddress != null">ip_address = #{ipAddress},</if>
|
||||
<if test="resourcePort != null">resource_port = #{resourcePort},</if>
|
||||
<if test="otherPortName != null">other_port_name = #{otherPortName},</if>
|
||||
<if test="agentVersion != null">agent_version = #{agentVersion},</if>
|
||||
<if test="protocol != null">protocol = #{protocol},</if>
|
||||
<if test="resourceVersion != null">resource_version = #{resourceVersion},</if>
|
||||
<if test="rwPermission != null">rw_permission = #{rwPermission},</if>
|
||||
<if test="snmpDetect != null">snmp_detect = #{snmpDetect},</if>
|
||||
<if test="teamName != null">team_name = #{teamName},</if>
|
||||
<if test="snmpCollectAddr != null">snmp_collect_addr = #{snmpCollectAddr},</if>
|
||||
<if test="securityLevel != null">security_level = #{securityLevel},</if>
|
||||
<if test="encryption != null">encryption = #{encryption},</if>
|
||||
<if test="resourceUserName != null">resource_user_name = #{resourceUserName},</if>
|
||||
@@ -171,7 +186,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmResourceRegistrationByIds" parameterType="String">
|
||||
delete from rm_resource_registration where id in
|
||||
delete from rm_resource_registration where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
@@ -186,7 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
<!-- 查询所有资源名称-->
|
||||
<select id="selectAllResourceNameByType" parameterType="RmResourceRegistration" resultType="java.util.Map">
|
||||
select resource_name resourceName from rm_resource_registration
|
||||
select resource_name resourceName,ip_address ipAddress,hardware_sn hardwareSn from rm_resource_registration
|
||||
<where>
|
||||
and registration_status = 1
|
||||
<if test="hardwareSn != null and hardwareSn != ''"> and hardware_sn = #{hardwareSn}</if>
|
||||
@@ -215,4 +230,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</where>
|
||||
group by resource_name
|
||||
</select>
|
||||
<select id="countBySn" parameterType="String">
|
||||
select count(1) from rm_resource_registration
|
||||
where hardware_sn = #{hardwareSn}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user