修改入库bug 资源管理模块bug
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.rocketmq.mapper.InitialSwitchInfoTempMapper">
|
||||
|
||||
|
||||
<resultMap type="InitialSwitchInfoTemp" id="InitialSwitchInfoTempResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
@@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="type" column="type" />
|
||||
<result property="inSpeed" column="in_speed" />
|
||||
<result property="outSpeed" column="out_speed" />
|
||||
<result property="switchIp" column="switch_ip" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@@ -21,12 +22,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInitialSwitchInfoTempVo">
|
||||
select id, client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, create_by, update_by, create_time, update_time from initial_switch_info_temp
|
||||
select id, client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, switch_ip, create_by, update_by, create_time, update_time from initial_switch_info_temp
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialSwitchInfoTempList" parameterType="InitialSwitchInfoTemp" resultMap="InitialSwitchInfoTempResult">
|
||||
<include refid="selectInitialSwitchInfoTempVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="inBytes != null "> and in_bytes = #{inBytes}</if>
|
||||
@@ -35,9 +36,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="inSpeed != null "> and in_speed = #{inSpeed}</if>
|
||||
<if test="outSpeed != null "> and out_speed = #{outSpeed}</if>
|
||||
<if test="switchIp != null and switchIp != ''"> and switch_ip = #{switchIp}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectInitialSwitchInfoTempById" parameterType="Long" resultMap="InitialSwitchInfoTempResult">
|
||||
<include refid="selectInitialSwitchInfoTempVo"/>
|
||||
where id = #{id}
|
||||
@@ -54,11 +56,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="type != null">type,</if>
|
||||
<if test="inSpeed != null">in_speed,</if>
|
||||
<if test="outSpeed != null">out_speed,</if>
|
||||
<if test="switchIp != null">switch_ip,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">#{clientId},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
@@ -68,11 +71,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="inSpeed != null">#{inSpeed},</if>
|
||||
<if test="outSpeed != null">#{outSpeed},</if>
|
||||
<if test="switchIp != null">#{switchIp},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInitialSwitchInfoTemp" parameterType="InitialSwitchInfoTemp">
|
||||
@@ -86,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="inSpeed != null">in_speed = #{inSpeed},</if>
|
||||
<if test="outSpeed != null">out_speed = #{outSpeed},</if>
|
||||
<if test="switchIp != null">switch_ip = #{switchIp},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
@@ -99,7 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialSwitchInfoTempByIds" parameterType="String">
|
||||
delete from initial_switch_info_temp where id in
|
||||
delete from initial_switch_info_temp where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
@@ -107,14 +112,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<insert id="batchInsertInitialSwitchInfoTemp" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO initial_switch_info_temp
|
||||
(
|
||||
client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed,
|
||||
client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, switch_ip,
|
||||
create_by, update_by, create_time, update_time
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.clientId}, #{item.name}, #{item.inBytes}, #{item.outBytes},
|
||||
#{item.status}, #{item.type}, #{item.inSpeed}, #{item.outSpeed}, #{item.createBy}, #{item.updateBy},
|
||||
#{item.status}, #{item.type}, #{item.inSpeed}, #{item.outSpeed}, #{item.switchIp}, #{item.createBy}, #{item.updateBy},
|
||||
<choose>
|
||||
<when test="item.createTime != null">
|
||||
#{item.createTime}
|
||||
@@ -134,7 +139,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="truncateSwitchInfoTemp">
|
||||
truncate table initial_switch_info_temp
|
||||
</update>
|
||||
<delete id="truncateSwitchInfoTemp" parameterType="String">
|
||||
DELETE FROM initial_switch_info_temp
|
||||
WHERE
|
||||
<choose>
|
||||
<when test="clientId != null and clientId != ''">
|
||||
client_id = #{clientId}
|
||||
</when>
|
||||
<otherwise>
|
||||
1=0 <!-- 安全措施:条件不满足时不删除任何数据 -->
|
||||
</otherwise>
|
||||
</choose>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user