szjbdgzl 2 лет назад
Родитель
Сommit
5e18984337

+ 8 - 4
ibps-model-root/modules/org-model/src/main/resources/com/lc/ibps/org/party/persistence/mapping/PartyEmployee.map.xml

@@ -379,7 +379,7 @@
     </select>
 
 	<select id="findByPosition"  parameterType="java.util.Map" resultMap="PartyEmployee">
-		select <include refid="columns"/> from IBPS_PARTY_EMPLOYEE
+		select <include refid="columns"/> from IBPS_PARTY_EMPLOYEE C
 		left join ( select ID_ USER_ID_,ACCOUNT_,IS_SUPER_ from IBPS_PARTY_USER ) A on USER_ID_ = ID_
 		left join ( select ID_ ORG_ID_,NAME_ ORG_NAME_ from IBPS_PARTY_ORG )B on ORG_ID_ = GROUP_ID_
 		where ID_ != '-1'
@@ -388,13 +388,15 @@
 			AND ${whereSql}
 		</if>
 		<if test="@o.Ognl@isNotEmpty(position)">
-			AND POSITIONS_ in(select id_ from ibps_party_entity where PATH_ like #{position} )
+			and EXISTS (SELECT	1 FROM ibps_party_entity d
+			WHERE FIND_IN_SET( d.id_, c.positions_ )
+			AND ( d.path_ LIKE #{position}  ) )
 		</if>
 		ORDER BY CREATE_TIME_ DESC
 	</select>
 
 	<select id="findIdsByPositionId"  parameterType="java.util.Map" resultMap="PartyEmployee">
-		select ID_ from IBPS_PARTY_EMPLOYEE
+		select ID_ from IBPS_PARTY_EMPLOYEE C
 		left join ( select ID_ USER_ID_,ACCOUNT_,IS_SUPER_ from IBPS_PARTY_USER ) A on USER_ID_ = ID_
 		left join ( select ID_ ORG_ID_,NAME_ ORG_NAME_ from IBPS_PARTY_ORG )B on ORG_ID_ = GROUP_ID_
 		where ID_ != '-1'
@@ -403,7 +405,9 @@
 			AND ${whereSql}
 		</if>
 		<if test="@o.Ognl@isNotEmpty(position)">
-			AND POSITIONS_ in(select id_ from ibps_party_entity where PATH_ like #{position} )
+			and EXISTS (SELECT	1 FROM ibps_party_entity d
+			WHERE FIND_IN_SET( d.id_, c.positions_ )
+			AND ( d.path_ LIKE #{position}  ) )
 		</if>
 		ORDER BY CREATE_TIME_ DESC
 	</select>