ResumeEducationMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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.ssm.mapper.business.ResumeEducationMapper" >
  4. <resultMap id="BaseResultMap" type="com.ssm.model.business.ResumeEducation" >
  5. <id column="EduId" property="eduid" jdbcType="INTEGER" />
  6. <result column="SchoolName" property="schoolname" jdbcType="VARCHAR" />
  7. <result column="Major" property="major" jdbcType="VARCHAR" />
  8. <result column="EduStartDate" property="edustartdate" jdbcType="TIMESTAMP" />
  9. <result column="EduEndDate" property="eduenddate" jdbcType="TIMESTAMP" />
  10. <result column="Degree" property="degree" jdbcType="VARCHAR" />
  11. <result column="ResumeID" property="resumeid" jdbcType="INTEGER" />
  12. <result column="Detail" property="detail" jdbcType="VARCHAR" />
  13. <result column="OrderBy" property="orderby" jdbcType="INTEGER" />
  14. </resultMap>
  15. <sql id="Base_Column_List" >
  16. EduId, SchoolName, Major, EduStartDate, EduEndDate, Degree, ResumeID, Detail, OrderBy
  17. </sql>
  18. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  19. select
  20. <include refid="Base_Column_List" />
  21. from ResumeEducation
  22. where EduId = #{eduid,jdbcType=INTEGER}
  23. </select>
  24. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  25. delete from ResumeEducation
  26. where EduId = #{eduid,jdbcType=INTEGER}
  27. </delete>
  28. <insert id="insert" parameterType="com.ssm.model.business.ResumeEducation" >
  29. insert into ResumeEducation (EduId, SchoolName, Major,
  30. EduStartDate, EduEndDate, Degree,
  31. ResumeID, Detail, OrderBy
  32. )
  33. values (#{eduid,jdbcType=INTEGER}, #{schoolname,jdbcType=VARCHAR}, #{major,jdbcType=VARCHAR},
  34. #{edustartdate,jdbcType=TIMESTAMP}, #{eduenddate,jdbcType=TIMESTAMP}, #{degree,jdbcType=VARCHAR},
  35. #{resumeid,jdbcType=INTEGER}, #{detail,jdbcType=VARCHAR}, #{orderby,jdbcType=INTEGER}
  36. )
  37. </insert>
  38. <insert id="insertSelective" parameterType="com.ssm.model.business.ResumeEducation" >
  39. insert into ResumeEducation
  40. <trim prefix="(" suffix=")" suffixOverrides="," >
  41. <if test="eduid != null" >
  42. EduId,
  43. </if>
  44. <if test="schoolname != null" >
  45. SchoolName,
  46. </if>
  47. <if test="major != null" >
  48. Major,
  49. </if>
  50. <if test="edustartdate != null" >
  51. EduStartDate,
  52. </if>
  53. <if test="eduenddate != null" >
  54. EduEndDate,
  55. </if>
  56. <if test="degree != null" >
  57. Degree,
  58. </if>
  59. <if test="resumeid != null" >
  60. ResumeID,
  61. </if>
  62. <if test="detail != null" >
  63. Detail,
  64. </if>
  65. <if test="orderby != null" >
  66. OrderBy,
  67. </if>
  68. </trim>
  69. <trim prefix="values (" suffix=")" suffixOverrides="," >
  70. <if test="eduid != null" >
  71. #{eduid,jdbcType=INTEGER},
  72. </if>
  73. <if test="schoolname != null" >
  74. #{schoolname,jdbcType=VARCHAR},
  75. </if>
  76. <if test="major != null" >
  77. #{major,jdbcType=VARCHAR},
  78. </if>
  79. <if test="edustartdate != null" >
  80. #{edustartdate,jdbcType=TIMESTAMP},
  81. </if>
  82. <if test="eduenddate != null" >
  83. #{eduenddate,jdbcType=TIMESTAMP},
  84. </if>
  85. <if test="degree != null" >
  86. #{degree,jdbcType=VARCHAR},
  87. </if>
  88. <if test="resumeid != null" >
  89. #{resumeid,jdbcType=INTEGER},
  90. </if>
  91. <if test="detail != null" >
  92. #{detail,jdbcType=VARCHAR},
  93. </if>
  94. <if test="orderby != null" >
  95. #{orderby,jdbcType=INTEGER},
  96. </if>
  97. </trim>
  98. ON DUPLICATE KEY UPDATE
  99. <trim suffixOverrides=",">
  100. <if test="schoolname != null" >
  101. SchoolName = #{schoolname,jdbcType=VARCHAR},
  102. </if>
  103. <if test="major != null" >
  104. Major = #{major,jdbcType=VARCHAR},
  105. </if>
  106. <if test="edustartdate != null" >
  107. EduStartDate = #{edustartdate,jdbcType=TIMESTAMP},
  108. </if>
  109. <if test="eduenddate != null" >
  110. EduEndDate = #{eduenddate,jdbcType=TIMESTAMP},
  111. </if>
  112. <if test="degree != null" >
  113. Degree = #{degree,jdbcType=VARCHAR},
  114. </if>
  115. <if test="detail != null" >
  116. Detail = #{detail,jdbcType=VARCHAR},
  117. </if>
  118. <if test="orderby != null" >
  119. OrderBy = #{orderby,jdbcType=INTEGER},
  120. </if>
  121. </trim>
  122. </insert>
  123. <update id="updateByPrimaryKeySelective" parameterType="com.ssm.model.business.ResumeEducation" >
  124. update ResumeEducation
  125. <set >
  126. <if test="schoolname != null" >
  127. SchoolName = #{schoolname,jdbcType=VARCHAR},
  128. </if>
  129. <if test="major != null" >
  130. Major = #{major,jdbcType=VARCHAR},
  131. </if>
  132. <if test="edustartdate != null" >
  133. EduStartDate = #{edustartdate,jdbcType=TIMESTAMP},
  134. </if>
  135. <if test="eduenddate != null" >
  136. EduEndDate = #{eduenddate,jdbcType=TIMESTAMP},
  137. </if>
  138. <if test="degree != null" >
  139. Degree = #{degree,jdbcType=VARCHAR},
  140. </if>
  141. <if test="resumeid != null" >
  142. ResumeID = #{resumeid,jdbcType=INTEGER},
  143. </if>
  144. <if test="detail != null" >
  145. Detail = #{detail,jdbcType=VARCHAR},
  146. </if>
  147. <if test="orderby != null" >
  148. OrderBy = #{orderby,jdbcType=INTEGER},
  149. </if>
  150. </set>
  151. where EduId = #{eduid,jdbcType=INTEGER}
  152. </update>
  153. <update id="updateByPrimaryKey" parameterType="com.ssm.model.business.ResumeEducation" >
  154. update ResumeEducation
  155. set SchoolName = #{schoolname,jdbcType=VARCHAR},
  156. Major = #{major,jdbcType=VARCHAR},
  157. EduStartDate = #{edustartdate,jdbcType=TIMESTAMP},
  158. EduEndDate = #{eduenddate,jdbcType=TIMESTAMP},
  159. Degree = #{degree,jdbcType=VARCHAR},
  160. ResumeID = #{resumeid,jdbcType=INTEGER},
  161. Detail = #{detail,jdbcType=VARCHAR},
  162. OrderBy = #{orderby,jdbcType=INTEGER}
  163. where EduId = #{eduid,jdbcType=INTEGER}
  164. </update>
  165. <select id="selectEduListByResumeId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  166. SELECT * from ResumeEducation s where s.ResumeID=#{resumeId} ORDER BY s.OrderBy ASC
  167. </select>
  168. </mapper>