CompanyWxChatMapper.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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.company.mapper.CompanyWxChatMapper">
  6. <resultMap type="CompanyWxChat" id="CompanyWxChatResult">
  7. <result property="id" column="id" />
  8. <result property="wxUserId" column="wx_user_id" />
  9. <result property="companyId" column="company_id" />
  10. <result property="companyUserId" column="company_user_id" />
  11. <result property="msgJson" column="msg_json" />
  12. <result property="content" column="content" />
  13. <result property="msgType" column="msg_type" />
  14. <result property="sendType" column="send_type" />
  15. <result property="createTime" column="create_time" />
  16. <result property="createBy" column="create_by" />
  17. <result property="updateBy" column="update_by" />
  18. <result property="updateTime" column="update_time" />
  19. <result property="remark" column="remark" />
  20. </resultMap>
  21. <sql id="selectCompanyWxChatVo">
  22. select id, wx_user_id, company_id, company_user_id, msg_json, content, msg_type, send_type, create_time, create_by, update_by, update_time, remark from company_wx_chat
  23. </sql>
  24. <select id="selectCompanyWxChatList" parameterType="CompanyWxChat" resultMap="CompanyWxChatResult">
  25. <include refid="selectCompanyWxChatVo"/>
  26. <where>
  27. <if test="wxUserId != null "> and wx_user_id = #{wxUserId}</if>
  28. <if test="companyId != null "> and company_id = #{companyId}</if>
  29. <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
  30. <if test="msgJson != null and msgJson != ''"> and msg_json = #{msgJson}</if>
  31. <if test="content != null and content != ''"> and content = #{content}</if>
  32. <if test="msgType != null "> and msg_type = #{msgType}</if>
  33. <if test="sendType != null "> and send_type = #{sendType}</if>
  34. </where>
  35. </select>
  36. <select id="selectCompanyWxChatById" parameterType="Long" resultMap="CompanyWxChatResult">
  37. <include refid="selectCompanyWxChatVo"/>
  38. where id = #{id}
  39. </select>
  40. <insert id="insertCompanyWxChat" parameterType="CompanyWxChat" useGeneratedKeys="true" keyProperty="id">
  41. insert into company_wx_chat
  42. <trim prefix="(" suffix=")" suffixOverrides=",">
  43. <if test="wxUserId != null">wx_user_id,</if>
  44. <if test="companyId != null">company_id,</if>
  45. <if test="companyUserId != null">company_user_id,</if>
  46. <if test="msgJson != null">msg_json,</if>
  47. <if test="content != null">content,</if>
  48. <if test="msgType != null">msg_type,</if>
  49. <if test="sendType != null">send_type,</if>
  50. <if test="createTime != null">create_time,</if>
  51. <if test="createBy != null">create_by,</if>
  52. <if test="updateBy != null">update_by,</if>
  53. <if test="updateTime != null">update_time,</if>
  54. <if test="remark != null">remark,</if>
  55. </trim>
  56. <trim prefix="values (" suffix=")" suffixOverrides=",">
  57. <if test="wxUserId != null">#{wxUserId},</if>
  58. <if test="companyId != null">#{companyId},</if>
  59. <if test="companyUserId != null">#{companyUserId},</if>
  60. <if test="msgJson != null">#{msgJson},</if>
  61. <if test="content != null">#{content},</if>
  62. <if test="msgType != null">#{msgType},</if>
  63. <if test="sendType != null">#{sendType},</if>
  64. <if test="createTime != null">#{createTime},</if>
  65. <if test="createBy != null">#{createBy},</if>
  66. <if test="updateBy != null">#{updateBy},</if>
  67. <if test="updateTime != null">#{updateTime},</if>
  68. <if test="remark != null">#{remark},</if>
  69. </trim>
  70. </insert>
  71. <update id="updateCompanyWxChat" parameterType="CompanyWxChat">
  72. update company_wx_chat
  73. <trim prefix="SET" suffixOverrides=",">
  74. <if test="wxUserId != null">wx_user_id = #{wxUserId},</if>
  75. <if test="companyId != null">company_id = #{companyId},</if>
  76. <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
  77. <if test="msgJson != null">msg_json = #{msgJson},</if>
  78. <if test="content != null">content = #{content},</if>
  79. <if test="msgType != null">msg_type = #{msgType},</if>
  80. <if test="sendType != null">send_type = #{sendType},</if>
  81. <if test="createTime != null">create_time = #{createTime},</if>
  82. <if test="createBy != null">create_by = #{createBy},</if>
  83. <if test="updateBy != null">update_by = #{updateBy},</if>
  84. <if test="updateTime != null">update_time = #{updateTime},</if>
  85. <if test="remark != null">remark = #{remark},</if>
  86. </trim>
  87. where id = #{id}
  88. </update>
  89. <delete id="deleteCompanyWxChatById" parameterType="Long">
  90. delete from company_wx_chat where id = #{id}
  91. </delete>
  92. <delete id="deleteCompanyWxChatByIds" parameterType="String">
  93. delete from company_wx_chat where id in
  94. <foreach item="id" collection="array" open="(" separator="," close=")">
  95. #{id}
  96. </foreach>
  97. </delete>
  98. </mapper>