| | |
| | | |
| | | private static final int STATUS_ENABLED = 1; |
| | | private static final int HOME_RECOMMEND_ENABLED = 1; |
| | | private static final int HOME_CARD_LIMIT = 2; |
| | | |
| | | private final HealthCourseMapper healthCourseMapper; |
| | | private final HealthPopularizationMapper healthPopularizationMapper; |
| | | private final LiveCourseCategoryMapper liveCourseCategoryMapper; |
| | |
| | | .eq(HealthCourse::getStatus, STATUS_ENABLED) |
| | | .eq(HealthCourse::getIsHomeRecommend, HOME_RECOMMEND_ENABLED) |
| | | .orderByAsc(HealthCourse::getSort) |
| | | .orderByDesc(HealthCourse::getId) |
| | | .last("LIMIT " + HOME_CARD_LIMIT)); |
| | | .orderByDesc(HealthCourse::getId)); |
| | | return records == null ? Collections.<HealthCourse>emptyList() : records; |
| | | } |
| | | |
| | |
| | | .eq(HealthPopularization::getStatus, STATUS_ENABLED) |
| | | .eq(HealthPopularization::getIsHomeRecommend, HOME_RECOMMEND_ENABLED) |
| | | .orderByAsc(HealthPopularization::getSort) |
| | | .orderByDesc(HealthPopularization::getId) |
| | | .last("LIMIT " + HOME_CARD_LIMIT)); |
| | | .orderByDesc(HealthPopularization::getId)); |
| | | return records == null ? Collections.<HealthPopularization>emptyList() : records; |
| | | } |
| | | |