| 12345678910111213141516171819202122232425262728293031 |
- select
- bu.id,
- bu.id as userid,
- bu.username,
- bu.realname,
- up.in_postid,
- up.position_status,
- up.contract_stime
- from t_s_base_user bu
- LEFT JOIN t_bus_user_personnel up ON bu.ID=up.userid
- LEFT JOIN t_s_user_org uo ON uo.user_id = bu.id
- WHERE 1=1
- <#if ( userAndUserPersonnelDto.userIdList )?? && userAndUserPersonnelDto.userIdList ?size gt 0>
- and bu.id in(
- <#list userAndUserPersonnelDto.userIdList as item>
- '${item}'
- <#if item_has_next>,</#if>
- </#list>
- )
- </#if>
- <#if (userAndUserPersonnelDto.realname )?? && userAndUserPersonnelDto.realname ?length gt 0>
- and bu.realname like CONCAT('%', :userAndUserPersonnelDto.realname ,'%')
- </#if>
- AND bu.delete_flag = '0'
- AND uo. STATUS = '0'
- AND uo.ifpluralism = '0'
- <#--在职状态 已入职1,已转正2-->
- and up.position_status in ('1','2')
- order by convert(bu.realname using gbk) collate gbk_Chinese_ci asc
|