RecruitProjectMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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.RecruitProjectMapper" >
  4. <resultMap id="BaseResultMap" type="com.ssm.model.business.RecruitProject" >
  5. <id column="ProjectID" property="projectid" jdbcType="INTEGER" />
  6. <result column="ProjectName" property="projectname" jdbcType="VARCHAR" />
  7. <result column="CompanyId" property="companyid" jdbcType="INTEGER" />
  8. <result column="PositionName" property="positionname" jdbcType="VARCHAR" />
  9. <result column="KeyWords" property="keywords" jdbcType="VARCHAR" />
  10. <result column="Degree" property="degree" jdbcType="VARCHAR" />
  11. <result column="Experience" property="experience" jdbcType="VARCHAR" />
  12. <result column="Salary" property="salary" jdbcType="VARCHAR" />
  13. <result column="PositionNumber" property="positionnumber" jdbcType="VARCHAR" />
  14. <result column="Detail" property="detail" jdbcType="VARCHAR" />
  15. <result column="Status" property="status" jdbcType="BIT" />
  16. <result column="UserId" property="userid" jdbcType="INTEGER" />
  17. <result column="CreateDate" property="createdate" jdbcType="TIMESTAMP" />
  18. <result column="UpdateUserId" property="updateuserid" jdbcType="INTEGER" />
  19. <result column="UpdateDate" property="updatedate" jdbcType="TIMESTAMP" />
  20. <result column="UserName" property="username" jdbcType="VARCHAR" />
  21. <result column="bindnum" property="bindnum" jdbcType="VARCHAR" />
  22. <result column="interviewnum" property="interviewnum" jdbcType="VARCHAR" />
  23. <result column="luyong" property="luyong" jdbcType="VARCHAR" />
  24. <result column="ruzhi" property="ruzhi" jdbcType="VARCHAR" />
  25. <result column="companyname" property="companyname" jdbcType="VARCHAR" />
  26. <result column="contactname" property="contactname" jdbcType="VARCHAR" />
  27. <result column="contactmobile" property="contactmobile" jdbcType="VARCHAR" />
  28. </resultMap>
  29. <sql id="Base_Column_List" >
  30. ProjectID, ProjectName, CompanyId, PositionName, KeyWords, Degree, Experience, Salary,
  31. PositionNumber, Detail, Status, UserId, CreateDate, UpdateUserId, UpdateDate
  32. </sql>
  33. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  34. select
  35. <include refid="Base_Column_List" />
  36. from RecruitProject
  37. where ProjectID = #{projectid,jdbcType=INTEGER}
  38. </select>
  39. <!-- 查询所有正在招聘的项目 -->
  40. <select id="selectAllRecruitmentProject" resultMap="BaseResultMap">
  41. SELECT rp.*, rc.CompanyName ,rc.contactmobile,rc.contactname
  42. FROM
  43. RecruitProject rp,
  44. RecruitCompany rc
  45. WHERE
  46. rp.Status = 0
  47. AND rc.CompanyId = rp.CompanyId
  48. ORDER BY
  49. rp.ProjectID ASC
  50. </select>
  51. <!-- 根据公司ID查询公司是否绑定了项目 -->
  52. <select id="selectByCompanyId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  53. SELECT * FROM RecruitProject WHERE CompanyId =#{CompanyId,jdbcType=INTEGER}
  54. </select>
  55. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  56. delete from RecruitProject
  57. where ProjectID = #{projectid,jdbcType=INTEGER}
  58. </delete>
  59. <insert id="insert" parameterType="com.ssm.model.business.RecruitProject" >
  60. insert into RecruitProject (ProjectID, ProjectName, CompanyId,
  61. PositionName, KeyWords, Degree,
  62. Experience, Salary, PositionNumber,
  63. Detail, Status, UserId,
  64. CreateDate, UpdateUserId, UpdateDate
  65. )
  66. values (#{projectid,jdbcType=INTEGER}, #{projectname,jdbcType=VARCHAR}, #{companyid,jdbcType=INTEGER},
  67. #{positionname,jdbcType=VARCHAR}, #{keywords,jdbcType=VARCHAR}, #{degree,jdbcType=VARCHAR},
  68. #{experience,jdbcType=VARCHAR}, #{salary,jdbcType=VARCHAR}, #{positionnumber,jdbcType=VARCHAR},
  69. #{detail,jdbcType=VARCHAR}, #{status,jdbcType=BIT}, #{userid,jdbcType=INTEGER},
  70. #{createdate,jdbcType=TIMESTAMP}, #{updateuserid,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}
  71. )
  72. </insert>
  73. <insert id="insertSelective" parameterType="com.ssm.model.business.RecruitProject" >
  74. insert into RecruitProject
  75. <trim prefix="(" suffix=")" suffixOverrides="," >
  76. <if test="projectid != null" >
  77. ProjectID,
  78. </if>
  79. <if test="projectname != null" >
  80. ProjectName,
  81. </if>
  82. <if test="companyid != null" >
  83. CompanyId,
  84. </if>
  85. <if test="positionname != null" >
  86. PositionName,
  87. </if>
  88. <if test="keywords != null" >
  89. KeyWords,
  90. </if>
  91. <if test="degree != null" >
  92. Degree,
  93. </if>
  94. <if test="experience != null" >
  95. Experience,
  96. </if>
  97. <if test="salary != null" >
  98. Salary,
  99. </if>
  100. <if test="positionnumber != null" >
  101. PositionNumber,
  102. </if>
  103. <if test="detail != null" >
  104. Detail,
  105. </if>
  106. <if test="status != null" >
  107. Status,
  108. </if>
  109. <if test="userid != null" >
  110. UserId,
  111. </if>
  112. <if test="createdate != null" >
  113. CreateDate,
  114. </if>
  115. <if test="updateuserid != null" >
  116. UpdateUserId,
  117. </if>
  118. <if test="updatedate != null" >
  119. UpdateDate,
  120. </if>
  121. </trim>
  122. <trim prefix="values (" suffix=")" suffixOverrides="," >
  123. <if test="projectid != null" >
  124. #{projectid,jdbcType=INTEGER},
  125. </if>
  126. <if test="projectname != null" >
  127. #{projectname,jdbcType=VARCHAR},
  128. </if>
  129. <if test="companyid != null" >
  130. #{companyid,jdbcType=INTEGER},
  131. </if>
  132. <if test="positionname != null" >
  133. #{positionname,jdbcType=VARCHAR},
  134. </if>
  135. <if test="keywords != null" >
  136. #{keywords,jdbcType=VARCHAR},
  137. </if>
  138. <if test="degree != null" >
  139. #{degree,jdbcType=VARCHAR},
  140. </if>
  141. <if test="experience != null" >
  142. #{experience,jdbcType=VARCHAR},
  143. </if>
  144. <if test="salary != null" >
  145. #{salary,jdbcType=VARCHAR},
  146. </if>
  147. <if test="positionnumber != null" >
  148. #{positionnumber,jdbcType=VARCHAR},
  149. </if>
  150. <if test="detail != null" >
  151. #{detail,jdbcType=VARCHAR},
  152. </if>
  153. <if test="status != null" >
  154. #{status,jdbcType=BIT},
  155. </if>
  156. <if test="userid != null" >
  157. #{userid,jdbcType=INTEGER},
  158. </if>
  159. <if test="createdate != null" >
  160. #{createdate,jdbcType=TIMESTAMP},
  161. </if>
  162. <if test="updateuserid != null" >
  163. #{updateuserid,jdbcType=INTEGER},
  164. </if>
  165. <if test="updatedate != null" >
  166. #{updatedate,jdbcType=TIMESTAMP},
  167. </if>
  168. </trim>
  169. </insert>
  170. <update id="updateByPrimaryKeySelective" parameterType="com.ssm.model.business.RecruitProject" >
  171. update RecruitProject
  172. <set >
  173. <if test="projectname != null" >
  174. ProjectName = #{projectname,jdbcType=VARCHAR},
  175. </if>
  176. <if test="companyid != null" >
  177. CompanyId = #{companyid,jdbcType=INTEGER},
  178. </if>
  179. <if test="positionname != null" >
  180. PositionName = #{positionname,jdbcType=VARCHAR},
  181. </if>
  182. <if test="keywords != null" >
  183. KeyWords = #{keywords,jdbcType=VARCHAR},
  184. </if>
  185. <if test="degree != null" >
  186. Degree = #{degree,jdbcType=VARCHAR},
  187. </if>
  188. <if test="experience != null" >
  189. Experience = #{experience,jdbcType=VARCHAR},
  190. </if>
  191. <if test="salary != null" >
  192. Salary = #{salary,jdbcType=VARCHAR},
  193. </if>
  194. <if test="positionnumber != null" >
  195. PositionNumber = #{positionnumber,jdbcType=VARCHAR},
  196. </if>
  197. <if test="detail != null" >
  198. Detail = #{detail,jdbcType=VARCHAR},
  199. </if>
  200. <if test="status != null" >
  201. Status = #{status,jdbcType=BIT},
  202. </if>
  203. <if test="userid != null" >
  204. UserId = #{userid,jdbcType=INTEGER},
  205. </if>
  206. <if test="createdate != null" >
  207. CreateDate = #{createdate,jdbcType=TIMESTAMP},
  208. </if>
  209. <if test="updateuserid != null" >
  210. UpdateUserId = #{updateuserid,jdbcType=INTEGER},
  211. </if>
  212. <if test="updatedate != null" >
  213. UpdateDate = #{updatedate,jdbcType=TIMESTAMP},
  214. </if>
  215. </set>
  216. where ProjectID = #{projectid,jdbcType=INTEGER}
  217. </update>
  218. <update id="updateByPrimaryKey" parameterType="com.ssm.model.business.RecruitProject" >
  219. update RecruitProject
  220. set ProjectName = #{projectname,jdbcType=VARCHAR},
  221. CompanyId = #{companyid,jdbcType=INTEGER},
  222. PositionName = #{positionname,jdbcType=VARCHAR},
  223. KeyWords = #{keywords,jdbcType=VARCHAR},
  224. Degree = #{degree,jdbcType=VARCHAR},
  225. Experience = #{experience,jdbcType=VARCHAR},
  226. Salary = #{salary,jdbcType=VARCHAR},
  227. PositionNumber = #{positionnumber,jdbcType=VARCHAR},
  228. Detail = #{detail,jdbcType=VARCHAR},
  229. Status = #{status,jdbcType=BIT},
  230. UserId = #{userid,jdbcType=INTEGER},
  231. CreateDate = #{createdate,jdbcType=TIMESTAMP},
  232. UpdateUserId = #{updateuserid,jdbcType=INTEGER},
  233. UpdateDate = #{updatedate,jdbcType=TIMESTAMP}
  234. where ProjectID = #{projectid,jdbcType=INTEGER}
  235. </update>
  236. <select id="selectAllByCondition" parameterType="com.ssm.model.business.RecruitProject" resultMap="BaseResultMap">
  237. SELECT rp.*, su.UserName,
  238. (
  239. SELECT count(rrp.ResumeProjectId) from ResumeRecruitProject rrp where rrp.ProjectId = rp.ProjectID AND rrp.IsDelete = 0
  240. ) bindnum,
  241. (
  242. SELECT count(i.InterviewId) from Interview i where i.ProjectId = rp.ProjectID AND i.IsDeleted = 0
  243. ) interviewnum,
  244. (
  245. SELECT count(i.InterviewId) from Interview i where i.ProjectId = rp.ProjectID AND i.IsDeleted = 0 AND i.status = '2'
  246. ) luyong,
  247. (
  248. SELECT count(i.InterviewId) from Interview i where i.ProjectId = rp.ProjectID AND i.IsDeleted = 0 AND i.status = '4'
  249. ) ruzhi
  250. from RecruitProject rp, SysUser su where 1=1
  251. AND su.UserID = rp.UserId
  252. <if test="username != null and username != '' " >
  253. AND su.UserName LIKE CONCAT('%',#{username},'%')
  254. </if>
  255. <if test="projectname != null and projectname != '' " >
  256. AND rp.ProjectName LIKE CONCAT('%',#{projectname},'%')
  257. </if>
  258. <if test="positionname != null and positionname != '' " >
  259. AND rp.PositionName LIKE CONCAT('%',#{positionnumber},'%')
  260. </if>
  261. <if test="status != null " >
  262. AND rp.Status = #{status,jdbcType=BIT}
  263. </if>
  264. ORDER BY rp.CreateDate DESC
  265. </select>
  266. <select id="selectUserRole" resultType="java.lang.Integer">
  267. SELECT count(*) from SysUserRole s
  268. WHERE s.UserID=#{userid} AND s.RoleID=#{roleid}
  269. </select>
  270. </mapper>