1
This commit is contained in:
parent
5a26033ea9
commit
d0e3da7555
@ -4,12 +4,19 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
@ -35,18 +42,21 @@ public class BaseConfigController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询基础配置-账户配置、小程序配置的内容列表
|
* 查询基础配置-账户配置、小程序配置的内容列表
|
||||||
*/
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('base:config:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public AjaxResult list(BaseConfig baseConfig,
|
public AjaxResult list(BaseConfig baseConfig,
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
||||||
{
|
{
|
||||||
Page<BaseConfig> page = new Page<>(pageNo, pageSize);
|
Page<BaseConfig> page = new Page<>(pageNum, pageSize);
|
||||||
return success(baseConfigService.queryListPage(baseConfig,page));
|
IPage<BaseConfig> list = baseConfigService.queryListPage(baseConfig,page);
|
||||||
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出基础配置-账户配置、小程序配置的内容列表
|
* 导出基础配置-账户配置、小程序配置的内容列表
|
||||||
*/
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('base:config:export')")
|
||||||
@Log(title = "基础配置-账户配置、小程序配置的内容", businessType = BusinessType.EXPORT)
|
@Log(title = "基础配置-账户配置、小程序配置的内容", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, BaseConfig baseConfig)
|
public void export(HttpServletResponse response, BaseConfig baseConfig)
|
||||||
@ -59,6 +69,7 @@ public class BaseConfigController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 获取基础配置-账户配置、小程序配置的内容详细信息
|
* 获取基础配置-账户配置、小程序配置的内容详细信息
|
||||||
*/
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('base:config:query')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||||
{
|
{
|
||||||
@ -68,6 +79,7 @@ public class BaseConfigController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 新增基础配置-账户配置、小程序配置的内容
|
* 新增基础配置-账户配置、小程序配置的内容
|
||||||
*/
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('base:config:add')")
|
||||||
@Log(title = "基础配置-账户配置、小程序配置的内容", businessType = BusinessType.INSERT)
|
@Log(title = "基础配置-账户配置、小程序配置的内容", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody BaseConfig baseConfig)
|
public AjaxResult add(@RequestBody BaseConfig baseConfig)
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
package com.ruoyi.base.mapper;
|
package com.ruoyi.base.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.ruoyi.base.domain.BaseConfig;
|
import com.ruoyi.base.domain.BaseConfig;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 基础配置-账户配置、小程序配置的内容Mapper接口
|
* 基础配置-账户配置、小程序配置的内容Mapper接口
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.ruoyi.base.service;
|
package com.ruoyi.base.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
package com.ruoyi.base.service.impl;
|
package com.ruoyi.base.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
@ -18,9 +18,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<sql id="selectBaseConfigVo">
|
<sql id="selectBaseConfigVo">
|
||||||
select id, code, json_str, creator, create_time, updater, update_time, del_flag from dl_base_config
|
select id, code, json_str, creator, create_time, updater, update_time, del_flag from dl_base_config
|
||||||
</sql>
|
</sql>
|
||||||
<select id="queryListPage" resultType="com.ruoyi.base.domain.BaseConfig">
|
|
||||||
select * from dl_base_config
|
<select id="queryListPage" parameterType="BaseConfig" resultMap="BaseConfigResult">
|
||||||
|
<include refid="selectBaseConfigVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="entity.code != null and entity.code != ''"> and code = #{entity.code}</if>
|
||||||
|
<if test="entity.jsonStr != null and entity.jsonStr != ''"> and json_str = #{entity.jsonStr}</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -4,8 +4,11 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
@ -45,10 +48,12 @@ public class ${ClassName}Controller extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')")
|
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
#if($table.crud || $table.sub)
|
#if($table.crud || $table.sub)
|
||||||
public AjaxResult list(${ClassName} ${className})
|
public AjaxResult list(${ClassName} ${className},
|
||||||
|
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
||||||
{
|
{
|
||||||
|
Page<${ClassName}> page = new Page<>(pageNum, pageSize);
|
||||||
List<${ClassName}> list = ${className}Service.list();
|
IPage<${ClassName}> list = ${className}Service.queryListPage(${className},page);
|
||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
#elseif($table.tree)
|
#elseif($table.tree)
|
||||||
@ -113,6 +118,6 @@ public class ${ClassName}Controller extends BaseController
|
|||||||
public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s)
|
public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s)
|
||||||
{
|
{
|
||||||
List<${pkColumn.javaType}> list = new ArrayList<>(Arrays.asList(${pkColumn.javaField}s));
|
List<${pkColumn.javaType}> list = new ArrayList<>(Arrays.asList(${pkColumn.javaField}s));
|
||||||
return toAjax(${className}Service.removeBatchByIds(list));
|
return toAjax(${className}Service.removeByIds(list));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
package ${packageName}.mapper;
|
package ${packageName}.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import ${packageName}.domain.${ClassName};
|
import ${packageName}.domain.${ClassName};
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
@ -17,5 +20,5 @@ import ${packageName}.domain.${subClassName};
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface ${ClassName}Mapper extends BaseMapper<${ClassName}>
|
public interface ${ClassName}Mapper extends BaseMapper<${ClassName}>
|
||||||
{
|
{
|
||||||
|
IPage<${ClassName}> queryListPage(@Param("entity") ${ClassName} entity, Page<${ClassName}> page);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package ${packageName}.service;
|
package ${packageName}.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import ${packageName}.domain.${ClassName};
|
import ${packageName}.domain.${ClassName};
|
||||||
|
|
||||||
@ -12,5 +14,5 @@ import ${packageName}.domain.${ClassName};
|
|||||||
*/
|
*/
|
||||||
public interface I${ClassName}Service extends IService<${ClassName}>
|
public interface I${ClassName}Service extends IService<${ClassName}>
|
||||||
{
|
{
|
||||||
|
IPage<${ClassName}> queryListPage(${ClassName} pageReqVO, Page<${ClassName}> page);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@ import com.ruoyi.common.utils.DateUtils;
|
|||||||
#break
|
#break
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@ -32,5 +34,8 @@ public class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper,${Cl
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ${ClassName}Mapper ${className}Mapper;
|
private ${ClassName}Mapper ${className}Mapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<${ClassName}> queryListPage(${ClassName} pageReqVO, Page<${ClassName}> page) {
|
||||||
|
return ${className}Mapper.queryListPage(pageReqVO, page);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -448,8 +448,8 @@ export default {
|
|||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
list${BusinessName}(this.queryParams).then(response => {
|
list${BusinessName}(this.queryParams).then(response => {
|
||||||
this.${businessName}List = response.rows;
|
this.${businessName}List = response.data.records;
|
||||||
this.total = response.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -26,5 +26,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName}
|
select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName}
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<select id="queryListPage" parameterType="${ClassName}" resultMap="${ClassName}Result">
|
||||||
|
<include refid="select${ClassName}Vo"/>
|
||||||
|
<where>
|
||||||
|
#foreach($column in $columns)
|
||||||
|
#set($queryType=$column.queryType)
|
||||||
|
#set($javaField=$column.javaField)
|
||||||
|
#set($javaType=$column.javaType)
|
||||||
|
#set($columnName=$column.columnName)
|
||||||
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
|
#if($column.query)
|
||||||
|
#if($column.queryType == "EQ")
|
||||||
|
<if test="entity.$javaField != null #if($javaType == 'String' ) and entity.$javaField.trim() != ''#end"> and $columnName = #{entity.$javaField}</if>
|
||||||
|
#elseif($queryType == "NE")
|
||||||
|
<if test="entity.$javaField != null #if($javaType == 'String' ) and entity.$javaField.trim() != ''#end"> and $columnName != #{entity.$javaField}</if>
|
||||||
|
#elseif($queryType == "GT")
|
||||||
|
<if test="entity.$javaField != null #if($javaType == 'String' ) and entity.$javaField.trim() != ''#end"> and $columnName > #{entity.$javaField}</if>
|
||||||
|
#elseif($queryType == "GTE")
|
||||||
|
<if test="entity.$javaField != null #if($javaType == 'String' ) and entity.$javaField.trim() != ''#end"> and $columnName >= #{entity.$javaField}</if>
|
||||||
|
#elseif($queryType == "LT")
|
||||||
|
<if test="entity.$javaField != null #if($javaType == 'String' ) and entity.$javaField.trim() != ''#end"> and $columnName < #{entity.$javaField}</if>
|
||||||
|
#elseif($queryType == "LTE")
|
||||||
|
<if test="entity.$javaField != null #if($javaType == 'String' ) and entity.$javaField.trim() != ''#end"> and $columnName <= #{entity.$javaField}</if>
|
||||||
|
#elseif($queryType == "LIKE")
|
||||||
|
<if test="entity.$javaField != null #if($javaType == 'String' ) and entity.$javaField.trim() != ''#end"> and $columnName like concat('%', #{entity.$javaField}, '%')</if>
|
||||||
|
#elseif($queryType == "BETWEEN")
|
||||||
|
<if test="params.begin$AttrName != null and params.begin$AttrName != '' and params.end$AttrName != null and params.end$AttrName != ''"> and $columnName between #{params.begin$AttrName} and #{params.end$AttrName}</if>
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue
Block a user