StatisticsCQuery.xml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  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.hz.employmentsite.mapper.cquery.StatisticsCQuery">
  4. <select id="findSystemDataCount" resultType="com.hz.employmentsite.vo.statistics.SystemDataCount">
  5. SELECT
  6. site.SiteID,
  7. site.RegionCode,
  8. site.SiteName,
  9. area.`name` AS regionName,
  10. -- 驿站人员数量
  11. (
  12. SELECT
  13. COUNT( 1 )
  14. FROM
  15. pc_site_user site_user
  16. LEFT JOIN sys_user sys_user ON site_user.UserID = sys_user.UserID
  17. WHERE
  18. site_user.SiteID = site.SiteID
  19. AND sys_user.RecordStatus = 1
  20. ) AS siteUserCount,
  21. -- 指定时间段的登记企业数量
  22. (
  23. SELECT
  24. COUNT( 1 )
  25. FROM
  26. pc_company
  27. WHERE
  28. SiteID = site.SiteID
  29. <if test="startDate != null">
  30. and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  31. </if>
  32. <if test="endDate != null ">
  33. and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  34. </if>
  35. ) AS companyCount,
  36. -- 指定时间段的登记岗位数量
  37. (
  38. SELECT
  39. COUNT( 1 )
  40. FROM
  41. pc_post post
  42. WHERE
  43. CompanyID IN ( SELECT company.CompanyID FROM pc_company company WHERE company.SiteID = site.SiteID )
  44. <if test="startDate != null">
  45. and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  46. </if>
  47. <if test="endDate != null ">
  48. and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  49. </if>
  50. ) AS postCount,
  51. (case when (
  52. SELECT
  53. COUNT( 1 )
  54. FROM
  55. pc_post post
  56. WHERE
  57. CompanyID IN ( SELECT company.CompanyID FROM pc_company company WHERE company.SiteID = site.SiteID )
  58. <if test="startDate != null">
  59. and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  60. </if>
  61. <if test="endDate != null ">
  62. and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  63. </if>
  64. )=0 then 0 else
  65. (
  66. SELECT
  67. sum(post.RecruitCount)
  68. FROM
  69. pc_post post
  70. WHERE
  71. CompanyID IN ( SELECT company.CompanyID FROM pc_company company WHERE company.SiteID = site.SiteID )
  72. <if test="startDate != null">
  73. and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  74. </if>
  75. <if test="endDate != null ">
  76. and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  77. </if>
  78. ) end )AS postRecruitCount,
  79. -- 指定时间段的登记求职人员数量
  80. (
  81. SELECT
  82. COUNT( 1 )
  83. FROM
  84. pc_jobuser
  85. WHERE
  86. SiteID = site.SiteID
  87. <if test="startDate != null">
  88. and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  89. </if>
  90. <if test="endDate != null ">
  91. and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  92. </if>
  93. ) AS jobUserCount
  94. FROM
  95. pc_site site
  96. LEFT JOIN area_code area ON site.RegionCode = area.`code`
  97. ORDER BY site.RegionCode
  98. </select>
  99. <select id="findWeekSystemDataCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
  100. SELECT
  101. subquery.RegionCode,
  102. subquery.RegionName,
  103. SUM(subquery.companyCount) AS companyCount,
  104. SUM(subquery.postCount) AS postCount,
  105. SUM(subquery.jobUserCount) AS jobUserCount
  106. FROM
  107. (
  108. SELECT
  109. site.SiteID,
  110. site.RegionCode,
  111. area.`Name` AS RegionName,
  112. -- 指定时间段的登记企业数量
  113. (
  114. SELECT COUNT(1)
  115. FROM pc_company
  116. WHERE
  117. SiteID = site.SiteID
  118. <if test="startDate != null">
  119. and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  120. </if>
  121. <if test="endDate != null ">
  122. and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  123. </if>
  124. ) AS companyCount,
  125. -- 指定时间段的登记岗位数量
  126. (
  127. SELECT COUNT(1)
  128. FROM pc_post post
  129. WHERE
  130. CompanyID IN (SELECT company.CompanyID FROM pc_company company WHERE company.SiteID = site.SiteID)
  131. <if test="startDate != null">
  132. and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  133. </if>
  134. <if test="endDate != null ">
  135. and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  136. </if>
  137. ) AS postCount,
  138. -- 指定时间段的登记求职人员数量
  139. (
  140. SELECT COUNT(1)
  141. FROM pc_jobuser
  142. WHERE
  143. SiteID = site.SiteID
  144. <if test="startDate != null">
  145. and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  146. </if>
  147. <if test="endDate != null ">
  148. and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  149. </if>
  150. ) AS jobUserCount
  151. FROM
  152. pc_site site
  153. LEFT JOIN area_code area ON site.RegionCode = area.`code`
  154. LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
  155. WHERE
  156. 1=1
  157. <if test="siteID!='' and siteID!=null">
  158. and site.siteID = #{siteID}
  159. </if>
  160. <if test="institutionID!='' and institutionID!=null">
  161. and siteInst.institutionID = #{institutionID}
  162. </if>
  163. <if test="regionCode!='' and regionCode!=null">
  164. and area.`code` = #{regionCode}
  165. </if>
  166. ) AS subquery
  167. GROUP BY
  168. subquery.RegionCode,
  169. subquery.RegionName
  170. ORDER BY
  171. subquery.RegionCode;
  172. </select>
  173. <select id="findRegionSiteUserCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
  174. SELECT
  175. area.`code` AS regionCode,
  176. area.`name` AS regionName,
  177. COUNT( sysUser.UserID ) AS siteUserCount
  178. FROM
  179. area_code area
  180. LEFT JOIN pc_site site ON site.RegionCode = area.`code`
  181. LEFT JOIN pc_site_user siteUser ON site.SiteID = siteUser.SiteID
  182. LEFT JOIN sys_user sysUser ON siteUser.UserID = sysUser.UserID AND sysUser.RecordStatus = 1
  183. LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
  184. WHERE
  185. area.lv = 3
  186. <if test="siteID!='' and siteID!=null">
  187. and site.siteID = #{siteID}
  188. </if>
  189. <if test="institutionID!='' and institutionID!=null">
  190. and siteInst.institutionID = #{institutionID}
  191. </if>
  192. <if test="regionCode!='' and regionCode!=null">
  193. and area.`code` = #{regionCode}
  194. </if>
  195. GROUP BY
  196. area.`code`,
  197. area.`name`
  198. ORDER BY
  199. area.`code`
  200. </select>
  201. <select id="findJobUserCountByAgeRange" resultType="com.hz.employmentsite.vo.statistics.jobUser.AgeRangeJobUserCount">
  202. SELECT
  203. CASE
  204. WHEN TIMESTAMPDIFF(YEAR, BirthDay, CURDATE()) BETWEEN 16 AND 25 THEN '16-25岁'
  205. WHEN TIMESTAMPDIFF(YEAR, BirthDay, CURDATE()) BETWEEN 26 AND 35 THEN '26-35岁'
  206. WHEN TIMESTAMPDIFF(YEAR, BirthDay, CURDATE()) BETWEEN 36 AND 45 THEN '36-45岁'
  207. WHEN TIMESTAMPDIFF(YEAR, BirthDay, CURDATE()) BETWEEN 46 AND 55 THEN '46-55岁'
  208. ELSE '55岁以上'
  209. END AS AgeRange,
  210. Sex,
  211. COUNT(1) AS jobUserCount
  212. FROM
  213. pc_jobuser jobUser
  214. LEFT JOIN pc_site site ON jobUser.SiteID = site.SiteID
  215. WHERE
  216. 1=1
  217. <if test="isNotCity!=null">
  218. and site.RegionCode != '441301000000000'
  219. </if>
  220. <if test="year!='' and year!=null">
  221. and YEAR(CreateTime) = #{year}
  222. </if>
  223. <if test="month!='' and month!=null">
  224. and MONTH(CreateTime) = #{month}
  225. </if>
  226. GROUP BY
  227. AgeRange,
  228. Sex
  229. ORDER BY
  230. AgeRange,
  231. Sex;
  232. </select>
  233. <select id="findJobUserCountByPersonType" resultType="com.hz.employmentsite.vo.statistics.jobUser.PersonTypeJobUserCount">
  234. SELECT
  235. jobuser.KeyPersonTypeID,
  236. keytype.`Name` AS KeyTypeName,
  237. jobuser.CultureRank,
  238. culture.`Name` AS CultureName,
  239. COUNT( 1 ) AS jobUserCount
  240. FROM
  241. `pc_jobuser` jobuser
  242. LEFT JOIN sys_dictionary_item keytype ON jobuser.KeyPersonTypeID = keytype.`Value`
  243. AND keytype.DictionaryCode = 'KeyPersonType'
  244. LEFT JOIN sys_dictionary_item culture ON jobuser.CultureRank = culture.`Value`
  245. AND culture.DictionaryCode = 'HighestDegree'
  246. WHERE
  247. CultureRank IS NOT NULL
  248. <if test="year!='' and year!=null">
  249. and YEAR(jobuser.CreateTime) = #{year}
  250. </if>
  251. <if test="month!='' and month!=null">
  252. and MONTH(jobuser.CreateTime) = #{month}
  253. </if>
  254. GROUP BY
  255. jobuser.KeyPersonTypeID,
  256. keytype.`Name`,
  257. jobuser.CultureRank
  258. ORDER BY
  259. jobuser.KeyPersonTypeID,
  260. jobuser.CultureRank DESC
  261. </select>
  262. <select id="findJobUserByRegion" resultType="com.hz.employmentsite.vo.statistics.jobUser.RegionJobUserCount">
  263. SELECT
  264. area.`code` AS regionCode,
  265. area.`name` AS regionName,
  266. COUNT( jobUser.JobuserID ) AS jobUserCount
  267. FROM
  268. area_code area
  269. LEFT JOIN pc_site site ON area.`code` = site.RegionCode
  270. LEFT JOIN pc_jobuser jobUser ON site.SiteID = jobUser.SiteID
  271. WHERE
  272. area.lv = 3
  273. <if test="isNotCity!=null">
  274. and site.RegionCode != '441301000000000'
  275. </if>
  276. <if test="year!='' and year!=null">
  277. and YEAR(jobUser.CreateTime) = #{year}
  278. </if>
  279. <if test="month!='' and month!=null">
  280. and MONTH(jobUser.CreateTime) = #{month}
  281. </if>
  282. <if test="startDate != null">
  283. and DATE(jobUser.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  284. </if>
  285. <if test="endDate != null ">
  286. and DATE(jobUser.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  287. </if>
  288. GROUP BY
  289. area.`code`,
  290. area.`name`
  291. ORDER BY
  292. area.`code`
  293. </select>
  294. <select id="findJobUserByRegionAndPersonType" resultType="com.hz.employmentsite.vo.statistics.jobUser.RegionJobUserCount">
  295. SELECT
  296. area.`code` AS regionCode,
  297. area.`name` AS regionName,
  298. COUNT( jobUser.JobuserID ) AS jobUserCount
  299. FROM
  300. area_code area
  301. LEFT JOIN pc_site site ON area.`code` = site.RegionCode
  302. LEFT JOIN pc_jobuser jobUser ON site.SiteID = jobUser.SiteID
  303. WHERE
  304. area.lv = 3
  305. AND jobUser.KeyPersonTypeID IN (13,14,15,16,17,18,19,20,21,22,23,24)
  306. <if test="year!='' and year!=null">
  307. and YEAR(jobUser.CreateTime) = #{year}
  308. </if>
  309. <if test="month!='' and month!=null">
  310. and MONTH(jobUser.CreateTime) = #{month}
  311. </if>
  312. GROUP BY
  313. area.`code`,
  314. area.`name`
  315. ORDER BY
  316. area.`code`
  317. </select>
  318. <select id="findYearCompanyCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
  319. SELECT
  320. area.`code` AS RegionCode,
  321. area.`name` AS RegionName,
  322. DATE_FORMAT( company.CreateTime, '%m' ) AS `Month`,
  323. COUNT( 1 ) AS CompanyCount
  324. FROM
  325. pc_company company
  326. LEFT JOIN pc_site site ON company.SiteID = site.SiteID
  327. LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
  328. LEFT JOIN area_code area ON area.`code` = site.RegionCode
  329. WHERE
  330. 1=1
  331. <if test="year!='' and year!=null">
  332. and YEAR(company.CreateTime) = #{year}
  333. </if>
  334. <if test="startDate != null">
  335. and DATE(company.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  336. </if>
  337. <if test="endDate != null ">
  338. and DATE(company.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  339. </if>
  340. <if test="siteID!='' and siteID!=null">
  341. and site.siteID = #{siteID}
  342. </if>
  343. <if test="institutionID!='' and institutionID!=null">
  344. and siteInst.institutionID = #{institutionID}
  345. </if>
  346. <if test="regionCode!='' and regionCode!=null">
  347. and area.`code` = #{regionCode}
  348. </if>
  349. GROUP BY
  350. area.`code`,
  351. area.`name`,
  352. `Month`
  353. ORDER BY
  354. area.`code`,
  355. `Month` ASC
  356. </select>
  357. <select id="findYearPostCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
  358. SELECT
  359. area.`code` AS RegionCode,
  360. area.`name` AS RegionName,
  361. DATE_FORMAT( post.CreateTime, '%m' ) AS `Month`,
  362. COUNT( 1 ) AS PostCount,
  363. SUM( post.RecruitCount ) AS PostRecruitCount
  364. FROM
  365. pc_post post
  366. LEFT JOIN pc_company company ON post.CompanyID = company.CompanyID
  367. LEFT JOIN pc_site site ON company.SiteID = site.SiteID
  368. LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
  369. LEFT JOIN area_code area ON area.`code` = site.RegionCode
  370. WHERE
  371. 1=1
  372. <if test="year!='' and year!=null">
  373. and YEAR(post.CreateTime) = #{year}
  374. </if>
  375. <if test="startDate != null">
  376. and DATE(post.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  377. </if>
  378. <if test="endDate != null ">
  379. and DATE(post.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  380. </if>
  381. <if test="siteID!='' and siteID!=null">
  382. and site.siteID = #{siteID}
  383. </if>
  384. <if test="institutionID!='' and institutionID!=null">
  385. and siteInst.institutionID = #{institutionID}
  386. </if>
  387. <if test="regionCode!='' and regionCode!=null">
  388. and area.`code` = #{regionCode}
  389. </if>
  390. GROUP BY
  391. area.`code`,
  392. area.`name`,
  393. `Month`
  394. ORDER BY
  395. area.`code`,
  396. `Month` ASC
  397. </select>
  398. <select id="findYearJobUserCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
  399. SELECT
  400. area.`code` AS RegionCode,
  401. area.`name` AS RegionName,
  402. DATE_FORMAT( jobUser.CreateTime, '%m' ) AS `Month`,
  403. COUNT( 1 ) AS JobUserCount
  404. FROM
  405. pc_jobuser jobUser
  406. LEFT JOIN pc_site site ON jobUser.SiteID = site.SiteID
  407. LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
  408. LEFT JOIN area_code area ON area.`code` = site.RegionCode
  409. WHERE
  410. 1=1
  411. <if test="year!='' and year!=null">
  412. and YEAR(jobUser.CreateTime) = #{year}
  413. </if>
  414. <if test="startDate != null">
  415. and DATE(jobUser.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  416. </if>
  417. <if test="endDate != null ">
  418. and DATE(jobUser.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  419. </if>
  420. <if test="siteID!='' and siteID!=null">
  421. and site.siteID = #{siteID}
  422. </if>
  423. <if test="institutionID!='' and institutionID!=null">
  424. and siteInst.institutionID = #{institutionID}
  425. </if>
  426. <if test="regionCode!='' and regionCode!=null">
  427. and area.`code` = #{regionCode}
  428. </if>
  429. GROUP BY
  430. area.`code`,
  431. area.`name`,
  432. `Month`
  433. ORDER BY
  434. area.`code`,
  435. `Month` ASC
  436. </select>
  437. <select id="findMonthCompanyCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
  438. SELECT
  439. area.`code` AS RegionCode,
  440. area.`name` AS RegionName,
  441. WEEK ( company.CreateTime, 5 ) AS `Week`,
  442. COUNT( 1 ) AS CompanyCount
  443. FROM
  444. pc_company company
  445. LEFT JOIN pc_site site ON company.SiteID = site.SiteID
  446. LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
  447. LEFT JOIN area_code area ON area.`code` = site.RegionCode
  448. WHERE
  449. YEAR ( company.CreateTime ) = #{year}
  450. AND MONTH ( company.CreateTime ) = #{month}
  451. <if test="siteID!='' and siteID!=null">
  452. and site.siteID = #{siteID}
  453. </if>
  454. <if test="institutionID!='' and institutionID!=null">
  455. and siteInst.institutionID = #{institutionID}
  456. </if>
  457. <if test="regionCode!='' and regionCode!=null">
  458. and area.`code` = #{regionCode}
  459. </if>
  460. GROUP BY
  461. area.`code`,
  462. area.`name`,
  463. `Week`
  464. ORDER BY
  465. area.`code`,
  466. `Week` ASC
  467. </select>
  468. <select id="findMonthPostCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
  469. SELECT
  470. area.`code` AS RegionCode,
  471. area.`name` AS RegionName,
  472. WEEK( post.CreateTime, 5 ) AS `Week`,
  473. COUNT( 1 ) AS PostCount,
  474. SUM( post.RecruitCount ) AS PostRecruitCount
  475. FROM
  476. pc_post post
  477. LEFT JOIN pc_company company ON post.CompanyID = company.CompanyID
  478. LEFT JOIN pc_site site ON company.SiteID = site.SiteID
  479. LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
  480. LEFT JOIN area_code area ON area.`code` = site.RegionCode
  481. WHERE
  482. YEAR ( post.CreateTime ) = #{year}
  483. AND MONTH ( post.CreateTime ) = #{month}
  484. <if test="siteID!='' and siteID!=null">
  485. and site.siteID = #{siteID}
  486. </if>
  487. <if test="institutionID!='' and institutionID!=null">
  488. and siteInst.institutionID = #{institutionID}
  489. </if>
  490. <if test="regionCode!='' and regionCode!=null">
  491. and area.`code` = #{regionCode}
  492. </if>
  493. GROUP BY
  494. area.`code`,
  495. area.`name`,
  496. `Week`
  497. ORDER BY
  498. area.`code`,
  499. `Week` ASC
  500. </select>
  501. <select id="findMonthJobUserCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
  502. SELECT
  503. area.`code` AS RegionCode,
  504. area.`name` AS RegionName,
  505. WEEK( jobUser.CreateTime, 5 ) AS `Week`,
  506. COUNT( 1 ) AS JobUserCount
  507. FROM
  508. pc_jobuser jobUser
  509. LEFT JOIN pc_site site ON jobUser.SiteID = site.SiteID
  510. LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
  511. LEFT JOIN area_code area ON area.`code` = site.RegionCode
  512. WHERE
  513. YEAR ( jobUser.CreateTime ) = #{year}
  514. AND MONTH ( jobUser.CreateTime ) = #{month}
  515. <if test="siteID!='' and siteID!=null">
  516. and site.siteID = #{siteID}
  517. </if>
  518. <if test="institutionID!='' and institutionID!=null">
  519. and siteInst.institutionID = #{institutionID}
  520. </if>
  521. <if test="regionCode!='' and regionCode!=null">
  522. and area.`code` = #{regionCode}
  523. </if>
  524. GROUP BY
  525. area.`code`,
  526. area.`name`,
  527. `Week`
  528. ORDER BY
  529. area.`code`,
  530. `Week` ASC
  531. </select>
  532. <select id="findJobUserCountByStatus" resultType="com.hz.employmentsite.vo.statistics.jobUser.RegionJobUserCount">
  533. SELECT
  534. area.`code` AS regionCode,
  535. area.`name` AS regionName,
  536. COUNT( jobUser.JobuserID ) AS jobUserCount
  537. FROM
  538. area_code area
  539. LEFT JOIN pc_site site ON area.`code` = site.RegionCode
  540. LEFT JOIN pc_jobuser jobUser ON site.SiteID = jobUser.SiteID
  541. WHERE
  542. area.lv = 3
  543. <if test="jobStatus != null and jobStatus == 1">
  544. AND jobUser.JobStatusID = 1
  545. </if>
  546. <if test="jobStatus != null and jobStatus > 1">
  547. AND jobUser.JobStatusID > 1
  548. </if>
  549. GROUP BY
  550. area.`code`,
  551. area.`name`
  552. ORDER BY
  553. area.`code`
  554. </select>
  555. <select id="findCompanyCountByRegion" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
  556. SELECT
  557. area.`code` AS RegionCode,
  558. area.`name` AS RegionName,
  559. COUNT( company.CompanyID ) AS companyCount
  560. FROM
  561. area_code area
  562. LEFT JOIN pc_site site ON area.`code` = site.RegionCode
  563. LEFT JOIN pc_company company ON site.SiteID = company.SiteID
  564. WHERE
  565. area.lv = 3
  566. <if test="startDate != null">
  567. and DATE(company.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  568. </if>
  569. <if test="endDate != null ">
  570. and DATE(company.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  571. </if>
  572. GROUP BY
  573. area.`code`,
  574. area.`name`
  575. ORDER BY
  576. area.`code`
  577. </select>
  578. <select id="findPostRecruitCountByRegion" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
  579. SELECT
  580. area.`code` AS RegionCode,
  581. area.`name` AS RegionName,
  582. SUM( post.RecruitCount ) AS postRecruitCount
  583. FROM
  584. area_code area
  585. LEFT JOIN pc_site site ON area.`code` = site.RegionCode
  586. LEFT JOIN pc_company company ON site.SiteID = company.SiteID
  587. LEFT JOIN pc_post post ON company.CompanyID = post.CompanyID
  588. WHERE
  589. area.lv = 3
  590. <if test="startDate != null">
  591. and DATE(post.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  592. </if>
  593. <if test="endDate != null ">
  594. and DATE(post.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  595. </if>
  596. GROUP BY
  597. area.`code`,
  598. area.`name`
  599. ORDER BY
  600. area.`code`
  601. </select>
  602. <select id="findCompanyModelDataByRegion" resultType="com.hz.employmentsite.vo.statistics.company.ModelCompanyCount">
  603. SELECT
  604. area.`code` AS RegionCode,
  605. area.`name` AS RegionName,
  606. modelDit.`Value` AS CompanyModel,
  607. modelDit.`Name` AS CompanyModelName,
  608. COUNT( company.CompanyID ) AS companyCount
  609. FROM
  610. area_code area
  611. LEFT JOIN pc_site site ON area.`code` = site.RegionCode
  612. LEFT JOIN pc_company company ON site.SiteID = company.SiteID
  613. LEFT JOIN sys_dictionary_item modelDit ON company.CompanyModel = modelDit.`Value` AND modelDit.DictionaryCode = 'CompanyModel'
  614. WHERE
  615. area.lv = 3
  616. AND company.CompanyModel IS NOT NULL
  617. GROUP BY
  618. area.`code`,
  619. area.`name`,
  620. modelDit.`Value`,
  621. modelDit.`Name`
  622. ORDER BY
  623. area.`code`
  624. </select>
  625. <select id="findDifficultyPersonTypeCount" resultType="com.hz.employmentsite.vo.statistics.jobUser.PersonTypeJobUserCount">
  626. SELECT
  627. item.`Name` AS keyTypeName,
  628. item.`Value` AS keyPersonTypeID,
  629. COUNT( jobUser.JobuserID ) AS jobUserCount
  630. FROM
  631. sys_dictionary_item item
  632. LEFT JOIN pc_jobuser jobUser ON jobUser.KeyPersonTypeID = item.`Value`
  633. LEFT JOIN pc_site site ON jobUser.SiteID = site.SiteID
  634. WHERE
  635. item.DictionaryCode = 'KeyPersonType'
  636. AND item.`Value` IN ( 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 )
  637. AND site.RegionCode != '441301000000000'
  638. GROUP BY
  639. item.`Name`,
  640. item.`Value`
  641. ORDER BY
  642. item.`Value`
  643. </select>
  644. <select id="findJobHuntByRegion" resultType="com.hz.employmentsite.vo.statistics.jobUser.RegionJobUserCount">
  645. SELECT
  646. area.`code` AS regionCode,
  647. area.`name` AS regionName,
  648. COUNT( jobHunt.JobHuntID ) AS jobHuntCount
  649. FROM
  650. area_code area
  651. LEFT JOIN pc_site site ON area.`code` = site.RegionCode
  652. LEFT JOIN pc_jobuser jobUser ON site.SiteID = jobUser.SiteID
  653. LEFT JOIN pc_jobhunt jobHunt ON jobUser.JobuserID = jobHunt.JobUserID
  654. WHERE
  655. area.lv = 3
  656. <if test="isNotCity!=null">
  657. and site.RegionCode != '441301000000000'
  658. </if>
  659. <if test="startDate != null">
  660. and DATE(jobHunt.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  661. </if>
  662. <if test="endDate != null ">
  663. and DATE(jobHunt.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  664. </if>
  665. GROUP BY
  666. area.`code`,
  667. area.`name`
  668. ORDER BY
  669. area.`code`
  670. </select>
  671. <select id="findSiteCountByRegion" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
  672. SELECT
  673. area.`code` AS regionCode,
  674. area.`name` AS regionName,
  675. COUNT( site.SiteID ) AS siteCount
  676. FROM
  677. area_code area
  678. LEFT JOIN pc_site site ON area.`code` = site.RegionCode
  679. WHERE
  680. area.lv = 3
  681. GROUP BY
  682. area.`code`,
  683. area.`name`
  684. ORDER BY
  685. area.`code`
  686. </select>
  687. <select id="findSiteJobUserCount" resultType="com.hz.employmentsite.vo.statistics.jobUser.SiteJobUserCount">
  688. SELECT
  689. site.SiteID,
  690. site.SiteName,
  691. COUNT( jobUser.JobuserID ) AS jobUserCount
  692. FROM
  693. pc_site site
  694. LEFT JOIN pc_jobuser jobUser ON jobUser.SiteID = site.SiteID
  695. WHERE
  696. 1=1
  697. <if test="jobStatus != null and jobStatus == 1">
  698. AND jobUser.JobStatusID = 1
  699. </if>
  700. <if test="isDifficulty != null">
  701. AND jobUser.KeyPersonTypeID IN (13,14,15,16,17,18,19,20,21,22,23,24)
  702. </if>
  703. <if test="isNotCity != null">
  704. and site.RegionCode != '441301000000000'
  705. </if>
  706. GROUP BY
  707. site.SiteID,
  708. site.SiteName
  709. </select>
  710. <select id="findJobUserHourNewAddCount" resultType="com.hz.employmentsite.vo.statistics.HourNewAddCount">
  711. SELECT
  712. HOUR( CreateTime ) AS `Hour`,
  713. COUNT( 1 ) AS jobUserCount
  714. FROM
  715. pc_jobuser
  716. WHERE
  717. 1=1
  718. <if test="day != null">
  719. and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{day})
  720. </if>
  721. GROUP BY
  722. `Hour`
  723. ORDER BY
  724. `Hour`
  725. </select>
  726. <select id="findCompanyHourNewAddCount" resultType="com.hz.employmentsite.vo.statistics.HourNewAddCount">
  727. SELECT
  728. HOUR( CreateTime ) AS `Hour`,
  729. COUNT( 1 ) AS companyCount
  730. FROM
  731. pc_company
  732. WHERE
  733. 1=1
  734. <if test="day != null">
  735. and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{day})
  736. </if>
  737. GROUP BY
  738. `Hour`
  739. ORDER BY
  740. `Hour`
  741. </select>
  742. <select id="findPostHourNewAddCount" resultType="com.hz.employmentsite.vo.statistics.HourNewAddCount">
  743. SELECT
  744. HOUR( CreateTime ) AS `Hour`,
  745. COUNT( 1 ) AS postCount
  746. FROM
  747. pc_post
  748. WHERE
  749. 1=1
  750. <if test="day != null">
  751. and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{day})
  752. </if>
  753. GROUP BY
  754. `Hour`
  755. ORDER BY
  756. `Hour`
  757. </select>
  758. </mapper>