SiteUserCQuery.xml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. <if test="userNo!='' and userNo!=null">
  30. and siteUser.userNo like Concat('%', #{userNo}, '%')
  31. </if>
  32. </select>
  33. <select id="getListBySiteID" resultType="com.hz.employmentsite.vo.baseSettings.SiteUserVo">
  34. select siteUser.*,dic_userRole.Name as RoleName,dic_gender.Name as GenderName from pc_site_user siteUser
  35. left join (select * from sys_dictionary_item where DictionaryCode ='UserType' ) dic_userRole on siteUser.RoleID = dic_userRole.Value
  36. left join (select * from sys_dictionary_item where DictionaryCode ='Gender' ) dic_gender on siteUser.Gender = dic_gender.Value
  37. where 1=1
  38. <if test="siteID!='' and siteID!=null">
  39. and siteID = #{siteID}
  40. </if>
  41. </select>
  42. </mapper>