FsInquiryOrderMsgMapper.xml 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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.his.mapper.FsInquiryOrderMsgMapper">
  6. <resultMap type="FsInquiryOrderMsg" id="FsInquiryOrderMsgResult">
  7. <result property="msgId" column="msg_id" />
  8. <result property="msgType" column="msg_type" />
  9. <result property="fromAccount" column="from_account" />
  10. <result property="toAccount" column="to_account" />
  11. <result property="content" column="content" />
  12. <result property="createTime" column="create_time" />
  13. <result property="orderId" column="order_id" />
  14. <result property="msgContentType" column="msg_content_type" />
  15. <result property="msgKey" column="msg_key" />
  16. </resultMap>
  17. <sql id="selectFsInquiryOrderMsgVo">
  18. select msg_id, msg_type, from_account, to_account, content, create_time, order_id,msg_content_type,msg_key from fs_inquiry_order_msg
  19. </sql>
  20. <select id="selectFsInquiryOrderMsgList" parameterType="FsInquiryOrderMsg" resultMap="FsInquiryOrderMsgResult">
  21. <include refid="selectFsInquiryOrderMsgVo"/>
  22. <where>
  23. <if test="msgType != null and msgType != ''"> and msg_type = #{msgType}</if>
  24. <if test="fromAccount != null and fromAccount != ''"> and from_account = #{fromAccount}</if>
  25. <if test="toAccount != null and toAccount != ''"> and to_account = #{toAccount}</if>
  26. <if test="content != null and content != ''"> and content = #{content}</if>
  27. <if test="orderId != null "> and order_id = #{orderId}</if>
  28. </where>
  29. </select>
  30. <select id="selectFsInquiryOrderMsgByMsgId" parameterType="Long" resultMap="FsInquiryOrderMsgResult">
  31. <include refid="selectFsInquiryOrderMsgVo"/>
  32. where msg_id = #{msgId}
  33. </select>
  34. <insert id="insertFsInquiryOrderMsg" parameterType="FsInquiryOrderMsg" useGeneratedKeys="true" keyProperty="msgId">
  35. insert into fs_inquiry_order_msg
  36. <trim prefix="(" suffix=")" suffixOverrides=",">
  37. <if test="msgType != null">msg_type,</if>
  38. <if test="fromAccount != null">from_account,</if>
  39. <if test="toAccount != null">to_account,</if>
  40. <if test="content != null">content,</if>
  41. <if test="createTime != null">create_time,</if>
  42. <if test="orderId != null">order_id,</if>
  43. <if test="msgContentType != null">msg_content_type,</if>
  44. <if test="msgKey != null">msg_key,</if>
  45. </trim>
  46. <trim prefix="values (" suffix=")" suffixOverrides=",">
  47. <if test="msgType != null">#{msgType},</if>
  48. <if test="fromAccount != null">#{fromAccount},</if>
  49. <if test="toAccount != null">#{toAccount},</if>
  50. <if test="content != null">#{content},</if>
  51. <if test="createTime != null">#{createTime},</if>
  52. <if test="orderId != null">#{orderId},</if>
  53. <if test="msgContentType != null">#{msgContentType},</if>
  54. <if test="msgKey != null">#{msgKey},</if>
  55. </trim>
  56. </insert>
  57. <update id="updateFsInquiryOrderMsg" parameterType="FsInquiryOrderMsg">
  58. update fs_inquiry_order_msg
  59. <trim prefix="SET" suffixOverrides=",">
  60. <if test="msgType != null">msg_type = #{msgType},</if>
  61. <if test="fromAccount != null">from_account = #{fromAccount},</if>
  62. <if test="toAccount != null">to_account = #{toAccount},</if>
  63. <if test="content != null">content = #{content},</if>
  64. <if test="createTime != null">create_time = #{createTime},</if>
  65. <if test="orderId != null">order_id = #{orderId},</if>
  66. <if test="msgContentType != null">msg_content_type = #{msgContentType},</if>
  67. <if test="msgKey != null">msg_key = #{msgKey},</if>
  68. </trim>
  69. where msg_id = #{msgId}
  70. </update>
  71. <delete id="deleteFsInquiryOrderMsgByMsgId" parameterType="Long">
  72. delete from fs_inquiry_order_msg where msg_id = #{msgId}
  73. </delete>
  74. <delete id="deleteFsInquiryOrderMsgByMsgIds" parameterType="String">
  75. delete from fs_inquiry_order_msg where msg_id in
  76. <foreach item="msgId" collection="array" open="(" separator="," close=")">
  77. #{msgId}
  78. </foreach>
  79. </delete>
  80. </mapper>