修改bug
This commit is contained in:
parent
e0ec8c9ff3
commit
601c9eab7b
|
@ -88,6 +88,26 @@ public class WjxWjxxTmlbController {
|
|||
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@ApiOperation(value="题目信息-分页列表查询", notes="题目信息-分页列表查询")
|
||||
@GetMapping(value = "/distinctList")
|
||||
public Result<IPage<WjxWjxxTmlb>> distinctList(WjxWjxxTmlb wjxWjxxTmlb,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<WjxWjxxTmlb> queryWrapper = QueryGenerator.initQueryWrapper(wjxWjxxTmlb, req.getParameterMap());
|
||||
Page<WjxWjxxTmlb> page = new Page<WjxWjxxTmlb>(pageNo, pageSize);
|
||||
queryWrapper.groupBy("wj_title,wj_score,wj_sytype,wj_type");
|
||||
IPage<WjxWjxxTmlb> pageList = wjxWjxxTmlbService.distinctList(page, queryWrapper);
|
||||
if(pageList.getRecords()!=null){
|
||||
for(WjxWjxxTmlb par:pageList.getRecords()){
|
||||
List<WjxWjxxTmxx> wjxWjxxTmxxList = wjxWjxxTmxxService.selectByMainId(par.getId());
|
||||
par.setWjxWjxxTmxxList(wjxWjxxTmxxList);
|
||||
}
|
||||
}
|
||||
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
|
|
|
@ -2,6 +2,10 @@ package org.jeecg.modules.kc.wjxWjxxTmlb.mapper;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmlb;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
@ -14,4 +18,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface WjxWjxxTmlbMapper extends BaseMapper<WjxWjxxTmlb> {
|
||||
|
||||
IPage<WjxWjxxTmlb> distinctList(Page<WjxWjxxTmlb> page,@Param(Constants.WRAPPER) QueryWrapper<WjxWjxxTmlb> queryWrapper);
|
||||
}
|
||||
|
|
|
@ -2,4 +2,9 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmlbMapper">
|
||||
|
||||
<select id="distinctList" resultType="org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmlb">
|
||||
select distinct max(id) id,wj_title,wj_score,wj_sytype,wj_type from wjx_wjxx_tmlb
|
||||
${ew.customSqlSegment}
|
||||
|
||||
</select>
|
||||
</mapper>
|
|
@ -1,5 +1,8 @@
|
|||
package org.jeecg.modules.kc.wjxWjxxTmlb.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmxx;
|
||||
import org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmlb;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
@ -50,4 +53,6 @@ public interface IWjxWjxxTmlbService extends IService<WjxWjxxTmlb> {
|
|||
List<WjxWjxxTmlb> queryByMainId(String id);
|
||||
|
||||
List<WjxWjxxTmlb> queryDjByMainId(String id);
|
||||
|
||||
IPage<WjxWjxxTmlb> distinctList(Page<WjxWjxxTmlb> page, QueryWrapper<WjxWjxxTmlb> queryWrapper);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package org.jeecg.modules.kc.wjxWjxxTmlb.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmlb;
|
||||
import org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmxx;
|
||||
|
@ -132,4 +134,9 @@ public class WjxWjxxTmlbServiceImpl extends ServiceImpl<WjxWjxxTmlbMapper, WjxWj
|
|||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<WjxWjxxTmlb> distinctList(Page<WjxWjxxTmlb> page, QueryWrapper<WjxWjxxTmlb> queryWrapper) {
|
||||
return baseMapper.distinctList(page,queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue