Merge remote-tracking branch 'origin/master'
commit
ee7dc90fc2
@ -0,0 +1,22 @@
|
|||||||
|
package com.glxp.api.config;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Configuration
|
||||||
|
public class YudaoMybatisAutoConfiguration {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||||
|
log.error("配置分页拦截器");
|
||||||
|
MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
|
||||||
|
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
|
||||||
|
mybatisPlusInterceptor.addInnerInterceptor(paginationInnerInterceptor); // 分页插件
|
||||||
|
return mybatisPlusInterceptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.glxp.api.controller.system;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||||
|
import com.glxp.api.common.res.BaseResponse;
|
||||||
|
import com.glxp.api.common.util.ResultVOUtils;
|
||||||
|
import com.glxp.api.entity.system.SysRemindMsgEntity;
|
||||||
|
import com.glxp.api.entity.system.SysRemindSetEntity;
|
||||||
|
import com.glxp.api.req.system.FilterSysRemindMsgRequest;
|
||||||
|
import com.glxp.api.service.system.SysRemindMsgService;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class SysRemindMsgController {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
SysRemindMsgService sysRemindMsgService;
|
||||||
|
|
||||||
|
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@GetMapping("/system/remind/msg/list")
|
||||||
|
public BaseResponse list(FilterSysRemindMsgRequest filterSysRemindMsgRequest) {
|
||||||
|
|
||||||
|
List<SysRemindMsgEntity> sysRemindMsgEntities = sysRemindMsgService.filterList(filterSysRemindMsgRequest);
|
||||||
|
PageInfo<SysRemindMsgEntity> pageInfo = new PageInfo<>(sysRemindMsgEntities);
|
||||||
|
return ResultVOUtils.page(pageInfo);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package com.glxp.api.controller.system;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||||
|
import com.glxp.api.common.res.BaseResponse;
|
||||||
|
import com.glxp.api.common.util.ResultVOUtils;
|
||||||
|
import com.glxp.api.entity.system.SysRemindSetEntity;
|
||||||
|
import com.glxp.api.req.system.FilterSysRemindSetRequest;
|
||||||
|
import com.glxp.api.service.system.SysRemindSetService;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class SysRemindSetController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
SysRemindSetService sysRemindSetService;
|
||||||
|
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@GetMapping("/system/remind/set/list")
|
||||||
|
public BaseResponse list(FilterSysRemindSetRequest filterSysRemindSetRequest) {
|
||||||
|
List<SysRemindSetEntity> sysRemindSetEntityList = sysRemindSetService.filterList(filterSysRemindSetRequest);
|
||||||
|
PageInfo<SysRemindSetEntity> pageInfo = new PageInfo<>(sysRemindSetEntityList);
|
||||||
|
return ResultVOUtils.page(pageInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.glxp.api.dao.system;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.glxp.api.entity.system.SysRemindMsgEntity;
|
||||||
|
import com.glxp.api.entity.system.SysRemindSetEntity;
|
||||||
|
import com.glxp.api.req.system.FilterSysRemindMsgRequest;
|
||||||
|
import com.glxp.api.req.system.FilterSysRemindSetRequest;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface SysRemindMsgMapper extends BaseMapper<SysRemindMsgEntity> {
|
||||||
|
|
||||||
|
List<SysRemindMsgEntity> filterList(FilterSysRemindMsgRequest filterSysRemindMsgRequest);
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.glxp.api.dao.system;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.glxp.api.dao.BaseMapperPlus;
|
||||||
|
import com.glxp.api.dao.inv.InvPreProductDao;
|
||||||
|
import com.glxp.api.entity.inv.InvPreProductEntity;
|
||||||
|
import com.glxp.api.entity.system.SysRemindSetEntity;
|
||||||
|
import com.glxp.api.req.system.FilterSysRemindSetRequest;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface SysRemindSetMapper extends BaseMapperPlus<SysRemindSetMapper, SysRemindSetEntity, SysRemindSetEntity> {
|
||||||
|
|
||||||
|
List<SysRemindSetEntity> filterList(FilterSysRemindSetRequest filterSysRemindSetRequest);
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package com.glxp.api.entity.system;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName(value = "sys_remind_set")
|
||||||
|
public class SysRemindSetEntity {
|
||||||
|
@TableId(value = "id", type = IdType.INPUT)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@TableField(value = "`key`")
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
@TableField(value = "`name`")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@TableField(value = "`value`")
|
||||||
|
private Integer value;
|
||||||
|
|
||||||
|
@TableField(value = "`type`")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@TableField(value = "remark")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
public static final String COL_ID = "id";
|
||||||
|
|
||||||
|
public static final String COL_KEY = "key";
|
||||||
|
|
||||||
|
public static final String COL_NAME = "name";
|
||||||
|
|
||||||
|
public static final String COL_VALUE = "value";
|
||||||
|
|
||||||
|
public static final String COL_TYPE = "type";
|
||||||
|
|
||||||
|
public static final String COL_REMARK = "remark";
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package com.glxp.api.req.system;
|
||||||
|
|
||||||
|
import com.glxp.api.util.page.ListPageRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FilterSysRemindMsgRequest extends ListPageRequest {
|
||||||
|
String key;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.glxp.api.req.system;
|
||||||
|
|
||||||
|
import com.glxp.api.util.page.ListPageRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FilterSysRemindSetRequest extends ListPageRequest {
|
||||||
|
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.glxp.api.service.system;
|
||||||
|
|
||||||
|
import com.glxp.api.entity.system.SysRemindMsgEntity;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.glxp.api.req.system.FilterSysRemindMsgRequest;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface SysRemindMsgService {
|
||||||
|
|
||||||
|
List<SysRemindMsgEntity> filterList(FilterSysRemindMsgRequest filterSysRemindMsgRequest);
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.glxp.api.service.system;
|
||||||
|
|
||||||
|
import com.glxp.api.entity.system.SysRemindSetEntity;
|
||||||
|
import com.glxp.api.req.system.FilterSysRemindSetRequest;
|
||||||
|
import com.glxp.api.util.page.TableDataInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface SysRemindSetService {
|
||||||
|
|
||||||
|
List<SysRemindSetEntity> filterList(FilterSysRemindSetRequest filterSysRemindSetRequest);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package com.glxp.api.service.system.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.glxp.api.req.system.FilterSysRemindMsgRequest;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.glxp.api.dao.system.SysRemindMsgMapper;
|
||||||
|
import com.glxp.api.entity.system.SysRemindMsgEntity;
|
||||||
|
import com.glxp.api.service.system.SysRemindMsgService;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class SysRemindMsgServiceImpl implements SysRemindMsgService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
SysRemindMsgMapper sysRemindMsgMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysRemindMsgEntity> filterList(FilterSysRemindMsgRequest filterSysRemindMsgRequest) {
|
||||||
|
|
||||||
|
if (filterSysRemindMsgRequest.getPage() != null) {
|
||||||
|
int offset = (filterSysRemindMsgRequest.getPage() - 1) * filterSysRemindMsgRequest.getLimit();
|
||||||
|
PageHelper.offsetPage(offset, filterSysRemindMsgRequest.getLimit());
|
||||||
|
}
|
||||||
|
return sysRemindMsgMapper.filterList(filterSysRemindMsgRequest);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.glxp.api.service.system.impl;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.glxp.api.dao.system.SysRemindSetMapper;
|
||||||
|
import com.glxp.api.entity.system.SysRemindSetEntity;
|
||||||
|
import com.glxp.api.req.system.FilterSysRemindSetRequest;
|
||||||
|
import com.glxp.api.service.system.SysRemindSetService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class SysRemindSetServiceImpl implements SysRemindSetService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
SysRemindSetMapper sysRemindSetMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysRemindSetEntity> filterList(FilterSysRemindSetRequest filterSysRemindSetRequest) {
|
||||||
|
if (filterSysRemindSetRequest.getPage() != null) {
|
||||||
|
int offset = (filterSysRemindSetRequest.getPage() - 1) * filterSysRemindSetRequest.getLimit();
|
||||||
|
PageHelper.offsetPage(offset, filterSysRemindSetRequest.getLimit());
|
||||||
|
}
|
||||||
|
return sysRemindSetMapper.filterList(filterSysRemindSetRequest);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.glxp.api.dao.system.SysRemindMsgMapper">
|
||||||
|
<select id="filterList" parameterType="com.glxp.api.req.system.FilterSysRemindMsgRequest"
|
||||||
|
resultType="com.glxp.api.entity.system.SysRemindMsgEntity">
|
||||||
|
SELECT *
|
||||||
|
FROM sys_remind_msg
|
||||||
|
<where>
|
||||||
|
<if test="key != null and key != ''">
|
||||||
|
AND `key` like CONCAT('%', #{key}, '%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order BY id
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.glxp.api.dao.system.SysRemindSetMapper">
|
||||||
|
<select id="filterList" parameterType="com.glxp.api.req.system.FilterSysRemindSetRequest"
|
||||||
|
resultType="com.glxp.api.entity.system.SysRemindSetEntity">
|
||||||
|
SELECT *
|
||||||
|
FROM sys_remind_set
|
||||||
|
<where>
|
||||||
|
<if test="key != null and key != ''">
|
||||||
|
AND `key` like CONCAT('%', #{key}, '%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order BY id
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue