Commit 39abf6e7 by 朱亚洁

feat:[1006821]getResourcePageByBookGroupId4Wechat

parent 420cdcf7
......@@ -99,6 +99,9 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz {
@Override
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);
if(CollUtil.isEmpty(list)){
return CollUtil.toList();
......
......@@ -55,4 +55,8 @@ public interface BookAppletSceneDao extends BaseDao<BookAppletScene> {
* @return
*/
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>{
* * @param null
*/
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>{
* * @param null
*/
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
map.put("adviserId", adviserId);
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>
public Integer getUserIsNotNew(Long 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
map.put("navigationJumpType", navigationJumpType);
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 @@
limit 1
</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>
\ No newline at end of file
......@@ -71,4 +71,14 @@
and is_new = 0
</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>
\ No newline at end of file
......@@ -355,4 +355,20 @@
where id = #{id}
</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>
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