OrgTechCenterDetailMapper.xml 6.5 KB

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