Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐少华
midjourney-proxy
Commits
0126342b
Commit
0126342b
authored
May 25, 2020
by
吴博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1002932
parent
e8aeb914
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
332 additions
and
23 deletions
+332
-23
BookBiz.java
...-book/src/main/java/com/pcloud/book/book/biz/BookBiz.java
+2
-0
BookBizImpl.java
.../main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
+35
-6
BookFacadeImpl.java
...java/com/pcloud/book/book/facade/impl/BookFacadeImpl.java
+19
-0
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+0
-0
RightsSettingCheck.java
...m/pcloud/book/rightsSetting/check/RightsSettingCheck.java
+2
-2
RightsSetting.java
...a/com/pcloud/book/rightsSetting/entity/RightsSetting.java
+3
-0
RightsSettingBookRelation.java
.../book/rightsSetting/entity/RightsSettingBookRelation.java
+21
-0
RightsSettingBookRelationMapper.java
...rightsSetting/mapper/RightsSettingBookRelationMapper.java
+31
-0
Book.Mapper.xml
...rvice-book/src/main/resources/mapper/book/Book.Mapper.xml
+55
-0
RightsSettingBookRelationMapper.xml
.../mapper/rightssetting/RightsSettingBookRelationMapper.xml
+128
-0
RightsSettingMapper.xml
...in/resources/mapper/rightssetting/RightsSettingMapper.xml
+36
-15
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/BookBiz.java
View file @
0126342b
...
@@ -652,4 +652,6 @@ public interface BookBiz {
...
@@ -652,4 +652,6 @@ public interface BookBiz {
void
updateIsOpenRobotProcess
(
Long
adviserId
,
UpdateBookRobotProcessDto
robotProcessDto
);
void
updateIsOpenRobotProcess
(
Long
adviserId
,
UpdateBookRobotProcessDto
robotProcessDto
);
void
updateIsOpenRobotProcess4Now
(
Long
adviserId
,
UpdateBookRobotProcessDto
robotProcessDto
);
void
updateIsOpenRobotProcess4Now
(
Long
adviserId
,
UpdateBookRobotProcessDto
robotProcessDto
);
PageBeanNew
<
BookDto
>
getAdviserBooks4Rights
(
String
keyword
,
Long
agentId
,
Long
templetId
,
Long
secondTempletId
,
String
typeCode
,
Integer
currentPage
,
Integer
numPerPage
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
View file @
0126342b
...
@@ -56,6 +56,7 @@ import com.pcloud.book.group.dto.BookGroupDTO;
...
@@ -56,6 +56,7 @@ import com.pcloud.book.group.dto.BookGroupDTO;
import
com.pcloud.book.group.entity.BookAppletScene
;
import
com.pcloud.book.group.entity.BookAppletScene
;
import
com.pcloud.book.group.enums.JoinGroupTypeEnum
;
import
com.pcloud.book.group.enums.JoinGroupTypeEnum
;
import
com.pcloud.book.mq.producer.BookMQProducer
;
import
com.pcloud.book.mq.producer.BookMQProducer
;
import
com.pcloud.book.rightsSetting.mapper.RightsSettingBookRelationMapper
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.channelcenter.wechat.dto.BookServeParamVO
;
import
com.pcloud.channelcenter.wechat.dto.BookServeParamVO
;
import
com.pcloud.channelcenter.wechat.vo.BookServeVO
;
import
com.pcloud.channelcenter.wechat.vo.BookServeVO
;
...
@@ -170,12 +171,8 @@ public class BookBizImpl implements BookBiz {
...
@@ -170,12 +171,8 @@ public class BookBizImpl implements BookBiz {
@Autowired
@Autowired
private
WechatConsr
wechatConsr
;
private
WechatConsr
wechatConsr
;
@Autowired
private
RightsSettingBookRelationMapper
rightsSettingBookRelationMapper
;
/**
/**
...
@@ -2258,6 +2255,38 @@ public class BookBizImpl implements BookBiz {
...
@@ -2258,6 +2255,38 @@ public class BookBizImpl implements BookBiz {
}
}
}
}
@Override
public
PageBeanNew
<
BookDto
>
getAdviserBooks4Rights
(
String
keyword
,
Long
agentId
,
Long
templetId
,
Long
secondTempletId
,
String
typeCode
,
Integer
currentPage
,
Integer
numPerPage
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"keyword"
,
keyword
);
map
.
put
(
"templetId"
,
templetId
);
map
.
put
(
"secondTempletId"
,
secondTempletId
);
map
.
put
(
"typeCode"
,
typeCode
);
if
(
agentId
!=
null
){
List
<
Long
>
adviserIds
=
adviserConsr
.
getIdsByNameAndAgentId
(
agentId
,
null
);
if
(
ListUtils
.
isEmpty
(
adviserIds
)){
map
.
put
(
"adviserIds"
,
Collections
.
singletonList
(-
1L
));
}
else
{
map
.
put
(
"adviserIds"
,
adviserIds
);
}
}
if
(!
StringUtil
.
isEmpty
(
keyword
))
{
// 模糊匹配编辑名称
List
<
Long
>
adviserIds
=
adviserConsr
.
getAdviserIdsByName
(
keyword
);
map
.
put
(
"adviserIds4Name"
,
adviserIds
);
}
//获取已被权益选择的书刊
List
<
Long
>
bookIds
=
rightsSettingBookRelationMapper
.
getAllBookIds
();
if
(!
ListUtils
.
isEmpty
(
bookIds
)){
map
.
put
(
"ignoreBookIds"
,
bookIds
);
}
PageBeanNew
<
BookDto
>
page
=
bookDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getAdviserBooks4Rights"
);
fillBookInfo
(
page
.
getRecordList
());
return
page
;
}
public
void
createBookGroupAppletUrl
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
List
<
Long
>
sceneIds
){
public
void
createBookGroupAppletUrl
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
List
<
Long
>
sceneIds
){
BookAdviserDto
bookAdviserDto
=
bookAdviserDao
.
getBase
(
bookId
,
channelId
,
adviserId
);
BookAdviserDto
bookAdviserDto
=
bookAdviserDao
.
getBase
(
bookId
,
channelId
,
adviserId
);
Long
raysClassifyId
=
bookRaysClassifyDao
.
getClassifyIdByBookTemplateId
(
bookAdviserDto
.
getTempletId
());
Long
raysClassifyId
=
bookRaysClassifyDao
.
getClassifyIdByBookTemplateId
(
bookAdviserDto
.
getTempletId
());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/facade/impl/BookFacadeImpl.java
View file @
0126342b
...
@@ -1051,4 +1051,22 @@ public class BookFacadeImpl implements BookFacade {
...
@@ -1051,4 +1051,22 @@ public class BookFacadeImpl implements BookFacade {
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
@GetMapping
(
"getAdviserBooks4Rights"
)
public
ResponseDto
<?>
getAdviserBooks4Rights
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
,
@RequestParam
(
value
=
"agentId"
,
required
=
false
)
Long
agentId
,
@RequestParam
(
value
=
"templetId"
,
required
=
false
)
Long
templetId
,
@RequestParam
(
value
=
"secondTempletId"
,
required
=
false
)
Long
secondTempletId
,
@RequestParam
(
value
=
"typeCode"
,
required
=
false
)
String
typeCode
,
@RequestParam
(
value
=
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
if
(
currentPage
==
null
||
numPerPage
==
null
||
currentPage
<
0
||
numPerPage
<
0
)
{
throw
BookBizException
.
PAGE_PARAM_DELETION
;
}
return
new
ResponseDto
<>(
bookBiz
.
getAdviserBooks4Rights
(
keyword
,
agentId
,
templetId
,
secondTempletId
,
typeCode
,
currentPage
,
numPerPage
));
}
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
0126342b
This diff is collapsed.
Click to expand it.
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/check/RightsSettingCheck.java
View file @
0126342b
...
@@ -38,8 +38,8 @@ public class RightsSettingCheck {
...
@@ -38,8 +38,8 @@ public class RightsSettingCheck {
if
(
null
==
rightsSetting
.
getRightsSettingType
()){
if
(
null
==
rightsSetting
.
getRightsSettingType
()){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"权益类型为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"权益类型为空!"
);
}
}
if
(
rightsSetting
.
getRightsSettingType
()==
2
&&
null
==
rightsSetting
.
getBookId
(
)){
if
(
ListUtils
.
isEmpty
(
rightsSetting
.
getRightsSettingBookRelations
()
)){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"
bookId
为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"
RightsSettingBookRelations不能
为空!"
);
}
}
if
(
rightsSetting
.
getRightsSettingType
()==
1
&&
null
==
rightsSetting
.
getFirstClassify
()){
if
(
rightsSetting
.
getRightsSettingType
()==
1
&&
null
==
rightsSetting
.
getFirstClassify
()){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"分类为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"分类为空!"
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/entity/RightsSetting.java
View file @
0126342b
...
@@ -70,6 +70,9 @@ public class RightsSetting extends BaseTempletClassify {
...
@@ -70,6 +70,9 @@ public class RightsSetting extends BaseTempletClassify {
@ApiModelProperty
(
"书刊id"
)
@ApiModelProperty
(
"书刊id"
)
private
Long
bookId
;
private
Long
bookId
;
@ApiModelProperty
(
"书刊ids"
)
private
List
<
RightsSettingBookRelation
>
rightsSettingBookRelations
;
/**
/**
* 书或isbn查询
* 书或isbn查询
*/
*/
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/entity/RightsSettingBookRelation.java
0 → 100644
View file @
0126342b
package
com
.
pcloud
.
book
.
rightsSetting
.
entity
;
import
java.util.Date
;
import
lombok.Data
;
@Data
public
class
RightsSettingBookRelation
{
private
Long
id
;
private
Long
rightsSettingId
;
private
Long
bookId
;
private
Date
createTime
;
private
Date
updateTime
;
private
String
bookName
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/mapper/RightsSettingBookRelationMapper.java
0 → 100644
View file @
0126342b
package
com
.
pcloud
.
book
.
rightsSetting
.
mapper
;
import
com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
RightsSettingBookRelationMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
RightsSettingBookRelation
record
);
int
insertSelective
(
RightsSettingBookRelation
record
);
RightsSettingBookRelation
selectByPrimaryKey
(
Long
id
);
int
updateByPrimaryKeySelective
(
RightsSettingBookRelation
record
);
int
updateByPrimaryKey
(
RightsSettingBookRelation
record
);
void
batchInsert
(
List
<
RightsSettingBookRelation
>
rightsSettingBookRelations
);
void
deleteByRightsSettingId
(
Long
rightsSettingId
);
List
<
RightsSettingBookRelation
>
selectByRithsSettingId
(
Long
rightsSettingId
);
List
<
RightsSettingBookRelation
>
selectBookByRithsSettingId
(
Long
rightsSettingId
);
List
<
Long
>
getAllBookIds
();
}
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/book/Book.Mapper.xml
View file @
0126342b
...
@@ -2379,4 +2379,58 @@
...
@@ -2379,4 +2379,58 @@
and is_delete=0
and is_delete=0
</update>
</update>
<select
id=
"getAdviserBooks4Rights"
resultMap=
"bookMap"
parameterType=
"map"
>
SELECT
A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK,
B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER,
A.TEMPLET_ID,A.SECOND_TEMPLET_ID,A.LAST_MODIFIED_DATE LAST_MODIFIED_DATE,A.BOOK_ADVISER_ID,CONCAT('BK',A.BOOK_ID) uniqueNumber
FROM
BOOK_ADVISER A
INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.IS_DELETE = 0 AND B.IS_DELETE = 0
LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE
WHERE
1=1
AND A.IS_MAIN_EDITOR = 1
<if
test=
"typeCode!=null"
>
AND
B.TYPE_CODE = #{typeCode}
</if>
<if
test=
"keyword != null"
>
AND (B.BOOK_NAME LIKE CONCAT('%', #{keyword}, '%')
OR B.ISBN LIKE CONCAT(#{keyword},'%')
OR CONCAT('BK',A.BOOK_ID) = #{keyword}
<if
test=
"adviserIds4Name!=null and adviserIds4Name.size()>0"
>
OR
A.ADVISER_ID in
<foreach
collection=
"adviserIds4Name"
item=
"item"
open=
"("
separator=
","
close=
")"
>
${item}
</foreach>
</if>
)
</if>
<if
test=
"templetId != null"
>
AND
A.TEMPLET_ID = #{templetId}
</if>
<if
test=
"secondTempletId!=null "
>
AND
A.SECOND_TEMPLET_ID=#{secondTempletId}
</if>
<if
test=
"adviserIds!=null and adviserIds.size()>0"
>
AND
A.ADVISER_ID in
<foreach
collection=
"adviserIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
${item}
</foreach>
</if>
<if
test=
"ignoreBookIds != null"
>
and
A.BOOK_ID not in
<foreach
collection=
"ignoreBookIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
${item}
</foreach>
</if>
GROUP BY A.BOOK_ID, A.CHANNEL_ID
ORDER BY
A.LAST_MODIFIED_DATE DESC
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsSettingBookRelationMapper.xml
0 → 100644
View file @
0126342b
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.rightsSetting.mapper.RightsSettingBookRelationMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"rights_setting_id"
property=
"rightsSettingId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_id"
property=
"bookId"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, rights_setting_id, book_id, create_time, update_time
</sql>
<sql
id=
"Base_Column_List_owm"
>
r.id, r.rights_setting_id, r.book_id, r.create_time, r.update_time
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
select
<include
refid=
"Base_Column_List"
/>
from rights_setting_book_relation
where id = #{id,jdbcType=BIGINT}
</select>
<select
id=
"selectByRithsSettingId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from rights_setting_book_relation
where rights_setting_id = #{rightsSettingId,jdbcType=BIGINT}
</select>
<select
id=
"getAllBookIds"
resultType=
"java.lang.Long"
>
select book_id
from
rights_setting_book_relation
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from rights_setting_book_relation
where id = #{id,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByRightsSettingId"
parameterType=
"long"
>
delete from rights_setting_book_relation
where rights_setting_id = #{rightsSettingId,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation"
>
insert into rights_setting_book_relation (id, rights_setting_id, book_id,
create_time, update_time)
values (#{id,jdbcType=BIGINT}, #{rightsSettingId,jdbcType=BIGINT}, #{bookId,jdbcType=BIGINT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation"
>
insert into rights_setting_book_relation
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"rightsSettingId != null"
>
rights_setting_id,
</if>
<if
test=
"bookId != null"
>
book_id,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=BIGINT},
</if>
<if
test=
"rightsSettingId != null"
>
#{rightsSettingId,jdbcType=BIGINT},
</if>
<if
test=
"bookId != null"
>
#{bookId,jdbcType=BIGINT},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<insert
id=
"batchInsert"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation"
>
insert into rights_setting_book_relation (rights_setting_id, book_id,
create_time, update_time)
values
<foreach
collection=
"list"
index=
"index"
item=
"item"
separator=
","
>
(#{item.rightsSettingId,jdbcType=BIGINT}, #{item.bookId,jdbcType=BIGINT},
now(),now())
</foreach>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation"
>
update rights_setting_book_relation
<set
>
<if
test=
"rightsSettingId != null"
>
rights_setting_id = #{rightsSettingId,jdbcType=BIGINT},
</if>
<if
test=
"bookId != null"
>
book_id = #{bookId,jdbcType=BIGINT},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation"
>
update rights_setting_book_relation
set rights_setting_id = #{rightsSettingId,jdbcType=BIGINT},
book_id = #{bookId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"selectBookByRithsSettingId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List_owm"
/>
,b.book_name
from rights_setting_book_relation r
left join book b on r.book_id = b.book_Id
where rights_setting_id = #{_parameter}
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsSettingMapper.xml
View file @
0126342b
...
@@ -43,11 +43,24 @@
...
@@ -43,11 +43,24 @@
<result
column=
"read_type_title"
property=
"readTypeTitle"
jdbcType=
"VARCHAR"
/>
<result
column=
"read_type_title"
property=
"readTypeTitle"
jdbcType=
"VARCHAR"
/>
<result
column=
"vol_label_id"
property=
"volLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"vol_label_id"
property=
"volLabelId"
jdbcType=
"BIGINT"
/>
</resultMap>
</resultMap>
<resultMap
id=
"DtoResultMap4Book"
type=
"com.pcloud.book.rightsSetting.dto.RightsSettingDto"
extends=
"DtoResultMap"
>
<collection
property=
"rightsSettingBookRelations"
ofType=
"com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation"
column=
"id"
select=
"com.pcloud.book.rightsSetting.mapper.RightsSettingBookRelationMapper.selectBookByRithsSettingId"
>
</collection>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, introduce, detail, count, first_classify, second_classify, grade_label_id, subject_label_id,
id, introduce, detail, count, first_classify, second_classify, grade_label_id, subject_label_id,
create_time, update_time, enable_group_service, rights_setting_type, book_id
create_time, update_time, enable_group_service, rights_setting_type, book_id
,online_course_open,learning_tool_open,draw_open,read_type_title, vol_label_id
,online_course_open,learning_tool_open,draw_open,read_type_title, vol_label_id
</sql>
</sql>
<sql
id=
"Base_Column_List_own"
>
r.id, r.introduce, r.detail, r.count, r.first_classify, r.second_classify, r.grade_label_id, r.subject_label_id,
r.create_time, r.update_time, r.enable_group_service, r.rights_setting_type, r.book_id
,r.online_course_open,r.learning_tool_open,r.draw_open,r.read_type_title
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
...
@@ -146,9 +159,10 @@
...
@@ -146,9 +159,10 @@
<select
id=
"listRightsSettingPage"
parameterType=
"map"
resultMap=
"DtoResultMap"
>
<select
id=
"listRightsSettingPage"
parameterType=
"map"
resultMap=
"DtoResultMap"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List
_own
"
/>
from
from
rights_setting
rights_setting r
left join rights_setting_book_relation b on r.id = b.rights_setting_id
<where>
<where>
<if
test=
"firstClassify != null"
>
<if
test=
"firstClassify != null"
>
first_classify = #{firstClassify}
first_classify = #{firstClassify}
...
@@ -165,30 +179,36 @@
...
@@ -165,30 +179,36 @@
<if
test=
"rightsSettingType !=null"
>
<if
test=
"rightsSettingType !=null"
>
and rights_setting_type = #{rightsSettingType}
and rights_setting_type = #{rightsSettingType}
</if>
</if>
<if
test=
"bookId!=null"
>
<if
test=
"bookIds != null and bookIds.size() > 0"
>
and book_id=#{bookId}
and b.book_id in
<foreach
collection=
"bookIds"
item=
"item"
index=
"index"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
</if>
</if>
<if
test=
"exceptId!=null"
>
<if
test=
"exceptId!=null"
>
and id != #{exceptId}
and
r.
id != #{exceptId}
</if>
</if>
<if
test=
"volLabelId != null"
>
<if
test=
"volLabelId != null"
>
and vol_label_id = #{volLabelId}
and vol_label_id = #{volLabelId}
</if>
</if>
</where>
</where>
order by create_time desc
order by
r.
create_time desc
</select>
</select>
<select
id=
"listBookRightsSettingPage"
parameterType=
"map"
resultMap=
"DtoResultMap"
>
<select
id=
"listBookRightsSettingPage"
parameterType=
"map"
resultMap=
"DtoResultMap
4Book
"
>
select
select
r.id, r.introduce, r.detail, r.count, r.first_classify, r.second_classify, r.grade_label_id, r.subject_label_id,
r.id, r.introduce, r.detail, r.count, r.first_classify, r.second_classify, r.grade_label_id, r.subject_label_id,
r.create_time, r.update_time, r.enable_group_service, r.rights_setting_type, r.book_id, b.BOOK_NAME, r.vol_label_id
r.create_time, r.update_time, r.enable_group_service, r.rights_setting_type, r.book_id, b.BOOK_NAME, r.vol_label_id
from
from
rights_setting r LEFT JOIN book b ON r.book_id=b.BOOK_ID
rights_setting r
left join rights_setting_book_relation s on r.id = s.rights_setting_id
LEFT JOIN book b ON s.book_id=b.BOOK_ID
WHERE
WHERE
r.rights_setting_type = 2
r.rights_setting_type = 2
<if
test=
"bookQuery !=null"
>
<if
test=
"bookQuery !=null"
>
AND (b.BOOK_NAME LIKE CONCAT("%",#{bookQuery},"%") OR b.ISBN LIKE CONCAT("%",#{bookQuery},"%"))
AND (b.BOOK_NAME LIKE CONCAT("%",#{bookQuery},"%") OR b.ISBN LIKE CONCAT("%",#{bookQuery},"%"))
</if>
</if>
group by r.id
order by r.create_time desc
order by r.create_time desc
</select>
</select>
...
@@ -219,10 +239,11 @@
...
@@ -219,10 +239,11 @@
<select
id=
"getByBookId"
parameterType=
"map"
resultMap=
"DtoResultMap"
>
<select
id=
"getByBookId"
parameterType=
"map"
resultMap=
"DtoResultMap"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List
_own
"
/>
from
from
rights_setting
rights_setting r
WHERE book_id = #{bookId}
left join rights_setting_book_relation b on r.id = b.rights_setting_id
WHERE b.book_id = #{bookId}
and rights_setting_type = 2
and rights_setting_type = 2
limit 1
limit 1
</select>
</select>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment