OrgStandardMapper.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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.OrgStandardMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrgStandard" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="uid" property="uid" jdbcType="VARCHAR" />
  7. <result column="standard_name" property="standardName" jdbcType="VARCHAR" />
  8. <result column="standard_number" property="standardNumber" jdbcType="VARCHAR" />
  9. <result column="standard_level" property="standardLevel" jdbcType="INTEGER" />
  10. <result column="participate_way" property="participateWay" jdbcType="INTEGER" />
  11. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  12. <result column="year" property="year" jdbcType="INTEGER" />
  13. <result column="enclosure_url" property="enclosureUrl" jdbcType="VARCHAR" />
  14. <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
  15. </resultMap>
  16. <sql id="Base_Column_List" >
  17. id, uid, standard_name, standard_number, standard_level, participate_way, create_time, year,
  18. enclosure_url, deleted_sign
  19. </sql>
  20. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  21. select
  22. <include refid="Base_Column_List" />
  23. from org_standard
  24. where id = #{id,jdbcType=VARCHAR}
  25. </select>
  26. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  27. delete from org_standard
  28. where id = #{id,jdbcType=VARCHAR}
  29. </delete>
  30. <insert id="insert" parameterType="com.goafanti.common.model.OrgStandard" >
  31. insert into org_standard (id, uid, standard_name,
  32. standard_number, standard_level, participate_way, create_time, year,
  33. enclosure_url, deleted_sign
  34. )
  35. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{standardName,jdbcType=VARCHAR},
  36. #{standardNumber,jdbcType=VARCHAR}, #{standardLevel,jdbcType=INTEGER}, #{participateWay,jdbcType=INTEGER},
  37. #{createTime,jdbcType=TIMESTAMP}, #{year,jdbcType=INTEGER}, #{enclosureUrl,jdbcType=VARCHAR},
  38. #{deletedSign,jdbcType=INTEGER}
  39. )
  40. </insert>
  41. <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgStandard" >
  42. insert into org_standard
  43. <trim prefix="(" suffix=")" suffixOverrides="," >
  44. <if test="id != null" >
  45. id,
  46. </if>
  47. <if test="uid != null" >
  48. uid,
  49. </if>
  50. <if test="standardName != null" >
  51. standard_name,
  52. </if>
  53. <if test="standardNumber != null" >
  54. standard_number,
  55. </if>
  56. <if test="standardLevel != null" >
  57. standard_level,
  58. </if>
  59. <if test="participateWay != null" >
  60. participate_way,
  61. </if>
  62. <if test="createTime != null" >
  63. create_time,
  64. </if>
  65. <if test="year != null" >
  66. year,
  67. </if>
  68. <if test="enclosureUrl != null" >
  69. enclosure_url,
  70. </if>
  71. <if test="deletedSign != null" >
  72. deleted_sign,
  73. </if>
  74. </trim>
  75. <trim prefix="values (" suffix=")" suffixOverrides="," >
  76. <if test="id != null" >
  77. #{id,jdbcType=VARCHAR},
  78. </if>
  79. <if test="uid != null" >
  80. #{uid,jdbcType=VARCHAR},
  81. </if>
  82. <if test="standardName != null" >
  83. #{standardName,jdbcType=VARCHAR},
  84. </if>
  85. <if test="standardNumber != null" >
  86. #{standardNumber,jdbcType=VARCHAR},
  87. </if>
  88. <if test="standardLevel != null" >
  89. #{standardLevel,jdbcType=INTEGER},
  90. </if>
  91. <if test="participateWay != null" >
  92. #{participateWay,jdbcType=INTEGER},
  93. </if>
  94. <if test="createTime != null" >
  95. #{createTime,jdbcType=TIMESTAMP},
  96. </if>
  97. <if test="year != null" >
  98. #{year,jdbcType=INTEGER},
  99. </if>
  100. <if test="enclosureUrl != null" >
  101. #{enclosureUrl,jdbcType=VARCHAR},
  102. </if>
  103. <if test="deletedSign != null" >
  104. #{deletedSign,jdbcType=INTEGER},
  105. </if>
  106. </trim>
  107. </insert>
  108. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrgStandard" >
  109. update org_standard
  110. <set >
  111. <if test="uid != null" >
  112. uid = #{uid,jdbcType=VARCHAR},
  113. </if>
  114. <if test="standardName != null" >
  115. standard_name = #{standardName,jdbcType=VARCHAR},
  116. </if>
  117. <if test="standardNumber != null" >
  118. standard_number = #{standardNumber,jdbcType=VARCHAR},
  119. </if>
  120. <if test="standardLevel != null" >
  121. standard_level = #{standardLevel,jdbcType=INTEGER},
  122. </if>
  123. <if test="participateWay != null" >
  124. participate_way = #{participateWay,jdbcType=INTEGER},
  125. </if>
  126. <if test="createTime != null" >
  127. create_time = #{createTime,jdbcType=TIMESTAMP},
  128. </if>
  129. <if test="year != null" >
  130. year = #{year,jdbcType=INTEGER},
  131. </if>
  132. <if test="enclosureUrl != null" >
  133. enclosure_url = #{enclosureUrl,jdbcType=VARCHAR},
  134. </if>
  135. <if test="deletedSign != null" >
  136. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  137. </if>
  138. </set>
  139. where id = #{id,jdbcType=VARCHAR}
  140. </update>
  141. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrgStandard" >
  142. update org_standard
  143. set uid = #{uid,jdbcType=VARCHAR},
  144. standard_name = #{standardName,jdbcType=VARCHAR},
  145. standard_number = #{standardNumber,jdbcType=VARCHAR},
  146. standard_level = #{standardLevel,jdbcType=INTEGER},
  147. participate_way = #{participateWay,jdbcType=INTEGER},
  148. create_time = #{createTime,jdbcType=TIMESTAMP},
  149. year = #{year,jdbcType=INTEGER},
  150. enclosure_url = #{enclosureUrl,jdbcType=VARCHAR},
  151. deleted_sign = #{deletedSign,jdbcType=INTEGER}
  152. where id = #{id,jdbcType=VARCHAR}
  153. </update>
  154. <select id="findOrgStandardListByPage" parameterType="java.lang.String" resultMap="BaseResultMap">
  155. select
  156. <include refid="Base_Column_List" />
  157. from org_standard
  158. where deleted_sign = 0
  159. <if test="uid != null">
  160. and uid = #{uid,jdbcType=VARCHAR}
  161. </if>
  162. <if test="year != null">
  163. and year = #{year,jdbcType=INTEGER}
  164. </if>
  165. <if test="standardName != null">
  166. and standard_name = #{standardName,jdbcType=VARCHAR}
  167. </if>
  168. <if test="standardNumber != null">
  169. and standard_number= #{standardNumber,jdbcType=VARCHAR}
  170. </if>
  171. <if test="standardLevel != null">
  172. and standard_level= #{standardLevel,jdbcType=INTEGER}
  173. </if>
  174. <if test="participateWay != null">
  175. and participate_way= #{participateWay,jdbcType=INTEGER}
  176. </if>
  177. order by create_time desc
  178. <if test="page_sql != null">
  179. ${page_sql}
  180. </if>
  181. </select>
  182. <select id="findOrgStandardCount" resultType="java.lang.Integer" parameterType="String">
  183. select count(1)
  184. from org_standard
  185. where deleted_sign = 0
  186. <if test="uid != null">
  187. and uid = #{uid,jdbcType=VARCHAR}
  188. </if>
  189. <if test="year != null">
  190. and year = #{year,jdbcType=INTEGER}
  191. </if>
  192. <if test="standardName != null">
  193. and standard_name = #{standardName,jdbcType=VARCHAR}
  194. </if>
  195. <if test="standardNumber != null">
  196. and standard_number= #{standardNumber,jdbcType=VARCHAR}
  197. </if>
  198. <if test="standardLevel != null">
  199. and standard_level= #{standardLevel,jdbcType=INTEGER}
  200. </if>
  201. <if test="participateWay != null">
  202. and participate_way= #{participateWay,jdbcType=INTEGER}
  203. </if>
  204. </select>
  205. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  206. update org_standard set deleted_sign = 1
  207. where id in
  208. <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
  209. #{item}
  210. </foreach>
  211. </update>
  212. </mapper>