StatisticsCQuery.xml 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225
  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. SUM( RecruitCount ) AS postRecruitCount
  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. <select id="findSiteCompanyServiceCount" resultType="com.hz.employmentsite.vo.statistics.SiteServiceCount">
  759. SELECT
  760. site.SiteID,
  761. site.SiteName,
  762. COUNT(CompanyID) AS companyCount
  763. FROM
  764. pc_site site
  765. LEFT JOIN pc_company company ON company.SiteID = site.SiteID
  766. WHERE
  767. 1=1
  768. <if test="startDate != null">
  769. and DATE(company.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  770. </if>
  771. <if test="endDate != null ">
  772. and DATE(company.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  773. </if>
  774. GROUP BY
  775. site.SiteID,
  776. site.SiteName
  777. </select>
  778. <select id="findSitePostServiceCount" resultType="com.hz.employmentsite.vo.statistics.SiteServiceCount">
  779. SELECT
  780. site.SiteID,
  781. site.SiteName,
  782. COUNT(PostID) AS postCount
  783. FROM
  784. pc_site site
  785. LEFT JOIN pc_company company ON company.SiteID = site.SiteID
  786. LEFT JOIN pc_post post ON company.CompanyID = post.CompanyID
  787. WHERE
  788. 1=1
  789. <if test="startDate != null">
  790. and DATE(post.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  791. </if>
  792. <if test="endDate != null ">
  793. and DATE(post.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  794. </if>
  795. GROUP BY
  796. site.SiteID,
  797. site.SiteName
  798. </select>
  799. <select id="findSiteJobUserServiceCount" resultType="com.hz.employmentsite.vo.statistics.SiteServiceCount">
  800. SELECT
  801. site.SiteID,
  802. site.SiteName,
  803. COUNT(JobuserID) AS jobUserCount
  804. FROM
  805. pc_site site
  806. LEFT JOIN pc_jobuser jobUser ON jobUser.SiteID = site.SiteID
  807. WHERE
  808. 1=1
  809. <if test="startDate != null">
  810. and DATE(jobUser.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  811. </if>
  812. <if test="endDate != null ">
  813. and DATE(jobUser.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  814. </if>
  815. GROUP BY
  816. site.SiteID,
  817. site.SiteName
  818. </select>
  819. <select id="findSitePostRecruitServiceCount" resultType="com.hz.employmentsite.vo.statistics.SiteServiceCount">
  820. SELECT
  821. site.SiteID,
  822. site.SiteName,
  823. SUM(post.RecruitCount) AS postRecruitCount
  824. FROM
  825. pc_site site
  826. LEFT JOIN pc_company company ON company.SiteID = site.SiteID
  827. LEFT JOIN pc_post post ON company.CompanyID = post.CompanyID
  828. WHERE
  829. 1=1
  830. <if test="startDate != null">
  831. and DATE(post.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  832. </if>
  833. <if test="endDate != null ">
  834. and DATE(post.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  835. </if>
  836. GROUP BY
  837. site.SiteID,
  838. site.SiteName
  839. </select>
  840. <select id="findPersonTypeCountInRegion" resultType="com.hz.employmentsite.vo.statistics.jobUser.PersonTypeJobUserCount">
  841. SELECT
  842. jobuser.KeyPersonTypeID,
  843. keytype.`Name` AS KeyTypeName,
  844. site.RegionCode,
  845. area.`name` AS regionName,
  846. COUNT( 1 ) AS jobUserCount
  847. FROM
  848. `pc_jobuser` jobuser
  849. LEFT JOIN sys_dictionary_item keytype ON jobuser.KeyPersonTypeID = keytype.`Value`
  850. AND keytype.DictionaryCode = 'KeyPersonType'
  851. LEFT JOIN pc_site site ON jobuser.SiteID = site.SiteID
  852. LEFT JOIN area_code area ON site.RegionCode = area.`code`
  853. WHERE
  854. 1=1
  855. <if test="keyPersonTypeID != null">
  856. and jobuser.KeyPersonTypeID = #{keyPersonTypeID}
  857. </if>
  858. <if test="startDate != null">
  859. and DATE(jobuser.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  860. </if>
  861. <if test="endDate != null ">
  862. and DATE(jobuser.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  863. </if>
  864. <if test="regionCode != null and regionCode != ''">
  865. and site.RegionCode = #{regionCode}
  866. </if>
  867. <if test="siteID != null and siteID != ''">
  868. and jobuser.siteID = #{siteID}
  869. </if>
  870. GROUP BY
  871. jobuser.KeyPersonTypeID,
  872. keytype.`Name`,
  873. site.RegionCode,
  874. area.`name`
  875. ORDER BY
  876. jobuser.KeyPersonTypeID DESC
  877. </select>
  878. <select id="findPersonTypeCountInSex" resultType="com.hz.employmentsite.vo.statistics.jobUser.PersonTypeJobUserCount">
  879. SELECT
  880. jobuser.KeyPersonTypeID,
  881. keytype.`Name` AS KeyTypeName,
  882. gender.`Value` AS genderID,
  883. gender.`name` AS genderName,
  884. COUNT( 1 ) AS jobUserCount
  885. FROM
  886. `pc_jobuser` jobuser
  887. LEFT JOIN sys_dictionary_item keytype ON jobuser.KeyPersonTypeID = keytype.`Value`
  888. AND keytype.DictionaryCode = 'KeyPersonType'
  889. LEFT JOIN sys_dictionary_item gender ON jobuser.Sex = gender.`Value`
  890. AND gender.DictionaryCode = 'Gender'
  891. LEFT JOIN pc_site site ON jobuser.SiteID = site.SiteID
  892. LEFT JOIN area_code area ON site.RegionCode = area.`code`
  893. WHERE
  894. 1=1
  895. <if test="keyPersonTypeID != null">
  896. and jobuser.KeyPersonTypeID = #{keyPersonTypeID}
  897. </if>
  898. <if test="startDate != null">
  899. and DATE(jobuser.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  900. </if>
  901. <if test="endDate != null ">
  902. and DATE(jobuser.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  903. </if>
  904. <if test="regionCode != null and regionCode != ''">
  905. and site.RegionCode = #{regionCode}
  906. </if>
  907. <if test="siteID != null and siteID != ''">
  908. and jobuser.siteID = #{siteID}
  909. </if>
  910. GROUP BY
  911. jobuser.KeyPersonTypeID,
  912. keytype.`Name`,
  913. gender.`Value`,
  914. gender.`name`
  915. ORDER BY
  916. jobuser.KeyPersonTypeID DESC
  917. </select>
  918. <select id="findPersonTypeCountInAgeRange" resultType="com.hz.employmentsite.vo.statistics.jobUser.PersonTypeJobUserCount">
  919. SELECT
  920. jobuser.KeyPersonTypeID,
  921. keytype.`Name` AS KeyTypeName,
  922. CASE
  923. WHEN TIMESTAMPDIFF(YEAR, BirthDay, CURDATE()) BETWEEN 18 AND 20 THEN '18-20岁'
  924. WHEN TIMESTAMPDIFF(YEAR, BirthDay, CURDATE()) BETWEEN 21 AND 30 THEN '21-30岁'
  925. WHEN TIMESTAMPDIFF(YEAR, BirthDay, CURDATE()) BETWEEN 31 AND 40 THEN '31-40岁'
  926. WHEN TIMESTAMPDIFF(YEAR, BirthDay, CURDATE()) BETWEEN 41 AND 50 THEN '41-50岁'
  927. WHEN TIMESTAMPDIFF(YEAR, BirthDay, CURDATE()) BETWEEN 51 AND 60 THEN '51-60岁'
  928. END AS AgeRange,
  929. COUNT( 1 ) AS jobUserCount
  930. FROM
  931. `pc_jobuser` jobuser
  932. LEFT JOIN sys_dictionary_item keytype ON jobuser.KeyPersonTypeID = keytype.`Value`
  933. AND keytype.DictionaryCode = 'KeyPersonType'
  934. LEFT JOIN pc_site site ON jobuser.SiteID = site.SiteID
  935. LEFT JOIN area_code area ON site.RegionCode = area.`code`
  936. WHERE
  937. 1=1
  938. <if test="keyPersonTypeID != null">
  939. and jobuser.KeyPersonTypeID = #{keyPersonTypeID}
  940. </if>
  941. <if test="startDate != null">
  942. and DATE(jobuser.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  943. </if>
  944. <if test="endDate != null ">
  945. and DATE(jobuser.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  946. </if>
  947. <if test="regionCode != null and regionCode != ''">
  948. and site.RegionCode = #{regionCode}
  949. </if>
  950. <if test="siteID != null and siteID != ''">
  951. and jobuser.siteID = #{siteID}
  952. </if>
  953. GROUP BY
  954. jobuser.KeyPersonTypeID,
  955. keytype.`Name`,
  956. AgeRange
  957. ORDER BY
  958. jobuser.KeyPersonTypeID DESC
  959. </select>
  960. <select id="findPersonTypeCountInCultureRank" resultType="com.hz.employmentsite.vo.statistics.jobUser.PersonTypeJobUserCount">
  961. SELECT
  962. jobuser.KeyPersonTypeID,
  963. keytype.`Name` AS KeyTypeName,
  964. jobuser.CultureRank,
  965. culture.`Name` AS CultureName,
  966. COUNT( 1 ) AS jobUserCount
  967. FROM
  968. `pc_jobuser` jobuser
  969. LEFT JOIN sys_dictionary_item keytype ON jobuser.KeyPersonTypeID = keytype.`Value`
  970. AND keytype.DictionaryCode = 'KeyPersonType'
  971. LEFT JOIN sys_dictionary_item culture ON jobuser.CultureRank = culture.`Value`
  972. AND culture.DictionaryCode = 'HighestDegree'
  973. WHERE
  974. 1=1
  975. <if test="keyPersonTypeID != null">
  976. and jobuser.KeyPersonTypeID = #{keyPersonTypeID}
  977. </if>
  978. <if test="startDate != null">
  979. and DATE(jobuser.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  980. </if>
  981. <if test="endDate != null ">
  982. and DATE(jobuser.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  983. </if>
  984. <if test="regionCode != null and regionCode != ''">
  985. and site.RegionCode = #{regionCode}
  986. </if>
  987. <if test="siteID != null and siteID != ''">
  988. and jobuser.siteID = #{siteID}
  989. </if>
  990. GROUP BY
  991. jobuser.KeyPersonTypeID,
  992. keytype.`Name`,
  993. jobuser.CultureRank
  994. ORDER BY
  995. jobuser.KeyPersonTypeID DESC
  996. </select>
  997. <select id="findRegionCompanyModelCompanyCount" resultType="com.hz.employmentsite.vo.statistics.company.ModelCompanyCount">
  998. SELECT
  999. area.`code` AS regionCode,
  1000. area.`name` AS regionName,
  1001. company.CompanyModel,
  1002. dict.`Name` AS companyModelName,
  1003. COUNT( company.CompanyID ) AS companyCount
  1004. FROM
  1005. area_code area
  1006. LEFT JOIN pc_site site ON area.`code` = site.RegionCode
  1007. LEFT JOIN pc_company company ON site.SiteID = company.SiteID
  1008. LEFT JOIN sys_dictionary_item dict ON company.CompanyModel = dict.`Value`
  1009. AND dict.DictionaryCode = 'CompanyModel'
  1010. WHERE
  1011. area.lv = 3
  1012. AND area.`code` != '441301000000000'
  1013. AND company.CompanyModel IS NOT NULL
  1014. <if test="startDate != null">
  1015. and DATE(company.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  1016. </if>
  1017. <if test="endDate != null ">
  1018. and DATE(company.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  1019. </if>
  1020. GROUP BY
  1021. area.`code`,
  1022. area.`name`,
  1023. company.CompanyModel,
  1024. dict.`Name`
  1025. ORDER BY
  1026. area.`code`
  1027. </select>
  1028. <select id="findRegionCompanyModelSigninCompanyCount" resultType="com.hz.employmentsite.vo.statistics.company.ModelCompanyCount">
  1029. SELECT
  1030. area.`code` AS regionCode,
  1031. area.`name` AS regionName,
  1032. company.CompanyModel,
  1033. dict.`Name` AS companyModelName,
  1034. COUNT( signin.CompanyID ) AS signinCompanyCount
  1035. FROM
  1036. area_code area
  1037. LEFT JOIN pc_site site ON area.`code` = site.RegionCode
  1038. LEFT JOIN pc_company company ON site.SiteID = company.SiteID
  1039. LEFT JOIN pc_signin signin ON company.CompanyID = signin.CompanyID
  1040. LEFT JOIN sys_dictionary_item dict ON company.CompanyModel = dict.`Value`
  1041. AND dict.DictionaryCode = 'CompanyModel'
  1042. WHERE
  1043. area.lv = 3
  1044. AND area.`code` != '441301000000000'
  1045. AND company.CompanyModel IS NOT NULL
  1046. AND signin.SigninType = 1
  1047. <if test="startDate != null">
  1048. and DATE(signin.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  1049. </if>
  1050. <if test="endDate != null ">
  1051. and DATE(signin.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  1052. </if>
  1053. GROUP BY
  1054. area.`code`,
  1055. area.`name`,
  1056. company.CompanyModel,
  1057. dict.`Name`
  1058. ORDER BY
  1059. area.`code`
  1060. </select>
  1061. <select id="findRegionCompanyWorkSituationCount" resultType="com.hz.employmentsite.vo.statistics.company.ModelCompanyCount">
  1062. SELECT
  1063. area.`code` AS regionCode,
  1064. area.`name` AS regionName,
  1065. company.CompanyModel,
  1066. dict.`Name` AS companyModelName,
  1067. SUM( company.workSituation ) AS workSituationCount
  1068. FROM
  1069. area_code area
  1070. LEFT JOIN pc_site site ON area.`code` = site.RegionCode
  1071. LEFT JOIN pc_company company ON site.SiteID = company.SiteID
  1072. LEFT JOIN sys_dictionary_item dict ON company.CompanyModel = dict.`Value`
  1073. AND dict.DictionaryCode = 'CompanyModel'
  1074. WHERE
  1075. area.lv = 3
  1076. AND area.`code` != '441301000000000'
  1077. AND company.CompanyModel IS NOT NULL
  1078. AND company.WorkSituation IS NOT NULL
  1079. <if test="startDate != null">
  1080. and DATE(company.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  1081. </if>
  1082. <if test="endDate != null ">
  1083. and DATE(company.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  1084. </if>
  1085. GROUP BY
  1086. area.`code`,
  1087. area.`name`,
  1088. company.CompanyModel,
  1089. dict.`Name`
  1090. ORDER BY
  1091. area.`code`
  1092. </select>
  1093. <select id="findRegionCompanyRecruitCount" resultType="com.hz.employmentsite.vo.statistics.company.ModelCompanyCount">
  1094. SELECT
  1095. area.`code` AS regionCode,
  1096. area.`name` AS regionName,
  1097. company.CompanyModel,
  1098. dict.`Name` AS companyModelName,
  1099. SUM( post.recruitCount ) AS recruitCount
  1100. FROM
  1101. area_code area
  1102. LEFT JOIN pc_site site ON area.`code` = site.RegionCode
  1103. LEFT JOIN pc_company company ON site.SiteID = company.SiteID
  1104. LEFT JOIN pc_post post ON company.CompanyID = post.CompanyID
  1105. LEFT JOIN sys_dictionary_item dict ON company.CompanyModel = dict.`Value`
  1106. AND dict.DictionaryCode = 'CompanyModel'
  1107. WHERE
  1108. area.lv = 3
  1109. AND area.`code` != '441301000000000'
  1110. AND company.CompanyModel IS NOT NULL
  1111. AND post.RecruitCount IS NOT NULL
  1112. <if test="startDate != null">
  1113. and DATE(post.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  1114. </if>
  1115. <if test="endDate != null ">
  1116. and DATE(post.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  1117. </if>
  1118. GROUP BY
  1119. area.`code`,
  1120. area.`name`,
  1121. company.CompanyModel,
  1122. dict.`Name`
  1123. ORDER BY
  1124. area.`code`
  1125. </select>
  1126. <select id="findIndustryCompanyWorkSituationCount" resultType="com.hz.employmentsite.vo.statistics.company.ModelCompanyCount">
  1127. SELECT
  1128. pIndustry.industryName AS parentIndustryName,
  1129. industry.industryName,
  1130. company.CompanyModel,
  1131. dict.`Name` AS companyModelName,
  1132. SUM( company.WorkSituation ) AS workSituationCount
  1133. FROM
  1134. pc_industry industry
  1135. LEFT JOIN pc_industry pIndustry ON industry.parentId = pIndustry.industryId
  1136. LEFT JOIN pc_company company ON company.IndustryID = industry.industryId
  1137. LEFT JOIN sys_dictionary_item dict ON company.CompanyModel = dict.`Value`
  1138. AND dict.DictionaryCode = 'CompanyModel'
  1139. WHERE
  1140. industry.parentId != ''
  1141. AND industry.parentId IS NOT NULL
  1142. <if test="startDate != null">
  1143. and DATE(company.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  1144. </if>
  1145. <if test="endDate != null ">
  1146. and DATE(company.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  1147. </if>
  1148. GROUP BY
  1149. pIndustry.industryName,
  1150. industry.industryName,
  1151. company.CompanyModel,
  1152. dict.`Name`
  1153. ORDER BY
  1154. industry.parentId
  1155. </select>
  1156. <select id="findIndustryCompanyRecruitCount" resultType="com.hz.employmentsite.vo.statistics.company.ModelCompanyCount">
  1157. SELECT
  1158. pIndustry.industryName AS parentIndustryName,
  1159. industry.industryName,
  1160. company.CompanyModel,
  1161. dict.`Name` AS companyModelName,
  1162. COUNT( post.RecruitCount ) AS recruitCount
  1163. FROM
  1164. pc_industry industry
  1165. LEFT JOIN pc_industry pIndustry ON industry.parentId = pIndustry.industryId
  1166. LEFT JOIN pc_company company ON company.IndustryID = industry.industryId
  1167. LEFT JOIN pc_post post on company.CompanyID = post.CompanyID
  1168. LEFT JOIN sys_dictionary_item dict ON company.CompanyModel = dict.`Value`
  1169. AND dict.DictionaryCode = 'CompanyModel'
  1170. WHERE
  1171. industry.parentId != ''
  1172. AND industry.parentId IS NOT NULL
  1173. <if test="startDate != null">
  1174. and DATE(post.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
  1175. </if>
  1176. <if test="endDate != null ">
  1177. and DATE(post.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
  1178. </if>
  1179. GROUP BY
  1180. pIndustry.industryName,
  1181. industry.industryName,
  1182. company.CompanyModel,
  1183. dict.`Name`
  1184. ORDER BY
  1185. industry.parentId
  1186. </select>
  1187. </mapper>