| | |
| | | AND mp.city_code = c.city_code |
| | | </if> |
| | | </select> |
| | | <select id="selectWithStateByMap" parameterType="java.util.Map" resultMap="BaseResultMap"> |
| | | |
| | | SELECT mpt.*,MAX(dev.state) as state from monitor_point mpt |
| | | LEFT JOIN device dev on dev.monitor_point_id = mpt.id |
| | | <where> |
| | | <if test="@com.moral.common.bean.Constants@isNotSpecialOrgId(orgId)"> |
| | | mpt.organization_id = #{orgId,jdbcType=VARCHAR} |
| | | </if> |
| | | <![CDATA[ |
| | | AND mpt.longitude < #{mapBounds.Ge,jdbcType=NUMERIC} |
| | | AND mpt.longitude > #{mapBounds.Le,jdbcType=NUMERIC} |
| | | AND mpt.latitude < #{mapBounds.Fe,jdbcType=NUMERIC} |
| | | AND mpt.latitude > #{mapBounds.Ke,jdbcType=NUMERIC} |
| | | and state<4 |
| | | GROUP BY mpt.`id` |
| | | ]]> |
| | | </where> |
| | | UNION |
| | | SELECT mpt.*,MAX(dev.state) as state from monitor_point mpt |
| | | LEFT JOIN device dev on dev.monitor_point_id = mpt.id |
| | | <where> |
| | | <if test="@com.moral.common.bean.Constants@isNotSpecialOrgId(orgId)"> |
| | | mpt.organization_id = #{orgId,jdbcType=VARCHAR} |
| | | </if> |
| | | <![CDATA[ |
| | | AND mpt.longitude < #{mapBounds.Ge,jdbcType=NUMERIC} |
| | | AND mpt.longitude > #{mapBounds.Le,jdbcType=NUMERIC} |
| | | AND mpt.latitude < #{mapBounds.Fe,jdbcType=NUMERIC} |
| | | AND mpt.latitude > #{mapBounds.Ke,jdbcType=NUMERIC} |
| | | and state>3 |
| | | GROUP BY mpt.`id` |
| | | ]]> |
| | | </where> |
| | | </select> |
| | | </mapper> |