import java.math.BigDecimal; import java.util.Collections; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Repository; @Repository("dao") public class CrawlerHistoryLogDaoImpl implements CrawlerNewHistoryDao { @PersistenceContext private EntityManager entityManager; @Override public Page getHistoryInfo(String crawlerId, String startDate, String description, Pageable pageable) { StringBuffer dataBuffer = new StringBuffer( "select h.title,h.CONTENT_URL,h.HISTORY_ID,h.CHANNEL_URL,h.description,f.FILE_LOCAL,c.CRAWLER_NAME,h.CREATE_TIME from XT_PC_CRAWLER_HISTORY h left join XT_PC_CRAWLER_FILE f on h.HISTORY_ID=f.ITEM_ID left join XT_PC_CRAWLER c on h.CRAWLER_ID
jpa原生query_JPA实现@Query手写原生sql拼接动态sql并分页的方法
import java.math.BigDecimal; import java.util.Collections; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; ...
摘要由CSDN通过智能技术生成