admin
2025-02-25 30d8e227e8d823b6c38c3b9c90ac2df03b63befe
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushRecordServiceImpl.java
@@ -1,52 +1,52 @@
package com.yeshi.fanli.service.impl.push;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.push.PushRecordMapper;
import com.yeshi.fanli.entity.xinge.PushRecord;
import com.yeshi.fanli.service.inter.push.PushRecordService;
@Service
public class PushRecordServiceImpl implements PushRecordService {
   @Resource
   private PushRecordMapper pushRecordMapper;
   public List<PushRecord> getPushRecordList(long start, int pageSize,String key, int type) {
      return pushRecordMapper.listQuery(start, pageSize, key, type);
   }
   public Long getCount(String title, int type) {
      return pushRecordMapper.countQuery(title, type);
   }
   public void increaseByAndroid(String pushId) {
      PushRecord pushRecord = pushRecordMapper.getByAndroidPushId(pushId);
      if (pushRecord != null) {
         Long count = pushRecord.getCount();
         if(count == null) {
            pushRecord.setCount(1L);
         } else {
            pushRecord.setCount(count + 1);
         }
         pushRecordMapper.updateByPrimaryKeySelective(pushRecord);
      }
   }
   public void increaseByIOS(String pushId) {
      PushRecord pushRecord = pushRecordMapper.getByIosPushId(pushId);
      if (pushRecord != null) {
         Long count = pushRecord.getCount();
         if(count == null) {
            pushRecord.setCount(1L);
         } else {
            pushRecord.setCount(count + 1);
         }
         pushRecordMapper.updateByPrimaryKeySelective(pushRecord);
      }
   }
}
package com.yeshi.fanli.service.impl.push;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.push.PushRecordMapper;
import com.yeshi.fanli.entity.xinge.PushRecord;
import com.yeshi.fanli.service.inter.push.PushRecordService;
@Service
public class PushRecordServiceImpl implements PushRecordService {
   @Resource
   private PushRecordMapper pushRecordMapper;
   public List<PushRecord> getPushRecordList(long start, int pageSize,String key, int type) {
      return pushRecordMapper.listQuery(start, pageSize, key, type);
   }
   public Long getCount(String title, int type) {
      return pushRecordMapper.countQuery(title, type);
   }
   public void increaseByAndroid(String pushId) {
      PushRecord pushRecord = pushRecordMapper.getByAndroidPushId(pushId);
      if (pushRecord != null) {
         Long count = pushRecord.getCount();
         if(count == null) {
            pushRecord.setCount(1L);
         } else {
            pushRecord.setCount(count + 1);
         }
         pushRecordMapper.updateByPrimaryKeySelective(pushRecord);
      }
   }
   public void increaseByIOS(String pushId) {
      PushRecord pushRecord = pushRecordMapper.getByIosPushId(pushId);
      if (pushRecord != null) {
         Long count = pushRecord.getCount();
         if(count == null) {
            pushRecord.setCount(1L);
         } else {
            pushRecord.setCount(count + 1);
         }
         pushRecordMapper.updateByPrimaryKeySelective(pushRecord);
      }
   }
}