WxMsgLogMapper.xml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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.fs.wxcid.mapper.WxMsgLogMapper">
  6. <resultMap type="WxMsgLog" id="WxMsgLogResult">
  7. <result property="id" column="id" />
  8. <result property="accountId" column="account_id" />
  9. <result property="key" column="key" />
  10. <result property="type" column="type" />
  11. <result property="msgId" column="msg_id" />
  12. <result property="fromUserName" column="from_user_name" />
  13. <result property="toUserName" column="to_user_name" />
  14. <result property="msgType" column="msg_type" />
  15. <result property="content" column="content" />
  16. <result property="imgStatus" column="img_status" />
  17. <result property="imgBuf" column="img_buf" />
  18. <result property="pushContent" column="push_content" />
  19. <result property="newMsgId" column="new_msg_id" />
  20. <result property="createTime" column="create_time" />
  21. <result property="createBy" column="create_by" />
  22. <result property="updateTime" column="update_time" />
  23. <result property="updateBy" column="update_by" />
  24. <result property="remark" column="remark" />
  25. </resultMap>
  26. <sql id="selectWxMsgLogVo">
  27. select id, account_id, key, type, msg_id, from_user_name, to_user_name, msg_type, content, img_status, img_buf, push_content, new_msg_id, create_time, create_by, update_time, update_by, remark from wx_msg_log
  28. </sql>
  29. <select id="selectWxMsgLogList" parameterType="WxMsgLog" resultMap="WxMsgLogResult">
  30. <include refid="selectWxMsgLogVo"/>
  31. <where>
  32. <if test="accountId != null "> and account_id = #{accountId}</if>
  33. <if test="key != null and key != ''"> and key = #{key}</if>
  34. <if test="type != null "> and type = #{type}</if>
  35. <if test="msgId != null "> and msg_id = #{msgId}</if>
  36. <if test="fromUserName != null and fromUserName != ''"> and from_user_name like concat('%', #{fromUserName}, '%')</if>
  37. <if test="toUserName != null and toUserName != ''"> and to_user_name like concat('%', #{toUserName}, '%')</if>
  38. <if test="msgType != null "> and msg_type = #{msgType}</if>
  39. <if test="content != null and content != ''"> and content = #{content}</if>
  40. <if test="imgStatus != null and imgStatus != ''"> and img_status = #{imgStatus}</if>
  41. <if test="imgBuf != null and imgBuf != ''"> and img_buf = #{imgBuf}</if>
  42. <if test="pushContent != null and pushContent != ''"> and push_content = #{pushContent}</if>
  43. <if test="newMsgId != null "> and new_msg_id = #{newMsgId}</if>
  44. </where>
  45. </select>
  46. <select id="selectWxMsgLogById" parameterType="Long" resultMap="WxMsgLogResult">
  47. <include refid="selectWxMsgLogVo"/>
  48. where id = #{id}
  49. </select>
  50. <insert id="insertWxMsgLog" parameterType="WxMsgLog" useGeneratedKeys="true" keyProperty="id">
  51. insert into wx_msg_log
  52. <trim prefix="(" suffix=")" suffixOverrides=",">
  53. <if test="accountId != null">account_id,</if>
  54. <if test="key != null">key,</if>
  55. <if test="type != null">type,</if>
  56. <if test="msgId != null">msg_id,</if>
  57. <if test="fromUserName != null">from_user_name,</if>
  58. <if test="toUserName != null">to_user_name,</if>
  59. <if test="msgType != null">msg_type,</if>
  60. <if test="content != null">content,</if>
  61. <if test="imgStatus != null">img_status,</if>
  62. <if test="imgBuf != null">img_buf,</if>
  63. <if test="pushContent != null">push_content,</if>
  64. <if test="newMsgId != null">new_msg_id,</if>
  65. <if test="createTime != null">create_time,</if>
  66. <if test="createBy != null">create_by,</if>
  67. <if test="updateTime != null">update_time,</if>
  68. <if test="updateBy != null">update_by,</if>
  69. <if test="remark != null">remark,</if>
  70. </trim>
  71. <trim prefix="values (" suffix=")" suffixOverrides=",">
  72. <if test="accountId != null">#{accountId},</if>
  73. <if test="key != null">#{key},</if>
  74. <if test="type != null">#{type},</if>
  75. <if test="msgId != null">#{msgId},</if>
  76. <if test="fromUserName != null">#{fromUserName},</if>
  77. <if test="toUserName != null">#{toUserName},</if>
  78. <if test="msgType != null">#{msgType},</if>
  79. <if test="content != null">#{content},</if>
  80. <if test="imgStatus != null">#{imgStatus},</if>
  81. <if test="imgBuf != null">#{imgBuf},</if>
  82. <if test="pushContent != null">#{pushContent},</if>
  83. <if test="newMsgId != null">#{newMsgId},</if>
  84. <if test="createTime != null">#{createTime},</if>
  85. <if test="createBy != null">#{createBy},</if>
  86. <if test="updateTime != null">#{updateTime},</if>
  87. <if test="updateBy != null">#{updateBy},</if>
  88. <if test="remark != null">#{remark},</if>
  89. </trim>
  90. </insert>
  91. <update id="updateWxMsgLog" parameterType="WxMsgLog">
  92. update wx_msg_log
  93. <trim prefix="SET" suffixOverrides=",">
  94. <if test="accountId != null">account_id = #{accountId},</if>
  95. <if test="key != null">key = #{key},</if>
  96. <if test="type != null">type = #{type},</if>
  97. <if test="msgId != null">msg_id = #{msgId},</if>
  98. <if test="fromUserName != null">from_user_name = #{fromUserName},</if>
  99. <if test="toUserName != null">to_user_name = #{toUserName},</if>
  100. <if test="msgType != null">msg_type = #{msgType},</if>
  101. <if test="content != null">content = #{content},</if>
  102. <if test="imgStatus != null">img_status = #{imgStatus},</if>
  103. <if test="imgBuf != null">img_buf = #{imgBuf},</if>
  104. <if test="pushContent != null">push_content = #{pushContent},</if>
  105. <if test="newMsgId != null">new_msg_id = #{newMsgId},</if>
  106. <if test="createTime != null">create_time = #{createTime},</if>
  107. <if test="createBy != null">create_by = #{createBy},</if>
  108. <if test="updateTime != null">update_time = #{updateTime},</if>
  109. <if test="updateBy != null">update_by = #{updateBy},</if>
  110. <if test="remark != null">remark = #{remark},</if>
  111. </trim>
  112. where id = #{id}
  113. </update>
  114. <delete id="deleteWxMsgLogById" parameterType="Long">
  115. delete from wx_msg_log where id = #{id}
  116. </delete>
  117. <delete id="deleteWxMsgLogByIds" parameterType="String">
  118. delete from wx_msg_log where id in
  119. <foreach item="id" collection="array" open="(" separator="," close=")">
  120. #{id}
  121. </foreach>
  122. </delete>
  123. </mapper>