UserBindMapper.xml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 != create_time">
  11. create_time,
  12. </if>
  13. <if test="null != del_flag">
  14. del_flag,
  15. </if>
  16. <if test="null != bind_uid">
  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 != create_time">
  28. #{create_time},
  29. </if>
  30. <if test="null != del_flag">
  31. #{del_flag},
  32. </if>
  33. <if test="null != bind_uid">
  34. #{bind_uid},
  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 != create_time">
  48. create_time = #{create_time},
  49. </if>
  50. <if test="null != del_flag">
  51. del_flag = #{del_flag},
  52. </if>
  53. <if test="null != bind_uid">
  54. bind_uid = #{bind_uid},
  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>