SQL 修改
This commit is contained in:
parent
183106222f
commit
5fd14cf810
|
|
@ -21,15 +21,15 @@
|
|||
and t."phone" like concat('%', #{params.phonenumber}, '%')
|
||||
</if>
|
||||
<if test="params.orgId != null and params.orgId != '' and params.roleLevel < 3">
|
||||
AND po."id" in (${params.orgAll})
|
||||
AND po.ID in (${params.orgAll})
|
||||
</if>
|
||||
<if test="params.orgId != null and params.orgId != '' and params.roleLevel >= 3">
|
||||
AND po."id" = #{params.orgId}
|
||||
AND po.ID = #{params.orgId}
|
||||
</if>
|
||||
<if test="params.keyWord != null and params.keyWord != ''">
|
||||
and (
|
||||
t."id_number" = #{params.keyWord} or
|
||||
bp.NAME like concat('%', #{params.keyWord}, '%') or
|
||||
bp."name" like concat('%', #{params.keyWord}, '%') or
|
||||
sr."name" = #{params.keyWord}
|
||||
)
|
||||
</if>
|
||||
|
|
@ -43,17 +43,17 @@
|
|||
t."id_number" AS idNumber,
|
||||
t."phone" AS phonenumber,
|
||||
CASE
|
||||
WHEN sr."type" LIKE '%3%' THEN po2."name"
|
||||
WHEN sr."type" LIKE '%3%' THEN po2.NAME
|
||||
ELSE po.NAME
|
||||
END AS orgName,
|
||||
sr.NAME AS roleName,
|
||||
sr."name" AS roleName,
|
||||
CASE
|
||||
WHEN sr."type" LIKE '%3%' THEN bp.NAME
|
||||
WHEN sr."type" LIKE '%4%' THEN bs."sub_NAME"
|
||||
WHEN sr."type" LIKE '%3%' THEN bp."name"
|
||||
WHEN sr."type" LIKE '%4%' THEN bs."sub_name"
|
||||
ELSE bp2."name"
|
||||
END AS proName,
|
||||
t."createTime",
|
||||
t.STATUS,
|
||||
t."status",
|
||||
t."is_push"
|
||||
FROM
|
||||
"ynrealname"."sys_user" t
|
||||
|
|
@ -78,15 +78,15 @@
|
|||
and t."phone" like concat('%', #{params.phonenumber}, '%')
|
||||
</if>
|
||||
<if test="params.orgId != null and params.orgId != '' and params.roleLevel < 3">
|
||||
AND po."id" in (${params.orgAll})
|
||||
AND po.ID in (${params.orgAll})
|
||||
</if>
|
||||
<if test="params.orgId != null and params.orgId != '' and params.roleLevel >= 3">
|
||||
AND po."id" = #{params.orgId}
|
||||
AND po.ID = #{params.orgId}
|
||||
</if>
|
||||
<if test="params.keyWord != null and params.keyWord != ''">
|
||||
and (
|
||||
t."id_number" = #{params.keyWord} or
|
||||
bp.NAME like concat('%', #{params.keyWord}, '%') or
|
||||
bp."name" like concat('%', #{params.keyWord}, '%') or
|
||||
sr."name" = #{params.keyWord}
|
||||
)
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -43,19 +43,19 @@
|
|||
|
||||
<select id="getCompanyAndSubCompany" resultType="com.bonus.system.api.domain.SelectBean">
|
||||
SELECT
|
||||
"id",
|
||||
ID,
|
||||
NAME,
|
||||
CASE WHEN "company_id" = "foreign_id" THEN 1 ELSE 2 END as type
|
||||
FROM
|
||||
"ynrealname"."pm_organization"
|
||||
WHERE
|
||||
"is_active" = '1'
|
||||
IS_ACTIVE = '1'
|
||||
AND "foreign_id" IS NOT NULL
|
||||
<if test="orgId != null and orgId != '' and roleLevel < 3 and roleLevel > 1">
|
||||
AND INSTR(getParentList(#{orgId}), "id") > 0
|
||||
AND INSTR(ID, getParentList(#{orgId})) > 0
|
||||
</if>
|
||||
<if test="orgId != null and orgId != '' and roleLevel >= 3">
|
||||
AND INSTR(getParentList(#{orgId}), "id") > 0
|
||||
AND INSTR(ID, getParentList(#{orgId})) > 0
|
||||
OFFSET 1 ROWS FETCH NEXT 1 ROWS ONLY
|
||||
</if>
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue