master
ck 5 years ago
parent a9dfe5b1a4
commit 45e3a01bd4

@ -6,5 +6,5 @@ import com.jingcheng.template.util.CommonMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface AwardRecordMapper extends CommonMapper<AwardRecord>,BaseMapper<AwardRecord> {
public interface AwardRecordMapper extends CommonMapper<AwardRecord>{
}

@ -4,8 +4,11 @@ import com.alibaba.fastjson.JSONObject;
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.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jingcheng.template.constants.Constants;
import com.jingcheng.template.mapper.AwardRecordMapper;
import com.jingcheng.template.mapper.AwardRecordVoMapper;
import com.jingcheng.template.mapper.AwardRuleMapper;
import com.jingcheng.template.mapper.UsersMapper;
import com.jingcheng.template.model.AwardRecord;
@ -37,7 +40,8 @@ public class AwardRecordServiceImpl extends BaseServiceImpl<AwardRecordMapper, A
private AwardRuleMapper awardRuleMapper;
@Resource
private UsersMapper usersMapper;
@Resource
private AwardRecordVoMapper awardRecordVoMapper;
private Logger logger = LogUtils.getBussinessLogger();
@ -201,17 +205,19 @@ public class AwardRecordServiceImpl extends BaseServiceImpl<AwardRecordMapper, A
Integer awardType = jsonObject.getInteger("awardType");
Integer pageNum = jsonObject.getInteger("pageNum");
Integer pageSize = jsonObject.getInteger("pageSize");
QueryWrapper<AwardRecord> queryWrapper = new QueryWrapper<>();
AwardRecord findAwardRecord = new AwardRecord();
// QueryWrapper<AwardRecord> queryWrapper = new QueryWrapper<>();
PageHelper.startPage(pageNum, pageSize);
if (null != awardType){
queryWrapper.ge("state", 1)
.ge("award_type",awardType);
findAwardRecord.setAwardType(awardType);
findAwardRecord.setState(Constants.STATE_VALID);
}else {
queryWrapper.ge("state", 1);
findAwardRecord.setState(Constants.STATE_VALID);
}
Page<AwardRecord> page = new Page<>(pageNum, pageSize, true);
IPage<AwardRecord> iPage = awardRecordMapper.selectPage(page,queryWrapper);
List<AwardRecord> awardRecordList = iPage.getRecords();
Long total = iPage.getTotal();
List<AwardRecord> list = awardRecordMapper.select(findAwardRecord);
PageInfo<AwardRecord> page = new PageInfo<>(list);
List<AwardRecord> awardRecordList = page.getList();
Long total = page.getTotal();
List<AwardRecordVo> awardRecordVoList = new ArrayList<>();
for (AwardRecord awardRecord:awardRecordList){
Long userId = awardRecord.getUserId();

@ -1,5 +1,8 @@
package com.jingcheng.template.util;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;

@ -21,7 +21,7 @@ spring:
#mybatis配置
mybatis:
type-aliases-package: com.oceanspot.template.util.model
type-aliases-package: com.jingcheng.template.model
mapper-locations: classpath:mapper/*.xml
configuration:
map-underscore-to-camel-case: true

@ -1,28 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ The MIT License (MIT)
~
~ Copyright (c) 2014-2016 abel533@gmail.com
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in
~ all copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
~ THE SOFTWARE.
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jingcheng.template.mapper.AwardRecordMapper">

Loading…
Cancel
Save