StarMapper.xml 3.0 KB

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