|
@@ -0,0 +1,99 @@
|
|
|
+<?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.slibra.business.mapper.CPhoneMapper">
|
|
|
+
|
|
|
+ <resultMap type="CPhone" id="CPhoneResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="saasId" column="saas_id" />
|
|
|
+ <result property="phoneNum" column="phone_num" />
|
|
|
+ <result property="phonePwd" column="phone_pwd" />
|
|
|
+ <result property="sipServer" column="sip_server" />
|
|
|
+ <result property="wssServer" column="wss_server" />
|
|
|
+ <result property="iceServer" column="ice_server" />
|
|
|
+ <result property="isDelete" column="is_delete" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCPhoneVo">
|
|
|
+ select id, saas_id, phone_num, phone_pwd, sip_server, wss_server, ice_server, is_delete, update_time, create_time from c_phone
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectCPhoneList" parameterType="CPhone" resultMap="CPhoneResult">
|
|
|
+ <include refid="selectCPhoneVo"/>
|
|
|
+ <where>
|
|
|
+ 1 = 1
|
|
|
+ <if test="saasId != null and saasId != ''"> and saas_id = #{saasId}</if>
|
|
|
+ <if test="phoneNum != null and phoneNum != ''"> and phone_num = #{phoneNum}</if>
|
|
|
+ <if test="phonePwd != null and phonePwd != ''"> and phone_pwd = #{phonePwd}</if>
|
|
|
+ <if test="sipServer != null and sipServer != ''"> and sip_server = #{sipServer}</if>
|
|
|
+ <if test="wssServer != null and wssServer != ''"> and wss_server = #{wssServer}</if>
|
|
|
+ <if test="iceServer != null and iceServer != ''"> and ice_server = #{iceServer}</if>
|
|
|
+ <if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
|
|
+ </where>
|
|
|
+ and del_flag = 0 order by id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCPhoneById" parameterType="String" resultMap="CPhoneResult">
|
|
|
+ <include refid="selectCPhoneVo"/>
|
|
|
+ where id = #{id} and del_flag = 0
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertCPhone" parameterType="CPhone" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into c_phone
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="saasId != null and saasId != ''">saas_id,</if>
|
|
|
+ <if test="phoneNum != null and phoneNum != ''">phone_num,</if>
|
|
|
+ <if test="phonePwd != null and phonePwd != ''">phone_pwd,</if>
|
|
|
+ <if test="sipServer != null and sipServer != ''">sip_server,</if>
|
|
|
+ <if test="wssServer != null and wssServer != ''">wss_server,</if>
|
|
|
+ <if test="iceServer != null and iceServer != ''">ice_server,</if>
|
|
|
+ <if test="isDelete != null">is_delete,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="saasId != null and saasId != ''">#{saasId},</if>
|
|
|
+ <if test="phoneNum != null and phoneNum != ''">#{phoneNum},</if>
|
|
|
+ <if test="phonePwd != null and phonePwd != ''">#{phonePwd},</if>
|
|
|
+ <if test="sipServer != null and sipServer != ''">#{sipServer},</if>
|
|
|
+ <if test="wssServer != null and wssServer != ''">#{wssServer},</if>
|
|
|
+ <if test="iceServer != null and iceServer != ''">#{iceServer},</if>
|
|
|
+ <if test="isDelete != null">#{isDelete},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCPhone" parameterType="CPhone">
|
|
|
+ update c_phone
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="saasId != null and saasId != ''">saas_id = #{saasId},</if>
|
|
|
+ <if test="phoneNum != null and phoneNum != ''">phone_num = #{phoneNum},</if>
|
|
|
+ <if test="phonePwd != null and phonePwd != ''">phone_pwd = #{phonePwd},</if>
|
|
|
+ <if test="sipServer != null and sipServer != ''">sip_server = #{sipServer},</if>
|
|
|
+ <if test="wssServer != null and wssServer != ''">wss_server = #{wssServer},</if>
|
|
|
+ <if test="iceServer != null and iceServer != ''">ice_server = #{iceServer},</if>
|
|
|
+ <if test="isDelete != null">is_delete = #{isDelete},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ ,revision = revision + 1
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <delete id="deleteCPhoneById" parameterType="String">
|
|
|
+ update c_phone set del_flag = 2,revision = revision + 1 where del_flag = 0 and id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteCPhoneByIds" parameterType="String">
|
|
|
+ update c_phone set del_flag = 2,revision = revision + 1 where del_flag = 0 and id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|