UserAbilityMapper.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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.UserAbilityMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserAbility" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="uid" property="uid" jdbcType="VARCHAR" />
  7. <result column="ability_label" property="abilityLabel" jdbcType="VARCHAR" />
  8. <result column="intellect_right" property="intellectRight" jdbcType="VARCHAR" />
  9. <result column="science_achievement" property="scienceAchievement" jdbcType="VARCHAR" />
  10. <result column="research_innovation" property="researchInnovation" jdbcType="VARCHAR" />
  11. <result column="personnel" property="personnel" jdbcType="VARCHAR" />
  12. </resultMap>
  13. <sql id="Base_Column_List" >
  14. id, uid, ability_label, intellect_right, science_achievement, research_innovation, personnel
  15. </sql>
  16. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  17. select
  18. <include refid="Base_Column_List" />
  19. from user_ability
  20. where id = #{id,jdbcType=VARCHAR}
  21. </select>
  22. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  23. delete from user_ability
  24. where id = #{id,jdbcType=VARCHAR}
  25. </delete>
  26. <insert id="insert" parameterType="com.goafanti.common.model.UserAbility" >
  27. insert into user_ability (id, uid, ability_label, intellect_right, science_achievement, research_innovation, personnel
  28. )
  29. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{abilityLabel,jdbcType=VARCHAR},
  30. #{intellectRight,jdbcType=VARCHAR}, #{scienceAchievement,jdbcType=VARCHAR},
  31. #{researchInnovation,jdbcType=VARCHAR}, #{personnel,jdbcType=VARCHAR}
  32. )
  33. </insert>
  34. <insert id="insertSelective" parameterType="com.goafanti.common.model.UserAbility" >
  35. insert into user_ability
  36. <trim prefix="(" suffix=")" suffixOverrides="," >
  37. <if test="id != null" >
  38. id,
  39. </if>
  40. <if test="uid != null" >
  41. uid,
  42. </if>
  43. <if test="abilityLabel != null" >
  44. ability_label,
  45. </if>
  46. <if test="intellectRight != null" >
  47. intellect_right,
  48. </if>
  49. <if test="scienceAchievement != null" >
  50. science_achievement,
  51. </if>
  52. <if test="researchInnovation != null" >
  53. research_innovation,
  54. </if>
  55. <if test="personnel != null" >
  56. personnel,
  57. </if>
  58. </trim>
  59. <trim prefix="values (" suffix=")" suffixOverrides="," >
  60. <if test="id != null" >
  61. #{id,jdbcType=VARCHAR},
  62. </if>
  63. <if test="uid != null" >
  64. #{uid,jdbcType=VARCHAR},
  65. </if>
  66. <if test="abilityLabel != null" >
  67. #{abilityLabel,jdbcType=VARCHAR},
  68. </if>
  69. <if test="intellectRight != null" >
  70. #{intellectRight,jdbcType=VARCHAR},
  71. </if>
  72. <if test="scienceAchievement != null" >
  73. #{scienceAchievement,jdbcType=VARCHAR},
  74. </if>
  75. <if test="researchInnovation != null" >
  76. #{researchInnovation,jdbcType=VARCHAR},
  77. </if>
  78. <if test="personnel != null" >
  79. #{personnel,jdbcType=VARCHAR},
  80. </if>
  81. </trim>
  82. </insert>
  83. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserAbility" >
  84. update user_ability
  85. <set >
  86. <if test="uid != null" >
  87. uid = #{uid,jdbcType=VARCHAR},
  88. </if>
  89. <if test="abilityLabel != null" >
  90. ability_label = #{abilityLabel,jdbcType=VARCHAR},
  91. </if>
  92. <if test="intellectRight != null" >
  93. intellect_right = #{intellectRight,jdbcType=VARCHAR},
  94. </if>
  95. <if test="scienceAchievement != null" >
  96. science_achievement = #{scienceAchievement,jdbcType=VARCHAR},
  97. </if>
  98. <if test="researchInnovation != null" >
  99. research_innovation = #{researchInnovation,jdbcType=VARCHAR},
  100. </if>
  101. <if test="personnel != null" >
  102. personnel = #{personnel,jdbcType=VARCHAR},
  103. </if>
  104. </set>
  105. where id = #{id,jdbcType=VARCHAR}
  106. </update>
  107. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserAbility" >
  108. update user_ability
  109. set uid = #{uid,jdbcType=VARCHAR},
  110. ability_label = #{abilityLabel,jdbcType=VARCHAR},
  111. intellect_right = #{intellectRight,jdbcType=VARCHAR},
  112. science_achievement = #{scienceAchievement,jdbcType=VARCHAR},
  113. research_innovation = #{researchInnovation,jdbcType=VARCHAR},
  114. personnel = #{personnel,jdbcType=VARCHAR}
  115. where id = #{id,jdbcType=VARCHAR}
  116. </update>
  117. <select id="selectUserAbilityByUserId" parameterType="java.lang.String" resultMap="BaseResultMap">
  118. select
  119. <include refid="Base_Column_List" />
  120. from user_ability
  121. where uid = #{uid,jdbcType=VARCHAR}
  122. </select>
  123. </mapper>