InterviewMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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.InterviewMapper" >
  4. <resultMap id="BaseResultMap" type="com.ssm.model.business.Interview" >
  5. <id column="InterviewId" property="interviewid" jdbcType="INTEGER" />
  6. <result column="ResumeId" property="resumeid" jdbcType="INTEGER" />
  7. <result column="ProjectId" property="projectid" jdbcType="INTEGER" />
  8. <result column="status" property="status" jdbcType="VARCHAR" />
  9. <result column="UnEmplyeeReson" property="unemplyeereson" jdbcType="VARCHAR" />
  10. <result column="UnJoineReson" property="unjoinereson" jdbcType="VARCHAR" />
  11. <result column="JoinDate" property="joindate" jdbcType="TIMESTAMP" />
  12. <result column="Salary" property="salary" jdbcType="VARCHAR" />
  13. <result column="UserId" property="userid" jdbcType="INTEGER" />
  14. <result column="InterviewDate" property="interviewdate" jdbcType="TIMESTAMP" />
  15. <result column="IsDeleted" property="isdeleted" jdbcType="BIT" />
  16. <result column="createusername" property="createusername" jdbcType="VARCHAR" />
  17. <result column="advice" property="advice" jdbcType="VARCHAR" />
  18. <result column="MeetingDate" property="meetingdate" jdbcType="TIMESTAMP" />
  19. <result column="interviewername" property="interviewername" jdbcType="VARCHAR" />
  20. <association property="project" javaType="com.ssm.model.business.RecruitProject">
  21. <result column="pr_ProjectName" property="projectname" jdbcType="VARCHAR" />
  22. <result column="pr_PositionName" property="positionname" jdbcType="VARCHAR" />
  23. <result column="pr_KeyWords" property="keywords" jdbcType="VARCHAR" />
  24. <result column="pr_Degree" property="degree" jdbcType="VARCHAR" />
  25. <result column="pr_PositionNumber" property="positionnumber" jdbcType="VARCHAR" />
  26. </association>
  27. <!-- 绑定的简历 -->
  28. <association property="resume" javaType="com.ssm.model.business.Resume">
  29. <result column="re_UserName" property="username" jdbcType="VARCHAR" />
  30. <result column="re_Gender" property="gender" jdbcType="VARCHAR" />
  31. <result column="re_Birthday" property="birthday" jdbcType="TIMESTAMP" />
  32. <result column="re_Degree" property="degree" jdbcType="VARCHAR" />
  33. <result column="re_Experience" property="experience" jdbcType="VARCHAR" />
  34. <result column="re_Mobile" property="mobile" jdbcType="VARCHAR" />
  35. <result column="re_Email" property="email" jdbcType="VARCHAR" />
  36. <result column="re_GraduateCollege" property="graduatecollege" jdbcType="VARCHAR" />
  37. <result column="re_Major" property="major" jdbcType="VARCHAR" />
  38. </association>
  39. </resultMap>
  40. <sql id="Base_Column_List" >
  41. InterviewId, ResumeId, ProjectId, status, UnEmplyeeReson,
  42. UnJoineReson, JoinDate, Salary, UserId, InterviewDate, IsDeleted
  43. </sql>
  44. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  45. select
  46. <include refid="Base_Column_List" />
  47. from Interview
  48. where InterviewId = #{interviewid,jdbcType=INTEGER}
  49. </select>
  50. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  51. delete from Interview
  52. where InterviewId = #{interviewid,jdbcType=INTEGER}
  53. </delete>
  54. <insert id="insert" parameterType="com.ssm.model.business.Interview" >
  55. insert into Interview (InterviewId, ResumeId, ProjectId, status,
  56. UnEmplyeeReson, UnJoineReson, JoinDate,
  57. Salary, UserId, InterviewDate,
  58. IsDeleted)
  59. values (#{interviewid,jdbcType=INTEGER}, #{resumeid,jdbcType=INTEGER}, #{projectid,jdbcType=INTEGER},
  60. #{status,jdbcType=VARCHAR},
  61. #{unemplyeereson,jdbcType=VARCHAR}, #{unjoinereson,jdbcType=VARCHAR}, #{joindate,jdbcType=TIMESTAMP},
  62. #{salary,jdbcType=VARCHAR}, #{userid,jdbcType=INTEGER}, #{interviewdate,jdbcType=TIMESTAMP},
  63. #{isdeleted,jdbcType=BIT})
  64. </insert>
  65. <insert id="insertSelective" parameterType="com.ssm.model.business.Interview" >
  66. <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="interviewid">
  67. SELECT LAST_INSERT_ID()
  68. </selectKey>
  69. insert into Interview
  70. <trim prefix="(" suffix=")" suffixOverrides="," >
  71. <if test="interviewid != null" >
  72. InterviewId,
  73. </if>
  74. <if test="resumeid != null" >
  75. ResumeId,
  76. </if>
  77. <if test="projectid != null" >
  78. ProjectId,
  79. </if>
  80. <if test="status != null" >
  81. status,
  82. </if>
  83. <if test="unemplyeereson != null" >
  84. UnEmplyeeReson,
  85. </if>
  86. <if test="unjoinereson != null" >
  87. UnJoineReson,
  88. </if>
  89. <if test="joindate != null" >
  90. JoinDate,
  91. </if>
  92. <if test="salary != null" >
  93. Salary,
  94. </if>
  95. <if test="userid != null" >
  96. UserId,
  97. </if>
  98. <if test="interviewdate != null" >
  99. InterviewDate,
  100. </if>
  101. <if test="isdeleted != null" >
  102. IsDeleted,
  103. </if>
  104. </trim>
  105. <trim prefix="values (" suffix=")" suffixOverrides="," >
  106. <if test="interviewid != null" >
  107. #{interviewid,jdbcType=INTEGER},
  108. </if>
  109. <if test="resumeid != null" >
  110. #{resumeid,jdbcType=INTEGER},
  111. </if>
  112. <if test="projectid != null" >
  113. #{projectid,jdbcType=INTEGER},
  114. </if>
  115. <if test="status != null" >
  116. #{status,jdbcType=VARCHAR},
  117. </if>
  118. <if test="unemplyeereson != null" >
  119. #{unemplyeereson,jdbcType=VARCHAR},
  120. </if>
  121. <if test="unjoinereson != null" >
  122. #{unjoinereson,jdbcType=VARCHAR},
  123. </if>
  124. <if test="joindate != null" >
  125. #{joindate,jdbcType=TIMESTAMP},
  126. </if>
  127. <if test="salary != null" >
  128. #{salary,jdbcType=VARCHAR},
  129. </if>
  130. <if test="userid != null" >
  131. #{userid,jdbcType=INTEGER},
  132. </if>
  133. <if test="interviewdate != null" >
  134. #{interviewdate,jdbcType=TIMESTAMP},
  135. </if>
  136. <if test="isdeleted != null" >
  137. #{isdeleted,jdbcType=BIT},
  138. </if>
  139. </trim>
  140. </insert>
  141. <update id="updateByPrimaryKeySelective" parameterType="com.ssm.model.business.Interview" >
  142. update Interview
  143. <set >
  144. <if test="resumeid != null" >
  145. ResumeId = #{resumeid,jdbcType=INTEGER},
  146. </if>
  147. <if test="projectid != null" >
  148. ProjectId = #{projectid,jdbcType=INTEGER},
  149. </if>
  150. <if test="status != null" >
  151. status = #{status,jdbcType=VARCHAR},
  152. </if>
  153. <if test="unemplyeereson != null" >
  154. UnEmplyeeReson = #{unemplyeereson,jdbcType=VARCHAR},
  155. </if>
  156. <if test="unjoinereson != null" >
  157. UnJoineReson = #{unjoinereson,jdbcType=VARCHAR},
  158. </if>
  159. <if test="joindate != null" >
  160. JoinDate = #{joindate,jdbcType=TIMESTAMP},
  161. </if>
  162. <if test="salary != null" >
  163. Salary = #{salary,jdbcType=VARCHAR},
  164. </if>
  165. <if test="userid != null" >
  166. UserId = #{userid,jdbcType=INTEGER},
  167. </if>
  168. <if test="interviewdate != null" >
  169. InterviewDate = #{interviewdate,jdbcType=TIMESTAMP},
  170. </if>
  171. <if test="isdeleted != null" >
  172. IsDeleted = #{isdeleted,jdbcType=BIT},
  173. </if>
  174. </set>
  175. where InterviewId = #{interviewid,jdbcType=INTEGER}
  176. </update>
  177. <update id="updateByPrimaryKey" parameterType="com.ssm.model.business.Interview" >
  178. update Interview
  179. set ResumeId = #{resumeid,jdbcType=INTEGER},
  180. ProjectId = #{projectid,jdbcType=INTEGER},
  181. status = #{status,jdbcType=VARCHAR},
  182. UnEmplyeeReson = #{unemplyeereson,jdbcType=VARCHAR},
  183. UnJoineReson = #{unjoinereson,jdbcType=VARCHAR},
  184. JoinDate = #{joindate,jdbcType=TIMESTAMP},
  185. Salary = #{salary,jdbcType=VARCHAR},
  186. UserId = #{userid,jdbcType=INTEGER},
  187. InterviewDate = #{interviewdate,jdbcType=TIMESTAMP},
  188. IsDeleted = #{isdeleted,jdbcType=BIT}
  189. where InterviewId = #{interviewid,jdbcType=INTEGER}
  190. </update>
  191. <!-- 查询面试记录状态 -->
  192. <select id="selectInterViewInviteData" resultMap="BaseResultMap">
  193. select iv.*,su.username createusername,
  194. rp.projectname pr_ProjectName,
  195. rp.PositionName pr_PositionName,
  196. rp.KeyWords pr_KeyWords,
  197. rp.Degree pr_Degree,
  198. rp.PositionNumber pr_PositionNumber,
  199. r.UserName re_UserName,
  200. r.Gender re_Gender,
  201. r.Degree re_Degree,
  202. r.Experience re_Experience,
  203. r.Mobile re_Mobile,
  204. r.Email re_Email,
  205. r.Major re_Major
  206. from Resume r, RecruitProject rp,Interview iv, SysUser su
  207. where iv.userid = su.userid
  208. AND iv.isdeleted = 0
  209. AND iv.ResumeId = r.ResumeID
  210. AND iv.ProjectId = rp.ProjectID
  211. <if test="item.userid != null and item.userid != '' ">
  212. and iv.userid = #{item.userid,jdbcType=INTEGER}
  213. </if>
  214. <if test="item.projectname != null and item.projectname != '' ">
  215. and rp.projectname LIKE CONCAT('%',#{item.projectname,jdbcType=VARCHAR},'%')
  216. </if>
  217. <if test="item.username != null and item.username != '' ">
  218. and r.username LIKE CONCAT('%',#{item.username,jdbcType=VARCHAR},'%')
  219. </if>
  220. <if test="item.c_username != null and item.c_username != '' ">
  221. and su.username LIKE CONCAT('%',#{item.c_username,jdbcType=VARCHAR},'%')
  222. </if>
  223. <if test="item.status != null and item.status != '' ">
  224. and iv.status = #{item.status,jdbcType=VARCHAR}
  225. </if>
  226. <if test="item.projectid != null and item.projectid != '' ">
  227. and iv.ProjectId = #{item.projectid}
  228. </if>
  229. order by iv.InterviewDate desc
  230. </select>
  231. <!-- 查询所有的我面试的记录 -->
  232. <select id="selectInterViewByInterviewer" resultMap="BaseResultMap">
  233. select iv.*,su.username createusername,rd.advice,rd.MeetingDate meetingdate,
  234. rp.projectname pr_ProjectName,
  235. rp.PositionName pr_PositionName,
  236. rp.KeyWords pr_KeyWords,
  237. rp.Degree pr_Degree,
  238. rp.PositionNumber pr_PositionNumber,
  239. r.UserName re_UserName,
  240. r.Gender re_Gender,
  241. r.Degree re_Degree,
  242. r.Experience re_Experience,
  243. r.Mobile re_Mobile,
  244. r.Email re_Email,
  245. r.Major re_Major
  246. from Resume r, RecruitProject rp,Interview iv, SysUser su ,InterviewRecord rd
  247. where iv.userid = su.userid and iv.isdeleted = 0
  248. and rd.interviewid = iv.interviewid
  249. AND iv.ResumeId = r.ResumeID AND iv.ProjectId = rp.ProjectID
  250. <if test="item.userid != null and item.userid != '' ">
  251. and rd.Interviewer = #{item.userid,jdbcType=INTEGER}
  252. </if>
  253. <if test="item.projectname != null and item.projectname != '' ">
  254. and rp.projectname LIKE CONCAT('%',#{item.projectname,jdbcType=VARCHAR},'%')
  255. </if>
  256. <if test="item.username != null and item.username != '' ">
  257. and r.username LIKE CONCAT('%',#{item.username,jdbcType=VARCHAR},'%')
  258. </if>
  259. <if test="item.c_username != null and item.c_username != '' ">
  260. and su.username LIKE CONCAT('%',#{item.c_username,jdbcType=VARCHAR},'%')
  261. </if>
  262. <if test="item.status != null and item.status != '' ">
  263. and iv.status = #{item.status,jdbcType=VARCHAR}
  264. </if>
  265. order by iv.interviewid asc
  266. </select>
  267. <select id="selectInterviewsByResumeid" resultMap="BaseResultMap">
  268. select iv.*,su.username createusername,
  269. rp.projectname pr_ProjectName,
  270. rp.PositionName pr_PositionName,
  271. rp.KeyWords pr_KeyWords,
  272. rp.Degree pr_Degree,
  273. rp.PositionNumber pr_PositionNumber,
  274. r.UserName re_UserName,
  275. r.Gender re_Gender,
  276. r.Degree re_Degree,
  277. r.Experience re_Experience,
  278. r.Mobile re_Mobile,
  279. r.Email re_Email,
  280. r.Major re_Major
  281. from Resume r, RecruitProject rp,Interview iv, SysUser su , InterviewRecord rd
  282. where iv.userid = su.userid
  283. and rd.interviewid = iv.interviewid
  284. AND iv.ResumeId = r.ResumeID AND iv.ProjectId = rp.ProjectID
  285. AND r.ResumeID = #{resumeid}
  286. order by iv.interviewid desc
  287. </select>
  288. <select id="selectInterviewingResumesByProjectId" resultType="java.lang.Integer">
  289. SELECT count(iv.InterviewId) from Interview iv WHERE iv.IsDeleted=0 AND iv.status='0'
  290. AND iv.ProjectId= #{projectid}
  291. </select>
  292. <select id="selectEmployedResumesByProjectId" resultType="java.lang.Integer">
  293. SELECT count(iv.InterviewId) from Interview iv WHERE iv.IsDeleted=0 AND iv.status='2'
  294. AND iv.ProjectId= #{projectid}
  295. </select>
  296. </mapper>