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
4ce0ed39
Commit
4ce0ed39
authored
Mar 12, 2021
by
朱亚洁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:[1004407]资讯推第三方资源支持图片
parent
2370360e
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
205 additions
and
13 deletions
+205
-13
AppletThirdResourcesDTO.java
...a/com/pcloud/book/applet/dto/AppletThirdResourcesDTO.java
+8
-0
AppletThirdResources.java
...a/com/pcloud/book/applet/entity/AppletThirdResources.java
+6
-0
AppletNewsBizImpl.java
...va/com/pcloud/book/applet/biz/impl/AppletNewsBizImpl.java
+10
-1
AppletThirdResourcesBizImpl.java
...oud/book/applet/biz/impl/AppletThirdResourcesBizImpl.java
+59
-3
AppletThirdResourcesDTO.java
...a/com/pcloud/book/applet/dto/AppletThirdResourcesDTO.java
+3
-1
AppletThirdResourcesPic.java
...om/pcloud/book/applet/entity/AppletThirdResourcesPic.java
+31
-0
AppletThirdResourcesPicMapper.java
...oud/book/applet/mapper/AppletThirdResourcesPicMapper.java
+39
-0
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+2
-8
AppletThirdResourcesPicMapper.xml
...resources/mapper/applet/AppletThirdResourcesPicMapper.xml
+47
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/applet/dto/AppletThirdResourcesDTO.java
View file @
4ce0ed39
package
com
.
pcloud
.
book
.
applet
.
dto
;
package
com
.
pcloud
.
book
.
applet
.
dto
;
import
com.pcloud.common.dto.BaseDto
;
import
com.pcloud.common.dto.BaseDto
;
import
java.util.List
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -42,4 +45,8 @@ public class AppletThirdResourcesDTO extends BaseDto {
...
@@ -42,4 +45,8 @@ public class AppletThirdResourcesDTO extends BaseDto {
@ApiModelProperty
(
"资讯自定义引导语"
)
@ApiModelProperty
(
"资讯自定义引导语"
)
private
String
guide
;
private
String
guide
;
@ApiModelProperty
(
"推送图片"
)
private
List
<
String
>
picUrlList
;
}
}
\ No newline at end of file
pcloud-facade-book/src/main/java/com/pcloud/book/applet/entity/AppletThirdResources.java
View file @
4ce0ed39
package
com
.
pcloud
.
book
.
applet
.
entity
;
package
com
.
pcloud
.
book
.
applet
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
com.pcloud.common.entity.BaseEntity
;
import
java.util.List
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -61,4 +64,6 @@ public class AppletThirdResources extends BaseEntity {
...
@@ -61,4 +64,6 @@ public class AppletThirdResources extends BaseEntity {
@ApiModelProperty
(
"位置 1 顶部 2 底部"
)
@ApiModelProperty
(
"位置 1 顶部 2 底部"
)
private
Integer
showType
;
private
Integer
showType
;
@ApiModelProperty
(
"推送图片"
)
private
List
<
String
>
picUrlList
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletNewsBizImpl.java
View file @
4ce0ed39
...
@@ -31,6 +31,7 @@ import com.pcloud.book.applet.entity.*;
...
@@ -31,6 +31,7 @@ import com.pcloud.book.applet.entity.*;
import
com.pcloud.book.applet.enums.AppletNewsServeTypeEnum
;
import
com.pcloud.book.applet.enums.AppletNewsServeTypeEnum
;
import
com.pcloud.book.applet.enums.DataRecordTypeEnum
;
import
com.pcloud.book.applet.enums.DataRecordTypeEnum
;
import
com.pcloud.book.applet.enums.DataTypeEnum
;
import
com.pcloud.book.applet.enums.DataTypeEnum
;
import
com.pcloud.book.applet.mapper.AppletThirdResourcesPicMapper
;
import
com.pcloud.book.applet.vo.AppletNewsClassifyVO
;
import
com.pcloud.book.applet.vo.AppletNewsClassifyVO
;
import
com.pcloud.book.applet.vo.AppletNewsShowStateVO
;
import
com.pcloud.book.applet.vo.AppletNewsShowStateVO
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
...
@@ -118,6 +119,8 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
...
@@ -118,6 +119,8 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
private
RegionMapMapper
regionMapMapper
;
private
RegionMapMapper
regionMapMapper
;
@Autowired
@Autowired
private
ServeCollectBiz
serveCollectBiz
;
private
ServeCollectBiz
serveCollectBiz
;
@Autowired
private
AppletThirdResourcesPicMapper
appletThirdResourcesPicMapper
;
@Override
@Override
public
void
deleteCategoryById
(
Long
id
)
{
public
void
deleteCategoryById
(
Long
id
)
{
...
@@ -906,7 +909,13 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
...
@@ -906,7 +909,13 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
com
.
pcloud
.
common
.
utils
.
BeanUtils
com
.
pcloud
.
common
.
utils
.
BeanUtils
.
copyListProperties
(
thirdResourcesList
,
dtoList
,
AppletThirdResourcesDTO
.
class
);
.
copyListProperties
(
thirdResourcesList
,
dtoList
,
AppletThirdResourcesDTO
.
class
);
//图片类型
for
(
AppletThirdResourcesDTO
resourcesDTO
:
dtoList
)
{
if
(
resourcesDTO
.
getType
()==
2
)
{
List
<
String
>
pics
=
appletThirdResourcesPicMapper
.
getPicList
(
resourcesDTO
.
getId
());
resourcesDTO
.
setPicUrlList
(
pics
);
}
}
appletNewsVO
.
setThirdResourcesRelations
(
dtoList
);
appletNewsVO
.
setThirdResourcesRelations
(
dtoList
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletThirdResourcesBizImpl.java
View file @
4ce0ed39
...
@@ -12,8 +12,10 @@ import com.pcloud.book.applet.dto.PvuvDTO;
...
@@ -12,8 +12,10 @@ import com.pcloud.book.applet.dto.PvuvDTO;
import
com.pcloud.book.applet.dto.ThirdResourceRecordDTO
;
import
com.pcloud.book.applet.dto.ThirdResourceRecordDTO
;
import
com.pcloud.book.applet.entity.AppletThirdResources
;
import
com.pcloud.book.applet.entity.AppletThirdResources
;
import
com.pcloud.book.applet.entity.AppletThirdResourcesClick
;
import
com.pcloud.book.applet.entity.AppletThirdResourcesClick
;
import
com.pcloud.book.applet.entity.AppletThirdResourcesPic
;
import
com.pcloud.book.applet.enums.DataRecordTypeEnum
;
import
com.pcloud.book.applet.enums.DataRecordTypeEnum
;
import
com.pcloud.book.applet.enums.DataTypeEnum
;
import
com.pcloud.book.applet.enums.DataTypeEnum
;
import
com.pcloud.book.applet.mapper.AppletThirdResourcesPicMapper
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.consumer.reader.ReaderConsr
;
import
com.pcloud.book.consumer.reader.ReaderConsr
;
import
com.pcloud.book.consumer.user.AdviserConsr
;
import
com.pcloud.book.consumer.user.AdviserConsr
;
...
@@ -57,6 +59,8 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
...
@@ -57,6 +59,8 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
private
ReaderConsr
readerConsr
;
private
ReaderConsr
readerConsr
;
@Autowired
@Autowired
private
AdviserConsr
adviserConsr
;
private
AdviserConsr
adviserConsr
;
@Autowired
private
AppletThirdResourcesPicMapper
appletThirdResourcesPicMapper
;
@Override
@Override
public
PageBeanNew
<
AppletThirdResourcesDTO
>
getListThirdResourcesAnalysis
(
String
keyValue
,
String
source
,
public
PageBeanNew
<
AppletThirdResourcesDTO
>
getListThirdResourcesAnalysis
(
String
keyValue
,
String
source
,
...
@@ -173,7 +177,27 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
...
@@ -173,7 +177,27 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
map
.
put
(
"type"
,
type
);
map
.
put
(
"type"
,
type
);
map
.
put
(
"source"
,
source
);
map
.
put
(
"source"
,
source
);
map
.
put
(
"keyValue"
,
keyValue
);
map
.
put
(
"keyValue"
,
keyValue
);
return
thirdResourcesDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getThirdResources"
);
PageBeanNew
<
AppletThirdResources
>
pageBeanNew
=
thirdResourcesDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getThirdResources"
);
if
(
ListUtils
.
isEmpty
(
pageBeanNew
.
getRecordList
()))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
pageBeanNew
.
getTotalCount
(),
new
ArrayList
<>());
}
//推送图片类型
List
<
Long
>
thirdResourceIds
=
pageBeanNew
.
getRecordList
().
stream
().
filter
(
s
->
s
.
getType
()==
2
)
.
map
(
AppletThirdResources:
:
getId
).
collect
(
Collectors
.
toList
());
if
(!
ListUtils
.
isEmpty
(
thirdResourceIds
))
{
List
<
AppletThirdResourcesPic
>
picList
=
appletThirdResourcesPicMapper
.
getPicListByResourceIds
(
thirdResourceIds
);
Map
<
Long
,
List
<
String
>>
picMap
=
picList
.
stream
().
collect
(
Collectors
.
groupingBy
(
AppletThirdResourcesPic:
:
getThirdResourcesId
,
Collectors
.
mapping
(
AppletThirdResourcesPic:
:
getPicUrl
,
Collectors
.
toList
())));
if
(!
MapUtils
.
isEmpty
(
picMap
))
{
for
(
AppletThirdResources
resources:
pageBeanNew
.
getRecordList
())
{
if
(
picMap
.
containsKey
(
resources
.
getId
()))
{
List
<
String
>
picUrlList
=
picMap
.
get
(
resources
.
getId
());
resources
.
setPicUrlList
(
picUrlList
);
}
}
}
}
return
pageBeanNew
;
}
}
@Override
@Override
...
@@ -185,6 +209,9 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
...
@@ -185,6 +209,9 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateThirdResources
(
AppletThirdResourcesDTO
thirdResourcesDTO
)
{
public
void
updateThirdResources
(
AppletThirdResourcesDTO
thirdResourcesDTO
)
{
AppletThirdResources
thirdResources
=
new
AppletThirdResources
();
AppletThirdResources
thirdResources
=
new
AppletThirdResources
();
if
(
thirdResourcesDTO
.
getType
()
==
2
&&
ListUtils
.
isEmpty
(
thirdResourcesDTO
.
getPicUrlList
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少推送图片"
);
}
Boolean
exist
=
appletNewsDao
.
newsSourceExist
(
thirdResourcesDTO
.
getSource
(),
0L
);
Boolean
exist
=
appletNewsDao
.
newsSourceExist
(
thirdResourcesDTO
.
getSource
(),
0L
);
if
(!
exist
)
{
if
(!
exist
)
{
appletNewsDao
.
insertSource
(
thirdResourcesDTO
.
getSource
(),
0L
);
appletNewsDao
.
insertSource
(
thirdResourcesDTO
.
getSource
(),
0L
);
...
@@ -211,7 +238,31 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
...
@@ -211,7 +238,31 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
BeanUtils
.
copyProperties
(
thirdResourcesDTO
,
thirdResources
);
BeanUtils
.
copyProperties
(
thirdResourcesDTO
,
thirdResources
);
thirdResourcesDao
.
update
(
thirdResources
);
thirdResourcesDao
.
update
(
thirdResources
);
//推送图片设置
if
(
thirdResourcesDTO
.
getType
()
==
2
)
{
addPicResources
(
thirdResourcesDTO
.
getId
(),
thirdResourcesDTO
.
getPicUrlList
());
}
}
/**
* 推送图片设置
* @author:zhuyajie
* @date:2021/3/10 19:08
* * @param null
*/
private
void
addPicResources
(
Long
thirdResourcesId
,
List
<
String
>
picList
)
{
if
(
ListUtils
.
isEmpty
(
picList
)
||
null
==
thirdResourcesId
)
{
return
;
}
appletThirdResourcesPicMapper
.
deleteByThirdResourcesId
(
thirdResourcesId
);
List
<
AppletThirdResourcesPic
>
pics
=
new
ArrayList
<>();
for
(
String
pic
:
picList
)
{
AppletThirdResourcesPic
resourcesPic
=
new
AppletThirdResourcesPic
();
resourcesPic
.
setPicUrl
(
pic
);
resourcesPic
.
setThirdResourcesId
(
thirdResourcesId
);
pics
.
add
(
resourcesPic
);
}
appletThirdResourcesPicMapper
.
batchInsert
(
pics
);
}
}
@Override
@Override
...
@@ -228,7 +279,9 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
...
@@ -228,7 +279,9 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
createThirdResources
(
AppletThirdResourcesDTO
thirdResourcesDTO
)
{
public
void
createThirdResources
(
AppletThirdResourcesDTO
thirdResourcesDTO
)
{
AppletThirdResources
thirdResources
=
new
AppletThirdResources
();
AppletThirdResources
thirdResources
=
new
AppletThirdResources
();
if
(
thirdResourcesDTO
.
getType
()
==
2
&&
ListUtils
.
isEmpty
(
thirdResourcesDTO
.
getPicUrlList
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少推送图片"
);
}
Boolean
exist
=
appletNewsDao
.
newsSourceExist
(
thirdResourcesDTO
.
getSource
(),
0L
);
Boolean
exist
=
appletNewsDao
.
newsSourceExist
(
thirdResourcesDTO
.
getSource
(),
0L
);
if
(!
exist
)
{
if
(!
exist
)
{
appletNewsDao
.
insertSource
(
thirdResourcesDTO
.
getSource
(),
0L
);
appletNewsDao
.
insertSource
(
thirdResourcesDTO
.
getSource
(),
0L
);
...
@@ -247,7 +300,10 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
...
@@ -247,7 +300,10 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
if
(
Objects
.
nonNull
(
thirdResourcesDTO
.
getRouteCode
())&&
thirdResourcesDTO
.
getRouteCode
()==
1
&&
StrUtil
.
isNotBlank
(
thirdResourcesDTO
.
getUrl
())){
if
(
Objects
.
nonNull
(
thirdResourcesDTO
.
getRouteCode
())&&
thirdResourcesDTO
.
getRouteCode
()==
1
&&
StrUtil
.
isNotBlank
(
thirdResourcesDTO
.
getUrl
())){
bizMaterialBiz
.
createMaterial4ThirdResource
(
thirdResourcesDTO
.
getName
(),
thirdResourcesDTO
.
getUrl
(),
Math
.
toIntExact
(
thirdResources
.
getId
()));
bizMaterialBiz
.
createMaterial4ThirdResource
(
thirdResourcesDTO
.
getName
(),
thirdResourcesDTO
.
getUrl
(),
Math
.
toIntExact
(
thirdResources
.
getId
()));
}
}
//推送图片设置
if
(
thirdResourcesDTO
.
getType
()
==
2
)
{
addPicResources
(
thirdResources
.
getId
(),
thirdResourcesDTO
.
getPicUrlList
());
}
}
}
@Override
@Override
...
...
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/AppletThirdResourcesDTO.java
View file @
4ce0ed39
...
@@ -23,7 +23,7 @@ public class AppletThirdResourcesDTO extends BaseDto {
...
@@ -23,7 +23,7 @@ public class AppletThirdResourcesDTO extends BaseDto {
@ApiModelProperty
(
"第三方资源编号"
)
@ApiModelProperty
(
"第三方资源编号"
)
private
String
number
;
private
String
number
;
@ApiModelProperty
(
"类型 0:小程序, 1:链接"
)
@ApiModelProperty
(
"类型 0:小程序, 1:链接
, 2图片
"
)
private
Long
type
;
private
Long
type
;
@ApiModelProperty
(
"第三方资源名称"
)
@ApiModelProperty
(
"第三方资源名称"
)
...
@@ -104,5 +104,7 @@ public class AppletThirdResourcesDTO extends BaseDto {
...
@@ -104,5 +104,7 @@ public class AppletThirdResourcesDTO extends BaseDto {
@ApiModelProperty
(
"位置 1 顶部 2 底部"
)
@ApiModelProperty
(
"位置 1 顶部 2 底部"
)
private
Integer
showType
;
private
Integer
showType
;
@ApiModelProperty
(
"推送图片"
)
private
List
<
String
>
picUrlList
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/entity/AppletThirdResourcesPic.java
0 → 100644
View file @
4ce0ed39
package
com
.
pcloud
.
book
.
applet
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
lombok.Data
;
/**
* 第三方资源图片(AppletThirdResourcesPic)实体类
*
* @author makejava
* @since 2021-03-10 17:35:18
*/
@Data
public
class
AppletThirdResourcesPic
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
905654121602157924L
;
/**
* 主键
*/
private
Long
id
;
/**
* 第三方资源id
*/
private
Long
thirdResourcesId
;
/**
* 图片
*/
private
String
picUrl
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/mapper/AppletThirdResourcesPicMapper.java
0 → 100644
View file @
4ce0ed39
package
com
.
pcloud
.
book
.
applet
.
mapper
;
import
com.pcloud.book.applet.entity.AppletThirdResourcesPic
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* 第三方资源图片(AppletThirdResourcesPic)表数据库访问层
*
* @author makejava
* @since 2021-03-10 17:35:18
*/
@Mapper
@Component
public
interface
AppletThirdResourcesPicMapper
{
/**
* 新增数据
*
* @param appletThirdResourcesPic 实例对象
* @return 影响行数
*/
int
insert
(
AppletThirdResourcesPic
appletThirdResourcesPic
);
void
batchInsert
(
@Param
(
"list"
)
List
<
AppletThirdResourcesPic
>
list
);
void
deleteByThirdResourcesId
(
Long
thirdResourcesId
);
List
<
String
>
getPicList
(
Long
thirdResourcesId
);
List
<
AppletThirdResourcesPic
>
getPicListByResourceIds
(
@Param
(
"list"
)
List
<
Long
>
thirdResourcesId
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
4ce0ed39
...
@@ -3803,16 +3803,10 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
...
@@ -3803,16 +3803,10 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
* * @param null
* * @param null
*/
*/
private
List
<
RightsNowItem
>
getPopupAnswerList
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
Long
rightsSettingId
,
Integer
readType
)
{
private
List
<
RightsNowItem
>
getPopupAnswerList
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
Long
rightsSettingId
,
Integer
readType
)
{
List
<
RightsItemGroup
>
groups
=
rightsItemGroupDao
.
getListByRightSettingId
(
rightsSettingId
,
readType
);
RightsSettingTitle
rightsSettingTitle
=
rightsSettingTitleMapper
.
getByRightSettingIdAndType
(
rightsSettingId
,
RightsNowItemTypeNew
.
FIXED_FIRST
.
value
,
readType
);
if
(
ListUtils
.
isEmpty
(
groups
))
{
if
(
null
==
rightsSettingTitle
||
null
==
rightsSettingTitle
.
getOpenState
()
||
!
rightsSettingTitle
.
getOpenState
())
{
return
new
ArrayList
<>();
}
for
(
RightsItemGroup
group
:
groups
)
{
//原版资源开关未开启
if
(
group
.
getShowState
()
!=
null
&&
!
group
.
getShowState
()
&&
RightsItemGroupType
.
ORIGINAL
.
value
.
equals
(
group
.
getType
()))
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
}
String
key
=
RightsSettingConstant
.
ANSWER_POPUP
;
String
key
=
RightsSettingConstant
.
ANSWER_POPUP
;
String
field
=
bookId
+
"-"
+
adviserId
+
"-"
+
channelId
;
String
field
=
bookId
+
"-"
+
adviserId
+
"-"
+
channelId
;
List
<
RightsNowItem
>
answerList
=
JedisClusterUtils
.
hgetJson2List
(
key
,
field
,
RightsNowItem
.
class
);
List
<
RightsNowItem
>
answerList
=
JedisClusterUtils
.
hgetJson2List
(
key
,
field
,
RightsNowItem
.
class
);
...
...
pcloud-service-book/src/main/resources/mapper/applet/AppletThirdResourcesPicMapper.xml
0 → 100644
View file @
4ce0ed39
<?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.applet.mapper.AppletThirdResourcesPicMapper"
>
<resultMap
type=
"com.pcloud.book.applet.entity.AppletThirdResourcesPic"
id=
"AppletThirdResourcesPicMap"
>
<result
property=
"id"
column=
"id"
jdbcType=
"INTEGER"
/>
<result
property=
"thirdResourcesId"
column=
"third_resources_id"
jdbcType=
"INTEGER"
/>
<result
property=
"picUrl"
column=
"pic_url"
jdbcType=
"VARCHAR"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<!--新增所有列-->
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into book.applet_third_resources_pic(third_resources_id, pic_url, create_time)
values (#{thirdResourcesId}, #{picUrl}, #{createTime})
</insert>
<insert
id=
"batchInsert"
parameterType=
"list"
>
insert into book.applet_third_resources_pic(third_resources_id, pic_url, create_time)
VALUES
<foreach
collection=
"list"
separator=
","
item=
"item"
>
(#{item.thirdResourcesId}, #{item.picUrl}, now())
</foreach>
</insert>
<!--通过主键删除-->
<delete
id=
"deleteByThirdResourcesId"
>
delete from book.applet_third_resources_pic where third_resources_id = #{thirdResourcesId}
</delete>
<select
id=
"getPicList"
parameterType=
"long"
resultType=
"string"
>
SELECT pic_url FROM
book.applet_third_resources_pic
WHERE third_resources_id = #{thirdResourcesId}
</select>
<select
id=
"getPicListByResourceIds"
parameterType=
"list"
resultMap=
"AppletThirdResourcesPicMap"
>
SELECT id, third_resources_id, pic_url FROM
book.applet_third_resources_pic
WHERE third_resources_id IN
<foreach
collection=
"list"
item=
"item"
separator=
","
open=
"("
close=
")"
index=
"index"
>
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file
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