12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?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.CompanyCQuery">
- <select id="getList" resultType="com.hz.employmentsite.vo.companyService.CompanyVo">
- select company.*,city.name as regionName,area.name as streetName,sparea.name as
- signInPoliticalAreaName,sys_cmodel.Name as companyModelType,
- (select count(*) from pc_post where CompanyID=company.CompanyID) as postCount,u.`Name` as createUserName
- ,inSites.InstitutionID as institutionID,site.SiteName,com_status.Name as recordStatusName,
- industry.industryName as industryName, com_estate.Name as estateCategoryName,com_type.Name as companyTypeName,
- com_tag.Name as tagName,com_short.Name as isShortageName,modifyUser.Name as modifyUserName
- from pc_company company
- left join sys_user u on u.UserID = company.CreateUserID
- left join (select * from sys_dictionary_item where DictionaryCode ='CompanyModel') sys_cmodel on
- company.CompanyModel = sys_cmodel.Value
- left join (select * from sys_dictionary_item where DictionaryCode ='CompanyType') com_type on
- company.CompanyType = com_type.Value
- left join (select * from sys_dictionary_item where DictionaryCode ='CompanyStatus') com_status on
- company.RecordStatus = com_status.Value
- left join (select * from sys_dictionary_item where DictionaryCode ='CompanyEstateCategory') com_estate on
- company.EstateCategoryID = com_estate.Value
- left join (select * from sys_dictionary_item where DictionaryCode ='CompanyTag') com_tag on
- company.TagID = com_tag.Value
- left join (select * from sys_dictionary_item where DictionaryCode ='IsShortAge') com_short on
- company.IsShortage = com_short.Value
- left join pc_industry industry on company.IndustryID = industry.industryId
- left join area_code city on company.RegionCode = city.code
- left join area_code area on company.StreetCode = area.code
- left join area_code sparea on company.SignInPoliticalArea = sparea.code
- left join pc_site site on company.siteID = site.siteID
- left join pc_site_institution inSites on site.SiteID = inSites.SiteID
- left join pc_institution institution on inSites.institutionID = institution.InstitutionID
- left join sys_user modifyUser on company.ModifyUserID = modifyUser.UserID
- where 1=1
- <if test="companyIDList!='' and companyIDList!=null">
- and company.companyID in (${companyIDList})
- </if>
- <if test="companyName!='' and companyName!=null">
- and company.companyName like Concat('%',#{companyName},'%')
- </if>
- <if test="companyCode!='' and companyCode!=null">
- and company.companyCode like Concat('%',#{companyCode},'%')
- </if>
- <if test="recordStatus!='' and recordStatus!=null">
- and company.RecordStatus = #{recordStatus}
- </if>
- <if test="regionCode!='' and regionCode!=null">
- and company.regionCode like Concat('%',#{regionCode},'%')
- </if>
- <if test="streetCode!='' and regionCode!=null">
- and company.streetCode like Concat('%',#{streetCode},'%')
- </if>
- <if test="createUserId!='' and createUserId!=null">
- and company.CreateUserID = #{createUserId}
- </if>
- <if test="workTime!='' and workTime!=null">
- and Date(company.CreateTime) = Date(#{workTime})
- </if>
- <if test="curLoginUserSiteID!='' and curLoginUserSiteID!=null">
- and company.siteID = #{curLoginUserSiteID}
- </if>
- <if test="siteID!='' and siteID!=null">
- and company.siteID = #{siteID}
- </if>
- <if test="startDate != null and endDate == null">
- and company.CreateTime <![CDATA[ >= ]]> #{startDate}
- </if>
- <if test="endDate != null and startDate == null">
- and company.CreateTime <![CDATA[ <= ]]> #{endDate}
- </if>
- <if test="startDate != null and endDate != null">
- and company.CreateTime <![CDATA[ >= ]]> #{startDate}
- and company.CreateTime <![CDATA[ <= ]]> #{endDate}
- </if>
- order by company.CreateTime desc,postCount desc
- </select>
- <select id="getFirmNameLikeList" resultType="com.hz.employmentsite.model.PcFirm">
- select id,FirmName
- from pc_firm
- <where>
- <choose>
- <when test="firmName!=null and firmName!=''">
- and FirmName like Concat('%',#{firmName},'%')
- </when>
- <otherwise>
- and 1!=1
- </otherwise>
- </choose>
- </where>
- order by id
- </select>
- </mapper>
|