QwContactWayLogsMapper.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.qw.mapper.QwContactWayLogsMapper">
  6. <resultMap type="QwContactWayLogs" id="QwContactWayLogsResult">
  7. <result property="id" column="id" />
  8. <result property="wayId" column="way_id" />
  9. <result property="userId" column="user_id" />
  10. <result property="companyUserId" column="company_user_id" />
  11. <result property="type" column="type" />
  12. <result property="msg" column="msg" />
  13. <result property="corpId" column="corp_id" />
  14. <result property="externalUserId" column="external_user_id" />
  15. <result property="companyId" column="company_id" />
  16. <result property="createTime" column="create_time" />
  17. <result property="informationId" column="information_id" />
  18. </resultMap>
  19. <sql id="selectQwContactWayLogsVo">
  20. select id, way_id,information_id, user_id, company_user_id, type, msg, external_user_id, company_id, create_time,corp_id from qw_contact_way_logs
  21. </sql>
  22. <select id="selectQwContactWayLogsList" parameterType="QwContactWayLogs" resultMap="QwContactWayLogsResult">
  23. <include refid="selectQwContactWayLogsVo"/>
  24. <where>
  25. <if test="wayId != null "> and way_id = #{wayId}</if>
  26. <if test="userId != null "> and user_id = #{userId}</if>
  27. <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
  28. <if test="type != null "> and type = #{type}</if>
  29. <if test="msg != null and msg != ''"> and msg = #{msg}</if>
  30. <if test="corpId != null "> and corp_id = #{corpId}</if>
  31. <if test="externalUserId != null "> and external_user_id = #{externalUserId}</if>
  32. <if test="companyId != null "> and company_id = #{companyId}</if>
  33. <if test="createTime != null "> and create_time = #{createTime}</if>
  34. </where>
  35. </select>
  36. <select id="selectQwContactWayLogsById" parameterType="Long" resultMap="QwContactWayLogsResult">
  37. <include refid="selectQwContactWayLogsVo"/>
  38. where id = #{id}
  39. </select>
  40. <insert id="insertQwContactWayLogs" parameterType="QwContactWayLogs" useGeneratedKeys="true" keyProperty="id">
  41. insert into qw_contact_way_logs
  42. <trim prefix="(" suffix=")" suffixOverrides=",">
  43. <if test="wayId != null">way_id,</if>
  44. <if test="userId != null">user_id,</if>
  45. <if test="companyUserId != null">company_user_id,</if>
  46. <if test="type != null">type,</if>
  47. <if test="msg != null">msg,</if>
  48. <if test="corpId != null">corp_id,</if>
  49. <if test="externalUserId != null">external_user_id,</if>
  50. <if test="companyId != null">company_id,</if>
  51. <if test="createTime != null">create_time,</if>
  52. <if test="informationId != null">information_id,</if>
  53. </trim>
  54. <trim prefix="values (" suffix=")" suffixOverrides=",">
  55. <if test="wayId != null">#{wayId},</if>
  56. <if test="userId != null">#{userId},</if>
  57. <if test="companyUserId != null">#{companyUserId},</if>
  58. <if test="type != null">#{type},</if>
  59. <if test="msg != null">#{msg},</if>
  60. <if test="corpId != null">#{corpId},</if>
  61. <if test="externalUserId != null">#{externalUserId},</if>
  62. <if test="companyId != null">#{companyId},</if>
  63. <if test="createTime != null">#{createTime},</if>
  64. <if test="informationId != null">#{informationId},</if>
  65. </trim>
  66. </insert>
  67. <update id="updateQwContactWayLogs" parameterType="QwContactWayLogs">
  68. update qw_contact_way_logs
  69. <trim prefix="SET" suffixOverrides=",">
  70. <if test="wayId != null">way_id = #{wayId},</if>
  71. <if test="userId != null">user_id = #{userId},</if>
  72. <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
  73. <if test="type != null">type = #{type},</if>
  74. <if test="msg != null">msg = #{msg},</if>
  75. <if test="corpId != null">corp_id = #{corpId},</if>
  76. <if test="externalUserId != null">external_user_id = #{externalUserId},</if>
  77. <if test="companyId != null">company_id = #{companyId},</if>
  78. <if test="createTime != null">create_time = #{createTime},</if>
  79. <if test="informationId != null">information_id = #{informationId},</if>
  80. </trim>
  81. where id = #{id}
  82. </update>
  83. <delete id="deleteQwContactWayLogsById" parameterType="Long">
  84. delete from qw_contact_way_logs where id = #{id}
  85. </delete>
  86. <delete id="deleteQwContactWayLogsByIds" parameterType="String">
  87. delete from qw_contact_way_logs where id in
  88. <foreach item="id" collection="array" open="(" separator="," close=")">
  89. #{id}
  90. </foreach>
  91. </delete>
  92. </mapper>