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