ustcyc
2025-01-07 90e30e1461f48721442d0391e46c2edde170d9e7
升级架构
已修改11个文件
168 ■■■■ 文件已修改
zhitan-admin/src/main/resources/application.yml 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhitan-admin/target/classes/application-dev.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhitan-admin/target/classes/application-prod.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhitan-admin/target/classes/application.yml 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhitan-system/target/classes/mapper/basicdata/MeterImplementMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhitan-system/target/classes/mapper/dataitem/DataItemMapper.xml 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhitan-system/target/classes/mapper/model/EnergyIndexMapper.xml 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhitan-system/target/classes/mapper/model/ModelNodeMapper.xml 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhitan-system/target/classes/mapper/peakvalley/ElectricityDataItemMapper.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhitan-system/target/classes/mapper/peakvalley/ElectricityPriceDateMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhitan-system/target/classes/mapper/system/SysUserMapper.xml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhitan-admin/src/main/resources/application.yml
@@ -101,8 +101,8 @@
  expireTime: 300
mybatis-plus:
#  configuration:
#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  #  configuration:
  #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  typeAliasesPackage: com.zhitan.**.domain
  mapperLocations: classpath*:mapper/**/*Mapper.xml
  # 加载全局的配置文件
@@ -144,7 +144,7 @@
  token: ==
  org: org
  bucket: bucket
###################### MQTT #################################
mqtt:
  # 服务器地址
@@ -156,7 +156,7 @@
  # 用户名
  username: admin
  # 密码
  password: 111111
  password: 1q2w3e4r.
  # 连接超时
  timeout: 30
  # 心跳检测
@@ -169,4 +169,5 @@
  # false为建立持久会话
  cleanSession: false
  # 断开后重新连接
  automaticReconnect: true
  automaticReconnect: true
singleLoginUrl: localhost:8090/singleLogin/getInfo
zhitan-admin/target/classes/application-dev.yml
@@ -35,7 +35,7 @@
      # 配置一个连接在池中最大生存的时间,单位是毫秒
      maxEvictableIdleTimeMillis: 900000
      # 配置检测连接是否有效
      validationQuery: SELECT 1
      validationQuery: SELECT 1
      testWhileIdle: true
      testOnBorrow: false
      testOnReturn: false
zhitan-admin/target/classes/application-prod.yml
@@ -6,7 +6,7 @@
    druid:
      # 主库数据源
      master:
        url: jdbc:postgresql://127.0.0.1:5432/energy
        url: jdbc:postgresql://127.0.0.1:5432/energy_ml
        username: root
        password: 123456
      # 从库数据源
zhitan-admin/target/classes/application.yml
@@ -101,8 +101,8 @@
  expireTime: 300
mybatis-plus:
#  configuration:
#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  #  configuration:
  #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  typeAliasesPackage: com.zhitan.**.domain
  mapperLocations: classpath*:mapper/**/*Mapper.xml
  # 加载全局的配置文件
@@ -144,7 +144,7 @@
  token: ==
  org: org
  bucket: bucket
###################### MQTT #################################
mqtt:
  # 服务器地址
@@ -156,7 +156,7 @@
  # 用户名
  username: admin
  # 密码
  password: 111111
  password: 1q2w3e4r.
  # 连接超时
  timeout: 30
  # 心跳检测
@@ -169,4 +169,5 @@
  # false为建立持久会话
  cleanSession: false
  # 断开后重新连接
  automaticReconnect: true
  automaticReconnect: true
singleLoginUrl: localhost:8090/singleLogin/getInfo
zhitan-system/target/classes/mapper/basicdata/MeterImplementMapper.xml
@@ -127,6 +127,12 @@
        JOIN node_index ni ON ni.node_id = nd.node_id
        where ni.node_id= #{nodeId} and index_id= #{indexId}
    </select>
    <select id="listMeterImplByInstallLocation" resultType="com.zhitan.basicdata.domain.MeterImplement">
        <include refid="selectMeterImplementVo"/>
        <where>
            installaction_location = #{installactionLocation}
        </where>
    </select>
    <insert id="insertMeterImplement" parameterType="MeterImplement">
        insert into meter_implement
