Recruitment.xml 11 KB

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