|
@@ -0,0 +1,81 @@
|
|
|
+/*
|
|
|
+ * Copyright (c) 2025 GaoKunW
|
|
|
+ *
|
|
|
+ */
|
|
|
+
|
|
|
+package org.eco.vip.nexus.core.service.config;
|
|
|
+
|
|
|
+
|
|
|
+import com.mybatisflex.core.paginate.Page;
|
|
|
+import com.mybatisflex.core.query.QueryWrapper;
|
|
|
+import jakarta.annotation.Resource;
|
|
|
+import org.eco.vip.nexus.core.domain.config.Config;
|
|
|
+import org.eco.vip.nexus.core.domain.config.pojo.ConfigBO;
|
|
|
+import org.eco.vip.nexus.core.domain.config.pojo.ConfigVO;
|
|
|
+import org.eco.vip.nexus.core.mapper.ConfigMapper;
|
|
|
+import org.eco.vip.orm.domain.PageQuery;
|
|
|
+import org.eco.vip.orm.pojo.PageResult;
|
|
|
+import org.eco.vip.orm.service.BaseService;
|
|
|
+import org.eco.vip.orm.utils.MapstructUtils;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static org.eco.vip.nexus.core.domain.config.table.ConfigTableDef.CONFIG;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @description ConfigService
|
|
|
+ *
|
|
|
+ * @author GaoKunW
|
|
|
+ * @date 2025/7/17 11:33
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class ConfigService extends BaseService<ConfigMapper, Config> implements IConfigService {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ConfigMapper configMapper;
|
|
|
+
|
|
|
+ private QueryWrapper buildQueryWrapper(ConfigBO configBO) {
|
|
|
+ return super.buildBaseQueryWrapper()
|
|
|
+ .and(CONFIG.CONFIG_ID.eq(configBO.getConfigId()))
|
|
|
+ .and(CONFIG.CONFIG_KEY.eq(configBO.getConfigKey()))
|
|
|
+ .and(CONFIG.CONFIG_VALUE.eq(configBO.getConfigValue()))
|
|
|
+ .and(CONFIG.STATUS.eq(configBO.getStatus()));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageResult<ConfigVO> selectPage(ConfigBO configBO) {
|
|
|
+ QueryWrapper queryWrapper = buildQueryWrapper(configBO);
|
|
|
+ Page<ConfigVO> page = configMapper.paginateWithRelationsAs(PageQuery.build(), queryWrapper, ConfigVO.class);
|
|
|
+ return PageResult.build(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<ConfigVO> selectList(ConfigBO configBO) {
|
|
|
+ QueryWrapper queryWrapper = buildQueryWrapper(configBO);
|
|
|
+ return configMapper.selectListWithRelationsByQueryAs(queryWrapper, ConfigVO.class);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean insert(ConfigBO configBO) {
|
|
|
+ Config config = MapstructUtils.convert(configBO, Config.class);
|
|
|
+ return this.save(config);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean update(ConfigBO configBO) {
|
|
|
+ Config config = MapstructUtils.convert(configBO, Config.class);
|
|
|
+ return this.updateById(config);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean delete(List<String> ids) {
|
|
|
+ return this.removeByIds(ids);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ConfigVO selectById(String id) {
|
|
|
+ QueryWrapper queryWrapper = query().where(CONFIG.CONFIG_ID.eq(id));
|
|
|
+ return this.getOneAs(queryWrapper, ConfigVO.class);
|
|
|
+ }
|
|
|
+}
|