GPU模块设计

This commit is contained in:
dc
2025-05-25 16:14:04 +08:00
parent 73388da706
commit c01e985256
9 changed files with 186 additions and 128 deletions

View File

@ -1,27 +1,33 @@
spring.application.name=intelligent-application-orchestration-service
spring.datasource.url=jdbc:kingbase8://116.205.121.200:54321/Ipz
spring.datasource.username=system
spring.datasource.password=root
spring.datasource.driver-class-name=com.kingbase8.Driver
spring.jpa.database-platform=org.hibernate.dialect.Kingbase8Dialect
#spring.datasource.url=jdbc:mysql://localhost:3306/Ipz
#spring.datasource.username=root
#spring.datasource.password=zxc25864
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect
#spring.datasource.url=jdbc:kingbase8://116.205.121.200:54321/Ipz
#spring.datasource.username=system
#spring.datasource.password=root
#spring.datasource.driver-class-name=com.kingbase8.Driver
#spring.jpa.database-platform=org.hibernate.dialect.Kingbase8Dialect
spring.datasource.url=jdbc:mysql://localhost:3306/Ipz
spring.datasource.username=root
spring.datasource.password=zxc25864
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect
spring.datasource.hikari.maximum-pool-size=10
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.connection-timeout=30000
# Redis ????
spring.data.redis.host=116.205.121.200
spring.data.redis.host=127.0.0.1
spring.data.redis.port=6379
#spring.data.redis.host=116.205.121.200
#spring.data.redis.port=6379
spring.data.redis.username=default
spring.data.redis.password=your_strong_password
spring.data.redis.ssl.enabled=true
mq.queue.cache-update=cache_update_queue
spring.data.redis.password=Jbjhhzstsl97@
spring.data.redis.ssl.enabled=false
#mq.queue.cache-update=cache_update_queue
mybatis-plus.mapper-locations=classpath:mapper/*.xml
mybatis-plus.configuration.map-underscore-to-camel-case=true
mybatis-plus.type-aliases-package=com.bipt.intelligentapplicationorchestrationservice.gpu.model.entity
#mybatis.mapper-locations=classpath:mapper/*.xml
#mybatis.type-aliases-package=com.bipt.intelligentapplicationorchestrationservice.gpu.model.entity

View File

@ -1,19 +1,57 @@
<!-- src/main/resources/mapper/GpuResourceMapper.xml -->
<select id="selectByCondition" resultType="GpuResource">
SELECT * FROM ipz.gpu_resource
<where>
<if test="gpuId != null">
GPUId = #{gpuId}
</if>
<if test="ipPattern != null and ipPattern != ''">
AND Ip LIKE CONCAT('%', #{ipPattern}, '%')
</if>
<if test="modelKeyword != null and modelKeyword != ''">
AND GPUModel LIKE CONCAT('%', #{modelKeyword}, '%')
</if>
<if test="startTime != null and endTime != null">
AND CreatedTime BETWEEN #{startTime} AND #{endTime}
</if>
</where>
ORDER BY GPUId DESC
</select>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bipt.intelligentapplicationorchestrationservice.gpu.dao.GpuResourceDao">
<!-- 动态条件查询 -->
<select id="selectByFields"
resultType="com.bipt.intelligentapplicationorchestrationservice.gpu.model.entity.GpuResource">
SELECT *
FROM ipz.gpu_resource
<where>
is_deleted = 0
<if test="params.model != null and params.model != ''">
AND GPUModel LIKE CONCAT('%', #{params.model}, '%')
</if>
<if test="params.memoryMin != null">
AND GPUMemorySize &gt;= #{params.memoryMin}
</if>
<if test="params.ip != null and params.ip != ''">
AND Ip = #{params.ip}
</if>
<if test="params.startTime != null and params.endTime != null">
AND update_time BETWEEN #{params.startTime} AND #{params.endTime}
</if>
</where>
ORDER BY GPUId DESC
</select>
<!-- 分页查询 -->
<select id="findByPage"
resultType="com.bipt.intelligentapplicationorchestrationservice.gpu.model.entity.GpuResource">
SELECT *
FROM ipz.gpu_resource
WHERE is_deleted = 0
ORDER BY GPUId ASC
LIMIT #{limit} OFFSET #{offset}
</select>
<!-- 增量同步查询 -->
<select id="findModifiedSince"
resultType="com.bipt.intelligentapplicationorchestrationservice.gpu.model.entity.GpuResource">
SELECT *, is_deleted
FROM ipz.gpu_resource
WHERE update_time &gt; #{since}
ORDER BY update_time ASC
</select>
<!-- 带锁查询 -->
<select id="selectByIdWithLock"
resultType="com.bipt.intelligentapplicationorchestrationservice.gpu.model.entity.GpuResource">
SELECT *
FROM ipz.gpu_resource
WHERE GPUId = #{gpuId}
FOR UPDATE NOWAIT
</select>
</mapper>