RecruitmentCollection.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <!-- namespace必须指向DAO接口 -->
  5. <mapper namespace="com.jpsoft.employment.modules.job.dao.RecruitmentCollectionDAO">
  6. <resultMap id="RecruitmentCollectionMap" type="com.jpsoft.employment.modules.job.entity.RecruitmentCollection">
  7. <id property="id" column="id_" />
  8. <result property="createBy" column="create_by" />
  9. <result property="createTime" column="create_time" />
  10. <result property="updateBy" column="update_by" />
  11. <result property="updateTime" column="update_time" />
  12. <result property="delFlag" column="del_flag" />
  13. <result property="companyId" column="company_id" />
  14. <result property="sysUserId" column="sys_user_id" />
  15. <result property="resumeId" column="resume_id" />
  16. </resultMap>
  17. <resultMap id="ResumeVOMap" type="com.jpsoft.employment.modules.job.entity.ResumeVO">
  18. <id property="id" column="id_" />
  19. <result property="createBy" column="create_by" />
  20. <result property="createTime" column="create_time" />
  21. <result property="updateBy" column="update_by" />
  22. <result property="updateTime" column="update_time" />
  23. <result property="delFlag" column="del_flag" />
  24. <result property="jobUserId" column="job_user_id" />
  25. <result property="sex" column="sex_" />
  26. <result property="positionCategoryId" column="position_category_id" />
  27. <result property="positionCategoryName" column="position_category_name" />
  28. <result property="workExp" column="work_exp" />
  29. <result property="education" column="education_" />
  30. <result property="dreamMoney" column="dream_money" />
  31. <result property="dreamAdd" column="dream_add" />
  32. <result property="birthday" column="birthday_" />
  33. <result property="introduction" column="introduction_" />
  34. <result property="status" column="status_" />
  35. <result property="approveStatus" column="approve_status" />
  36. </resultMap>
  37. <insert id="insert" parameterType="com.jpsoft.employment.modules.job.entity.RecruitmentCollection">
  38. <!--
  39. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  40. select sys_guid() from dual
  41. </selectKey>
  42. -->
  43. <![CDATA[
  44. insert into job_recruitment_collection
  45. (id_,create_by,create_time,update_by,update_time,del_flag,company_id,sys_user_id,resume_id)
  46. values
  47. (
  48. #{id,jdbcType=VARCHAR}
  49. ,#{createBy,jdbcType=VARCHAR}
  50. ,#{createTime,jdbcType= TIMESTAMP }
  51. ,#{updateBy,jdbcType=VARCHAR}
  52. ,#{updateTime,jdbcType= TIMESTAMP }
  53. ,#{delFlag,jdbcType= NUMERIC }
  54. ,#{companyId,jdbcType=VARCHAR}
  55. ,#{sysUserId,jdbcType=VARCHAR}
  56. ,#{resumeId,jdbcType=VARCHAR}
  57. )
  58. ]]>
  59. </insert>
  60. <delete id="delete" parameterType="string">
  61. delete from job_recruitment_collection where id_=#{id,jdbcType=VARCHAR}
  62. </delete>
  63. <update id="update" parameterType="com.jpsoft.employment.modules.job.entity.RecruitmentCollection">
  64. update job_recruitment_collection
  65. <set>
  66. <if test="createBy!=null">
  67. create_by=#{createBy,jdbcType=VARCHAR},
  68. </if>
  69. <if test="createTime!=null">
  70. create_time=#{createTime,jdbcType= TIMESTAMP },
  71. </if>
  72. <if test="updateBy!=null">
  73. update_by=#{updateBy,jdbcType=VARCHAR},
  74. </if>
  75. <if test="updateTime!=null">
  76. update_time=#{updateTime,jdbcType= TIMESTAMP },
  77. </if>
  78. <if test="delFlag!=null">
  79. del_flag=#{delFlag,jdbcType= NUMERIC },
  80. </if>
  81. <if test="companyId!=null">
  82. company_id=#{companyId,jdbcType=VARCHAR},
  83. </if>
  84. <if test="sysUserId!=null">
  85. sys_user_id=#{sysUserId,jdbcType=VARCHAR},
  86. </if>
  87. <if test="resumeId!=null">
  88. resume_id=#{resumeId,jdbcType=VARCHAR},
  89. </if>
  90. </set>
  91. where id_=#{id}
  92. </update>
  93. <select id="findByUserIdAndCompanyIdAndResumeId" parameterType="string" resultMap="RecruitmentCollectionMap">
  94. select * from job_recruitment_collection
  95. where del_flag=false
  96. and sys_user_id=#{userId}
  97. and company_id=#{companyId}
  98. and resume_id=#{resumeid}
  99. limit 1
  100. </select>
  101. <select id="get" parameterType="string" resultMap="RecruitmentCollectionMap">
  102. select * from job_recruitment_collection where id_=#{0}
  103. </select>
  104. <select id="exist" parameterType="string" resultType="int">
  105. select count(*) from job_recruitment_collection where id_=#{0}
  106. </select>
  107. <select id="list" resultMap="RecruitmentCollectionMap">
  108. select * from job_recruitment_collection
  109. </select>
  110. <select id="countByUserId" resultType="int">
  111. select count(*) from job_recruitment_collection
  112. where del_flag = false and company_id=#{companyId} and sys_user_id = #{sysUserId}
  113. </select>
  114. <select id="search" parameterType="hashmap" resultMap="RecruitmentCollectionMap">
  115. <![CDATA[
  116. select * from job_recruitment_collection a left join job_resume b on a.resume_id = b.id_
  117. ]]>
  118. <where>
  119. a.del_flag = false and b.del_flag = false
  120. <if test="searchParams.sysUserId != null">
  121. and a.sys_user_id = #{searchParams.sysUserId}
  122. </if>
  123. <if test="searchParams.positionCategoryId != null">
  124. and b.position_category_id = #{searchParams.positionCategoryId}
  125. </if>
  126. <if test="searchParams.sex != null">
  127. and b.sex_ = #{searchParams.sex}
  128. </if>
  129. <if test="searchParams.workExp != null">
  130. and b.work_exp = #{searchParams.workExp}
  131. </if>
  132. <if test="searchParams.education != null">
  133. and b.education_ = #{searchParams.education}
  134. </if>
  135. <if test="searchParams.curDate != null">
  136. <![CDATA[
  137. and a.birthday_ <= #{searchParams.curDate}
  138. ]]>
  139. </if>
  140. </where>
  141. <foreach item="sort" collection="sortList" open="order by" separator=",">
  142. ${sort.name} ${sort.order}
  143. </foreach>
  144. </select>
  145. <!--用于移动端接口:招聘方【收藏简历】-->
  146. <select id="pagedLoadCollectResumes" parameterType="hashMap" resultType="Map">
  147. <![CDATA[
  148. select * from (select
  149. c.sys_user_id hrId,
  150. c.resume_id resumeId,
  151. ju.real_name realName,
  152. ju.head_image_url headImage,
  153. ju.address_ address,
  154. year(now())-year(ju.birthday_) age,
  155. w.name_ positionCategoryName,
  156. workExpw.name_ workExp,
  157. eduw.name_ eduName,
  158. sexw.name_ sex,
  159. jobstaw.name_ jobStatus,
  160. drmoneyw.name_ dreamMoney,
  161. c.update_time collectionTime,
  162. c.del_flag,
  163. r.education_,
  164. r.work_exp,
  165. r.dream_money,
  166. r.job_status,
  167. r.position_category_id
  168. from job_recruitment_collection c inner join job_resume r on c.resume_id=r.id_
  169. inner join job_jobuser ju on r.job_user_id=ju.id_ and ju.del_flag=0
  170. left join job_work_category w on r.position_category_id=w.id_ and w.del_flag=0
  171. left join sys_data_dictionary workExpw on r.work_exp=workExpw.id_ and workExpw.del_flag=0
  172. left join sys_data_dictionary eduw on r.education_=eduw.id_ and eduw.del_flag=0
  173. LEFT JOIN sys_data_dictionary sexw ON r.sex_ = sexw.value_ and sexw.parent_id = '0c3194dc-884d-4ea9-9966-dfb94f537f5c' AND sexw.del_flag = 0
  174. left join sys_data_dictionary jobstaw on r.job_status=jobstaw.id_ and jobstaw.del_flag=0
  175. left join sys_data_dictionary drmoneyw on r.dream_money=drmoneyw.id_ and drmoneyw.del_flag=0
  176. ) tab
  177. ]]>
  178. <where>
  179. <if test="1==1">
  180. and del_flag=0 and hrId = #{searchParams.recruiterId}
  181. </if>
  182. <if test="searchParams.positionName != null and searchParams.positionName !=''">
  183. and positionCategoryName like #{searchParams.positionName}
  184. </if>
  185. <if test="searchParams.positionId != null and searchParams.positionId !=''">
  186. and position_category_id in (select id_ from job_work_category where instr(code_,#{searchParams.positionId})>0)
  187. </if>
  188. <if test="searchParams.education != null and searchParams.education != ''">
  189. and education_ = #{searchParams.education}
  190. </if>
  191. <if test="searchParams.workExp != null and searchParams.workExp !='' ">
  192. and work_exp = #{searchParams.workExp}
  193. </if>
  194. <if test="searchParams.dreamMoney != null and searchParams.dreamMoney !=''">
  195. and dream_money = #{searchParams.dreamMoney}
  196. </if>
  197. <if test="searchParams.jobStatus != null and searchParams.jobStatus != ''">
  198. and job_status = #{searchParams.jobStatus}
  199. </if>
  200. </where>
  201. <foreach item="sort" collection="sortList" open="order by" separator=",">
  202. ${sort.name} ${sort.order}
  203. </foreach>
  204. </select>
  205. <!-- 用于移动端接口:招聘方【收藏简历】 取消收藏 -->
  206. <update id="updateCancelCollect">
  207. update job_recruitment_collection set del_flag=1,update_time=now(),update_by=#{hrId} where resume_id=#{resumeId} and sys_user_id=#{hrId}
  208. </update>
  209. <!--用于移动端接口:招聘方【招聘主页】-->
  210. <select id="pagedLoadAllResumes" parameterType="hashMap" resultType="Map">
  211. <![CDATA[
  212. select DISTINCT * from (select
  213. ju.real_name realName,
  214. ju.head_image_url headImage,
  215. ju.address_ address,
  216. year(now())-year(ju.birthday_) age,
  217. w.name_ positionCategoryName,
  218. workExpw.name_ workExp,
  219. eduw.name_ eduName,
  220. sexw.name_ sex,
  221. jobstaw.name_ jobStatus,
  222. drmoneyw.name_ dreamMoney,
  223. r.id_ as resumeId,
  224. r.del_flag,
  225. r.update_time,
  226. rede.chat_status,
  227. rerd.browse_count,
  228. r.education_,
  229. r.work_exp,
  230. r.dream_money,
  231. r.job_status,
  232. r.position_category_id
  233. from job_resume r
  234. inner join job_jobuser ju on r.job_user_id=ju.id_ and ju.del_flag=0
  235. left join job_resume_deliver rede on r.id_=rede.job_resume_id and rede.del_flag=0
  236. left join job_work_category w on r.position_category_id=w.id_ and w.del_flag=0
  237. left join sys_data_dictionary workExpw on r.work_exp=workExpw.id_ and workExpw.del_flag=0
  238. left join sys_data_dictionary eduw on r.education_=eduw.id_ and eduw.del_flag=0
  239. LEFT JOIN sys_data_dictionary sexw ON r.sex_ = sexw.value_ and sexw.parent_id = '0c3194dc-884d-4ea9-9966-dfb94f537f5c' AND sexw.del_flag = 0
  240. left join sys_data_dictionary jobstaw on r.job_status=jobstaw.id_ and jobstaw.del_flag=0
  241. left join sys_data_dictionary drmoneyw on r.dream_money=drmoneyw.id_ and drmoneyw.del_flag=0
  242. left join (select count(1) browse_count,job_resume_id from job_user_browse_hr where del_flag=0 group by job_resume_id) rerd on r.id_=rerd.job_resume_id
  243. ) tab
  244. ]]>
  245. <where>
  246. <if test="1==1">
  247. <![CDATA[ and del_flag=0 and (chat_status is null or chat_status <>'5') ]]> <!--非已入职的简历sys_data_dictionary where parent_id=5e048b6d-cb1d-4fd5-bc70-c94259960862-->
  248. </if>
  249. <if test="searchParams.positionName != null and searchParams.positionName !=''">
  250. and positionCategoryName like #{searchParams.positionName}
  251. </if>
  252. <if test="searchParams.positionId != null and searchParams.positionId !=''">
  253. and position_category_id in (select id_ from job_work_category where instr(code_,#{searchParams.positionId})>0)
  254. </if>
  255. <if test="searchParams.education != null and searchParams.education != ''">
  256. and education_ = #{searchParams.education}
  257. </if>
  258. <if test="searchParams.workExp != null and searchParams.workExp !='' ">
  259. and work_exp = #{searchParams.workExp}
  260. </if>
  261. <if test="searchParams.dreamMoney != null and searchParams.dreamMoney !=''">
  262. and dream_money = #{searchParams.dreamMoney}
  263. </if>
  264. <if test="searchParams.jobStatus != null and searchParams.jobStatus != ''">
  265. and job_status = #{searchParams.jobStatus}
  266. </if>
  267. </where>
  268. <foreach item="sort" collection="sortList" open="order by" separator=",">
  269. ${sort.name} ${sort.order}
  270. </foreach>
  271. </select>
  272. </mapper>