|
|
@ -186,4 +186,76 @@ |
|
|
|
gridd.DEL_FLAG = '0' |
|
|
|
AND gridd.ID = #{gridId} |
|
|
|
</select> |
|
|
|
|
|
|
|
<resultMap id="treeMap" type="com.epmet.dto.result.ExtStaffPermissionResultDTO"> |
|
|
|
<id column="agencyId" property="agencyId" /> |
|
|
|
<result column="agencyName" property="agencyName"/> |
|
|
|
<collection property="gridList" ofType="com.epmet.dto.result.ExtGridResultDTO"> |
|
|
|
<id column="gridId" property="gridId" /> |
|
|
|
<result column="gridName" property="gridName" /> |
|
|
|
</collection> |
|
|
|
|
|
|
|
<collection property="departmentList" column="agencyId" ofType="com.epmet.dto.result.ExtDeptResultDTO" select="selectDeptList"> |
|
|
|
<id column="deptId" property="deptId" /> |
|
|
|
<result column="deptName" property="deptName" /> |
|
|
|
</collection> |
|
|
|
|
|
|
|
<collection property="subAgencyList" column="agencyId" |
|
|
|
ofType="com.epmet.dto.result.ExtStaffPermissionResultDTO" select="selectSubAgencyByPid"> |
|
|
|
|
|
|
|
<!-- <collection property="gridList" ofType="com.epmet.dto.result.ExtGridResultDTO"> |
|
|
|
<id column="ID" property="gridId" /> |
|
|
|
<result column="GRID_NAME" property="gridName" /> |
|
|
|
</collection> |
|
|
|
|
|
|
|
<collection property="departmentList" ofType="com.epmet.dto.result.ExtDeptResultDTO" select="selectDeptList"> |
|
|
|
<id column="ID" property="deptId" /> |
|
|
|
<result column="DEPARTMENT_ID" property="deptName" /> |
|
|
|
</collection>--> |
|
|
|
|
|
|
|
</collection> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
|
|
<select id="selectAgencyById" resultMap="treeMap"> |
|
|
|
SELECT |
|
|
|
agency.ID AS agencyId, |
|
|
|
agency.ORGANIZATION_NAME AS agencyName, |
|
|
|
grid.ID AS gridId, |
|
|
|
grid.GRID_NAME AS gridName |
|
|
|
FROM |
|
|
|
CUSTOMER_AGENCY agency |
|
|
|
LEFT JOIN CUSTOMER_GRID grid ON agency.ID = grid.PID |
|
|
|
AND grid.DEL_FLAG = '0' |
|
|
|
WHERE |
|
|
|
agency.DEL_FLAG = '0' |
|
|
|
AND agency.ID = #{agencyId} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectDeptList" resultType="com.epmet.dto.result.ExtDeptResultDTO"> |
|
|
|
SELECT |
|
|
|
ID AS deptId, |
|
|
|
DEPARTMENT_NAME AS deptName |
|
|
|
FROM |
|
|
|
CUSTOMER_DEPARTMENT dept |
|
|
|
WHERE |
|
|
|
DEL_FLAG = '0' |
|
|
|
AND AGENCY_ID = #{agencyId} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectSubAgencyByPid" resultMap="treeMap"> |
|
|
|
SELECT |
|
|
|
agency.ID AS agencyId, |
|
|
|
agency.ORGANIZATION_NAME AS agencyName, |
|
|
|
grid.ID AS gridId, |
|
|
|
grid.GRID_NAME AS gridName |
|
|
|
FROM |
|
|
|
CUSTOMER_AGENCY agency |
|
|
|
LEFT JOIN CUSTOMER_GRID grid ON agency.ID = grid.PID |
|
|
|
AND grid.DEL_FLAG = '0' |
|
|
|
WHERE |
|
|
|
agency.DEL_FLAG = '0' |
|
|
|
AND agency.PID = #{pid} |
|
|
|
</select> |
|
|
|
|
|
|
|
</mapper> |