parent
ff07475aa3
commit
8521863255
@ -1,11 +1,20 @@
|
|||||||
package com.luoo.user.dao;
|
package com.luoo.user.dao;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||||
|
|
||||||
|
import com.luoo.user.dto.UserCollectCount;
|
||||||
import com.luoo.user.pojo.UserCollect;
|
import com.luoo.user.pojo.UserCollect;
|
||||||
|
|
||||||
public interface UserCollectDao extends MongoRepository<UserCollect, String> {
|
public interface UserCollectDao extends MongoRepository<UserCollect, String> {
|
||||||
public UserCollect findByUserIdAndObjectIdAndCollectType(String userId, String objectId, Integer collectType);
|
public UserCollect findByUserIdAndObjectIdAndCollectType(String userId, String objectId, Integer collectType);
|
||||||
public long deleteByUserIdAndObjectIdAndCollectType(String userId, String objectId, Integer collectType);
|
public long deleteByUserIdAndObjectIdAndCollectType(String userId, String objectId, Integer collectType);
|
||||||
|
//@Query(value = "select NumberInt(collectType),count(*) from common.userCollect where userId=?1 group by collectType", nativeQuery = true)
|
||||||
|
//public List<UserCollectCount> countByUserIdAndGroupByCollectType(String userId);
|
||||||
|
|
||||||
|
public long countByObjectIdAndCollectType(String objectId, Integer collectType);
|
||||||
|
public long countByUserIdAndCollectType(String userId, Integer collectType);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.luoo.user.dto;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UserCollectCount {
|
||||||
|
private int collectType;
|
||||||
|
private long count;
|
||||||
|
}
|
Loading…
Reference in new issue