1、微信搜狗列表排序前端可手动调节根据创建时间
2、英语单词页面查询条件优化,一个框可以查询两个条件 3、英语单词页面排序优化,也可手动调节 4、MyBaseController类优化mybatisplus分页相关参数设置
This commit is contained in:
parent
f757d2c967
commit
d388634a23
|
|
@ -1,26 +1,17 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="英语单词" prop="englishWord">
|
||||
<el-form-item label="中英文" prop="condition">
|
||||
<el-input
|
||||
v-model="queryParams.englishWord"
|
||||
placeholder="英语单词"
|
||||
clearable
|
||||
maxlength="20"
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="中文" prop="chineseWord">
|
||||
<el-input
|
||||
v-model="queryParams.chineseWord"
|
||||
placeholder="请输入中文"
|
||||
v-model="queryParams.condition"
|
||||
placeholder="请输入中英文"
|
||||
clearable
|
||||
maxlength="10"
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="daterangeCreateTime"
|
||||
|
|
@ -106,7 +97,13 @@
|
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="wordList" @selection-change="handleSelectionChange">
|
||||
<el-table
|
||||
ref="tables"
|
||||
v-loading="loading"
|
||||
:data="wordList"
|
||||
:default-sort="defaultSort"
|
||||
@sort-change="handleSortChange"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="英语单词" align="center" prop="englishWord" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="中文" align="center" prop="chineseWord" :show-overflow-tooltip="true"/>
|
||||
|
|
@ -122,7 +119,12 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="查看次数" align="center" prop="lookCount" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
sortable="custom"
|
||||
:sort-orders="['descending', 'ascending']"
|
||||
:show-overflow-tooltip="true"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip class="item" effect="dark" content="点击查看详情" placement="top-start">
|
||||
|
|
@ -307,9 +309,12 @@ export default {
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
condition: null,
|
||||
englishWord: null,
|
||||
chineseWord: null,
|
||||
createTime: null
|
||||
createTime: null,
|
||||
isAsc: null,
|
||||
orderByColumn: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
|
|
@ -318,6 +323,10 @@ export default {
|
|||
},
|
||||
//英语一言数据
|
||||
oneEnglishData: {},
|
||||
|
||||
// 默认排序
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
|
||||
// 表单校验
|
||||
rulesEdit: {
|
||||
englishWord: [
|
||||
|
|
@ -352,6 +361,7 @@ export default {
|
|||
};
|
||||
},
|
||||
created() {
|
||||
this.resetSort()
|
||||
this.getList();
|
||||
},
|
||||
|
||||
|
|
@ -373,6 +383,12 @@ export default {
|
|||
})
|
||||
},
|
||||
|
||||
//重置排序
|
||||
resetSort() {
|
||||
this.queryParams.isAsc = this.defaultSort.order
|
||||
this.queryParams.orderByColumn = this.defaultSort.prop
|
||||
},
|
||||
|
||||
|
||||
//关闭抽屉
|
||||
handleClose(done) {
|
||||
|
|
@ -396,10 +412,14 @@ export default {
|
|||
this.queryParams.createTime = this.daterangeCreateTime[0];
|
||||
this.queryParams.endCreateTime = this.daterangeCreateTime[1];
|
||||
}
|
||||
|
||||
// this.queryParams.orderByColumn=this.defaultSort.prop
|
||||
// this.queryParams.isAsc=this.defaultSort.order
|
||||
|
||||
listWord(this.queryParams).then(response => {
|
||||
this.loading = false;
|
||||
this.wordList = response.rows;
|
||||
this.total = response.total;
|
||||
this.wordList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
|
|
@ -429,6 +449,7 @@ export default {
|
|||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetSort()
|
||||
this.daterangeCreateTime = [];
|
||||
this.queryParams.createTime = null
|
||||
this.queryParams.endCreateTime = null
|
||||
|
|
@ -447,10 +468,17 @@ export default {
|
|||
this.openAdd = true;
|
||||
this.title = "添加英语单词";
|
||||
//下拉框默认选中
|
||||
this.form.isCollect= parseInt(this.dict.type.english_collect[0].value)
|
||||
this.form.isCollect = parseInt(this.dict.type.english_collect[0].value)
|
||||
this.form.top = parseInt(this.dict.type.english_top[1].value)
|
||||
|
||||
},
|
||||
|
||||
/** 排序触发事件 */
|
||||
handleSortChange(column, prop, order) {
|
||||
this.queryParams.isAsc = column.order;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
|
|
|
|||
|
|
@ -85,12 +85,40 @@
|
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="weixinsougouList" @selection-change="handleSelectionChange">
|
||||
<el-table
|
||||
ref="tables"
|
||||
v-loading="loading"
|
||||
:data="weixinsougouList"
|
||||
@selection-change="handleSelectionChange"
|
||||
:default-sort="defaultSort"
|
||||
@sort-change="handleSortChange">
|
||||
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="props">
|
||||
|
||||
<el-form label-position="left" class="demo-table-expand">
|
||||
<el-form-item label="文章标题">
|
||||
<a :href=props.row.url target="_blank">{{ props.row.title }}</a>
|
||||
</el-form-item>
|
||||
<el-form-item label="文章内容">
|
||||
<span>{{ props.row.content }}</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="文章标题" align="center" prop="title" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="简略的内容" align="center" prop="content" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="文章来源" align="center" prop="source" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:show-overflow-tooltip="true"
|
||||
sortable="custom"
|
||||
:sort-orders="['descending', 'ascending']"
|
||||
/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
|
@ -143,18 +171,24 @@ export default {
|
|||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
|
||||
// 默认排序
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
isAsc: 'desc',
|
||||
title: null,
|
||||
content: null,
|
||||
source: null,
|
||||
createTime: null,
|
||||
condition: null //综合条件
|
||||
condition: null, //综合条件
|
||||
isAsc: null,
|
||||
orderByColumn: null
|
||||
},
|
||||
|
||||
|
||||
//检查查询范围
|
||||
daterangeCreateTime: [],
|
||||
|
||||
|
|
@ -165,6 +199,7 @@ export default {
|
|||
};
|
||||
},
|
||||
created() {
|
||||
this.resetSort()
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -175,6 +210,8 @@ export default {
|
|||
this.queryParams.createTime = this.daterangeCreateTime[0];
|
||||
this.queryParams.endCreateTime = this.daterangeCreateTime[1];
|
||||
}
|
||||
|
||||
|
||||
listWeixinsougou(this.queryParams).then(response => {
|
||||
this.weixinsougouList = response.data.dataList;
|
||||
this.total = response.data.totalCount;
|
||||
|
|
@ -182,6 +219,18 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
/** 排序触发事件 */
|
||||
handleSortChange(column, prop, order) {
|
||||
this.queryParams.isAsc = column.order;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
//重置排序
|
||||
resetSort() {
|
||||
this.queryParams.isAsc = this.defaultSort.order
|
||||
this.queryParams.orderByColumn = this.defaultSort.prop
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
|
@ -189,6 +238,7 @@ export default {
|
|||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetSort()
|
||||
this.daterangeCreateTime = [];
|
||||
this.queryParams.createTime = null
|
||||
this.queryParams.endCreateTime = null
|
||||
|
|
@ -222,3 +272,7 @@ export default {
|
|||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,32 +1,45 @@
|
|||
package com.xjs.web;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.utils.sql.SqlUtil;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.page.PageDomain;
|
||||
import com.ruoyi.common.core.web.page.TableSupport;
|
||||
|
||||
/**
|
||||
* 自定义通用controller
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2021-12-31
|
||||
* @since 2021-12-31
|
||||
*/
|
||||
public class MyBaseController extends BaseController {
|
||||
public class MyBaseController<T> extends BaseController {
|
||||
|
||||
/**
|
||||
* mp分页封装
|
||||
* mp分页封装
|
||||
*
|
||||
* @return Page
|
||||
*/
|
||||
protected Page startPageMP( ){
|
||||
protected Page<T> startPageMP() {
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
Page page = new Page<>();
|
||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
||||
{
|
||||
Page<T> page = new Page<>();
|
||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) {
|
||||
page.setSize(pageSize);
|
||||
page.setCurrent(pageNum);
|
||||
}
|
||||
String orderByColumn = pageDomain.getOrderByColumn();
|
||||
if (StringUtils.isNotNull(orderByColumn)) {
|
||||
String orderBy = SqlUtil.escapeOrderBySql(StringUtils.toUnderScoreCase(orderByColumn));
|
||||
|
||||
if (pageDomain.getIsAsc().equals("asc")) {
|
||||
page.addOrder(OrderItem.asc(orderBy));
|
||||
} else {
|
||||
page.addOrder(OrderItem.desc(orderBy));
|
||||
}
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.xjs.word.controller;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
|
|
@ -31,13 +30,14 @@ import java.util.List;
|
|||
@RestController
|
||||
@RequestMapping("/word")
|
||||
@Api(tags = "业务模块-英语管理")
|
||||
public class EnglishWordController extends MyBaseController {
|
||||
public class EnglishWordController extends MyBaseController<EnglishWord> {
|
||||
@Autowired
|
||||
private IEnglishWordService englishWordService;
|
||||
|
||||
|
||||
/**
|
||||
* 英语单词收藏夹
|
||||
*
|
||||
* @return TableDataInfo
|
||||
*/
|
||||
@RequiresPermissions("english:word:collect")
|
||||
|
|
@ -45,7 +45,7 @@ public class EnglishWordController extends MyBaseController {
|
|||
@Log(title = "查看单词夹")
|
||||
@ApiOperation("英语单词收藏夹")
|
||||
public AjaxResult collect() {
|
||||
IPage<EnglishWord> englishWordList=englishWordService.getEnglishWordByCollect(startPageMP());
|
||||
IPage<EnglishWord> englishWordList = englishWordService.getEnglishWordByCollect(startPageMP());
|
||||
return AjaxResult.success(englishWordList);
|
||||
}
|
||||
|
||||
|
|
@ -69,21 +69,20 @@ public class EnglishWordController extends MyBaseController {
|
|||
return AjaxResult.success(englishWordService.selectById(id));
|
||||
}
|
||||
|
||||
|
||||
//------------------------代码自动生成-----------------------------------
|
||||
|
||||
/**
|
||||
* 查询英语单词列表
|
||||
*/
|
||||
@RequiresPermissions("english:word:list")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询英语单词列表")
|
||||
public TableDataInfo list(@Validated({SelectGroup.class}) EnglishWord englishWord) {
|
||||
startPage();
|
||||
List<EnglishWord> list = englishWordService.selectEnglishWordList(englishWord);
|
||||
return getDataTable(list);
|
||||
public AjaxResult list(@Validated({SelectGroup.class}) EnglishWord englishWord) {
|
||||
return AjaxResult.success(englishWordService.selectEnglishWordList(startPageMP(), englishWord));
|
||||
}
|
||||
|
||||
|
||||
//------------------------代码自动生成-----------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* 导出英语单词列表
|
||||
*/
|
||||
|
|
@ -98,7 +97,6 @@ public class EnglishWordController extends MyBaseController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增英语单词
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,14 +2,18 @@ package com.xjs.word.domain;
|
|||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.xjs.entity.BaseEntity;
|
||||
import com.xjs.validation.group.AddGroup;
|
||||
import com.xjs.validation.group.SelectGroup;
|
||||
import com.xjs.validation.group.UpdateGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -20,7 +24,9 @@ import java.util.Date;
|
|||
*/
|
||||
@Data
|
||||
@TableName("english_word")
|
||||
public class EnglishWord {
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
public class EnglishWord extends BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
|
|
@ -84,7 +90,5 @@ public class EnglishWord {
|
|||
private Date createTime;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private Date endCreateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.xjs.word.service;
|
|||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xjs.word.domain.EnglishWord;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -12,7 +13,7 @@ import java.util.List;
|
|||
* @author xjs
|
||||
* @date 2021-12-29
|
||||
*/
|
||||
public interface IEnglishWordService {
|
||||
public interface IEnglishWordService extends IService<EnglishWord> {
|
||||
|
||||
/**
|
||||
* 查询收藏的单词列表
|
||||
|
|
@ -30,16 +31,22 @@ public interface IEnglishWordService {
|
|||
|
||||
EnglishWord selectById(Long id);
|
||||
|
||||
|
||||
//------------------------代码自动生成-----------------------------------
|
||||
|
||||
/**
|
||||
* 查询英语单词列表
|
||||
* 查询英语单词列表(mybatis分页)
|
||||
*
|
||||
* @param englishWord 英语单词
|
||||
* @return 英语单词集合
|
||||
*/
|
||||
public List<EnglishWord> selectEnglishWordList(EnglishWord englishWord);
|
||||
List<EnglishWord> selectEnglishWordList(EnglishWord englishWord);
|
||||
|
||||
/**
|
||||
* 查询英语单词列表(mybatis-plus分页)
|
||||
*
|
||||
* @param page 分页条件
|
||||
* @param englishWord 查询条件
|
||||
* @return 英语单词集合
|
||||
*/
|
||||
IPage<EnglishWord> selectEnglishWordList(Page<EnglishWord> page,EnglishWord englishWord);
|
||||
|
||||
/**
|
||||
* 新增英语单词
|
||||
|
|
@ -65,6 +72,11 @@ public interface IEnglishWordService {
|
|||
*/
|
||||
public int deleteEnglishWordByIds(Long[] ids);
|
||||
|
||||
|
||||
//------------------------代码自动生成-----------------------------------
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除英语单词信息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.core.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.redis.service.RedisService;
|
||||
|
|
@ -16,6 +17,7 @@ import com.xjs.word.domain.EnglishWord;
|
|||
import com.xjs.word.mapper.EnglishWordMapper;
|
||||
import com.xjs.word.service.IEnglishWordService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -31,11 +33,11 @@ import static com.xjs.consts.RedisConst.TRAN_DICT_EXPIRE;
|
|||
* 英语单词Service业务层处理
|
||||
*
|
||||
* @author xjs
|
||||
* @since 2021-12-29
|
||||
* @since 2021-12-29
|
||||
*/
|
||||
@Service
|
||||
@Log4j2
|
||||
public class EnglishWordServiceImpl implements IEnglishWordService {
|
||||
public class EnglishWordServiceImpl extends ServiceImpl<EnglishWordMapper, EnglishWord> implements IEnglishWordService {
|
||||
@Resource
|
||||
private EnglishWordMapper englishWordMapper;
|
||||
@Autowired
|
||||
|
|
@ -52,7 +54,8 @@ public class EnglishWordServiceImpl implements IEnglishWordService {
|
|||
.eq("is_collect", COLLECT)
|
||||
.orderByDesc("top")
|
||||
.orderByDesc("create_time");
|
||||
return englishWordMapper.selectPage(page,wr);
|
||||
|
||||
return englishWordMapper.selectPage(page, wr);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -73,7 +76,7 @@ public class EnglishWordServiceImpl implements IEnglishWordService {
|
|||
String hkey = englishWord.getEnglishWord() + ":" + id;
|
||||
Object value = redisService.getCacheMapValue(TRAN_DICT, hkey);
|
||||
if (Objects.nonNull(value)) {
|
||||
return (EnglishWord)value;
|
||||
return (EnglishWord) value;
|
||||
}
|
||||
R<TranslationVo> r = remoteTranDIctFeign.tranDict(englishWord.getEnglishWord());
|
||||
if (r.getCode() != R.FAIL) {
|
||||
|
|
@ -110,7 +113,7 @@ public class EnglishWordServiceImpl implements IEnglishWordService {
|
|||
.eq("english_word", englishWord.getContent()));
|
||||
List<EnglishWord> chineseWordList = englishWordMapper.selectList(new QueryWrapper<EnglishWord>()
|
||||
.eq("chinese_word", englishWord.getContent()));
|
||||
if (CollUtil.isNotEmpty(englishWordList)|| CollUtil.isNotEmpty(chineseWordList)) {
|
||||
if (CollUtil.isNotEmpty(englishWordList) || CollUtil.isNotEmpty(chineseWordList)) {
|
||||
throw new BusinessException("该词汇已存在!!!!");
|
||||
}
|
||||
|
||||
|
|
@ -172,8 +175,6 @@ public class EnglishWordServiceImpl implements IEnglishWordService {
|
|||
}
|
||||
|
||||
|
||||
//------------------------代码自动生成-----------------------------------
|
||||
|
||||
/**
|
||||
* 查询英语单词列表
|
||||
*
|
||||
|
|
@ -185,6 +186,22 @@ public class EnglishWordServiceImpl implements IEnglishWordService {
|
|||
return englishWordMapper.selectEnglishWordList(englishWord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<EnglishWord> selectEnglishWordList(Page<EnglishWord> page, EnglishWord englishWord) {
|
||||
String condition = englishWord.getCondition();
|
||||
|
||||
QueryWrapper<EnglishWord> wr = new QueryWrapper<>();
|
||||
wr.and(StringUtils.isNotEmpty(condition), obj -> {
|
||||
obj.like("english_word", condition).or().like("chinese_word", condition);
|
||||
});
|
||||
|
||||
//wr.like("english_word", condition).or().like("chinese_word", condition);
|
||||
|
||||
return this.page(page, wr);
|
||||
}
|
||||
|
||||
|
||||
//------------------------代码自动生成-----------------------------------
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ public class WeiXinSouGouServiceImpl extends ServiceImpl<WeiXinSouGouMapper, Wei
|
|||
.op("ct")
|
||||
.field(WeiXinSouGou::getSource,weiXinSouGou.getSource())
|
||||
.op("ct")
|
||||
.field(WeiXinSouGou::getCreateTime,weiXinSouGou.getCreateTime(),weiXinSouGou.getEndCreateTime())
|
||||
.op("bt")
|
||||
.field(pageDomain.getOrderByColumn(),weiXinSouGou.getCreateTime(),weiXinSouGou.getEndCreateTime())
|
||||
.op("bt")//构建bt区间查询
|
||||
.orderBy(WeiXinSouGou::getCreateTime,pageDomain.getIsAsc())
|
||||
.build();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue