UserBindMapper.xml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. <if test="null != name">
  23. name,
  24. </if>
  25. </trim>
  26. <trim prefix="values (" suffix=")" suffixOverrides=",">
  27. <if test="null != uid">
  28. #{ uid },
  29. </if>
  30. <if test="null != create_time">
  31. #{create_time},
  32. </if>
  33. <if test="null != del_flag">
  34. #{del_flag},
  35. </if>
  36. <if test="null != bind_uid">
  37. #{bind_uid},
  38. </if>
  39. <if test="null != type">
  40. #{ type },
  41. </if>
  42. <if test="null != name">
  43. #{name},
  44. </if>
  45. </trim>
  46. </insert>
  47. <update id="updateByPrimaryKeySelective">
  48. update user_bind
  49. <set>
  50. <if test="null != uid">
  51. uid = #{ uid },
  52. </if>
  53. <if test="null != create_time">
  54. create_time = #{create_time},
  55. </if>
  56. <if test="null != del_flag">
  57. del_flag = #{del_flag},
  58. </if>
  59. <if test="null != bind_uid">
  60. bind_uid = #{bind_uid},
  61. </if>
  62. <if test="null != type">
  63. type = #{ type },
  64. </if>
  65. <if test="null != name">
  66. type = #{name},
  67. </if>
  68. </set>
  69. where id = #{id}
  70. </update>
  71. <select id="selectByUid" resultType="com.tdba.cxb.ares.api.model.UserBind">
  72. select * from user_bind where del_flag = 0 and uid = #{uid}
  73. </select>
  74. <select id="selectUid" resultType="java.lang.Integer">
  75. select uid from user_bind where del_flag = 0 and type = 0 and bind_uid = #{bindUid}
  76. </select>
  77. </mapper>