baoshiwei
2025-06-19 0571c03740d9069cf761695d0dcadd4d6bc9af0d
zhitan-system/src/main/resources/mapper/model/ModelNodeMapper.xml
@@ -292,7 +292,7 @@
    </select>
    <select id="getModelNodeIndexIdRelationInforByCode"
            resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor">
            resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo">
        SELECT mn.node_id  nodeId,
               mn."name"   "name",
               ni.index_id indexId
@@ -303,17 +303,17 @@
    </select>
    <select id="listModelNodeIndexIdRelationInforByParentId"
            resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor">
            resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo">
        SELECT mn.node_id  nodeId,
               mn."name"   "name",
               ni.index_id indexId
        FROM "model_node" mn
                 LEFT JOIN "node_index" ni ON mn.node_id = ni.node_id
        WHERE mn.parent_id = #{parentId}
        WHERE mn.parent_id = #{parentId} or ni.node_id = #{parentId}
    </select>
    <select id="getModelNodeIndexIdRelationInforByNodeId"
            resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor">
            resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo">
        SELECT mn.node_id  nodeId,
               mn."name"   "name",
               ni.index_id indexId
@@ -336,7 +336,7 @@
        LIMIT 1;
    </select>
    <select id="selectIndexByModelCodeAndNodeId"
            resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor">
            resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo">
        SELECT mn.node_id  nodeId,
               mn."name",
               ni.index_id indexId
@@ -380,7 +380,7 @@
        </foreach>
    </insert>
    <select id="getModelNodeIndexIdByNodeId" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor">
    <select id="getModelNodeIndexIdByNodeId" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo">
        SELECT mn.node_id nodeId,
        mn."name" "name",
        ni.index_id indexId,
@@ -395,7 +395,7 @@
            and ei.energy_id = #{energyType}
        </if>
    </select>
    <select id="getModelNodeByParentId" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor">
    <select id="getModelNodeByParentId" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo">
        SELECT mn.node_id  nodeId,
               mn."name"   "name",
               ni.index_id indexId,
@@ -411,7 +411,7 @@
        where model_code = #{modelCode} AND parent_id is null
        order by order_num
    </select>
    <select id="selectIndexByNodeIds" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor">
    <select id="selectIndexByNodeIds" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo">
        SELECT mn.node_id nodeId,
        mn."name" "name",
        ni.index_id indexId,
@@ -466,4 +466,22 @@
          AND di.data_time >= #{dateTimeMap.startTime}
          AND di.data_time &lt;= #{dateTimeMap.endTime}
    </select>
    <select id="getAllModelNodeIndexByAddress" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo">
        SELECT
            mn.node_id nodeId,
            mn.code nodeCode,
            mn."name" nodeName,
            ni.index_id indexId,
            ei."name" indexName,
            ei.index_type indexType,
            mi.energy_type
        FROM
            "model_node" mn
                LEFT JOIN "node_index" ni ON mn.node_id = ni.node_id
                LEFT JOIN energy_index ei ON ni.index_id = ei.index_id
                LEFT JOIN meter_implement mi ON mi."id" = ei.meter_id
        WHERE
            mn.model_code = #{modelCode}
          AND mn.address LIKE concat( #{address} , '%' )
    </select>
</mapper>