and a.biz_org_code LIKE CONCAT (#{bizOrgCode} ,'%')
and a.biz_org_code LIKE CONCAT (#{bizOrgCode} ,'%')
</if>
</if>
<iftest="treeId != null and treeId != '' and treeId == -1">
<iftest="treeId != null and treeId != '' and treeId == '-1'">
and a.facilities_type is not null
and a.facilities_type is not null
</if>
</if>
<iftest="treeId != null and treeId != '' and treeId == -2">
<iftest="treeId != null and treeId != '' and treeId == '-2'">
and a.equipment_type is not null
and a.equipment_type is not null
</if>
</if>
<iftest="treeId != null and treeId != '' and treeId == -4">
<iftest="treeId != null and treeId != '' and treeId == '-4'">
and a.key_parts_type is not null
and a.key_parts_type is not null
</if>
</if>
<iftest="treeId != null and treeId != '' and treeId == -5">
<iftest="treeId != null and treeId != '' and treeId == '-5'">
and a.custom_type is not null
and a.custom_type is not null
</if>
</if>
<iftest="subCode!=null and subCode!='' and subCode!=' ' and treeId != null and treeId != '' and treeId != -3 and treeId != -1 and treeId != -2 and treeId != -4 and treeId != -5">
<iftest="subCode!=null and subCode!='' and subCode!=' ' and
and ((LEFT (a.facilities_type, #{inhierarchy}) = #{subCode}) or (LEFT (a.equipment_type, #{inhierarchy}) = #{subCode}))
treeId != null and treeId != '' and treeId != '-3' and treeId != '-1' and
treeId != '-2' and treeId != '-4' and treeId != '-5' and treeId.contains('@'.toString())">
and LEFT (a.facilities_type, #{inhierarchy}) = #{subCode}
</if>
<iftest="subCode!=null and subCode!='' and subCode!=' ' and
treeId != null and treeId != '' and treeId != '-3' and treeId != '-1' and
treeId != '-2' and treeId != '-4' and treeId != '-5' and !treeId.contains('@'.toString())">
and LEFT (a.equipment_type, #{inhierarchy}) = #{subCode}
</if>
</if>
<choose>
<choose>
<whentest="level == '-0' ">and a.level is null</when>
<whentest="level == '-0' ">and a.level is null</when>
...
@@ -346,20 +353,27 @@
...
@@ -346,20 +353,27 @@
<iftest="bizOrgCode!=null and bizOrgCode!=''">
<iftest="bizOrgCode!=null and bizOrgCode!=''">
and a.biz_org_code LIKE CONCAT (#{bizOrgCode},'%')
and a.biz_org_code LIKE CONCAT (#{bizOrgCode},'%')
</if>
</if>
<iftest="treeId != null and treeId != '' and treeId == -1">
<iftest="treeId != null and treeId != '' and treeId == '-1'">
and a.facilities_type is not null
and a.facilities_type is not null
</if>
</if>
<iftest="treeId != null and treeId != '' and treeId == -2">
<iftest="treeId != null and treeId != '' and treeId == '-2'">
and a.equipment_type is not null
and a.equipment_type is not null
</if>
</if>
<iftest="treeId != null and treeId != '' and treeId == -4">
<iftest="treeId != null and treeId != '' and treeId == '-4'">
and a.key_parts_type is not null
and a.key_parts_type is not null
</if>
</if>
<iftest="treeId != null and treeId != '' and treeId == -5">
<iftest="treeId != null and treeId != '' and treeId == '-5'">
and a.custom_type is not null
and a.custom_type is not null
</if>
</if>
<iftest="subCode!=null and subCode!='' and subCode!=' ' and treeId != null and treeId != '' and treeId != -3 and treeId != -1 and treeId != -2 and treeId != -4 and treeId != -5">
<iftest="subCode!=null and subCode!='' and subCode!=' ' and
and ((LEFT (a.facilities_type, #{inhierarchy}) = #{subCode}) or (LEFT (a.equipment_type, #{inhierarchy}) = #{subCode}))
treeId != null and treeId != '' and treeId != '-3' and treeId != '-1' and
treeId != '-2' and treeId != '-4' and treeId != '-5' and treeId.contains('@'.toString())">
and LEFT (a.facilities_type, #{inhierarchy}) = #{subCode}
</if>
<iftest="subCode!=null and subCode!='' and subCode!=' ' and
treeId != null and treeId != '' and treeId != '-3' and treeId != '-1' and
treeId != '-2' and treeId != '-4' and treeId != '-5' and !treeId.contains('@'.toString())">
and LEFT (a.equipment_type, #{inhierarchy}) = #{subCode}
</if>
</if>
<choose>
<choose>
<whentest="level == '-0' ">and a.level is null</when>
<whentest="level == '-0' ">and a.level is null</when>