|
@@ -0,0 +1,70 @@
|
|
|
+<?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.phm.manage.mapper.GlobalIdRegisterMapper">
|
|
|
+
|
|
|
+ <resultMap type="GlobalIdRegister" id="GlobalIdRegisterResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="machine" column="machine" />
|
|
|
+ <result property="machineId" column="machine_id" />
|
|
|
+ <result property="datacenterId" column="datacenter_id" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectGlobalIdRegisterVo">
|
|
|
+ select id, machine, machine_id, datacenter_id from phm_global_id_register
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectGlobalIdRegisterList" parameterType="GlobalIdRegister" resultMap="GlobalIdRegisterResult">
|
|
|
+ <include refid="selectGlobalIdRegisterVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="machine != null "> and machine = #{machine}</if>
|
|
|
+ <if test="machineId != null "> and machine_id = #{machineId}</if>
|
|
|
+ <if test="datacenterId != null "> and datacenter_id = #{datacenterId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectGlobalIdRegisterById" parameterType="Long" resultMap="GlobalIdRegisterResult">
|
|
|
+ <include refid="selectGlobalIdRegisterVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+ <select id="selectGlobalIdRegister" parameterType="Long" resultMap="GlobalIdRegisterResult">
|
|
|
+ <include refid="selectGlobalIdRegisterVo"/>
|
|
|
+ order by id desc limit 1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertGlobalIdRegister" parameterType="GlobalIdRegister" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into phm_global_id_register
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="machine != null and machine != ''">machine,</if>
|
|
|
+ <if test="machineId != null">machine_id,</if>
|
|
|
+ <if test="datacenterId != null">datacenter_id,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="machine != null and machine != ''">#{machine},</if>
|
|
|
+ <if test="machineId != null">#{machineId},</if>
|
|
|
+ <if test="datacenterId != null">#{datacenterId},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateGlobalIdRegister" parameterType="GlobalIdRegister">
|
|
|
+ update phm_global_id_register
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="machine != null and machine != ''">machine = #{machine},</if>
|
|
|
+ <if test="machineId != null">machine_id = #{machineId},</if>
|
|
|
+ <if test="datacenterId != null">datacenter_id = #{datacenterId},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteGlobalIdRegisterById" parameterType="Long">
|
|
|
+ delete from phm_global_id_register where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteGlobalIdRegisterByIds" parameterType="String">
|
|
|
+ delete from phm_global_id_register where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|