add ai delete

This commit is contained in:
Chuck1sn
2025-05-29 17:09:29 +08:00
parent 55884bb1a1
commit 10bee7c656
14 changed files with 355 additions and 17 deletions

View File

@@ -15,6 +15,7 @@ import org.jooq.generated.mjga.tables.daos.DepartmentDao;
import org.jooq.impl.DSL;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
@Repository
public class DepartmentRepository extends DepartmentDao {
@@ -95,4 +96,9 @@ public class DepartmentRepository extends DepartmentDao {
.innerJoin(USER.department())
.where(USER.ID.eq(userId));
}
@Transactional
public void deleteByName(String name) {
ctx().deleteFrom(DEPARTMENT).where(DEPARTMENT.NAME.eq(name)).execute();
}
}

View File

@@ -26,8 +26,7 @@ public class LlmRepository extends AiLlmConfigDao {
public Result<Record> pageFetchBy(PageRequestDto pageRequestDto, LlmQueryDto llmQueryDto) {
return ctx()
.select(
AI_LLM_CONFIG.asterisk(),
DSL.count().over().as("total_llm").convertFrom(Long::valueOf))
AI_LLM_CONFIG.asterisk(), DSL.count().over().as("total_llm").convertFrom(Long::valueOf))
.from(AI_LLM_CONFIG)
.where(
StringUtils.isNotEmpty(llmQueryDto.name())