Commit 39abf6e7 by 朱亚洁

feat:[1006821]getResourcePageByBookGroupId4Wechat

parent 420cdcf7
...@@ -99,6 +99,9 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz { ...@@ -99,6 +99,9 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz {
@Override @Override
public List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Long channelId, Long wechatUserId, ResourcePageFixtureTypeEnum fixtureTypeEnum) { public List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Long channelId, Long wechatUserId, ResourcePageFixtureTypeEnum fixtureTypeEnum) {
if (null == resourcePageId) {
return CollUtil.toList();
}
List<ResourcePageBookstoreVO> list = resourcePageBookstoreDao.getByResourcePageId(resourcePageId, fixtureTypeEnum.fixtureType); List<ResourcePageBookstoreVO> list = resourcePageBookstoreDao.getByResourcePageId(resourcePageId, fixtureTypeEnum.fixtureType);
if(CollUtil.isEmpty(list)){ if(CollUtil.isEmpty(list)){
return CollUtil.toList(); return CollUtil.toList();
......
...@@ -55,4 +55,8 @@ public interface BookAppletSceneDao extends BaseDao<BookAppletScene> { ...@@ -55,4 +55,8 @@ public interface BookAppletSceneDao extends BaseDao<BookAppletScene> {
* @return * @return
*/ */
BookAppletSceneDTO getBookAppletByBookId(Long bookId, Long channelId, Long adviserId); BookAppletSceneDTO getBookAppletByBookId(Long bookId, Long channelId, Long adviserId);
String getAppletIdByBookGroupId(Long bookGroupId);
String getAppletIdBySceneId(Long sceneId);
} }
...@@ -27,4 +27,6 @@ public interface ResourcePageCollectDao extends BaseDao<ResourcePageCollect>{ ...@@ -27,4 +27,6 @@ public interface ResourcePageCollectDao extends BaseDao<ResourcePageCollect>{
* * @param null * * @param null
*/ */
Integer getUserIsNotNew(Long wechatUserId); Integer getUserIsNotNew(Long wechatUserId);
Integer getCollectStateByUser(Long wechatUserId, Long resourcePageId);
} }
\ No newline at end of file
...@@ -125,4 +125,8 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{ ...@@ -125,4 +125,8 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{
* * @param null * * @param null
*/ */
void updateNavigationFormat(Long resourcePageId, Integer navigationColor, Integer navigationFormat, Integer navigationJumpType); void updateNavigationFormat(Long resourcePageId, Integer navigationColor, Integer navigationFormat, Integer navigationJumpType);
Long getBookIdByBookGroupId(Long bookGroupId);
Long getBookIdBySceneId(Long sceneId);
} }
...@@ -56,4 +56,14 @@ public class BookAppletSceneDaoImpl extends BaseDaoImpl<BookAppletScene> impleme ...@@ -56,4 +56,14 @@ public class BookAppletSceneDaoImpl extends BaseDaoImpl<BookAppletScene> impleme
map.put("adviserId", adviserId); map.put("adviserId", adviserId);
return getSessionTemplate().selectOne(getStatement("getBookAppletByBookId"), map); return getSessionTemplate().selectOne(getStatement("getBookAppletByBookId"), map);
} }
@Override
public String getAppletIdByBookGroupId(Long bookGroupId) {
return getSessionTemplate().selectOne(getStatement("getAppletIdByBookGroupId"), bookGroupId);
}
@Override
public String getAppletIdBySceneId(Long sceneId) {
return getSessionTemplate().selectOne(getStatement("getAppletIdBySceneId"), sceneId);
}
} }
...@@ -31,4 +31,12 @@ public class ResourcePageCollectDaoImpl extends BaseDaoImpl<ResourcePageCollect> ...@@ -31,4 +31,12 @@ public class ResourcePageCollectDaoImpl extends BaseDaoImpl<ResourcePageCollect>
public Integer getUserIsNotNew(Long wechatUserId) { public Integer getUserIsNotNew(Long wechatUserId) {
return getSessionTemplate().selectOne(getStatement("getUserIsNotNew"), wechatUserId); return getSessionTemplate().selectOne(getStatement("getUserIsNotNew"), wechatUserId);
} }
@Override
public Integer getCollectStateByUser(Long wechatUserId, Long resourcePageId) {
Map<String, Object> map = new HashMap<>();
map.put("wechatUserId", wechatUserId);
map.put("resourcePageId", resourcePageId);
return getSessionTemplate().selectOne(getStatement("getCollectStateByUser"), map);
}
} }
...@@ -166,4 +166,14 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re ...@@ -166,4 +166,14 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re
map.put("navigationJumpType", navigationJumpType); map.put("navigationJumpType", navigationJumpType);
getSessionTemplate().update(getStatement("updateNavigationFormat"), map); getSessionTemplate().update(getStatement("updateNavigationFormat"), map);
} }
@Override
public Long getBookIdByBookGroupId(Long bookGroupId) {
return getSessionTemplate().selectOne(getStatement("getBookIdByBookGroupId"), bookGroupId);
}
@Override
public Long getBookIdBySceneId(Long sceneId) {
return getSessionTemplate().selectOne(getStatement("getBookIdBySceneId"), sceneId);
}
} }
...@@ -141,4 +141,22 @@ ...@@ -141,4 +141,22 @@
limit 1 limit 1
</select> </select>
<select id="getAppletIdByBookGroupId" parameterType="long" resultType="string">
SELECT
applet_id
FROM book_applet_scene
WHERE book_group_id=#{bookGroupId}
AND is_delete = 0
limit 1
</select>
<select id="getAppletIdBySceneId" parameterType="long" resultType="string">
SELECT
applet_id
FROM book_applet_scene
WHERE scene_id=#{sceneId}
AND is_delete = 0
limit 1
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -71,4 +71,14 @@ ...@@ -71,4 +71,14 @@
and is_new = 0 and is_new = 0
</select> </select>
<select id="getCollectStateByUser" parameterType="map" resultType="integer">
select
collect_state
from resource_page_collect
where resource_page_id = #{resourcePageId}
and wechat_user_id = #{wechatUserId}
and collect_state = 1
limit 1
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -355,4 +355,20 @@ ...@@ -355,4 +355,20 @@
where id = #{id} where id = #{id}
</select> </select>
<select id="getBookIdByBookGroupId" parameterType="long" resultType="long" >
select
book_id
from resource_page
where book_group_id = #{bookGroupId}
limit 1
</select>
<select id="getBookIdBySceneId" parameterType="long" resultType="long">
select
book_id
from resource_page
where scene_id = #{sceneId}
limit 1
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment