You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
3.0 KiB
85 lines
3.0 KiB
|
7 months ago
|
<?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="com.techsor.datacenter.business.dao.ex.BasicBuildingMapperExt">
|
||
|
|
|
||
|
|
|
||
|
|
<select id="checkExist" resultType="java.util.Map">
|
||
|
|
SELECT
|
||
|
|
CASE
|
||
|
|
WHEN name = #{buildingName} THEN 'buildingName'
|
||
|
|
WHEN udf_building_id = #{udfBuildingId} THEN 'udfBuildingId'
|
||
|
|
END AS conflict_field
|
||
|
|
FROM
|
||
|
|
basic_building
|
||
|
|
WHERE
|
||
|
|
flag != 1
|
||
|
|
AND (
|
||
|
|
name = #{buildingName}
|
||
|
|
OR
|
||
|
|
udf_building_id = #{udfBuildingId}
|
||
|
|
)
|
||
|
|
<if test="companyId != null">
|
||
|
|
AND company_id = #{companyId}
|
||
|
|
</if>
|
||
|
|
<if test="buildingId != null">
|
||
|
|
AND building_id != #{buildingId}
|
||
|
|
</if>
|
||
|
|
LIMIT 1
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="getListPage" resultType="com.techsor.datacenter.business.vo.building.BuildingPageVO">
|
||
|
|
SELECT
|
||
|
|
bbuilding.building_id buildingId,
|
||
|
|
bbuilding.company_id companyId,
|
||
|
|
bcomp.company_name companyName,
|
||
|
|
bbuilding.name buildingName,
|
||
|
|
bbuilding.address,
|
||
|
|
bbuilding.udf_building_id udfBuildingId,
|
||
|
|
bbuilding.building_bucket,
|
||
|
|
bbuilding.floor_info_list,
|
||
|
|
bbuilding.thumbnail_num,
|
||
|
|
bbuilding.show_switch_2d3d,
|
||
|
|
bbuilding.brief_introduction,
|
||
|
|
bbuilding.picture_introduction
|
||
|
|
FROM
|
||
|
|
basic_building bbuilding
|
||
|
|
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bbuilding.company_id
|
||
|
|
WHERE
|
||
|
|
bbuilding.flag != 1 AND bcomp.flag != 1
|
||
|
|
AND bbuilding.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
|
||
|
|
<if test="bindBuildingIdList != null">
|
||
|
|
AND bbuilding.building_id IN <foreach collection="bindBuildingIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
|
||
|
|
</if>
|
||
|
|
<if test="buildingIdList != null">
|
||
|
|
AND bbuilding.building_id IN <foreach collection="buildingIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
|
||
|
|
</if>
|
||
|
|
<if test="buildingName != null">
|
||
|
|
AND bbuilding.name LIKE CONCAT('%',#{buildingName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="platformType != null and platformType == 1">
|
||
|
|
AND bbuilding.show_switch_2d3d = 0
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getAll" resultType="com.techsor.datacenter.business.vo.building.BuildingPageVO">
|
||
|
|
SELECT
|
||
|
|
bbuilding.building_id buildingId,
|
||
|
|
bbuilding.company_id companyId,
|
||
|
|
bcomp.company_name companyName,
|
||
|
|
bbuilding.name buildingName,
|
||
|
|
bbuilding.address,
|
||
|
|
bbuilding.udf_building_id udfBuildingId
|
||
|
|
FROM
|
||
|
|
basic_building bbuilding
|
||
|
|
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bbuilding.company_id
|
||
|
|
WHERE
|
||
|
|
bbuilding.flag != 1
|
||
|
|
<if test="companyId != null">
|
||
|
|
AND bbuilding.company_id = #{companyId}
|
||
|
|
</if>
|
||
|
|
AND bcomp.flag != 1
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
</mapper>
|