UserAndUserPersonnelMiniDao_getUserAndUserPersonnelByUserId.sql 494 B

1234567891011121314151617181920212223
  1. select
  2. bu.id,
  3. bu.id as userid,
  4. bu.username,
  5. bu.realname,
  6. up.in_postid,
  7. up.position_status,
  8. up.contract_stime
  9. from t_s_base_user bu
  10. LEFT JOIN t_bus_user_personnel up ON bu.ID=up.userid
  11. WHERE 1=1
  12. <#if ( userAndUserPersonnelDto.userIdList )?? && userAndUserPersonnelDto.userIdList ?size gt 0>
  13. and bu.id in(
  14. <#list userAndUserPersonnelDto.userIdList as item>
  15. '${item}'
  16. <#if item_has_next>,</#if>
  17. </#list>
  18. )
  19. <#else >
  20. and bu.id=null
  21. </#if>
  22. and bu.delete_flag='0'