|
|
@ -119,4 +119,55 @@ |
|
|
|
) rr |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getPlaceOrgByDanger" resultType="com.epmet.dto.result.PlaceOrgDetailResultDTO"> |
|
|
|
SELECT |
|
|
|
p.id placeOrgId, |
|
|
|
p.grid_id gridId, |
|
|
|
b.grid_name gridName, |
|
|
|
p.nine_place_val ninePlaceVal, |
|
|
|
p.place_org_name placeOrgName, |
|
|
|
p.address address, |
|
|
|
p.scale scale, |
|
|
|
p.person_in_charge personInCharge, |
|
|
|
p.mobile mobile, |
|
|
|
p.AGENCY_ID agencyId, |
|
|
|
p.SECURITY_FLAG securityFlag, |
|
|
|
p.SECURITY_PRINCIPAL_NAME securityPrincipalName, |
|
|
|
p.SECURITY_PRINCIPAL_MOBILE securityPrincipalMobile, |
|
|
|
p.BQ_LD bqLd, |
|
|
|
p.BQ_GB bqGb, |
|
|
|
p.LONGITUDE longitude, |
|
|
|
p.LATITUDE latitude, |
|
|
|
p.COMPANY_PROFILE companyProfile |
|
|
|
FROM ic_place_org p |
|
|
|
LEFT JOIN customer_grid b ON p.GRID_ID = b.ID |
|
|
|
<where> |
|
|
|
p.DEL_FLAG = 0 |
|
|
|
AND p.id IN ( |
|
|
|
SELECT r.PLACE_ORG_ID FROM ic_place_patrol_record r |
|
|
|
<where> |
|
|
|
r.FINAL_RESULT = 1 and r.DEL_FLAG = 0 |
|
|
|
<if test="null != orgType and orgType !=''"> |
|
|
|
<if test="null != orgId and orgId != '' and orgType == 'agancy'"> |
|
|
|
AND r.agency_id = #{orgId} |
|
|
|
</if> |
|
|
|
<if test="null != orgId and orgId != '' and orgType == 'grid'"> |
|
|
|
AND r.grid_id = #{orgId} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
) |
|
|
|
<if test="null != orgType and orgType !=''"> |
|
|
|
<if test="null != orgId and orgId != '' and orgType == 'agancy'"> |
|
|
|
AND p.agency_id = #{orgId} |
|
|
|
</if> |
|
|
|
<if test="null != orgId and orgId != '' and orgType == 'grid'"> |
|
|
|
AND p.grid_id = #{orgId} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
</mapper> |
|
|
|