This commit is contained in:
Vinjor 2025-03-18 14:31:03 +08:00
parent 555d9a0db6
commit bd6ed30f61
4 changed files with 31 additions and 0 deletions

View File

@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.security.access.prepost.PreAuthorize;
@ -109,4 +111,18 @@ public class BaseConfigController extends BaseController
List<String> list = new ArrayList<>(Arrays.asList(ids));
return toAjax(baseConfigService.removeByIds(list));
}
/**
* 获取基础配置-账户配置小程序配置的内容详细信息-根据code获取
*/
@GetMapping(value = "/getConfigByCode")
public AjaxResult getConfigByCode(String code)
{
LambdaQueryWrapper<BaseConfig> queryWrapper = new LambdaQueryWrapper<BaseConfig>().eq(BaseConfig::getCode,code);
List<BaseConfig> list = baseConfigService.list(queryWrapper);
if(list.isEmpty()){
error("未查询到相关配置!");
}
return success(list.get(0));
}
}

View File

@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="queryListPage" parameterType="BaseConfig" resultMap="BaseConfigResult">
<include refid="selectBaseConfigVo"/>
<where>
del_flag=0
<if test="entity.code != null and entity.code != ''"> and code = #{entity.code}</if>
<if test="entity.title != null and entity.title != ''"> and title = #{entity.title}</if>
<if test="entity.jsonStr != null and entity.jsonStr != ''"> and json_str = #{entity.jsonStr}</if>

View File

@ -28,11 +28,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="queryListPage" parameterType="BaseRights" resultMap="BaseRightsResult">
<include refid="selectBaseRightsVo"/>
<where>
del_flag=0
<if test="entity.userType != null and entity.userType != ''"> and user_type = #{entity.userType}</if>
<if test="entity.code != null and entity.code != ''"> and code = #{entity.code}</if>
<if test="entity.name != null and entity.name != ''"> and name like concat('%', #{entity.name}, '%')</if>
<if test="entity.rightsType != null and entity.rightsType != ''"> and rights_type = #{entity.rightsType}</if>
<if test="entity.rightsCycle != null and entity.rightsCycle != ''"> and rights_cycle = #{entity.rightsCycle}</if>
</where>
order by user_type,sort asc,create_time asc
</select>
</mapper>

View File

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.incrementer.H2KeyGenerator;
import com.baomidou.mybatisplus.extension.incrementer.KingbaseKeyGenerator;
import com.baomidou.mybatisplus.extension.incrementer.OracleKeyGenerator;
import com.baomidou.mybatisplus.extension.incrementer.PostgreKeyGenerator;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.ruoyi.framework.handler.DefaultDBFieldHandler;
import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
@ -33,4 +34,15 @@ public class MybatisAutoConfiguration {
return new DefaultDBFieldHandler(); // 自动填充参数类
}
/** Mybatis plus 分页插件 **/
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
// 设置请求的页面大于最大页后操作 true调回到首页false 继续请求 默认false
// paginationInterceptor.setOverflow(false);
// 设置最大单页限制数量默认 500 -1 不受限制
paginationInterceptor.setLimit(-1);
return paginationInterceptor;
}
}