OrgTechAchievementMapper.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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.OrgTechAchievementMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrgTechAchievement" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="uid" property="uid" jdbcType="VARCHAR" />
  7. <result column="achievement_name" property="achievementName" jdbcType="VARCHAR" />
  8. <result column="source" property="source" jdbcType="VARCHAR" />
  9. <result column="conversion_form" property="conversionForm" jdbcType="INTEGER" />
  10. <result column="conversion_result" property="conversionResult" jdbcType="VARCHAR" />
  11. <result column="year" property="year" jdbcType="INTEGER" />
  12. <result column="enclosure_url" property="enclosureUrl" jdbcType="VARCHAR" />
  13. <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
  14. </resultMap>
  15. <sql id="Base_Column_List" >
  16. id, uid, achievement_name, source, conversion_form, conversion_result, year, enclosure_url,
  17. deleted_sign
  18. </sql>
  19. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  20. select
  21. <include refid="Base_Column_List" />
  22. from org_tech_achievement
  23. where id = #{id,jdbcType=VARCHAR}
  24. </select>
  25. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  26. delete from org_tech_achievement
  27. where id = #{id,jdbcType=VARCHAR}
  28. </delete>
  29. <insert id="insert" parameterType="com.goafanti.common.model.OrgTechAchievement" >
  30. insert into org_tech_achievement (id, uid, achievement_name,
  31. source, conversion_form, conversion_result,
  32. year, enclosure_url, deleted_sign
  33. )
  34. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{achievementName,jdbcType=VARCHAR},
  35. #{source,jdbcType=VARCHAR}, #{conversionForm,jdbcType=INTEGER}, #{conversionResult,jdbcType=VARCHAR},
  36. #{year,jdbcType=INTEGER}, #{enclosureUrl,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER}
  37. )
  38. </insert>
  39. <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgTechAchievement" >
  40. insert into org_tech_achievement
  41. <trim prefix="(" suffix=")" suffixOverrides="," >
  42. <if test="id != null" >
  43. id,
  44. </if>
  45. <if test="uid != null" >
  46. uid,
  47. </if>
  48. <if test="achievementName != null" >
  49. achievement_name,
  50. </if>
  51. <if test="source != null" >
  52. source,
  53. </if>
  54. <if test="conversionForm != null" >
  55. conversion_form,
  56. </if>
  57. <if test="conversionResult != null" >
  58. conversion_result,
  59. </if>
  60. <if test="year != null" >
  61. year,
  62. </if>
  63. <if test="enclosureUrl != null" >
  64. enclosure_url,
  65. </if>
  66. <if test="deletedSign != null" >
  67. deleted_sign,
  68. </if>
  69. </trim>
  70. <trim prefix="values (" suffix=")" suffixOverrides="," >
  71. <if test="id != null" >
  72. #{id,jdbcType=VARCHAR},
  73. </if>
  74. <if test="uid != null" >
  75. #{uid,jdbcType=VARCHAR},
  76. </if>
  77. <if test="achievementName != null" >
  78. #{achievementName,jdbcType=VARCHAR},
  79. </if>
  80. <if test="source != null" >
  81. #{source,jdbcType=VARCHAR},
  82. </if>
  83. <if test="conversionForm != null" >
  84. #{conversionForm,jdbcType=INTEGER},
  85. </if>
  86. <if test="conversionResult != null" >
  87. #{conversionResult,jdbcType=VARCHAR},
  88. </if>
  89. <if test="year != null" >
  90. #{year,jdbcType=INTEGER},
  91. </if>
  92. <if test="enclosureUrl != null" >
  93. #{enclosureUrl,jdbcType=VARCHAR},
  94. </if>
  95. <if test="deletedSign != null" >
  96. #{deletedSign,jdbcType=INTEGER},
  97. </if>
  98. </trim>
  99. </insert>
  100. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrgTechAchievement" >
  101. update org_tech_achievement
  102. <set >
  103. <if test="uid != null" >
  104. uid = #{uid,jdbcType=VARCHAR},
  105. </if>
  106. <if test="achievementName != null" >
  107. achievement_name = #{achievementName,jdbcType=VARCHAR},
  108. </if>
  109. <if test="source != null" >
  110. source = #{source,jdbcType=VARCHAR},
  111. </if>
  112. <if test="conversionForm != null" >
  113. conversion_form = #{conversionForm,jdbcType=INTEGER},
  114. </if>
  115. <if test="conversionResult != null" >
  116. conversion_result = #{conversionResult,jdbcType=VARCHAR},
  117. </if>
  118. <if test="year != null" >
  119. year = #{year,jdbcType=INTEGER},
  120. </if>
  121. <if test="enclosureUrl != null" >
  122. enclosure_url = #{enclosureUrl,jdbcType=VARCHAR},
  123. </if>
  124. <if test="deletedSign != null" >
  125. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  126. </if>
  127. </set>
  128. where id = #{id,jdbcType=VARCHAR}
  129. </update>
  130. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrgTechAchievement" >
  131. update org_tech_achievement
  132. set uid = #{uid,jdbcType=VARCHAR},
  133. achievement_name = #{achievementName,jdbcType=VARCHAR},
  134. source = #{source,jdbcType=VARCHAR},
  135. conversion_form = #{conversionForm,jdbcType=INTEGER},
  136. conversion_result = #{conversionResult,jdbcType=VARCHAR},
  137. year = #{year,jdbcType=INTEGER},
  138. enclosure_url = #{enclosureUrl,jdbcType=VARCHAR},
  139. deleted_sign = #{deletedSign,jdbcType=INTEGER}
  140. where id = #{id,jdbcType=VARCHAR}
  141. </update>
  142. <select id="findOrgTechAchievementListByPage" parameterType="java.lang.String" resultMap="BaseResultMap">
  143. select
  144. <include refid="Base_Column_List" />
  145. from org_tech_achievement
  146. where deleted_sign = 0
  147. <if test="uid != null">
  148. and uid = #{uid,jdbcType=VARCHAR}
  149. </if>
  150. order by year desc
  151. <if test="page_sql != null">
  152. ${page_sql}
  153. </if>
  154. </select>
  155. <select id="findOrgTechAchievementCount" resultType="java.lang.Integer" parameterType="String">
  156. select count(1)
  157. from org_tech_achievement
  158. where deleted_sign = 0
  159. <if test="uid != null">
  160. and uid = #{uid,jdbcType=VARCHAR}
  161. </if>
  162. </select>
  163. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  164. update org_tech_achievement set deleted_sign = 1
  165. where id in
  166. <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
  167. #{item}
  168. </foreach>
  169. </update>
  170. </mapper>