Recruitment.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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.RecruitmentDAO">
  6. <resultMap id="RecruitmentMap" type="com.jpsoft.employment.modules.job.entity.Recruitment">
  7. <id property="id" column="id_" />
  8. <result property="companyId" column="company_id" />
  9. <result property="title" column="title_" />
  10. <result property="area" column="area_" />
  11. <result property="address" column="address_" />
  12. <result property="position" column="position_" />
  13. <result property="positionMessage" column="position_message" />
  14. <result property="requirements" column="requirements_" />
  15. <result property="positionNumber" column="position_number" />
  16. <result property="workYear" column="work_year" />
  17. <result property="education" column="education_" />
  18. <result property="positionSex" column="position_sex" />
  19. <result property="readTimes" column="read_times" />
  20. <result property="wageType" column="wage_type" />
  21. <result property="isDiscussPersonally" column="is_discuss_personally" />
  22. <result property="contactPerson" column="contact_person" />
  23. <result property="tel" column="tel_" />
  24. <result property="status" column="status_" />
  25. <result property="approveStatus" column="approve_status" />
  26. <result property="readingTimes" column="reading_times" />
  27. <result property="collectionTimes" column="collection_times" />
  28. <result property="deliveryTimes" column="delivery_times" />
  29. <result property="createBy" column="create_by" />
  30. <result property="createTime" column="create_time" />
  31. <result property="updateBy" column="update_by" />
  32. <result property="updateTime" column="update_time" />
  33. <result property="delFlag" column="del_flag" />
  34. <result property="workCategoryId" column="work_category_id" />
  35. <result property="welfare" column="welfare_" />
  36. </resultMap>
  37. <resultMap id="RecruitmentVOMap" type="com.jpsoft.employment.modules.job.entity.RecruitmentVO" extends="RecruitmentMap">
  38. <result property="positionName" column="position_name" />
  39. </resultMap>
  40. <insert id="insert" parameterType="com.jpsoft.employment.modules.job.entity.Recruitment">
  41. <!--
  42. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  43. select sys_guid() from dual
  44. </selectKey>
  45. -->
  46. <![CDATA[
  47. insert into job_recruitment
  48. (id_,company_id,title_,area_,address_,position_,position_message,requirements_,position_number,work_year,education_,position_sex,read_times,wage_type,is_discuss_personally,contact_person,tel_,status_,approve_status,reading_times,collection_times,delivery_times,create_by,create_time,update_by,update_time,del_flag,work_category_id,welfare_)
  49. values
  50. (
  51. #{id,jdbcType=VARCHAR}
  52. ,#{companyId,jdbcType=VARCHAR}
  53. ,#{title,jdbcType=VARCHAR}
  54. ,#{area,jdbcType=VARCHAR}
  55. ,#{address,jdbcType=VARCHAR}
  56. ,#{position,jdbcType=VARCHAR}
  57. ,#{positionMessage,jdbcType=VARCHAR}
  58. ,#{requirements,jdbcType=VARCHAR}
  59. ,#{positionNumber,jdbcType= NUMERIC }
  60. ,#{workYear,jdbcType=VARCHAR}
  61. ,#{education,jdbcType=VARCHAR}
  62. ,#{positionSex,jdbcType=VARCHAR}
  63. ,#{readTimes,jdbcType= NUMERIC }
  64. ,#{wageType,jdbcType=VARCHAR}
  65. ,#{isDiscussPersonally,jdbcType= NUMERIC }
  66. ,#{contactPerson,jdbcType=VARCHAR}
  67. ,#{tel,jdbcType=VARCHAR}
  68. ,#{status,jdbcType=VARCHAR}
  69. ,#{approveStatus,jdbcType=VARCHAR}
  70. ,#{readingTimes,jdbcType= NUMERIC }
  71. ,#{collectionTimes,jdbcType= NUMERIC }
  72. ,#{deliveryTimes,jdbcType= NUMERIC }
  73. ,#{createBy,jdbcType=VARCHAR}
  74. ,#{createTime,jdbcType= TIMESTAMP }
  75. ,#{updateBy,jdbcType=VARCHAR}
  76. ,#{updateTime,jdbcType= TIMESTAMP }
  77. ,#{delFlag,jdbcType= NUMERIC }
  78. ,#{workCategoryId,jdbcType= VARCHAR }
  79. ,#{welfare,jdbcType= VARCHAR }
  80. )
  81. ]]>
  82. </insert>
  83. <delete id="delete" parameterType="string">
  84. delete from job_recruitment where id_=#{id,jdbcType=VARCHAR}
  85. </delete>
  86. <update id="update" parameterType="com.jpsoft.employment.modules.job.entity.Recruitment">
  87. update job_recruitment
  88. <set>
  89. <if test="companyId!=null">
  90. company_id=#{companyId,jdbcType=VARCHAR},
  91. </if>
  92. <if test="title!=null">
  93. title_=#{title,jdbcType=VARCHAR},
  94. </if>
  95. <if test="area!=null">
  96. area_=#{area,jdbcType=VARCHAR},
  97. </if>
  98. <if test="address!=null">
  99. address_=#{address,jdbcType=VARCHAR},
  100. </if>
  101. <if test="position!=null">
  102. position_=#{position,jdbcType=VARCHAR},
  103. </if>
  104. <if test="positionMessage!=null">
  105. position_message=#{positionMessage,jdbcType=VARCHAR},
  106. </if>
  107. <if test="requirements!=null">
  108. requirements_=#{requirements,jdbcType=VARCHAR},
  109. </if>
  110. <if test="positionNumber!=null">
  111. position_number=#{positionNumber,jdbcType= NUMERIC },
  112. </if>
  113. <if test="workYear!=null">
  114. work_year=#{workYear,jdbcType=VARCHAR},
  115. </if>
  116. <if test="education!=null">
  117. education_=#{education,jdbcType=VARCHAR},
  118. </if>
  119. <if test="positionSex!=null">
  120. position_sex=#{positionSex,jdbcType=VARCHAR},
  121. </if>
  122. <if test="readTimes!=null">
  123. read_times=#{readTimes,jdbcType= NUMERIC },
  124. </if>
  125. <if test="wageType!=null">
  126. wage_type=#{wageType,jdbcType=VARCHAR},
  127. </if>
  128. <if test="isDiscussPersonally!=null">
  129. is_discuss_personally=#{isDiscussPersonally,jdbcType= NUMERIC },
  130. </if>
  131. <if test="contactPerson!=null">
  132. contact_person=#{contactPerson,jdbcType=VARCHAR},
  133. </if>
  134. <if test="tel!=null">
  135. tel_=#{tel,jdbcType=VARCHAR},
  136. </if>
  137. <if test="status!=null">
  138. status_=#{status,jdbcType=VARCHAR},
  139. </if>
  140. <if test="approveStatus!=null">
  141. approve_status=#{approveStatus,jdbcType=VARCHAR},
  142. </if>
  143. <if test="readingTimes!=null">
  144. reading_times=#{readingTimes,jdbcType= NUMERIC },
  145. </if>
  146. <if test="collectionTimes!=null">
  147. collection_times=#{collectionTimes,jdbcType= NUMERIC },
  148. </if>
  149. <if test="deliveryTimes!=null">
  150. delivery_times=#{deliveryTimes,jdbcType= NUMERIC },
  151. </if>
  152. <if test="createBy!=null">
  153. create_by=#{createBy,jdbcType=VARCHAR},
  154. </if>
  155. <if test="createTime!=null">
  156. create_time=#{createTime,jdbcType= TIMESTAMP },
  157. </if>
  158. <if test="updateBy!=null">
  159. update_by=#{updateBy,jdbcType=VARCHAR},
  160. </if>
  161. <if test="updateTime!=null">
  162. update_time=#{updateTime,jdbcType= TIMESTAMP },
  163. </if>
  164. <if test="delFlag!=null">
  165. del_flag=#{delFlag,jdbcType= NUMERIC },
  166. </if>
  167. <if test="workCategoryId!=null">
  168. work_category_id=#{workCategoryId,jdbcType= VARCHAR },
  169. </if>
  170. <if test="welfare!=null">
  171. welfare_=#{welfare,jdbcType= VARCHAR },
  172. </if>
  173. </set>
  174. where id_=#{id}
  175. </update>
  176. <select id="get" parameterType="string" resultMap="RecruitmentMap">
  177. select * from job_recruitment where id_=#{0}
  178. </select>
  179. <select id="exist" parameterType="string" resultType="int">
  180. select count(*) from job_recruitment where id_=#{0}
  181. </select>
  182. <select id="list" resultMap="RecruitmentMap">
  183. select * from job_recruitment
  184. </select>
  185. <select id="search" parameterType="hashmap" resultMap="RecruitmentMap">
  186. <![CDATA[
  187. select * from job_recruitment
  188. ]]>
  189. <where>
  190. del_flag = false
  191. <if test="searchParams.companyId != null">
  192. and company_id = #{searchParams.companyId}
  193. </if>
  194. <if test="searchParams.area != null">
  195. and area_ = #{searchParams.area}
  196. </if>
  197. <if test="searchParams.position != null">
  198. and position_ = #{searchParams.position}
  199. </if>
  200. <if test="searchParams.status != null">
  201. and status_ = #{searchParams.status}
  202. </if>
  203. <if test="searchParams.approveStatus != null">
  204. and approve_status = #{searchParams.approveStatus}
  205. </if>
  206. <if test="searchParams.position != null">
  207. and position_ = #{searchParams.position}
  208. </if>
  209. </where>
  210. <foreach item="sort" collection="sortList" open="order by" separator=",">
  211. ${sort.name} ${sort.order}
  212. </foreach>
  213. </select>
  214. <select id="foundPageList" parameterType="hashmap" resultType="map">
  215. <![CDATA[
  216. SELECT
  217. jr.id_ AS id,
  218. jr.title_ AS title,
  219. jr.address_ AS address,
  220. bc.logo_ AS logo,
  221. bc.name_ AS name,
  222. sdda.name_ AS scaleName,
  223. sddb.name_ AS wageTypeN,
  224. bci.city_name AS cityName,
  225. sddc.name_ AS industry,
  226. sddd.name_ AS workYear
  227. FROM
  228. job_recruitment AS jr
  229. LEFT JOIN base_company AS bc ON jr.company_id = bc.id_
  230. LEFT JOIN sys_data_dictionary AS sdda ON bc.scale_ = sdda.id_
  231. LEFT JOIN sys_data_dictionary AS sddb ON jr.wage_type = sddb.id_
  232. LEFT JOIN sys_data_dictionary AS sddc ON bc.industry_ = sddc.id_
  233. LEFT JOIN base_city AS bci ON jr.area_ = bci.id_
  234. ]]>
  235. <where>
  236. <if test="searchParams.title != null">
  237. and jr.title_ like #{searchParams.title}
  238. </if>
  239. <if test="searchParams.monthlySalary != null">
  240. and jr.wage_type like #{searchParams.monthlySalary}
  241. </if>
  242. <if test="searchParams.workExperience != null">
  243. and sddd.name_ like #{searchParams.workExperience}
  244. </if>
  245. <if test="searchParams.education != null">
  246. and jr.education_ like #{searchParams.education}
  247. </if>
  248. <if test="searchParams.recruitmentPosition != null">
  249. and jr.position_ like #{searchParams.recruitmentPosition}
  250. </if>
  251. <if test="searchParams.relevantTitle != null">
  252. and jr.title_ like #{searchParams.relevantTitle}
  253. </if>
  254. <if test="searchParams.notrelevantId != null">
  255. and jr.id_ != #{searchParams.notrelevantId}
  256. </if>
  257. <if test="searchParams.status != null">
  258. and jr.status_ = #{searchParams.status}
  259. </if>
  260. <if test="searchParams.approveStatus != null">
  261. and jr.approve_status = #{searchParams.approveStatus}
  262. </if>
  263. </where>
  264. <foreach item="sort" collection="sortList" open="order by" separator=",">
  265. ${sort.name} ${sort.order}
  266. </foreach>
  267. </select>
  268. <!--招聘方职位管理-->
  269. <select id="loadForRecruiter" parameterType="hashMap" resultType="Map">
  270. <![CDATA[
  271. SELECT * FROM (
  272. SELECT
  273. jr.del_flag,
  274. jr.create_by,
  275. jr.id_ recruitmentId,
  276. DATE_FORMAT(jr.update_time,'%c月%e日 %H:%i') updateTime,
  277. jr.status_ status,
  278. jr.approve_status approveStatus,
  279. jr.title_ title,
  280. jwc.name_ position_name,
  281. waged.name_ wageTypeName,
  282. educationd.name_ educationName,
  283. workyeard.name_ workYear
  284. FROM
  285. job_recruitment jr
  286. INNER JOIN job_work_category jwc ON jr.position_ = jwc.id_ and jwc.del_flag=0
  287. left join sys_data_dictionary waged on jr.wage_type=waged.id_ and waged.del_flag=0
  288. left join sys_data_dictionary workyeard on jr.work_year=workyeard.id_ and workyeard.del_flag=0
  289. left join sys_data_dictionary educationd on jr.education_=educationd.id_ and educationd.del_flag=0
  290. ) TAB
  291. ]]>
  292. <where>
  293. <if test="1==1">
  294. and del_flag=0
  295. </if>
  296. <if test="searchParams.recruiter != null"> <!--按创建人(招聘人)过滤-->
  297. and create_by=#{searchParams.recruiter}
  298. </if>
  299. <if test='searchParams.status =="publish"'> <!--按招聘状态过滤publish:已发布且审核完;approve:审核中;close:关闭下架-->
  300. and status='1' and approveStatus='3' <!--sys_data_dictionary where parent_id='163b92e3-9847-4370-a31e-6d62bed279e8' -->
  301. </if>
  302. <if test='searchParams.status =="approve"'>
  303. and status='1' and approveStatus='2'
  304. </if>
  305. <if test='searchParams.status =="close"'>
  306. and status='0'
  307. </if>
  308. </where>
  309. <foreach item="sort" collection="sortList" open="order by" separator=",">
  310. ${sort.name} ${sort.order}
  311. </foreach>
  312. </select>
  313. <!--招聘方个人中心主页:统计已发布的招聘,被浏览量(不包含已撤销的(已关闭的))-->
  314. <select id="rptMyRecruitmentCount" parameterType="String" resultType="Map">
  315. select count(1) jobCount,sum(reading_times) readTimes from job_recruitment where create_by=#{0} and status_='1'
  316. </select>
  317. <!--招聘方职位管理 上下架管理-->
  318. <update id="updateForPublish">
  319. update job_recruitment set status_=#{publishTag},update_time=now(),update_by=#{caller} where id_=#{recruitmentId}
  320. </update>
  321. </mapper>