|
@@ -125,13 +125,12 @@ interface IRelationExcelExportMapper {
|
|
|
* @param type 关系类型
|
|
|
* @return 关系记录
|
|
|
*/
|
|
|
- @Select("SELECT r.id1 AS id, eq.name, eq.local_id, eq.local_name,eq.cad_id, '设备' AS object_type,\n" +
|
|
|
- "(SELECT local_name FROM public.building WHERE id = eq.building_id) AS building_name,\n" +
|
|
|
- "(SELECT local_name FROM public.floor WHERE id = eq.floor_id) AS floor_name\n" +
|
|
|
- ",r.id2 AS _id, sp.name AS _name, sp.local_id AS _local_id, sp.local_name AS _local_name, '设备' AS _object_type, \n" +
|
|
|
- "(SELECT local_name FROM building WHERE id = sp.building_id ) AS _building_name,\n" +
|
|
|
- "(SELECT local_name FROM floor WHERE id = sp.floor_id) AS _floor_name \n" +
|
|
|
- "FROM relationship.r_eq2eq r JOIN equipment AS eq ON r.id1 = eq.id JOIN equipment AS sp ON r.id2 = sp.id WHERE r.project_id = #{projectId} AND r.type = #{type} ")
|
|
|
+ @Select("SELECT r.id1 AS id,eq.cad_id, eq.name, eq.local_id, eq.local_name,eq.cad_id, '设备' AS object_type," +
|
|
|
+ "(SELECT local_name FROM public.building WHERE id = eq.building_id) AS building_name,(SELECT local_name FROM public.floor " +
|
|
|
+ "WHERE id = eq.floor_id) AS floor_name,r.id2 AS _id, sp.cad_id AS _cad_id ,sp.name AS _name, sp.local_id AS _local_id, sp.local_name" +
|
|
|
+ " AS _local_name, '设备' AS _object_type,(SELECT local_name FROM building WHERE id = sp.building_id ) AS _building_name," +
|
|
|
+ "(SELECT local_name FROM floor WHERE id = sp.floor_id) AS _floor_name FROM relationship.r_eq2eq r JOIN equipment AS eq ON r.id1 " +
|
|
|
+ "= eq.id JOIN equipment AS sp ON r.id2 = sp.id WHERE r.project_id = #{projectId} AND r.type = #{type} ")
|
|
|
fun eq2eq(projectId: String, type: String): List<HashMap<String, Any?>>
|
|
|
|
|
|
/**
|