QwContactWayUserMapper.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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.QwContactWayUserMapper">
  6. <resultMap type="QwContactWayUser" id="QwContactWayUserResult">
  7. <result property="id" column="id" />
  8. <result property="wayId" column="way_id" />
  9. <result property="qwUserId" column="qw_user_id" />
  10. <result property="userId" column="user_id" />
  11. <result property="limitCount" column="limit_count" />
  12. <result property="dayCount" column="day_count" />
  13. <result property="companyId" column="company_id" />
  14. </resultMap>
  15. <sql id="selectQwContactWayUserVo">
  16. select id, way_id, qw_user_id, user_id, limit_count, day_count, company_id from qw_contact_way_user
  17. </sql>
  18. <select id="selectQwContactWayUserList" parameterType="QwContactWayUser" resultMap="QwContactWayUserResult">
  19. <include refid="selectQwContactWayUserVo"/>
  20. <where>
  21. <if test="wayId != null "> and way_id = #{wayId}</if>
  22. <if test="qwUserId != null "> and qw_user_id = #{qwUserId}</if>
  23. <if test="userId != null and userId != ''"> and user_id = #{userId}</if>
  24. <if test="limitCount != null "> and limit_count = #{limitCount}</if>
  25. <if test="dayCount != null "> and day_count = #{dayCount}</if>
  26. <if test="companyId != null "> and company_id = #{companyId}</if>
  27. </where>
  28. </select>
  29. <select id="selectQwContactWayUserById" parameterType="Long" resultMap="QwContactWayUserResult">
  30. <include refid="selectQwContactWayUserVo"/>
  31. where id = #{id}
  32. </select>
  33. <insert id="insertQwContactWayUser" parameterType="QwContactWayUser" useGeneratedKeys="true" keyProperty="id">
  34. insert into qw_contact_way_user
  35. <trim prefix="(" suffix=")" suffixOverrides=",">
  36. <if test="wayId != null">way_id,</if>
  37. <if test="qwUserId != null">qw_user_id,</if>
  38. <if test="userId != null">user_id,</if>
  39. <if test="limitCount != null">limit_count,</if>
  40. <if test="dayCount != null">day_count,</if>
  41. <if test="companyId != null">company_id,</if>
  42. </trim>
  43. <trim prefix="values (" suffix=")" suffixOverrides=",">
  44. <if test="wayId != null">#{wayId},</if>
  45. <if test="qwUserId != null">#{qwUserId},</if>
  46. <if test="userId != null">#{userId},</if>
  47. <if test="limitCount != null">#{limitCount},</if>
  48. <if test="dayCount != null">#{dayCount},</if>
  49. <if test="companyId != null">#{companyId},</if>
  50. </trim>
  51. </insert>
  52. <update id="updateQwContactWayUser" parameterType="QwContactWayUser">
  53. update qw_contact_way_user
  54. <trim prefix="SET" suffixOverrides=",">
  55. <if test="wayId != null">way_id = #{wayId},</if>
  56. <if test="qwUserId != null">qw_user_id = #{qwUserId},</if>
  57. <if test="userId != null">user_id = #{userId},</if>
  58. <if test="limitCount != null">limit_count = #{limitCount},</if>
  59. <if test="dayCount != null">day_count = #{dayCount},</if>
  60. <if test="companyId != null">company_id = #{companyId},</if>
  61. </trim>
  62. where id = #{id}
  63. </update>
  64. <delete id="deleteQwContactWayUserById" parameterType="Long">
  65. delete from qw_contact_way_user where id = #{id}
  66. </delete>
  67. <delete id="deleteQwContactWayUserByIds" parameterType="String">
  68. delete from qw_contact_way_user where id in
  69. <foreach item="id" collection="array" open="(" separator="," close=")">
  70. #{id}
  71. </foreach>
  72. </delete>
  73. </mapper>