SiteUserCQuery.xml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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.UserInfoCQuery">
  4. <select id="getList" resultType="com.hz.employmentsite.vo.baseSettings.SiteUserVo">
  5. select siteUser.*,dic_userRole.Name as RoleName,dic_gender.Name as GenderName,site.SiteName
  6. ,inSites.InstitutionID as institutionID,site.regionCode
  7. from pc_site_user siteUser
  8. left join pc_site site on siteUser.siteID = site.siteID
  9. left join (select * from sys_dictionary_item where DictionaryCode ='UserType' ) dic_userRole on siteUser.RoleID = dic_userRole.Value
  10. left join (select * from sys_dictionary_item where DictionaryCode ='Gender' ) dic_gender on siteUser.Gender = dic_gender.Value
  11. left join pc_site_institution inSites on site.SiteID = inSites.SiteID
  12. left join pc_institution institution on inSites.institutionID = institution.InstitutionID
  13. where 1=1
  14. <if test="siteUserIDList!='' and siteUserIDList!=null">
  15. and siteUserID in (${siteUserIDList})
  16. </if>
  17. <if test="siteUserName!='' and siteUserName!=null">
  18. and siteUser.siteUserName like Concat('%',#{siteUserName},'%')
  19. </if>
  20. <if test="siteID!='' and siteID!=null">
  21. and siteUser.siteID = #{siteID}
  22. </if>
  23. <if test="roleName!='' and roleName!=null">
  24. and dic_userRole.Name = #{roleName}
  25. </if>
  26. <if test="regionCode!='' and regionCode!=null">
  27. and site.regionCode = #{regionCode}
  28. </if>
  29. </select>
  30. <select id="getListBySiteID" resultType="com.hz.employmentsite.vo.baseSettings.SiteUserVo">
  31. select siteUser.*,dic_userRole.Name as RoleName,dic_gender.Name as GenderName from pc_site_user siteUser
  32. left join (select * from sys_dictionary_item where DictionaryCode ='UserType' ) dic_userRole on siteUser.RoleID = dic_userRole.Value
  33. left join (select * from sys_dictionary_item where DictionaryCode ='Gender' ) dic_gender on siteUser.Gender = dic_gender.Value
  34. where 1=1
  35. <if test="siteID!='' and siteID!=null">
  36. and siteID = #{siteID}
  37. </if>
  38. </select>
  39. </mapper>