123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.hz.employmentsite.mapper.cquery.StatisticsCQuery">
- <select id="findSystemDataCount" resultType="com.hz.employmentsite.vo.statistics.SystemDataCount">
- SELECT
- site.SiteID,
- site.RegionCode,
- site.SiteName,
- area.`name` AS regionName,
- -- 驿站人员数量
- (
- SELECT
- COUNT( 1 )
- FROM
- pc_site_user site_user
- LEFT JOIN sys_user sys_user ON site_user.UserID = sys_user.UserID
- WHERE
- site_user.SiteID = site.SiteID
- AND sys_user.RecordStatus = 1
- ) AS siteUserCount,
- -- 指定时间段的登记企业数量
- (
- SELECT
- COUNT( 1 )
- FROM
- pc_company
- WHERE
- SiteID = site.SiteID
- <if test="startDate != null">
- and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- ) AS companyCount,
- -- 指定时间段的登记岗位数量
- (
- SELECT
- COUNT( 1 )
- FROM
- pc_post post
- WHERE
- CompanyID IN ( SELECT company.CompanyID FROM pc_company company WHERE company.SiteID = site.SiteID )
- <if test="startDate != null">
- and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- ) AS postCount,
- (case when (
- SELECT
- COUNT( 1 )
- FROM
- pc_post post
- WHERE
- CompanyID IN ( SELECT company.CompanyID FROM pc_company company WHERE company.SiteID = site.SiteID )
- <if test="startDate != null">
- and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- )=0 then 0 else
- (
- SELECT
- sum(post.RecruitCount)
- FROM
- pc_post post
- WHERE
- CompanyID IN ( SELECT company.CompanyID FROM pc_company company WHERE company.SiteID = site.SiteID )
- <if test="startDate != null">
- and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- ) end )AS postRecruitCount,
- -- 指定时间段的登记求职人员数量
- (
- SELECT
- COUNT( 1 )
- FROM
- pc_jobuser
- WHERE
- SiteID = site.SiteID
- <if test="startDate != null">
- and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- ) AS jobUserCount
- FROM
- pc_site site
- LEFT JOIN area_code area ON site.RegionCode = area.`code`
- ORDER BY site.RegionCode
- </select>
- <select id="findWeekSystemDataCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
- SELECT
- subquery.RegionCode,
- subquery.RegionName,
- SUM(subquery.companyCount) AS companyCount,
- SUM(subquery.postCount) AS postCount,
- SUM(subquery.jobUserCount) AS jobUserCount
- FROM
- (
- SELECT
- site.SiteID,
- site.RegionCode,
- area.`Name` AS RegionName,
- -- 指定时间段的登记企业数量
- (
- SELECT COUNT(1)
- FROM pc_company
- WHERE
- SiteID = site.SiteID
- <if test="startDate != null">
- and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- ) AS companyCount,
- -- 指定时间段的登记岗位数量
- (
- SELECT COUNT(1)
- FROM pc_post post
- WHERE
- CompanyID IN (SELECT company.CompanyID FROM pc_company company WHERE company.SiteID = site.SiteID)
- <if test="startDate != null">
- and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- ) AS postCount,
- -- 指定时间段的登记求职人员数量
- (
- SELECT COUNT(1)
- FROM pc_jobuser
- WHERE
- SiteID = site.SiteID
- <if test="startDate != null">
- and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- ) AS jobUserCount
- FROM
- pc_site site
- LEFT JOIN area_code area ON site.RegionCode = area.`code`
- LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
- WHERE
- 1=1
- <if test="siteID!='' and siteID!=null">
- and site.siteID = #{siteID}
- </if>
- <if test="institutionID!='' and institutionID!=null">
- and siteInst.institutionID = #{institutionID}
- </if>
- <if test="regionCode!='' and regionCode!=null">
- and area.`code` = #{regionCode}
- </if>
- ) AS subquery
- GROUP BY
- subquery.RegionCode,
- subquery.RegionName
- ORDER BY
- subquery.RegionCode;
- </select>
- <select id="findRegionSiteUserCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
- SELECT
- area.`code` AS regionCode,
- area.`name` AS regionName,
- COUNT( sysUser.UserID ) AS siteUserCount
- FROM
- area_code area
- LEFT JOIN pc_site site ON site.RegionCode = area.`code`
- LEFT JOIN pc_site_user siteUser ON site.SiteID = siteUser.SiteID
- LEFT JOIN sys_user sysUser ON siteUser.UserID = sysUser.UserID AND sysUser.RecordStatus = 1
- LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
- WHERE
- area.lv = 3
- <if test="siteID!='' and siteID!=null">
- and site.siteID = #{siteID}
- </if>
- <if test="institutionID!='' and institutionID!=null">
- and siteInst.institutionID = #{institutionID}
- </if>
- <if test="regionCode!='' and regionCode!=null">
- and area.`code` = #{regionCode}
- </if>
- GROUP BY
- area.`code`,
- area.`name`
- ORDER BY
- area.`code`
- </select>
- <select id="findJobUserCountByAgeRange" resultType="com.hz.employmentsite.vo.statistics.jobUser.AgeRangeJobUserCount">
- SELECT
- CASE
- WHEN TIMESTAMPDIFF(YEAR, BirthDay, CURDATE()) BETWEEN 16 AND 25 THEN '16-25岁'
- WHEN TIMESTAMPDIFF(YEAR, BirthDay, CURDATE()) BETWEEN 26 AND 35 THEN '26-35岁'
- WHEN TIMESTAMPDIFF(YEAR, BirthDay, CURDATE()) BETWEEN 36 AND 45 THEN '36-45岁'
- WHEN TIMESTAMPDIFF(YEAR, BirthDay, CURDATE()) BETWEEN 46 AND 55 THEN '46-55岁'
- ELSE '55岁以上'
- END AS AgeRange,
- Sex,
- COUNT(1) AS jobUserCount
- FROM
- pc_jobuser jobUser
- LEFT JOIN pc_site site ON jobUser.SiteID = site.SiteID
- WHERE
- 1=1
- <if test="isNotCity!=null">
- and site.RegionCode != '441301000000000'
- </if>
- <if test="year!='' and year!=null">
- and YEAR(CreateTime) = #{year}
- </if>
- <if test="month!='' and month!=null">
- and MONTH(CreateTime) = #{month}
- </if>
- GROUP BY
- AgeRange,
- Sex
- ORDER BY
- AgeRange,
- Sex;
- </select>
- <select id="findJobUserCountByPersonType" resultType="com.hz.employmentsite.vo.statistics.jobUser.PersonTypeJobUserCount">
- SELECT
- jobuser.KeyPersonTypeID,
- keytype.`Name` AS KeyTypeName,
- jobuser.CultureRank,
- culture.`Name` AS CultureName,
- COUNT( 1 ) AS jobUserCount
- FROM
- `pc_jobuser` jobuser
- LEFT JOIN sys_dictionary_item keytype ON jobuser.KeyPersonTypeID = keytype.`Value`
- AND keytype.DictionaryCode = 'KeyPersonType'
- LEFT JOIN sys_dictionary_item culture ON jobuser.CultureRank = culture.`Value`
- AND culture.DictionaryCode = 'HighestDegree'
- WHERE
- CultureRank IS NOT NULL
- <if test="year!='' and year!=null">
- and YEAR(jobuser.CreateTime) = #{year}
- </if>
- <if test="month!='' and month!=null">
- and MONTH(jobuser.CreateTime) = #{month}
- </if>
- GROUP BY
- jobuser.KeyPersonTypeID,
- keytype.`Name`,
- jobuser.CultureRank
- ORDER BY
- jobuser.KeyPersonTypeID,
- jobuser.CultureRank DESC
- </select>
- <select id="findJobUserByRegion" resultType="com.hz.employmentsite.vo.statistics.jobUser.RegionJobUserCount">
- SELECT
- area.`code` AS regionCode,
- area.`name` AS regionName,
- COUNT( jobUser.JobuserID ) AS jobUserCount
- FROM
- area_code area
- LEFT JOIN pc_site site ON area.`code` = site.RegionCode
- LEFT JOIN pc_jobuser jobUser ON site.SiteID = jobUser.SiteID
- WHERE
- area.lv = 3
- <if test="isNotCity!=null">
- and site.RegionCode != '441301000000000'
- </if>
- <if test="year!='' and year!=null">
- and YEAR(jobUser.CreateTime) = #{year}
- </if>
- <if test="month!='' and month!=null">
- and MONTH(jobUser.CreateTime) = #{month}
- </if>
- <if test="startDate != null">
- and DATE(jobUser.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(jobUser.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- GROUP BY
- area.`code`,
- area.`name`
- ORDER BY
- area.`code`
- </select>
- <select id="findJobUserByRegionAndPersonType" resultType="com.hz.employmentsite.vo.statistics.jobUser.RegionJobUserCount">
- SELECT
- area.`code` AS regionCode,
- area.`name` AS regionName,
- COUNT( jobUser.JobuserID ) AS jobUserCount
- FROM
- area_code area
- LEFT JOIN pc_site site ON area.`code` = site.RegionCode
- LEFT JOIN pc_jobuser jobUser ON site.SiteID = jobUser.SiteID
- WHERE
- area.lv = 3
- AND jobUser.KeyPersonTypeID IN (13,14,15,16,17,18,19,20,21,22,23,24)
- <if test="year!='' and year!=null">
- and YEAR(jobUser.CreateTime) = #{year}
- </if>
- <if test="month!='' and month!=null">
- and MONTH(jobUser.CreateTime) = #{month}
- </if>
- GROUP BY
- area.`code`,
- area.`name`
- ORDER BY
- area.`code`
- </select>
- <select id="findYearCompanyCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
- SELECT
- area.`code` AS RegionCode,
- area.`name` AS RegionName,
- DATE_FORMAT( company.CreateTime, '%m' ) AS `Month`,
- COUNT( 1 ) AS CompanyCount
- FROM
- pc_company company
- LEFT JOIN pc_site site ON company.SiteID = site.SiteID
- LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
- LEFT JOIN area_code area ON area.`code` = site.RegionCode
- WHERE
- 1=1
- <if test="year!='' and year!=null">
- and YEAR(company.CreateTime) = #{year}
- </if>
- <if test="startDate != null">
- and DATE(company.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(company.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- <if test="siteID!='' and siteID!=null">
- and site.siteID = #{siteID}
- </if>
- <if test="institutionID!='' and institutionID!=null">
- and siteInst.institutionID = #{institutionID}
- </if>
- <if test="regionCode!='' and regionCode!=null">
- and area.`code` = #{regionCode}
- </if>
- GROUP BY
- area.`code`,
- area.`name`,
- `Month`
- ORDER BY
- area.`code`,
- `Month` ASC
- </select>
- <select id="findYearPostCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
- SELECT
- area.`code` AS RegionCode,
- area.`name` AS RegionName,
- DATE_FORMAT( post.CreateTime, '%m' ) AS `Month`,
- COUNT( 1 ) AS PostCount,
- SUM( post.RecruitCount ) AS PostRecruitCount
- FROM
- pc_post post
- LEFT JOIN pc_company company ON post.CompanyID = company.CompanyID
- LEFT JOIN pc_site site ON company.SiteID = site.SiteID
- LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
- LEFT JOIN area_code area ON area.`code` = site.RegionCode
- WHERE
- 1=1
- <if test="year!='' and year!=null">
- and YEAR(post.CreateTime) = #{year}
- </if>
- <if test="startDate != null">
- and DATE(post.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(post.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- <if test="siteID!='' and siteID!=null">
- and site.siteID = #{siteID}
- </if>
- <if test="institutionID!='' and institutionID!=null">
- and siteInst.institutionID = #{institutionID}
- </if>
- <if test="regionCode!='' and regionCode!=null">
- and area.`code` = #{regionCode}
- </if>
- GROUP BY
- area.`code`,
- area.`name`,
- `Month`
- ORDER BY
- area.`code`,
- `Month` ASC
- </select>
- <select id="findYearJobUserCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
- SELECT
- area.`code` AS RegionCode,
- area.`name` AS RegionName,
- DATE_FORMAT( jobUser.CreateTime, '%m' ) AS `Month`,
- COUNT( 1 ) AS JobUserCount
- FROM
- pc_jobuser jobUser
- LEFT JOIN pc_site site ON jobUser.SiteID = site.SiteID
- LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
- LEFT JOIN area_code area ON area.`code` = site.RegionCode
- WHERE
- 1=1
- <if test="year!='' and year!=null">
- and YEAR(jobUser.CreateTime) = #{year}
- </if>
- <if test="startDate != null">
- and DATE(jobUser.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(jobUser.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- <if test="siteID!='' and siteID!=null">
- and site.siteID = #{siteID}
- </if>
- <if test="institutionID!='' and institutionID!=null">
- and siteInst.institutionID = #{institutionID}
- </if>
- <if test="regionCode!='' and regionCode!=null">
- and area.`code` = #{regionCode}
- </if>
- GROUP BY
- area.`code`,
- area.`name`,
- `Month`
- ORDER BY
- area.`code`,
- `Month` ASC
- </select>
- <select id="findMonthCompanyCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
- SELECT
- area.`code` AS RegionCode,
- area.`name` AS RegionName,
- WEEK ( company.CreateTime, 5 ) AS `Week`,
- COUNT( 1 ) AS CompanyCount
- FROM
- pc_company company
- LEFT JOIN pc_site site ON company.SiteID = site.SiteID
- LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
- LEFT JOIN area_code area ON area.`code` = site.RegionCode
- WHERE
- YEAR ( company.CreateTime ) = #{year}
- AND MONTH ( company.CreateTime ) = #{month}
- <if test="siteID!='' and siteID!=null">
- and site.siteID = #{siteID}
- </if>
- <if test="institutionID!='' and institutionID!=null">
- and siteInst.institutionID = #{institutionID}
- </if>
- <if test="regionCode!='' and regionCode!=null">
- and area.`code` = #{regionCode}
- </if>
- GROUP BY
- area.`code`,
- area.`name`,
- `Week`
- ORDER BY
- area.`code`,
- `Week` ASC
- </select>
- <select id="findMonthPostCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
- SELECT
- area.`code` AS RegionCode,
- area.`name` AS RegionName,
- WEEK( post.CreateTime, 5 ) AS `Week`,
- COUNT( 1 ) AS PostCount,
- SUM( post.RecruitCount ) AS PostRecruitCount
- FROM
- pc_post post
- LEFT JOIN pc_company company ON post.CompanyID = company.CompanyID
- LEFT JOIN pc_site site ON company.SiteID = site.SiteID
- LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
- LEFT JOIN area_code area ON area.`code` = site.RegionCode
- WHERE
- YEAR ( post.CreateTime ) = #{year}
- AND MONTH ( post.CreateTime ) = #{month}
- <if test="siteID!='' and siteID!=null">
- and site.siteID = #{siteID}
- </if>
- <if test="institutionID!='' and institutionID!=null">
- and siteInst.institutionID = #{institutionID}
- </if>
- <if test="regionCode!='' and regionCode!=null">
- and area.`code` = #{regionCode}
- </if>
- GROUP BY
- area.`code`,
- area.`name`,
- `Week`
- ORDER BY
- area.`code`,
- `Week` ASC
- </select>
- <select id="findMonthJobUserCount" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
- SELECT
- area.`code` AS RegionCode,
- area.`name` AS RegionName,
- WEEK( jobUser.CreateTime, 5 ) AS `Week`,
- COUNT( 1 ) AS JobUserCount
- FROM
- pc_jobuser jobUser
- LEFT JOIN pc_site site ON jobUser.SiteID = site.SiteID
- LEFT JOIN pc_site_institution siteInst ON site.SiteID = siteInst.SiteID
- LEFT JOIN area_code area ON area.`code` = site.RegionCode
- WHERE
- YEAR ( jobUser.CreateTime ) = #{year}
- AND MONTH ( jobUser.CreateTime ) = #{month}
- <if test="siteID!='' and siteID!=null">
- and site.siteID = #{siteID}
- </if>
- <if test="institutionID!='' and institutionID!=null">
- and siteInst.institutionID = #{institutionID}
- </if>
- <if test="regionCode!='' and regionCode!=null">
- and area.`code` = #{regionCode}
- </if>
- GROUP BY
- area.`code`,
- area.`name`,
- `Week`
- ORDER BY
- area.`code`,
- `Week` ASC
- </select>
- <select id="findJobUserCountByStatus" resultType="com.hz.employmentsite.vo.statistics.jobUser.RegionJobUserCount">
- SELECT
- area.`code` AS regionCode,
- area.`name` AS regionName,
- COUNT( jobUser.JobuserID ) AS jobUserCount
- FROM
- area_code area
- LEFT JOIN pc_site site ON area.`code` = site.RegionCode
- LEFT JOIN pc_jobuser jobUser ON site.SiteID = jobUser.SiteID
- WHERE
- area.lv = 3
- <if test="jobStatus != null and jobStatus == 1">
- AND jobUser.JobStatusID = 1
- </if>
- <if test="jobStatus != null and jobStatus > 1">
- AND jobUser.JobStatusID > 1
- </if>
- GROUP BY
- area.`code`,
- area.`name`
- ORDER BY
- area.`code`
- </select>
- <select id="findCompanyCountByRegion" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
- SELECT
- area.`code` AS RegionCode,
- area.`name` AS RegionName,
- COUNT( company.CompanyID ) AS companyCount
- FROM
- area_code area
- LEFT JOIN pc_site site ON area.`code` = site.RegionCode
- LEFT JOIN pc_company company ON site.SiteID = company.SiteID
- WHERE
- area.lv = 3
- <if test="startDate != null">
- and DATE(company.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(company.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- GROUP BY
- area.`code`,
- area.`name`
- ORDER BY
- area.`code`
- </select>
- <select id="findPostRecruitCountByRegion" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
- SELECT
- area.`code` AS RegionCode,
- area.`name` AS RegionName,
- SUM( post.RecruitCount ) AS postRecruitCount
- FROM
- area_code area
- LEFT JOIN pc_site site ON area.`code` = site.RegionCode
- LEFT JOIN pc_company company ON site.SiteID = company.SiteID
- LEFT JOIN pc_post post ON company.CompanyID = post.CompanyID
- WHERE
- area.lv = 3
- <if test="startDate != null">
- and DATE(post.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(post.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- GROUP BY
- area.`code`,
- area.`name`
- ORDER BY
- area.`code`
- </select>
- <select id="findCompanyModelDataByRegion" resultType="com.hz.employmentsite.vo.statistics.company.ModelCompanyCount">
- SELECT
- area.`code` AS RegionCode,
- area.`name` AS RegionName,
- modelDit.`Value` AS CompanyModel,
- modelDit.`Name` AS CompanyModelName,
- COUNT( company.CompanyID ) AS companyCount
- FROM
- area_code area
- LEFT JOIN pc_site site ON area.`code` = site.RegionCode
- LEFT JOIN pc_company company ON site.SiteID = company.SiteID
- LEFT JOIN sys_dictionary_item modelDit ON company.CompanyModel = modelDit.`Value` AND modelDit.DictionaryCode = 'CompanyModel'
- WHERE
- area.lv = 3
- AND company.CompanyModel IS NOT NULL
- GROUP BY
- area.`code`,
- area.`name`,
- modelDit.`Value`,
- modelDit.`Name`
- ORDER BY
- area.`code`
- </select>
- <select id="findDifficultyPersonTypeCount" resultType="com.hz.employmentsite.vo.statistics.jobUser.PersonTypeJobUserCount">
- SELECT
- item.`Name` AS keyTypeName,
- item.`Value` AS keyPersonTypeID,
- COUNT( jobUser.JobuserID ) AS jobUserCount
- FROM
- sys_dictionary_item item
- LEFT JOIN pc_jobuser jobUser ON jobUser.KeyPersonTypeID = item.`Value`
- LEFT JOIN pc_site site ON jobUser.SiteID = site.SiteID
- WHERE
- item.DictionaryCode = 'KeyPersonType'
- AND item.`Value` IN ( 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 )
- AND site.RegionCode != '441301000000000'
- GROUP BY
- item.`Name`,
- item.`Value`
- ORDER BY
- item.`Value`
- </select>
- <select id="findJobHuntByRegion" resultType="com.hz.employmentsite.vo.statistics.jobUser.RegionJobUserCount">
- SELECT
- area.`code` AS regionCode,
- area.`name` AS regionName,
- COUNT( jobHunt.JobHuntID ) AS jobHuntCount
- FROM
- area_code area
- LEFT JOIN pc_site site ON area.`code` = site.RegionCode
- LEFT JOIN pc_jobuser jobUser ON site.SiteID = jobUser.SiteID
- LEFT JOIN pc_jobhunt jobHunt ON jobUser.JobuserID = jobHunt.JobUserID
- WHERE
- area.lv = 3
- <if test="isNotCity!=null">
- and site.RegionCode != '441301000000000'
- </if>
- <if test="startDate != null">
- and DATE(jobHunt.CreateTime) <![CDATA[ >= ]]> DATE(#{startDate})
- </if>
- <if test="endDate != null ">
- and DATE(jobHunt.CreateTime) <![CDATA[ <= ]]> DATE(#{endDate})
- </if>
- GROUP BY
- area.`code`,
- area.`name`
- ORDER BY
- area.`code`
- </select>
- <select id="findSiteCountByRegion" resultType="com.hz.employmentsite.vo.statistics.RegionSystemDataCount">
- SELECT
- area.`code` AS regionCode,
- area.`name` AS regionName,
- COUNT( site.SiteID ) AS siteCount
- FROM
- area_code area
- LEFT JOIN pc_site site ON area.`code` = site.RegionCode
- WHERE
- area.lv = 3
- GROUP BY
- area.`code`,
- area.`name`
- ORDER BY
- area.`code`
- </select>
- <select id="findSiteJobUserCount" resultType="com.hz.employmentsite.vo.statistics.jobUser.SiteJobUserCount">
- SELECT
- site.SiteID,
- site.SiteName,
- COUNT( jobUser.JobuserID ) AS jobUserCount
- FROM
- pc_site site
- LEFT JOIN pc_jobuser jobUser ON jobUser.SiteID = site.SiteID
- WHERE
- 1=1
- <if test="jobStatus != null and jobStatus == 1">
- AND jobUser.JobStatusID = 1
- </if>
- <if test="isDifficulty != null">
- AND jobUser.KeyPersonTypeID IN (13,14,15,16,17,18,19,20,21,22,23,24)
- </if>
- <if test="isNotCity != null">
- and site.RegionCode != '441301000000000'
- </if>
- GROUP BY
- site.SiteID,
- site.SiteName
- </select>
- <select id="findJobUserHourNewAddCount" resultType="com.hz.employmentsite.vo.statistics.HourNewAddCount">
- SELECT
- HOUR( CreateTime ) AS `Hour`,
- COUNT( 1 ) AS jobUserCount
- FROM
- pc_jobuser
- WHERE
- 1=1
- <if test="day != null">
- and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{day})
- </if>
- GROUP BY
- `Hour`
- ORDER BY
- `Hour`
- </select>
- <select id="findCompanyHourNewAddCount" resultType="com.hz.employmentsite.vo.statistics.HourNewAddCount">
- SELECT
- HOUR( CreateTime ) AS `Hour`,
- COUNT( 1 ) AS companyCount
- FROM
- pc_company
- WHERE
- 1=1
- <if test="day != null">
- and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{day})
- </if>
- GROUP BY
- `Hour`
- ORDER BY
- `Hour`
- </select>
- <select id="findPostHourNewAddCount" resultType="com.hz.employmentsite.vo.statistics.HourNewAddCount">
- SELECT
- HOUR( CreateTime ) AS `Hour`,
- COUNT( 1 ) AS postCount
- FROM
- pc_post
- WHERE
- 1=1
- <if test="day != null">
- and DATE(CreateTime) <![CDATA[ >= ]]> DATE(#{day})
- </if>
- GROUP BY
- `Hour`
- ORDER BY
- `Hour`
- </select>
- </mapper>
|