WxSopLogsMapper.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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.wx.sop.mapper.WxSopLogsMapper">
  6. <resultMap type="WxSopLogs" id="WxSopLogsResult">
  7. <result property="id" column="id" />
  8. <result property="type" column="type" />
  9. <result property="sopId" column="sop_id" />
  10. <result property="sopUserId" column="sop_user_id" />
  11. <result property="sendType" column="send_type" />
  12. <result property="generateType" column="generate_type" />
  13. <result property="accountId" column="account_id" />
  14. <result property="wxContactId" column="wx_contact_id" />
  15. <result property="wxContactName" column="wx_contact_name" />
  16. <result property="wxRoomId" column="wx_room_id" />
  17. <result property="wxRoomName" column="wx_room_name" />
  18. <result property="fsUserId" column="fs_user_id" />
  19. <result property="sendStatus" column="send_status" />
  20. <result property="sendRemark" column="send_remark" />
  21. <result property="sendSort" column="send_sort" />
  22. <result property="expirationTime" column="expiration_time" />
  23. <result property="createTime" column="create_time" />
  24. <result property="createBy" column="create_by" />
  25. <result property="updateTime" column="update_time" />
  26. <result property="updateBy" column="update_by" />
  27. <result property="remark" column="remark" />
  28. </resultMap>
  29. <sql id="selectWxSopLogsVo">
  30. select id, type, sop_id, sop_user_id, send_type, generate_type, account_id, wx_contact_id, wx_contact_name, wx_room_id, wx_room_name, fs_user_id, send_status, send_remark, send_sort, expiration_time, create_time, create_by, update_time, update_by, remark from wx_sop_logs
  31. </sql>
  32. <select id="selectWxSopLogsList" parameterType="WxSopLogs" resultMap="WxSopLogsResult">
  33. <include refid="selectWxSopLogsVo"/>
  34. <where>
  35. <if test="type != null "> and type = #{type}</if>
  36. <if test="sopId != null "> and sop_id = #{sopId}</if>
  37. <if test="sopUserId != null "> and sop_user_id = #{sopUserId}</if>
  38. <if test="sendType != null "> and send_type = #{sendType}</if>
  39. <if test="generateType != null "> and generate_type = #{generateType}</if>
  40. <if test="accountId != null "> and account_id = #{accountId}</if>
  41. <if test="wxContactId != null "> and wx_contact_id = #{wxContactId}</if>
  42. <if test="wxContactName != null and wxContactName != ''"> and wx_contact_name like concat('%', #{wxContactName}, '%')</if>
  43. <if test="wxRoomId != null "> and wx_room_id = #{wxRoomId}</if>
  44. <if test="wxRoomName != null and wxRoomName != ''"> and wx_room_name like concat('%', #{wxRoomName}, '%')</if>
  45. <if test="fsUserId != null "> and fs_user_id = #{fsUserId}</if>
  46. <if test="sendStatus != null "> and send_status = #{sendStatus}</if>
  47. <if test="sendRemark != null and sendRemark != ''"> and send_remark = #{sendRemark}</if>
  48. <if test="sendSort != null "> and send_sort = #{sendSort}</if>
  49. <if test="expirationTime != null "> and expiration_time = #{expirationTime}</if>
  50. </where>
  51. </select>
  52. <select id="selectWxSopLogsById" parameterType="Long" resultMap="WxSopLogsResult">
  53. <include refid="selectWxSopLogsVo"/>
  54. where id = #{id}
  55. </select>
  56. <insert id="insertWxSopLogs" parameterType="WxSopLogs" useGeneratedKeys="true" keyProperty="id">
  57. insert into wx_sop_logs
  58. <trim prefix="(" suffix=")" suffixOverrides=",">
  59. <if test="type != null">type,</if>
  60. <if test="sopId != null">sop_id,</if>
  61. <if test="sopUserId != null">sop_user_id,</if>
  62. <if test="sendType != null">send_type,</if>
  63. <if test="generateType != null">generate_type,</if>
  64. <if test="accountId != null">account_id,</if>
  65. <if test="wxContactId != null">wx_contact_id,</if>
  66. <if test="wxContactName != null">wx_contact_name,</if>
  67. <if test="wxRoomId != null">wx_room_id,</if>
  68. <if test="wxRoomName != null">wx_room_name,</if>
  69. <if test="fsUserId != null">fs_user_id,</if>
  70. <if test="sendStatus != null">send_status,</if>
  71. <if test="sendRemark != null">send_remark,</if>
  72. <if test="sendSort != null">send_sort,</if>
  73. <if test="expirationTime != null">expiration_time,</if>
  74. <if test="createTime != null">create_time,</if>
  75. <if test="createBy != null">create_by,</if>
  76. <if test="updateTime != null">update_time,</if>
  77. <if test="updateBy != null">update_by,</if>
  78. <if test="remark != null">remark,</if>
  79. </trim>
  80. <trim prefix="values (" suffix=")" suffixOverrides=",">
  81. <if test="type != null">#{type},</if>
  82. <if test="sopId != null">#{sopId},</if>
  83. <if test="sopUserId != null">#{sopUserId},</if>
  84. <if test="sendType != null">#{sendType},</if>
  85. <if test="generateType != null">#{generateType},</if>
  86. <if test="accountId != null">#{accountId},</if>
  87. <if test="wxContactId != null">#{wxContactId},</if>
  88. <if test="wxContactName != null">#{wxContactName},</if>
  89. <if test="wxRoomId != null">#{wxRoomId},</if>
  90. <if test="wxRoomName != null">#{wxRoomName},</if>
  91. <if test="fsUserId != null">#{fsUserId},</if>
  92. <if test="sendStatus != null">#{sendStatus},</if>
  93. <if test="sendRemark != null">#{sendRemark},</if>
  94. <if test="sendSort != null">#{sendSort},</if>
  95. <if test="expirationTime != null">#{expirationTime},</if>
  96. <if test="createTime != null">#{createTime},</if>
  97. <if test="createBy != null">#{createBy},</if>
  98. <if test="updateTime != null">#{updateTime},</if>
  99. <if test="updateBy != null">#{updateBy},</if>
  100. <if test="remark != null">#{remark},</if>
  101. </trim>
  102. </insert>
  103. <update id="updateWxSopLogs" parameterType="WxSopLogs">
  104. update wx_sop_logs
  105. <trim prefix="SET" suffixOverrides=",">
  106. <if test="type != null">type = #{type},</if>
  107. <if test="sopId != null">sop_id = #{sopId},</if>
  108. <if test="sopUserId != null">sop_user_id = #{sopUserId},</if>
  109. <if test="sendType != null">send_type = #{sendType},</if>
  110. <if test="generateType != null">generate_type = #{generateType},</if>
  111. <if test="accountId != null">account_id = #{accountId},</if>
  112. <if test="wxContactId != null">wx_contact_id = #{wxContactId},</if>
  113. <if test="wxContactName != null">wx_contact_name = #{wxContactName},</if>
  114. <if test="wxRoomId != null">wx_room_id = #{wxRoomId},</if>
  115. <if test="wxRoomName != null">wx_room_name = #{wxRoomName},</if>
  116. <if test="fsUserId != null">fs_user_id = #{fsUserId},</if>
  117. <if test="sendStatus != null">send_status = #{sendStatus},</if>
  118. <if test="sendRemark != null">send_remark = #{sendRemark},</if>
  119. <if test="sendSort != null">send_sort = #{sendSort},</if>
  120. <if test="expirationTime != null">expiration_time = #{expirationTime},</if>
  121. <if test="createTime != null">create_time = #{createTime},</if>
  122. <if test="createBy != null">create_by = #{createBy},</if>
  123. <if test="updateTime != null">update_time = #{updateTime},</if>
  124. <if test="updateBy != null">update_by = #{updateBy},</if>
  125. <if test="remark != null">remark = #{remark},</if>
  126. </trim>
  127. where id = #{id}
  128. </update>
  129. <delete id="deleteWxSopLogsById" parameterType="Long">
  130. delete from wx_sop_logs where id = #{id}
  131. </delete>
  132. <delete id="deleteWxSopLogsByIds" parameterType="String">
  133. delete from wx_sop_logs where id in
  134. <foreach item="id" collection="array" open="(" separator="," close=")">
  135. #{id}
  136. </foreach>
  137. </delete>
  138. </mapper>