<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="org.springblade.modules.yw.mapper.FacilityMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="facilityResultMap" type="org.springblade.modules.yw.entity.FacilityEntity">
|
<result column="id" property="id"/>
|
<result column="name" property="name"/>
|
<result column="lng" property="lng"/>
|
<result column="lat" property="lat"/>
|
<result column="fac_level" property="facLevel"/>
|
<result column="remark" property="remark"/>
|
<result column="firm_id" property="firmId"/>
|
<result column="image_url" property="imageUrl"/>
|
<result column="create_user" property="createUser"/>
|
<result column="create_time" property="createTime"/>
|
<result column="update_user" property="updateUser"/>
|
<result column="update_time" property="updateTime"/>
|
<result column="is_deleted" property="isDeleted"/>
|
</resultMap>
|
|
|
<!--自定义分页查询-->
|
<select id="selectFacilityPage" resultMap="facilityResultMap">
|
select * from yw_facility where is_deleted = 0
|
</select>
|
|
<!--三道防线信息查询-->
|
<select id="getFacilityList" resultType="org.springblade.modules.yw.vo.FacilityVO">
|
select
|
yf.*,
|
yfi.name as firmName
|
from yw_facility yf
|
left join yw_firm_info yfi on yfi.id = yf.firm_id and yfi.is_deleted = 0
|
where yf.is_deleted = 0
|
<if test="facility.facLevel!=null">
|
and yf.fac_level = #{facility.facLevel}
|
</if>
|
<if test="facility.firmId!=null">
|
and yf.firm_id = #{facility.firmId}
|
</if>
|
</select>
|
|
<!--三道防线信息查询-->
|
<select id="getTreeFacilityList" resultType="org.springblade.modules.yw.vo.FacilityVO">
|
select
|
yes.id,yes.name,yes.lng,yes.lat,yes.image_url,yes.capacity,yfi.id as firm_id,
|
yfi.name as firmName
|
from yw_emergency_space yes
|
left join yw_firm_info yfi on yfi.id = yes.firm_id and yfi.is_deleted = 0
|
where yes.is_deleted = 0
|
and yes.type = 1
|
<if test="facility.firmId!=null">
|
and yes.firm_id = #{facility.firmId}
|
</if>
|
</select>
|
|
</mapper>
|