UserBindMapper.xml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.tdba.cxb.ares.api.repository.UserBindMapper">
  4. <insert id="insertSelective">
  5. insert into user_bind
  6. <trim prefix="(" suffix=")" suffixOverrides=",">
  7. <if test="null != uid">
  8. uid,
  9. </if>
  10. <if test="null != createTime">
  11. create_time,
  12. </if>
  13. <if test="null != delFlag">
  14. del_flag,
  15. </if>
  16. <if test="null != bindUid">
  17. bind_uid,
  18. </if>
  19. <if test="null != type">
  20. type,
  21. </if>
  22. </trim>
  23. <trim prefix="values (" suffix=")" suffixOverrides=",">
  24. <if test="null != uid">
  25. #{ uid },
  26. </if>
  27. <if test="null != createTime">
  28. #{ createTime },
  29. </if>
  30. <if test="null != delFlag">
  31. #{ delFlag },
  32. </if>
  33. <if test="null != bindUid">
  34. #{ bindUid },
  35. </if>
  36. <if test="null != type">
  37. #{ type },
  38. </if>
  39. </trim>
  40. </insert>
  41. <update id="updateByPrimaryKeySelective">
  42. update user_bind
  43. <set>
  44. <if test="null != uid">
  45. uid = #{ uid },
  46. </if>
  47. <if test="null != createTime">
  48. create_time = #{ createTime },
  49. </if>
  50. <if test="null != delFlag">
  51. del_flag = #{ delFlag },
  52. </if>
  53. <if test="null != bindUid">
  54. bind_uid = #{ bindUid },
  55. </if>
  56. <if test="null != type">
  57. type = #{ type },
  58. </if>
  59. </set>
  60. where id = #{id}
  61. </update>
  62. <select id="selectByUid" resultType="com.tdba.cxb.ares.api.model.UserBind">
  63. select * from user_bind where del_flag = 0 and uid = #{uid}
  64. </select>
  65. <select id="selectUid" resultType="java.lang.Integer">
  66. select uid from user_bind where del_flag = 0 and type = 0 and bind_uid = #{bindUid}
  67. </select>
  68. </mapper>