Merge branch 'dc-feature'
# Conflicts: # pom.xml # src/main/java/com/bipt/intelligentapplicationorchestrationservice/IntelligentApplicationOrchestrationServiceApplication.java # src/main/resources/application.properties
This commit is contained in:
57
src/main/resources/mapper/GpuResourceMapper.xml
Normal file
57
src/main/resources/mapper/GpuResourceMapper.xml
Normal file
@ -0,0 +1,57 @@
|
||||
<?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.mapper.GpuResourceDao">
|
||||
|
||||
<!-- 动态条件查询 -->
|
||||
<select id="selectByFields"
|
||||
resultType="com.bipt.intelligentapplicationorchestrationservice.entity.entity.GpuResource">
|
||||
SELECT *
|
||||
FROM Ipz.public.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 >= #{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.entity.entity.GpuResource">
|
||||
SELECT *
|
||||
FROM gpu_resource
|
||||
WHERE is_deleted = 0
|
||||
ORDER BY GPUId ASC
|
||||
LIMIT #{limit} OFFSET #{offset}
|
||||
</select>
|
||||
|
||||
<!-- 增量同步查询 -->
|
||||
<select id="findModifiedSince"
|
||||
resultType="com.bipt.intelligentapplicationorchestrationservice.entity.entity.GpuResource">
|
||||
SELECT *, is_deleted
|
||||
FROM gpu_resource
|
||||
WHERE update_time > #{since}
|
||||
ORDER BY update_time ASC
|
||||
</select>
|
||||
|
||||
<!-- 带锁查询 -->
|
||||
<select id="selectByIdWithLock"
|
||||
resultType="com.bipt.intelligentapplicationorchestrationservice.entity.entity.GpuResource">
|
||||
SELECT *
|
||||
FROM gpu_resource
|
||||
WHERE GPUId = #{gpuId}
|
||||
FOR UPDATE NOWAIT
|
||||
</select>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user