示例#1
0
 @Override
 public List<Message> queryDisplayMessage(String sort, Integer page, Integer size) {
   MessageExample messageExample = new MessageExample();
   messageExample.createCriteria().andDisplayEqualTo(true);
   String limitSql = "";
   if (size != null && size > 0) {
     if (page != null && page > 0) {
       limitSql += " limit " + (page - 1) * size + "," + size;
     } else {
       limitSql += " limit " + size;
     }
   }
   if (sort != null && !"".equals(sort)) {
     messageExample.setOrderByClause(sort + limitSql);
   } else {
     messageExample.setOrderByClause("id desc" + limitSql);
   }
   return messageMapper.selectByExampleWithBLOBs(messageExample);
 }
示例#2
0
 @Override
 public int countDisplayMessage() {
   MessageExample messageExample = new MessageExample();
   messageExample.createCriteria().andDisplayEqualTo(true);
   return messageMapper.countByExample(messageExample);
 }
示例#3
0
 @Override
 public int updateMessage(Message message) {
   return messageMapper.updateByPrimaryKeySelective(message);
 }
示例#4
0
 public int queryMessageCount() {
   return messageMapper.countByExample(null);
 }
示例#5
0
 public int delete(Integer id) {
   return messageMapper.deleteByPrimaryKey(id);
 }
示例#6
0
 public void insert(Message message) {
   messageMapper.insert(message);
 }