Compare commits

...

6 Commits

  1. 2
      dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java
  2. 4
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml
  3. 22
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml
  4. 9
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/FavoritedDeviceMapperExt.xml
  5. 2
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/OverviewInfoMapperExt.xml

2
dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java

@ -76,7 +76,7 @@ public class Constants {
public static final List<Long> DEVICE_TYPE_TEMPERATURE_HUMIDITY = Arrays.asList(8888882L,9999992L); public static final List<Long> DEVICE_TYPE_TEMPERATURE_HUMIDITY = Arrays.asList(8888882L,9999992L);
static { static {
CATEGORY_MAP.put(CATEGORY_ALARM, new ArrayList<>(List.of(1001L))); CATEGORY_MAP.put(CATEGORY_ALARM, new ArrayList<>(List.of(1001L, 1011L)));
CATEGORY_MAP.put(CATEGORY_MEASURE, new ArrayList<>(List.of(1003L))); CATEGORY_MAP.put(CATEGORY_MEASURE, new ArrayList<>(List.of(1003L)));

4
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml

@ -23,10 +23,10 @@
WHERE WHERE
bbuilding.flag != 1 AND bcomp.flag != 1 bbuilding.flag != 1 AND bcomp.flag != 1
AND bbuilding.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach> AND bbuilding.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
<if test="bindBuildingIdList != null"> <if test="bindBuildingIdList != null and bindBuildingIdList.size() > 0">
AND bbuilding.building_id IN <foreach collection="bindBuildingIdList" item="item" open="(" separator="," close=")">#{item}</foreach> AND bbuilding.building_id IN <foreach collection="bindBuildingIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
</if> </if>
<if test="buildingIdList != null"> <if test="buildingIdList != null and buildingIdList.size() > 0">
AND bbuilding.building_id IN <foreach collection="buildingIdList" item="item" open="(" separator="," close=")">#{item}</foreach> AND bbuilding.building_id IN <foreach collection="buildingIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
</if> </if>
<if test="buildingName != null"> <if test="buildingName != null">

22
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml

@ -42,7 +42,7 @@
<if test="buildingId != null"> <if test="buildingId != null">
and basic_building.building_id = #{buildingId} and basic_building.building_id = #{buildingId}
</if> </if>
<if test="bindBuildingIdList != null"> <if test="bindBuildingIdList != null and bindBuildingIdList.size() > 0">
and basic_building.building_id in and basic_building.building_id in
<foreach collection="bindBuildingIdList" item="item" open="(" separator="," close=")"> <foreach collection="bindBuildingIdList" item="item" open="(" separator="," close=")">
#{item} #{item}
@ -63,7 +63,15 @@
#{deviceId} #{deviceId}
</foreach> </foreach>
</if> </if>
and device_info.flag = 0 and (device_info.device_id LIKE '%\_85' or device_info.device_id LIKE '%\_85_9003' or device_info.device_id LIKE '%\_131_5') and device_info.flag = 0
and (
device_info.device_id LIKE '%\\_85'
or device_info.device_id LIKE '%\\_85_9003'
or device_info.device_id LIKE '%\\_131_5'
<if test="categoryIdList.contains(1011L)">
or type.device_category_id = 1011
</if>
)
and basic_monitoring_asset.flag != 1 and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1 and basic_monitoring_asset.flag != 1 and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1
and type.device_category_id in and type.device_category_id in
<foreach collection="categoryIdList" item="categoryId" open="(" separator="," close=")"> <foreach collection="categoryIdList" item="categoryId" open="(" separator="," close=")">
@ -507,7 +515,15 @@
#{companyId} #{companyId}
</foreach> </foreach>
</if> </if>
and device_info.flag = 0 and (device_info.device_id LIKE '%\_85' or device_info.device_id LIKE '%\_85_9003' or device_info.device_id LIKE '%\_131_5') and device_info.flag = 0
and (
device_info.device_id LIKE '%\\_85'
or device_info.device_id LIKE '%\\_85_9003'
or device_info.device_id LIKE '%\\_131_5'
<if test="categoryIdList.contains(1011L)">
or type.device_category_id = 1011
</if>
)
and basic_monitoring_asset.flag != 1 and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1 and basic_monitoring_asset.flag != 1 and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1
and type.device_category_id in and type.device_category_id in
<foreach collection="categoryIdList" item="categoryId" open="(" separator="," close=")"> <foreach collection="categoryIdList" item="categoryId" open="(" separator="," close=")">

9
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/FavoritedDeviceMapperExt.xml

@ -19,7 +19,14 @@
left join type ty on ty.id = dinfo.type_id left join type ty on ty.id = dinfo.type_id
WHERE WHERE
dinfo.flag != 1 AND basic_monitoring_asset.flag != 1 dinfo.flag != 1 AND basic_monitoring_asset.flag != 1
AND (dinfo.device_id LIKE '%\_85' or dinfo.device_id LIKE '%\_85_9003' or dinfo.device_id LIKE '%\_131_5') AND (
dinfo.device_id LIKE '%\\_85'
or dinfo.device_id LIKE '%\\_85_9003'
or dinfo.device_id LIKE '%\\_131_5'
<if test="categoryIdList.contains(1011L)">
or ty.device_category_id = 1011
</if>
)
AND basic_space.flag != 1 AND basic_floor.flag != 1 AND basic_building.flag != 1 AND basic_space.flag != 1 AND basic_floor.flag != 1 AND basic_building.flag != 1
<if test="buildingId != null"> <if test="buildingId != null">
AND basic_building.building_id = #{buildingId} AND basic_building.building_id = #{buildingId}

2
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/OverviewInfoMapperExt.xml

@ -44,7 +44,7 @@
WHERE WHERE
bbuilding.flag != 1 bbuilding.flag != 1
AND bbuilding.company_id = #{companyId} AND bbuilding.company_id = #{companyId}
<if test="bindBuildingIdList != null"> <if test="bindBuildingIdList != null and bindBuildingIdList.size() > 0">
AND bbuilding.building_id IN <foreach collection="bindBuildingIdList" item="item" open="(" separator="," close=")">#{item}</foreach> AND bbuilding.building_id IN <foreach collection="bindBuildingIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
</if> </if>
order by bbuilding.building_id desc order by bbuilding.building_id desc

Loading…
Cancel
Save