46 lines
1.7 KiB
XML
46 lines
1.7 KiB
XML
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||
|
|
<mapper namespace="jnpf.permission.mapper.PositionMapper">
|
||
|
|
|
||
|
|
<select id="getListByUserId" parameterType="String" resultType="jnpf.permission.entity.PositionEntity">
|
||
|
|
SELECT * FROM base_position WHERE F_ID IN(SELECT F_OBJECT_ID FROM base_user_relation WHERE F_USER_ID = #{userId}) ORDER BY F_SORT_CODE
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="query" resultType="java.lang.String">
|
||
|
|
SELECT F_Id FROM base_position WHERE F_Id IN (
|
||
|
|
SELECT DISTINCT a.F_Id FROM (
|
||
|
|
SELECT
|
||
|
|
bp.F_Id
|
||
|
|
FROM
|
||
|
|
base_organize bo
|
||
|
|
LEFT JOIN
|
||
|
|
base_organize_relation bor
|
||
|
|
ON bo.F_Id = bor.F_Organize_Id
|
||
|
|
LEFT JOIN
|
||
|
|
base_position bp
|
||
|
|
ON bp.F_Id = bor.F_Object_Id
|
||
|
|
WHERE
|
||
|
|
bor.F_Object_Type = 'Position'
|
||
|
|
AND bor.F_Object_Type IS NOT NULL
|
||
|
|
<if test="keyword != null and keyword != ''">
|
||
|
|
AND (bp.F_Full_Name LIKE #{keyword} OR bp.F_En_Code LIKE #{keyword})
|
||
|
|
</if>
|
||
|
|
<if test="orgIdList != null and orgIdList.size() != 0">
|
||
|
|
AND bo.F_Id IN
|
||
|
|
<foreach collection="orgIdList"
|
||
|
|
item="orgIds" index="index" separator="," open="(" close=")">
|
||
|
|
#{orgIds}
|
||
|
|
</foreach>
|
||
|
|
</if>
|
||
|
|
) a
|
||
|
|
)
|
||
|
|
ORDER BY f_sort_code asc, f_creator_time desc
|
||
|
|
<!-- <if test="keyword != null and keyword != ''">-->
|
||
|
|
<!-- ,f_last_modify_time desc-->
|
||
|
|
<!-- </if>-->
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
</mapper>
|