ActivityUserMapper.xml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.goafanti.common.dao.ActivityUserMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.ActivityUser" >
  5. <id column="aid" property="aid" jdbcType="BIGINT" />
  6. <id column="uid" property="uid" jdbcType="VARCHAR" />
  7. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  8. <result column="last_update_time" property="lastUpdateTime" jdbcType="TIMESTAMP" />
  9. </resultMap>
  10. <sql id="Base_Column_List" >
  11. aid, uid, create_time, last_update_time
  12. </sql>
  13. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.goafanti.common.model.ActivityUserKey" >
  14. select
  15. <include refid="Base_Column_List" />
  16. from activity_user
  17. where aid = #{aid,jdbcType=BIGINT}
  18. and uid = #{uid,jdbcType=VARCHAR}
  19. </select>
  20. <delete id="deleteByPrimaryKey" parameterType="com.goafanti.common.model.ActivityUserKey" >
  21. delete from activity_user
  22. where aid = #{aid,jdbcType=BIGINT}
  23. and uid = #{uid,jdbcType=VARCHAR}
  24. </delete>
  25. <insert id="insert" parameterType="com.goafanti.common.model.ActivityUser" >
  26. insert into activity_user (aid, uid, create_time,
  27. last_update_time)
  28. values (#{aid,jdbcType=BIGINT}, #{uid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  29. #{lastUpdateTime,jdbcType=TIMESTAMP})
  30. </insert>
  31. <insert id="insertSelective" parameterType="com.goafanti.common.model.ActivityUser" >
  32. insert into activity_user
  33. <trim prefix="(" suffix=")" suffixOverrides="," >
  34. <if test="aid != null" >
  35. aid,
  36. </if>
  37. <if test="uid != null" >
  38. uid,
  39. </if>
  40. <if test="createTime != null" >
  41. create_time,
  42. </if>
  43. <if test="lastUpdateTime != null" >
  44. last_update_time,
  45. </if>
  46. </trim>
  47. <trim prefix="values (" suffix=")" suffixOverrides="," >
  48. <if test="aid != null" >
  49. #{aid,jdbcType=BIGINT},
  50. </if>
  51. <if test="uid != null" >
  52. #{uid,jdbcType=VARCHAR},
  53. </if>
  54. <if test="createTime != null" >
  55. #{createTime,jdbcType=TIMESTAMP},
  56. </if>
  57. <if test="lastUpdateTime != null" >
  58. #{lastUpdateTime,jdbcType=TIMESTAMP},
  59. </if>
  60. </trim>
  61. </insert>
  62. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ActivityUser" >
  63. update activity_user
  64. <set >
  65. <if test="createTime != null" >
  66. create_time = #{createTime,jdbcType=TIMESTAMP},
  67. </if>
  68. <if test="lastUpdateTime != null" >
  69. last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP},
  70. </if>
  71. </set>
  72. where aid = #{aid,jdbcType=BIGINT}
  73. and uid = #{uid,jdbcType=VARCHAR}
  74. </update>
  75. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ActivityUser" >
  76. update activity_user
  77. set create_time = #{createTime,jdbcType=TIMESTAMP},
  78. last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP}
  79. where aid = #{aid,jdbcType=BIGINT}
  80. and uid = #{uid,jdbcType=VARCHAR}
  81. </update>
  82. <select id="selectByUid" resultMap="BaseResultMap" parameterType="java.lang.String" >
  83. select
  84. <include refid="Base_Column_List" />
  85. from activity_user
  86. where uid = #{uid,jdbcType=VARCHAR}
  87. </select>
  88. </mapper>