CompanyCQuery.xml 4.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.CompanyCQuery">
  4. <select id="getList" resultType="com.hz.employmentsite.vo.companyService.CompanyVo">
  5. select company.*,city.name as regionName,area.name as streetName,sparea.name as
  6. signInPoliticalAreaName,sys_cmodel.Name as companyModelType,
  7. (select count(*) from pc_post where CompanyID=company.CompanyID) as postCount,u.`Name` as createUserName
  8. ,inSites.InstitutionID as institutionID,site.SiteName,com_status.Name as recordStatusName,
  9. industry.industryName as industryName, com_estate.Name as estateCategoryName,com_type.Name as companyTypeName,
  10. com_tag.Name as tagName,com_short.Name as isShortageName,modifyUser.Name as modifyUserName
  11. from pc_company company
  12. left join sys_user u on u.UserID = company.CreateUserID
  13. left join (select * from sys_dictionary_item where DictionaryCode ='CompanyModel') sys_cmodel on
  14. company.CompanyModel = sys_cmodel.Value
  15. left join (select * from sys_dictionary_item where DictionaryCode ='CompanyType') com_type on
  16. company.CompanyType = com_type.Value
  17. left join (select * from sys_dictionary_item where DictionaryCode ='CompanyStatus') com_status on
  18. company.RecordStatus = com_status.Value
  19. left join (select * from sys_dictionary_item where DictionaryCode ='CompanyEstateCategory') com_estate on
  20. company.EstateCategoryID = com_estate.Value
  21. left join (select * from sys_dictionary_item where DictionaryCode ='CompanyTag') com_tag on
  22. company.TagID = com_tag.Value
  23. left join (select * from sys_dictionary_item where DictionaryCode ='IsShortAge') com_short on
  24. company.IsShortage = com_short.Value
  25. left join pc_industry industry on company.IndustryID = industry.industryId
  26. left join area_code city on company.RegionCode = city.code
  27. left join area_code area on company.StreetCode = area.code
  28. left join area_code sparea on company.SignInPoliticalArea = sparea.code
  29. left join pc_site site on company.siteID = site.siteID
  30. left join pc_site_institution inSites on site.SiteID = inSites.SiteID
  31. left join pc_institution institution on inSites.institutionID = institution.InstitutionID
  32. left join sys_user modifyUser on company.ModifyUserID = modifyUser.UserID
  33. where 1=1
  34. <if test="companyIDList!='' and companyIDList!=null">
  35. and company.companyID in (${companyIDList})
  36. </if>
  37. <if test="companyName!='' and companyName!=null">
  38. and company.companyName like Concat('%',#{companyName},'%')
  39. </if>
  40. <if test="companyCode!='' and companyCode!=null">
  41. and company.companyCode like Concat('%',#{companyCode},'%')
  42. </if>
  43. <if test="recordStatus!='' and recordStatus!=null">
  44. and company.RecordStatus = #{recordStatus}
  45. </if>
  46. <if test="regionCode!='' and regionCode!=null">
  47. and company.regionCode like Concat('%',#{regionCode},'%')
  48. </if>
  49. <if test="streetCode!='' and regionCode!=null">
  50. and company.streetCode like Concat('%',#{streetCode},'%')
  51. </if>
  52. <if test="createUserId!='' and createUserId!=null">
  53. and company.CreateUserID = #{createUserId}
  54. </if>
  55. <if test="workTime!='' and workTime!=null">
  56. and Date(company.CreateTime) = Date(#{workTime})
  57. </if>
  58. <if test="curLoginUserSiteID!='' and curLoginUserSiteID!=null">
  59. and company.siteID = #{curLoginUserSiteID}
  60. </if>
  61. <if test="siteID!='' and siteID!=null">
  62. and company.siteID = #{siteID}
  63. </if>
  64. <if test="startDate != null and endDate == null">
  65. and company.CreateTime <![CDATA[ >= ]]> #{startDate}
  66. </if>
  67. <if test="endDate != null and startDate == null">
  68. and company.CreateTime <![CDATA[ <= ]]> #{endDate}
  69. </if>
  70. <if test="startDate != null and endDate != null">
  71. and company.CreateTime <![CDATA[ >= ]]> #{startDate}
  72. and company.CreateTime <![CDATA[ <= ]]> #{endDate}
  73. </if>
  74. order by company.CreateTime desc,postCount desc
  75. </select>
  76. <select id="getFirmNameLikeList" resultType="com.hz.employmentsite.model.PcFirm">
  77. select id,FirmName
  78. from pc_firm
  79. <where>
  80. <choose>
  81. <when test="firmName!=null and firmName!=''">
  82. and FirmName like Concat('%',#{firmName},'%')
  83. </when>
  84. <otherwise>
  85. and 1!=1
  86. </otherwise>
  87. </choose>
  88. </where>
  89. order by id
  90. </select>
  91. </mapper>