zhitan-system/target/classes/mapper/dataitem/DataItemMapper.xml
@@ -136,4 +136,67 @@
            </foreach>
            AND time_code = #{timeCode}
    </select>
    <select id="getUpCarbonEmission" resultType="com.zhitan.carbonemission.domain.CarbonEmission">
        SELECT
            di.index_id,
            di.data_time,
            di.value,
            ei.energy_id
        FROM
            data_item  di
                JOIN energy_index ei  ON di.index_id = ei.index_id
        WHERE
            ei.energy_id != '' and
            di.index_id IN ( SELECT index_id FROM node_index WHERE node_id = #{indexId})
          AND di.data_time BETWEEN   #{beginTime}  AND  #{endTime}
          AND di.time_type = #{timeType}
    </select>
    <select id="getMiddleCarbonEmission" resultType="com.zhitan.carbonemission.domain.CarbonEmission">
        SELECT
            di.index_id,
            di.data_time,
        CASE
        WHEN di.time_type = 'MONTH' THEN
        TO_CHAR( di.create_time, 'MM' )
        WHEN di.time_type = 'DAY' THEN
        TO_CHAR( di.create_time, 'DD' )
        WHEN di.time_type = 'HOUR' THEN
        TO_CHAR( di.data_time, 'HH' )
        ELSE TO_CHAR( di.data_time, 'YYMMDD' )
        END AS dataTimeStr,
            di.value,
            ei.energy_id,
            di.time_type
        FROM
            data_item  di
                JOIN energy_index ei  ON di.index_id = ei.index_id
        WHERE
            di.index_id IN ( SELECT index_id FROM node_index WHERE node_id = #{indexId})
        <if test="emissionType !='' and emissionType !=null  and emissionType =='allType'">
            AND ei.energy_id != ''
        </if>
        <if test="emissionType !='' and emissionType !=null  and emissionType !='allType'">
            AND  ei.energy_id = #{emissionType}
        </if>
          AND di.data_time BETWEEN   #{beginTime}  AND  #{endTime}
          AND di.time_type = #{timeType}
    </select>
    <select id="getDownCarbonEmission" resultType="com.zhitan.carbonemission.domain.CarbonEmission">
        SELECT
            di.index_id,
            di.data_time,
            di.value,
            ei.energy_id,
            mn.name as nodeName
        FROM
        model_node mn
        LEFT JOIN node_index ni ON mn.node_id = ni.node_id
        LEFT JOIN data_item di ON di.index_id = ni.index_id
        LEFT JOIN energy_index ei ON di.index_id = ei.index_id
        WHERE
        ei.energy_id != ''
        AND mn.parent_id = #{indexId}
        AND di.data_time BETWEEN   #{beginTime}  AND  #{endTime}
        AND di.time_type =  #{timeType}
    </select>
</mapper>
zhitan-system/target/classes/mapper/model/EnergyIndexMapper.xml
@@ -184,7 +184,7 @@
      <if test="energyId != null">#{energyId},
      </if>
    </trim>
  </insert>
  <insert id="insertNodeIndex">
    insert into node_index (node_id, index_id) values (#{nodeId}, #{indexId});
@@ -331,7 +331,7 @@
    and ei.meter_id = me.id
    order by ei.order_num
  </select>
  <select id="selectEnergyIndexPage" resultMap="EnergyIndexResult">
    select ni.index_id, name, code, index_type, remark, unit_id, index_category
    from energy_index ei left join node_index ni on ei.index_id = ni.index_id
@@ -346,7 +346,7 @@
      </if>
    </where>
    order by ei.order_num
  </select>
    <select id="listIndexByMeterIds" resultType="com.zhitan.model.domain.EnergyIndex">
      select ei.index_id,
@@ -363,7 +363,7 @@
      from energy_index ei
      left join node_index ni on ei.index_id = ni.index_id
      <where>
        <if test="nodeId != null  and nodeId != ''">and ni.node_id = #{nodeId}</if>
        <if test="meterIds != null">
          and ei.meter_id in
@@ -377,4 +377,18 @@
    <include refid="selectEnergyIndexVo"/>
    where code = #{cdoe}
  </select>
  <select id="getIndexByCode" resultType="com.zhitan.model.domain.EnergyIndex">
    SELECT ei.code,mi.meter_name||'_'||ei.name as name from energy_index ei
    LEFT JOIN node_device nd on ei.meter_id =  nd.device_id
    LEFT JOIN meter_implement  mi on mi."id" = nd.device_id
    <where>
        <if test="nodeId != null  and nodeId != ''">and nd.node_id  = #{nodeId}</if>
        <if test="code != null  and code != ''">
          and (mi.meter_name like concat('%', #{code}, '%')
          or ei.code like concat('%', #{code}, '%')
          or ei.name like concat('%', #{code}, '%')
          )
        </if>
    </where>
  </select>
</mapper>
zhitan-system/target/classes/mapper/model/ModelNodeMapper.xml
@@ -377,7 +377,7 @@
            values (#{nodeId}, #{indexId})
        </foreach>
    </insert>
    <select id="getModelNodeIndexIdByNodeId" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor">
        SELECT mn.node_id  nodeId,
               mn."name"   "name",
@@ -386,7 +386,7 @@
        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
        WHERE ni.node_id = #{nodeId}
        WHERE ni.node_id = #{nodeId}
        <if test="energyType!=null and energyType!=''">
            and ei.energy_id = #{energyType}
        </if>
@@ -404,7 +404,7 @@
    <select id="getFirstModeNodeInfo" resultType="com.zhitan.model.domain.ModelNode">
        <include refid="selectModelNodeVo"/>
        where model_code = #{modelCode}  AND parent_id is null
        order by order_num
        order by order_num
    </select>
    <select id="selectIndexByNodeIds" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor">
        SELECT mn.node_id  nodeId,
@@ -414,10 +414,17 @@
        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
        WHERE mn.model_code = #{modelCode}
        <where>
            mn.model_code = #{modelCode}
          AND mn.node_id in
        <foreach collection="nodeIds" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        <if test="modelCode!=null and modelCode!='' and nodeIds.size>0">
            and ei.index_type='STATISTIC'
        </if>
        </where>
    </select>
</mapper>
zhitan-system/target/classes/mapper/peakvalley/ElectricityDataItemMapper.xml
@@ -27,5 +27,26 @@
        AND (data_time BETWEEN #{startTime} AND #{endTime})
        AND time_type = #{timeType}
    </select>
    <select id="getDataStatisticsDeviationAnalysis"
            resultType="com.zhitan.peakvalley.domain.ElectricityDataItem">
        SELECT
        index_code indexCode,
        time_code timeCode,
        electricity_type electricityType,
        data_time dataTime,
        electricity,
        "cost",
        time_type timeType,
        price,
        remark
        FROM
        "electricity_data_item"
        WHERE
        index_id IN
        <foreach collection="indexIdSet" item="indexId" open="(" separator="," close=")">
            #{indexId}
        </foreach>
        AND time_type = #{timeType}
    </select>
</mapper>
zhitan-system/target/classes/mapper/peakvalley/ElectricityPriceDateMapper.xml
@@ -80,4 +80,10 @@
            #{id}
        </foreach>
    </delete>
    <select id="selectElectricityPriceDatePageTacticsAll"  resultMap="ElectricityPriceDateResult">
        <include refid="selectElectricityPriceDateVo"/>
        WHERE begin_date &lt; CURRENT_TIMESTAMP
        AND end_date &gt; CURRENT_TIMESTAMP
    </select>
</mapper>
zhitan-system/target/classes/mapper/system/SysUserMapper.xml
@@ -23,6 +23,7 @@
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="remark" column="remark"/>
        <result property="singleUser" column="single_user"/>
        <association property="dept"    javaType="SysDept"         resultMap="deptResult" />
        <collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
    </resultMap>
@@ -63,6 +64,7 @@
               u.create_by,
               u.create_time,
               u.remark,
               u.single_user,
               d.dept_id,
               d.parent_id,
               d.ancestors,
@@ -84,7 +86,7 @@
    <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
        select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phone_number, u.password, u.sex,
        u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from
        u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.single_user, d.dept_name, d.leader from
        sys_user u
        left join sys_dept d on u.dept_id = d.dept_id
        where u.del_flag = '0'
@@ -147,6 +149,7 @@
        <if test="status != null and status != ''">status,</if>
        <if test="createBy != null and createBy != ''">create_by,</if>
        <if test="remark != null and remark != ''">remark,</if>
        <if test="singleUser != null and singleUser != ''">single_user,</if>
        create_time
        )values(
        <if test="userId != null and userId != ''">#{userId},</if>
@@ -161,6 +164,7 @@
        <if test="status != null and status != ''">#{status},</if>
        <if test="createBy != null and createBy != ''">#{createBy},</if>
        <if test="remark != null and remark != ''">#{remark},</if>
        <if test="singleUser != null and singleUser != ''">#{singleUser},</if>
        now()
        )
    </insert>
@@ -181,6 +185,7 @@
            <if test="loginDate != null">login_date = #{loginDate},</if>
            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="singleUser != null and singleUser != ''">single_user = #{singleUser},</if>
            update_time = now()
        </set>
        where user_id = #{userId}
@@ -219,4 +224,4 @@
        </foreach>
    </delete>
</mapper>
</mapper>