TUTalkMapper.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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.business.slfh.manager.talkmanager.mapper.TUTalkMapper">
  6. <resultMap type="TUTalk" id="TUTalkResult">
  7. <result property="id" column="id" />
  8. <result property="status" column="status" />
  9. <result property="remark" column="remark" />
  10. <result property="delFlag" column="del_flag" />
  11. <result property="createBy" column="create_by" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateBy" column="update_by" />
  14. <result property="updateTime" column="update_time" />
  15. <result property="senderId" column="sender_id" />
  16. <result property="senderName" column="sender_name" />
  17. <result property="sendTime" column="send_time" />
  18. <result property="sendType" column="send_type" />
  19. <result property="context" column="context" />
  20. <result property="eventId" column="event_id" />
  21. <result property="voiceName" column="voice_name" />
  22. <result property="voiceTimelength" column="voice_timelength" />
  23. </resultMap>
  24. <sql id="selectTUTalkVo">
  25. select id, status, remark, del_flag, create_by, create_time, update_by, update_time, sender_id, sender_name, send_time, send_type, context, event_id,voice_name,voice_timelength from t_u_talk
  26. </sql>
  27. <select id="selectTUTalkList" parameterType="TUTalk" resultMap="TUTalkResult">
  28. <include refid="selectTUTalkVo"/>
  29. <where>
  30. <if test="status != null and status != ''"> and status = #{status}</if>
  31. <if test="senderId != null "> and sender_id = #{senderId}</if>
  32. <if test="senderName != null and senderName != ''"> and sender_name like concat('%', #{senderName}, '%')</if>
  33. <if test="sendTime != null "> and send_time = #{sendTime}</if>
  34. <if test="sendType != null and sendType != ''"> and send_type = #{sendType}</if>
  35. <if test="context != null and context != ''"> and context = #{context}</if>
  36. <if test="eventId != null and eventId != ''"> and event_id = #{eventId}</if>
  37. <if test="voiceName != null and voiceName != ''"> and voice_name = #{voiceName}</if>
  38. <if test="voiceTimelength != null and voiceTimelength != ''"> and voice_timelength = #{voiceTimelength}</if>
  39. </where>
  40. order by send_time asc
  41. </select>
  42. <select id="selectTUTalkById" parameterType="String" resultMap="TUTalkResult">
  43. <include refid="selectTUTalkVo"/>
  44. where id = #{id}
  45. </select>
  46. <insert id="insertTUTalk" parameterType="TUTalk">
  47. insert into t_u_talk
  48. <trim prefix="(" suffix=")" suffixOverrides=",">
  49. <if test="id != null">id,</if>
  50. <if test="status != null">status,</if>
  51. <if test="remark != null">remark,</if>
  52. <if test="delFlag != null and delFlag != ''">del_flag,</if>
  53. <if test="createBy != null">create_by,</if>
  54. <if test="createTime != null">create_time,</if>
  55. <if test="updateBy != null">update_by,</if>
  56. <if test="updateTime != null">update_time,</if>
  57. <if test="senderId != null">sender_id,</if>
  58. <if test="senderName != null">sender_name,</if>
  59. <if test="sendTime != null">send_time,</if>
  60. <if test="sendType != null">send_type,</if>
  61. <if test="context != null">context,</if>
  62. <if test="eventId != null">event_id,</if>
  63. <if test="voiceName != null">voice_name,</if>
  64. <if test="voiceTimelength != null">voice_timelength,</if>
  65. </trim>
  66. <trim prefix="values (" suffix=")" suffixOverrides=",">
  67. <if test="id != null">#{id},</if>
  68. <if test="status != null">#{status},</if>
  69. <if test="remark != null">#{remark},</if>
  70. <if test="delFlag != null and delFlag != ''">#{delFlag},</if>
  71. <if test="createBy != null">#{createBy},</if>
  72. <if test="createTime != null">#{createTime},</if>
  73. <if test="updateBy != null">#{updateBy},</if>
  74. <if test="updateTime != null">#{updateTime},</if>
  75. <if test="senderId != null">#{senderId},</if>
  76. <if test="senderName != null">#{senderName},</if>
  77. <if test="sendTime != null">#{sendTime},</if>
  78. <if test="sendType != null">#{sendType},</if>
  79. <if test="context != null">#{context},</if>
  80. <if test="eventId != null">#{eventId},</if>
  81. <if test="voiceName != null">#{voiceName},</if>
  82. <if test="voiceTimelength != null">#{voiceTimelength},</if>
  83. </trim>
  84. </insert>
  85. <update id="updateTUTalk" parameterType="TUTalk">
  86. update t_u_talk
  87. <trim prefix="SET" suffixOverrides=",">
  88. <if test="status != null">status = #{status},</if>
  89. <if test="remark != null">remark = #{remark},</if>
  90. <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
  91. <if test="createBy != null">create_by = #{createBy},</if>
  92. <if test="createTime != null">create_time = #{createTime},</if>
  93. <if test="updateBy != null">update_by = #{updateBy},</if>
  94. <if test="updateTime != null">update_time = #{updateTime},</if>
  95. <if test="senderId != null">sender_id = #{senderId},</if>
  96. <if test="senderName != null">sender_name = #{senderName},</if>
  97. <if test="sendTime != null">send_time = #{sendTime},</if>
  98. <if test="sendType != null">send_type = #{sendType},</if>
  99. <if test="context != null">context = #{context},</if>
  100. <if test="eventId != null">event_id = #{eventId},</if>
  101. <if test="voiceName != null">voice_name = #{voiceName},</if>
  102. <if test="voiceTimelength != null">voice_timelength = #{voiceTimelength},</if>
  103. </trim>
  104. where id = #{id}
  105. </update>
  106. <delete id="deleteTUTalkById" parameterType="String">
  107. delete from t_u_talk where id = #{id}
  108. </delete>
  109. <delete id="deleteTUTalkByIds" parameterType="String">
  110. delete from t_u_talk where id in
  111. <foreach item="id" collection="array" open="(" separator="," close=")">
  112. #{id}
  113. </foreach>
  114. </delete>
  115. </mapper>