1
This commit is contained in:
parent
cb04ad0741
commit
7ae2ba0ce1
@ -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.conditions.query.LambdaQueryWrapper;
|
||||||
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.apache.commons.lang3.StringUtils;
|
||||||
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.*;
|
||||||
@ -44,12 +47,17 @@ public class BaseCategoryController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('base:category:list')")
|
@PreAuthorize("@ss.hasPermi('base:category:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public AjaxResult list(BaseCategory baseCategory,
|
public AjaxResult list(BaseCategory baseCategory)
|
||||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
|
||||||
{
|
{
|
||||||
Page<BaseCategory> page = new Page<>(pageNum, pageSize);
|
LambdaQueryWrapper<BaseCategory> queryWrapper = new LambdaQueryWrapper<BaseCategory>();
|
||||||
IPage<BaseCategory> list = baseCategoryService.queryListPage(baseCategory,page);
|
if(StringUtils.isNotEmpty(baseCategory.getCode())){
|
||||||
|
queryWrapper.like(BaseCategory::getCode,baseCategory.getCode());
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(baseCategory.getTitle())){
|
||||||
|
queryWrapper.like(BaseCategory::getTitle,baseCategory.getTitle());
|
||||||
|
}
|
||||||
|
queryWrapper.orderByAsc(BaseCategory::getSort);
|
||||||
|
List<BaseCategory> list = baseCategoryService.list(queryWrapper);
|
||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,9 @@ public class BaseConfig extends DlBaseEntity
|
|||||||
/** 唯一编码 */
|
/** 唯一编码 */
|
||||||
@Excel(name = "唯一编码")
|
@Excel(name = "唯一编码")
|
||||||
private String code;
|
private String code;
|
||||||
|
/** 标题 */
|
||||||
|
@Excel(name = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
/** json字符串 */
|
/** json字符串 */
|
||||||
@Excel(name = "json字符串")
|
@Excel(name = "json字符串")
|
||||||
|
@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<resultMap type="BaseConfig" id="BaseConfigResult">
|
<resultMap type="BaseConfig" id="BaseConfigResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="code" column="code" />
|
<result property="code" column="code" />
|
||||||
|
<result property="title" column="title" />
|
||||||
<result property="jsonStr" column="json_str" />
|
<result property="jsonStr" column="json_str" />
|
||||||
<result property="creator" column="creator" />
|
<result property="creator" column="creator" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
@ -16,13 +17,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<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,title, json_str, creator, create_time, updater, update_time, del_flag from dl_base_config
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="queryListPage" parameterType="BaseConfig" resultMap="BaseConfigResult">
|
<select id="queryListPage" parameterType="BaseConfig" resultMap="BaseConfigResult">
|
||||||
<include refid="selectBaseConfigVo"/>
|
<include refid="selectBaseConfigVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="entity.code != null and entity.code != ''"> and code = #{entity.code}</if>
|
<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>
|
<if test="entity.jsonStr != null and entity.jsonStr != ''"> and json_str = #{entity.jsonStr}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
@ -61,7 +61,7 @@ public class DefaultDBFieldHandler implements MetaObjectHandler {
|
|||||||
// setFieldValByName("updater", userId.toString(), metaObject);
|
// setFieldValByName("updater", userId.toString(), metaObject);
|
||||||
// }
|
// }
|
||||||
//更新数据时,强制更新数据的更新时间和更新人
|
//更新数据时,强制更新数据的更新时间和更新人
|
||||||
setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
|
setFieldValByName("updateTime", new Date(), metaObject);
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
if (Objects.nonNull(userId)) {
|
if (Objects.nonNull(userId)) {
|
||||||
setFieldValByName("updater", userId.toString(), metaObject);
|
setFieldValByName("updater", userId.toString(), metaObject);
|
||||||
|
Loading…
Reference in New Issue
Block a user