FsInquiryOrderMsgMapper.xml 4.8 KB

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