QwContactBatchMapper.xml 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.QwContactBatchMapper">
  6. <resultMap type="QwContactBatch" id="QwContactBatchResult">
  7. <result property="id" column="id" />
  8. <result property="phone" column="phone" />
  9. <result property="tagIds" column="tag_ids" />
  10. <result property="status" column="status" />
  11. <result property="userId" column="user_id" />
  12. <result property="num" column="num" />
  13. <result property="companyUserId" column="company_user_id" />
  14. <result property="companyId" column="company_id" />
  15. <result property="createTime" column="create_time" />
  16. <result property="remark" column="remark" />
  17. <result property="qwUserId" column="qw_user_id" />
  18. </resultMap>
  19. <sql id="selectQwContactBatchVo">
  20. select id, phone, tag_ids, status,qw_user_id, user_id, num, company_user_id, company_id, create_time, remark from qw_contact_batch
  21. </sql>
  22. <select id="selectQwContactBatchList" parameterType="QwContactBatch" resultMap="QwContactBatchResult">
  23. <include refid="selectQwContactBatchVo"/>
  24. <where>
  25. <if test="phone != null and phone != ''"> and phone = #{phone}</if>
  26. <if test="tagIds != null and tagIds != ''"> and tag_ids = #{tagIds}</if>
  27. <if test="status != null "> and status = #{status}</if>
  28. <if test="userId != null "> and user_id = #{userId}</if>
  29. <if test="num != null "> and num = #{num}</if>
  30. <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
  31. <if test="companyId != null "> and company_id = #{companyId}</if>
  32. </where>
  33. </select>
  34. <select id="selectQwContactBatchById" parameterType="Long" resultMap="QwContactBatchResult">
  35. <include refid="selectQwContactBatchVo"/>
  36. where id = #{id}
  37. </select>
  38. <insert id="insertQwContactBatch" parameterType="QwContactBatch" useGeneratedKeys="true" keyProperty="id">
  39. insert into qw_contact_batch
  40. <trim prefix="(" suffix=")" suffixOverrides=",">
  41. <if test="phone != null">phone,</if>
  42. <if test="tagIds != null">tag_ids,</if>
  43. <if test="status != null">status,</if>
  44. <if test="userId != null">user_id,</if>
  45. <if test="num != null">num,</if>
  46. <if test="companyUserId != null">company_user_id,</if>
  47. <if test="companyId != null">company_id,</if>
  48. <if test="createTime != null">create_time,</if>
  49. <if test="remark != null">remark,</if>
  50. <if test="qwUserId != null">qw_user_id,</if>
  51. </trim>
  52. <trim prefix="values (" suffix=")" suffixOverrides=",">
  53. <if test="phone != null">#{phone},</if>
  54. <if test="tagIds != null">#{tagIds},</if>
  55. <if test="status != null">#{status},</if>
  56. <if test="userId != null">#{userId},</if>
  57. <if test="num != null">#{num},</if>
  58. <if test="companyUserId != null">#{companyUserId},</if>
  59. <if test="companyId != null">#{companyId},</if>
  60. <if test="createTime != null">#{createTime},</if>
  61. <if test="remark != null">#{remark},</if>
  62. <if test="qwUserId != null">#{qwUserId},</if>
  63. </trim>
  64. </insert>
  65. <update id="updateQwContactBatch" parameterType="QwContactBatch">
  66. update qw_contact_batch
  67. <trim prefix="SET" suffixOverrides=",">
  68. <if test="phone != null">phone = #{phone},</if>
  69. <if test="tagIds != null">tag_ids = #{tagIds},</if>
  70. <if test="status != null">status = #{status},</if>
  71. <if test="userId != null">user_id = #{userId},</if>
  72. <if test="num != null">num = #{num},</if>
  73. <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
  74. <if test="companyId != null">company_id = #{companyId},</if>
  75. <if test="createTime != null">create_time = #{createTime},</if>
  76. <if test="remark != null">remark = #{remark},</if>
  77. <if test="qwUserId != null">qw_user_id = #{qwUserId},</if>
  78. </trim>
  79. where id = #{id}
  80. </update>
  81. <delete id="deleteQwContactBatchById" parameterType="Long">
  82. delete from qw_contact_batch where id = #{id}
  83. </delete>
  84. <delete id="deleteQwContactBatchByIds" parameterType="String">
  85. delete from qw_contact_batch where id in
  86. <foreach item="id" collection="array" open="(" separator="," close=")">
  87. #{id}
  88. </foreach>
  89. </delete>
  90. </mapper>