提交 0064e5af 编写于 作者: F fengyw

架构调整

上级 9ba2295e
package com.roncoo.education.user.common;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.user.feign.interfaces.vo.LecturerProfitVO;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.xssf.streaming.SXSSFCell;
import org.apache.poi.xssf.streaming.SXSSFRow;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.SimpleDateFormat;
/**
* @author WY
*/
public final class ReportExcelUtil {
private final static Logger logger = LoggerFactory.getLogger(ReportExcelUtil.class);
public static void exportExcelForLecturerProfit(HttpServletResponse response, Page<LecturerProfitVO> result) throws IOException {
// 创建一个workbook 对应一个excel文件
final SXSSFWorkbook workBook = new SXSSFWorkbook();
SXSSFSheet sheet = workBook.createSheet("讲师分润报表");
// 列名和列宽
String[] names = {"讲师名称", "银行卡号", "银行名称", "银行开户名", "讲师分润(元)", "平台分润(元)", "时间"};// 表头
Integer[] widths = {25, 15, 15, 25, 25, 25, 25};// 列宽
// 创建第一行
SXSSFRow row = sheet.createRow(0);
// 设置第一行样式
CellStyle headStyle = workBook.createCellStyle();
headStyle.setAlignment(HorizontalAlignment.CENTER_SELECTION);// 水平居中
headStyle.setVerticalAlignment(VerticalAlignment.CENTER);// 垂直居中
// 设置第一行字体
Font headFont = workBook.createFont();
headFont.setBold(true);
headStyle.setFont(headFont);
// 设置第一行单元格内容、单元格样式
for (int i = 0; i < names.length; i++) {
SXSSFCell cell = row.createCell(i);
cell.setCellValue(names[i]);
cell.setCellStyle(headStyle);
sheet.setColumnWidth(i, widths[i] * 256);
}
// 从第二行开始遍历出分润记录表的数据,再写入单元格
SXSSFRow row1 = sheet.createRow(1);
int r = 1;
for (LecturerProfitVO bean : result.getList()) {
row1 = sheet.createRow(r++);
row1.createCell(0).setCellValue(bean.getLecturerVO().getLecturerName());
row1.createCell(1).setCellValue(bean.getBankCardNo());
row1.createCell(2).setCellValue(bean.getBankName());
row1.createCell(3).setCellValue(bean.getBankUserName());
row1.createCell(4).setCellValue(bean.getLecturerProfit().doubleValue());
row1.createCell(5).setCellValue(bean.getPlatformProfit().doubleValue());
row1.createCell(6).setCellValue(new SimpleDateFormat("yyyy/MM/dd").format(bean.getGmtCreate()));
}
try {
workBook.write(response.getOutputStream());
response.getOutputStream().flush();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (response.getOutputStream() != null)
response.getOutputStream().close();
if (workBook != null)
workBook.close();
}
}
}
package com.roncoo.education.user.dao;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.user.dao.impl.mapper.entity.LecturerAudit;
import com.roncoo.education.user.dao.impl.mapper.entity.LecturerAuditExample;
public interface LecturerAuditDao {
int save(LecturerAudit record);
int deleteById(Long id);
int updateById(LecturerAudit record);
LecturerAudit getById(Long id);
Page<LecturerAudit> listForPage(int pageCurrent, int pageSize, LecturerAuditExample example);
/**
* 根据讲师编号查询讲师账户信息
*
* @param orgNo
* @param lecturerUserNo
* @return
* @author LHR
*/
LecturerAudit getByLecturerUserNo(Long lecturerUserNo);
}
package com.roncoo.education.user.dao;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.user.dao.impl.mapper.entity.LecturerExt;
import com.roncoo.education.user.dao.impl.mapper.entity.LecturerExtExample;
public interface LecturerExtDao {
int save(LecturerExt record);
int deleteById(Long id);
int updateById(LecturerExt record);
LecturerExt getById(Long id);
Page<LecturerExt> listForPage(int pageCurrent, int pageSize, LecturerExtExample example);
/**
* 根据传入讲师用户编号获取讲师账户信息
*
* @param lecturerUserNo
* @return
*/
LecturerExt getByLecturerUserNo(Long lecturerUserNo);
/**
* 根据传入讲师用户编号更新讲师账户信息
*
* @param lecturerUserNo
* @return
* @author wuyun
*/
int updateByLecturerUserNo(LecturerExt record);
}
package com.roncoo.education.user.dao;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.user.dao.impl.mapper.entity.LecturerProfit;
import com.roncoo.education.user.dao.impl.mapper.entity.LecturerProfitExample;
public interface LecturerProfitDao {
int save(LecturerProfit record);
int deleteById(Long id);
int updateById(LecturerProfit record);
LecturerProfit getById(Long id);
Page<LecturerProfit> listForPage(int pageCurrent, int pageSize, LecturerProfitExample example);
}
package com.roncoo.education.user.dao;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.user.dao.impl.mapper.entity.Platform;
import com.roncoo.education.user.dao.impl.mapper.entity.PlatformExample;
public interface PlatformDao {
int save(Platform record);
int deleteById(Long id);
int updateById(Platform record);
Platform getById(Long id);
Page<Platform> listForPage(int pageCurrent, int pageSize, PlatformExample example);
Platform getByClientId(String clientId);
Platform getByClientName(String clientName);
}
package com.roncoo.education.user.dao;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.user.dao.impl.mapper.entity.SendSmsLog;
import com.roncoo.education.user.dao.impl.mapper.entity.SendSmsLogExample;
public interface SendSmsLogDao {
int save(SendSmsLog record);
int deleteById(Long id);
int updateById(SendSmsLog record);
SendSmsLog getById(Long id);
Page<SendSmsLog> listForPage(int pageCurrent, int pageSize, SendSmsLogExample example);
}
package com.roncoo.education.user.dao;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.user.dao.impl.mapper.entity.UserExt;
import com.roncoo.education.user.dao.impl.mapper.entity.UserExtExample;
public interface UserExtDao {
int save(UserExt record);
int deleteById(Long id);
int updateById(UserExt record);
UserExt getById(Long id);
Page<UserExt> listForPage(int pageCurrent, int pageSize, UserExtExample example);
UserExt getByUserNo(Long userNo);
int updateByUserNo(UserExt record);
/**
* 根据手机号码获取用户信息
*
* @param mobile
* @return
* @author wuyun
*/
UserExt getByMobile(String mobile);
/**
* 获取用户注册量
*
* @param date
* @return
* @author wuyun
*/
Integer sumByCountOrders(String date);
}
package com.roncoo.education.user.dao;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.user.dao.impl.mapper.entity.UserLogLogin;
import com.roncoo.education.user.dao.impl.mapper.entity.UserLogLoginExample;
public interface UserLogLoginDao {
int save(UserLogLogin record);
int deleteById(Long id);
int updateById(UserLogLogin record);
UserLogLogin getById(Long id);
Page<UserLogLogin> listForPage(int pageCurrent, int pageSize, UserLogLoginExample example);
}
package com.roncoo.education.user.dao;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.user.dao.impl.mapper.entity.UserLogModified;
import com.roncoo.education.user.dao.impl.mapper.entity.UserLogModifiedExample;
public interface UserLogModifiedDao {
int save(UserLogModified record);
int deleteById(Long id);
int updateById(UserLogModified record);
UserLogModified getById(Long id);
Page<UserLogModified> listForPage(int pageCurrent, int pageSize, UserLogModifiedExample example);
}
package com.roncoo.education.user.dao.impl;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.common.core.base.PageUtil;
import com.roncoo.education.common.core.tools.IdWorker;
import com.roncoo.education.user.dao.LecturerAuditDao;
import com.roncoo.education.user.dao.impl.mapper.LecturerAuditMapper;
import com.roncoo.education.user.dao.impl.mapper.entity.LecturerAudit;
import com.roncoo.education.user.dao.impl.mapper.entity.LecturerAuditExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class LecturerAuditDaoImpl implements LecturerAuditDao {
@Autowired
private LecturerAuditMapper lecturerAuditMapper;
@Override
public int save(LecturerAudit record) {
record.setId(IdWorker.getId());
return this.lecturerAuditMapper.insertSelective(record);
}
@Override
public int deleteById(Long id) {
return this.lecturerAuditMapper.deleteByPrimaryKey(id);
}
@Override
public int updateById(LecturerAudit record) {
record.setGmtCreate(null);
record.setGmtModified(null);
return this.lecturerAuditMapper.updateByPrimaryKeySelective(record);
}
@Override
public LecturerAudit getById(Long id) {
return this.lecturerAuditMapper.selectByPrimaryKey(id);
}
@Override
public Page<LecturerAudit> listForPage(int pageCurrent, int pageSize, LecturerAuditExample example) {
int count = this.lecturerAuditMapper.countByExample(example);
pageSize = PageUtil.checkPageSize(pageSize);
pageCurrent = PageUtil.checkPageCurrent(count, pageSize, pageCurrent);
int totalPage = PageUtil.countTotalPage(count, pageSize);
example.setLimitStart(PageUtil.countOffset(pageCurrent, pageSize));
example.setPageSize(pageSize);
return new Page<LecturerAudit>(count, totalPage, pageCurrent, pageSize, this.lecturerAuditMapper.selectByExample(example));
}
@Override
public LecturerAudit getByLecturerUserNo(Long lecturerUserNo) {
LecturerAuditExample example = new LecturerAuditExample();
example.createCriteria().andLecturerUserNoEqualTo(lecturerUserNo);
List<LecturerAudit> list = this.lecturerAuditMapper.selectByExample(example);
if (list.isEmpty()) {
return null;
}
return list.get(0);
}
}
package com.roncoo.education.user.dao.impl;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.common.core.base.PageUtil;
import com.roncoo.education.common.core.tools.IdWorker;
import com.roncoo.education.user.dao.LecturerExtDao;
import com.roncoo.education.user.dao.impl.mapper.LecturerExtMapper;
import com.roncoo.education.user.dao.impl.mapper.entity.LecturerExt;
import com.roncoo.education.user.dao.impl.mapper.entity.LecturerExtExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class LecturerExtDaoImpl implements LecturerExtDao {
@Autowired
private LecturerExtMapper lecturerExtMapper;
@Override
public int save(LecturerExt record) {
record.setId(IdWorker.getId());
return this.lecturerExtMapper.insertSelective(record);
}
@Override
public int deleteById(Long id) {
return this.lecturerExtMapper.deleteByPrimaryKey(id);
}
@Override
public int updateById(LecturerExt record) {
return this.lecturerExtMapper.updateByPrimaryKeySelective(record);
}
@Override
public LecturerExt getById(Long id) {
return this.lecturerExtMapper.selectByPrimaryKey(id);
}
@Override
public Page<LecturerExt> listForPage(int pageCurrent, int pageSize, LecturerExtExample example) {
int count = this.lecturerExtMapper.countByExample(example);
pageSize = PageUtil.checkPageSize(pageSize);
pageCurrent = PageUtil.checkPageCurrent(count, pageSize, pageCurrent);
int totalPage = PageUtil.countTotalPage(count, pageSize);
example.setLimitStart(PageUtil.countOffset(pageCurrent, pageSize));
example.setPageSize(pageSize);
return new Page<LecturerExt>(count, totalPage, pageCurrent, pageSize, this.lecturerExtMapper.selectByExample(example));
}
/**
* 根据传入讲师用户编号获取讲师信息
*/
@Override
public LecturerExt getByLecturerUserNo(Long lecturerUserNo) {
LecturerExtExample example = new LecturerExtExample();
LecturerExtExample.Criteria criteria = example.createCriteria();
criteria.andLecturerUserNoEqualTo(lecturerUserNo);
List<LecturerExt> resultList = this.lecturerExtMapper.selectByExample(example);
if (resultList.isEmpty()) {
return null;
}
return resultList.get(0);
}
@Override
public int updateByLecturerUserNo(LecturerExt record) {
record.setGmtCreate(null);
record.setGmtModified(null);
LecturerExtExample example = new LecturerExtExample();
LecturerExtExample.Criteria c = example.createCriteria();
c.andLecturerUserNoEqualTo(record.getLecturerUserNo());
return this.lecturerExtMapper.updateByExampleSelective(record, example);
}
}
package com.roncoo.education.user.dao.impl;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.common.core.base.PageUtil;
import com.roncoo.education.common.core.tools.IdWorker;
import com.roncoo.education.user.dao.LecturerProfitDao;
import com.roncoo.education.user.dao.impl.mapper.LecturerProfitMapper;
import com.roncoo.education.user.dao.impl.mapper.entity.LecturerProfit;
import com.roncoo.education.user.dao.impl.mapper.entity.LecturerProfitExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class LecturerProfitDaoImpl implements LecturerProfitDao {
@Autowired
private LecturerProfitMapper lecturerProfitMapper;
public int save(LecturerProfit record) {
record.setId(IdWorker.getId());
return this.lecturerProfitMapper.insertSelective(record);
}
public int deleteById(Long id) {
return this.lecturerProfitMapper.deleteByPrimaryKey(id);
}
public int updateById(LecturerProfit record) {
return this.lecturerProfitMapper.updateByPrimaryKeySelective(record);
}
public LecturerProfit getById(Long id) {
return this.lecturerProfitMapper.selectByPrimaryKey(id);
}
public Page<LecturerProfit> listForPage(int pageCurrent, int pageSize, LecturerProfitExample example) {
int count = this.lecturerProfitMapper.countByExample(example);
pageSize = PageUtil.checkPageSize(pageSize);
pageCurrent = PageUtil.checkPageCurrent(count, pageSize, pageCurrent);
int totalPage = PageUtil.countTotalPage(count, pageSize);
example.setLimitStart(PageUtil.countOffset(pageCurrent, pageSize));
example.setPageSize(pageSize);
return new Page<LecturerProfit>(count, totalPage, pageCurrent, pageSize, this.lecturerProfitMapper.selectByExample(example));
}
}
package com.roncoo.education.user.dao.impl;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.common.core.base.PageUtil;
import com.roncoo.education.common.core.tools.IdWorker;
import com.roncoo.education.user.dao.PlatformDao;
import com.roncoo.education.user.dao.impl.mapper.PlatformMapper;
import com.roncoo.education.user.dao.impl.mapper.entity.Platform;
import com.roncoo.education.user.dao.impl.mapper.entity.PlatformExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class PlatformDaoImpl implements PlatformDao {
@Autowired
private PlatformMapper platformMapper;
@Override
public int save(Platform record) {
record.setId(IdWorker.getId());
return this.platformMapper.insertSelective(record);
}
@Override
public int deleteById(Long id) {
return this.platformMapper.deleteByPrimaryKey(id);
}
@Override
public int updateById(Platform record) {
return this.platformMapper.updateByPrimaryKeySelective(record);
}
@Override
public Platform getById(Long id) {
return this.platformMapper.selectByPrimaryKey(id);
}
@Override
public Page<Platform> listForPage(int pageCurrent, int pageSize, PlatformExample example) {
int count = this.platformMapper.countByExample(example);
pageSize = PageUtil.checkPageSize(pageSize);
pageCurrent = PageUtil.checkPageCurrent(count, pageSize, pageCurrent);
int totalPage = PageUtil.countTotalPage(count, pageSize);
example.setLimitStart(PageUtil.countOffset(pageCurrent, pageSize));
example.setPageSize(pageSize);
return new Page<Platform>(count, totalPage, pageCurrent, pageSize,
this.platformMapper.selectByExample(example));
}
@Override
public Platform getByClientId(String clientId) {
PlatformExample example = new PlatformExample();
example.createCriteria().andClientIdEqualTo(clientId);
List<Platform> list = this.platformMapper.selectByExample(example);
if (list.isEmpty()) {
return null;
}
return list.get(0);
}
@Override
public Platform getByClientName(String clientName) {
PlatformExample example = new PlatformExample();
example.createCriteria().andClientNameEqualTo(clientName);
List<Platform> list = this.platformMapper.selectByExample(example);
if (list.isEmpty()) {
return null;
}
return list.get(0);
}
}
package com.roncoo.education.user.dao.impl;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.common.core.base.PageUtil;
import com.roncoo.education.common.core.tools.IdWorker;
import com.roncoo.education.user.dao.SendSmsLogDao;
import com.roncoo.education.user.dao.impl.mapper.SendSmsLogMapper;
import com.roncoo.education.user.dao.impl.mapper.entity.SendSmsLog;
import com.roncoo.education.user.dao.impl.mapper.entity.SendSmsLogExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class SendSmsLogDaoImpl implements SendSmsLogDao {
@Autowired
private SendSmsLogMapper sendSmsLogMapper;
public int save(SendSmsLog record) {
record.setId(IdWorker.getId());
return this.sendSmsLogMapper.insertSelective(record);
}
public int deleteById(Long id) {
return this.sendSmsLogMapper.deleteByPrimaryKey(id);
}
public int updateById(SendSmsLog record) {
return this.sendSmsLogMapper.updateByPrimaryKeySelective(record);
}
public SendSmsLog getById(Long id) {
return this.sendSmsLogMapper.selectByPrimaryKey(id);
}
public Page<SendSmsLog> listForPage(int pageCurrent, int pageSize, SendSmsLogExample example) {
int count = this.sendSmsLogMapper.countByExample(example);
pageSize = PageUtil.checkPageSize(pageSize);
pageCurrent = PageUtil.checkPageCurrent(count, pageSize, pageCurrent);
int totalPage = PageUtil.countTotalPage(count, pageSize);
example.setLimitStart(PageUtil.countOffset(pageCurrent, pageSize));
example.setPageSize(pageSize);
return new Page<SendSmsLog>(count, totalPage, pageCurrent, pageSize, this.sendSmsLogMapper.selectByExample(example));
}
}
package com.roncoo.education.user.dao.impl;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.common.core.base.PageUtil;
import com.roncoo.education.common.core.tools.IdWorker;
import com.roncoo.education.user.dao.UserExtDao;
import com.roncoo.education.user.dao.impl.mapper.UserExtMapper;
import com.roncoo.education.user.dao.impl.mapper.entity.UserExt;
import com.roncoo.education.user.dao.impl.mapper.entity.UserExtExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Map;
@Repository
public class UserExtDaoImpl implements UserExtDao {
@Autowired
private UserExtMapper userExtMapper;
@Autowired
private JdbcTemplate jdbcTemplate;
@Override
public int save(UserExt record) {
record.setId(IdWorker.getId());
return this.userExtMapper.insertSelective(record);
}
@Override
public int deleteById(Long id) {
return this.userExtMapper.deleteByPrimaryKey(id);
}
@Override
public int updateById(UserExt record) {
return this.userExtMapper.updateByPrimaryKeySelective(record);
}
@Override
public UserExt getById(Long id) {
return this.userExtMapper.selectByPrimaryKey(id);
}
@Override
public Page<UserExt> listForPage(int pageCurrent, int pageSize, UserExtExample example) {
int count = this.userExtMapper.countByExample(example);
pageSize = PageUtil.checkPageSize(pageSize);
pageCurrent = PageUtil.checkPageCurrent(count, pageSize, pageCurrent);
int totalPage = PageUtil.countTotalPage(count, pageSize);
example.setLimitStart(PageUtil.countOffset(pageCurrent, pageSize));
example.setPageSize(pageSize);
return new Page<UserExt>(count, totalPage, pageCurrent, pageSize, this.userExtMapper.selectByExample(example));
}
@Override
public UserExt getByUserNo(Long userNo) {
UserExtExample example = new UserExtExample();
UserExtExample.Criteria criteria = example.createCriteria();
criteria.andUserNoEqualTo(userNo);
List<UserExt> list = this.userExtMapper.selectByExample(example);
if (list.isEmpty()) {
return null;
}
return list.get(0);
}
@Override
public int updateByUserNo(UserExt record) {
UserExtExample example = new UserExtExample();
example.createCriteria().andUserNoEqualTo(record.getUserNo());
return this.userExtMapper.updateByExampleSelective(record, example);
}
@Override
public UserExt getByMobile(String mobile) {
UserExtExample example = new UserExtExample();
UserExtExample.Criteria c = example.createCriteria();
c.andMobileEqualTo(mobile);
List<UserExt> list = this.userExtMapper.selectByExample(example);
if (list.size() < 0 || list.isEmpty()) {
return null;
}
return list.get(0);
}
/**
* 获取用户注册量
*/
@Override
public Integer sumByCountOrders(String date) {
StringBuilder builder = new StringBuilder();
builder.append("select count(*) as count from user_ext where");
builder.append(" status_id = 1 ");
builder.append("and gmt_create >= '").append(date).append(" 00:00:00' ");
builder.append("and gmt_create <= '").append(date).append(" 23:59:59'");
String sql = builder.toString();
Integer count = 0;
Map<String, Object> map = jdbcTemplate.queryForMap(sql);
if (!StringUtils.isEmpty(map.get("count"))) {
count = Integer.valueOf(String.valueOf(map.get("count")));
}
return count;
}
}
package com.roncoo.education.user.dao.impl;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.common.core.base.PageUtil;
import com.roncoo.education.common.core.tools.IdWorker;
import com.roncoo.education.user.dao.UserLogLoginDao;
import com.roncoo.education.user.dao.impl.mapper.UserLogLoginMapper;
import com.roncoo.education.user.dao.impl.mapper.entity.UserLogLogin;
import com.roncoo.education.user.dao.impl.mapper.entity.UserLogLoginExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class UserLogLoginDaoImpl implements UserLogLoginDao {
@Autowired
private UserLogLoginMapper userLogLoginMapper;
public int save(UserLogLogin record) {
record.setId(IdWorker.getId());
return this.userLogLoginMapper.insertSelective(record);
}
public int deleteById(Long id) {
return this.userLogLoginMapper.deleteByPrimaryKey(id);
}
public int updateById(UserLogLogin record) {
return this.userLogLoginMapper.updateByPrimaryKeySelective(record);
}
public UserLogLogin getById(Long id) {
return this.userLogLoginMapper.selectByPrimaryKey(id);
}
public Page<UserLogLogin> listForPage(int pageCurrent, int pageSize, UserLogLoginExample example) {
int count = this.userLogLoginMapper.countByExample(example);
pageSize = PageUtil.checkPageSize(pageSize);
pageCurrent = PageUtil.checkPageCurrent(count, pageSize, pageCurrent);
int totalPage = PageUtil.countTotalPage(count, pageSize);
example.setLimitStart(PageUtil.countOffset(pageCurrent, pageSize));
example.setPageSize(pageSize);
return new Page<UserLogLogin>(count, totalPage, pageCurrent, pageSize, this.userLogLoginMapper.selectByExample(example));
}
}
package com.roncoo.education.user.dao.impl;
import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.common.core.base.PageUtil;
import com.roncoo.education.common.core.tools.IdWorker;
import com.roncoo.education.user.dao.UserLogModifiedDao;
import com.roncoo.education.user.dao.impl.mapper.UserLogModifiedMapper;
import com.roncoo.education.user.dao.impl.mapper.entity.UserLogModified;
import com.roncoo.education.user.dao.impl.mapper.entity.UserLogModifiedExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class UserLogModifiedDaoImpl implements UserLogModifiedDao {
@Autowired
private UserLogModifiedMapper userLogModifiedMapper;
public int save(UserLogModified record) {
record.setId(IdWorker.getId());
return this.userLogModifiedMapper.insertSelective(record);
}
public int deleteById(Long id) {
return this.userLogModifiedMapper.deleteByPrimaryKey(id);
}
public int updateById(UserLogModified record) {
return this.userLogModifiedMapper.updateByPrimaryKeySelective(record);
}
public UserLogModified getById(Long id) {
return this.userLogModifiedMapper.selectByPrimaryKey(id);
}
public Page<UserLogModified> listForPage(int pageCurrent, int pageSize, UserLogModifiedExample example) {
int count = this.userLogModifiedMapper.countByExample(example);
pageSize = PageUtil.checkPageSize(pageSize);
pageCurrent = PageUtil.checkPageCurrent(count, pageSize, pageCurrent);
int totalPage = PageUtil.countTotalPage(count, pageSize);
example.setLimitStart(PageUtil.countOffset(pageCurrent, pageSize));
example.setPageSize(pageSize);
return new Page<UserLogModified>(count, totalPage, pageCurrent, pageSize, this.userLogModifiedMapper.selectByExample(example));
}
}
......@@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface MsgusersMapper {
public interface MsgUserMapper {
int countByExample(MsgUserExample example);
int deleteByExample(MsgUserExample example);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册