VideoCallMapper.xml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.system.mapper.VideoCallMapper">
  6. <resultMap type="VideoCall" id="VideoCallResult">
  7. <result property="id" column="id" />
  8. <result property="userId" column="user_id" />
  9. <result property="callId" column="call_id" />
  10. <result property="content" column="content" />
  11. <result property="answer" column="answer" />
  12. </resultMap>
  13. <sql id="selectVideoCallVo">
  14. select id, user_id,call_id, content,answer from video_call
  15. </sql>
  16. <select id="selectVideoCallList" parameterType="VideoCall" resultMap="VideoCallResult">
  17. <include refid="selectVideoCallVo"/>
  18. <where>
  19. <if test="userId != null "> and user_id = #{userId}</if>
  20. <if test="callId != null "> and call_id = #{callId}</if>
  21. <if test="content != null and content != ''"> and content = #{content}</if>
  22. <if test="answer != null and answer != ''"> and answer = #{answer}</if>
  23. </where>
  24. </select>
  25. <select id="selectVideoCallById" parameterType="Long" resultMap="VideoCallResult">
  26. <include refid="selectVideoCallVo"/>
  27. where id = #{id}
  28. </select>
  29. <insert id="insertVideoCall" parameterType="VideoCall" useGeneratedKeys="true" keyProperty="id">
  30. insert into video_call
  31. <trim prefix="(" suffix=")" suffixOverrides=",">
  32. <if test="userId != null">user_id,</if>
  33. <if test="callId != null">call_id,</if>
  34. <if test="content != null">content,</if>
  35. <if test="answer != null">answer,</if>
  36. </trim>
  37. <trim prefix="values (" suffix=")" suffixOverrides=",">
  38. <if test="userId != null">#{userId},</if>
  39. <if test="callId != null">#{callId},</if>
  40. <if test="content != null">#{content},</if>
  41. <if test="answer != null">#{answer},</if>
  42. </trim>
  43. </insert>
  44. <update id="updateVideoCall" parameterType="VideoCall">
  45. update video_call
  46. <trim prefix="SET" suffixOverrides=",">
  47. <if test="userId != null">user_id = #{userId},</if>
  48. <if test="callId != null">call_id = #{callId},</if>
  49. <if test="content != null">content = #{content},</if>
  50. <if test="answer != null">answer = #{answer},</if>
  51. </trim>
  52. where id = #{id}
  53. </update>
  54. <delete id="deleteVideoCallById" parameterType="Long">
  55. delete from video_call where id = #{id}
  56. </delete>
  57. <delete id="deleteVideoCallByIds" parameterType="String">
  58. delete from video_call where id in
  59. <foreach item="id" collection="array" open="(" separator="," close=")">
  60. #{id}
  61. </foreach>
  62. </delete>
  63. </mapper>