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
d87b70b1
Commit
d87b70b1
authored
Aug 07, 2019
by
郑永强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
C1001361 早晚报优化
parent
84344081
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
722 additions
and
51 deletions
+722
-51
AdNewsBiz.java
...k/src/main/java/com/pcloud/book/adnews/biz/AdNewsBiz.java
+39
-0
AdNewsBizImpl.java
...n/java/com/pcloud/book/adnews/biz/impl/AdNewsBizImpl.java
+74
-16
AdNewsCheck.java
...c/main/java/com/pcloud/book/adnews/check/AdNewsCheck.java
+36
-30
AdNewsGroupDao.java
.../main/java/com/pcloud/book/adnews/dao/AdNewsGroupDao.java
+6
-0
AdNewsWechatChooseDao.java
...ava/com/pcloud/book/adnews/dao/AdNewsWechatChooseDao.java
+20
-0
AdNewsWechatDao.java
...main/java/com/pcloud/book/adnews/dao/AdNewsWechatDao.java
+12
-0
AdNewsWechatChooseDaoImpl.java
...cloud/book/adnews/dao/impl/AdNewsWechatChooseDaoImpl.java
+39
-0
AdNewsWechatDaoImpl.java
.../com/pcloud/book/adnews/dao/impl/AdNewsWechatDaoImpl.java
+14
-0
AdNewsSet.java
...rc/main/java/com/pcloud/book/adnews/entity/AdNewsSet.java
+37
-1
AdNewsWechat.java
...main/java/com/pcloud/book/adnews/entity/AdNewsWechat.java
+85
-0
AdNewsWechatChoose.java
...ava/com/pcloud/book/adnews/entity/AdNewsWechatChoose.java
+83
-0
AdContentFromEnum.java
.../java/com/pcloud/book/adnews/enums/AdContentFromEnum.java
+37
-0
AdNewsWechatEnum.java
...n/java/com/pcloud/book/adnews/enums/AdNewsWechatEnum.java
+18
-0
AdNewsFacade.java
...main/java/com/pcloud/book/adnews/facade/AdNewsFacade.java
+8
-1
AdNewsFacadeImpl.java
.../com/pcloud/book/adnews/facade/impl/AdNewsFacadeImpl.java
+13
-1
AdNewsSetMapper.xml
...book/src/main/resources/mapper/adnews/AdNewsSetMapper.xml
+18
-2
AdNewsWechatChooseMapper.xml
...main/resources/mapper/adnews/AdNewsWechatChooseMapper.xml
+115
-0
AdNewsWechatMapper.xml
...k/src/main/resources/mapper/adnews/AdNewsWechatMapper.xml
+68
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/adnews/biz/AdNewsBiz.java
View file @
d87b70b1
...
...
@@ -2,6 +2,7 @@ package com.pcloud.book.adnews.biz;
import
com.pcloud.book.adnews.entity.AdNews
;
import
com.pcloud.book.adnews.entity.AdNewsSet
;
import
com.pcloud.book.adnews.entity.AdNewsWechat
;
import
com.pcloud.common.page.PageBeanNew
;
import
java.util.List
;
...
...
@@ -46,4 +47,42 @@ public interface AdNewsBiz {
* 获取编辑已选取的素材库列表
*/
PageBeanNew
<
AdNews
>
getAdNewsChooseList
(
Long
partyId
,
String
title
,
Boolean
hasUsed
,
Integer
currentPage
,
Integer
numPerPage
);
/**
* 增加公众号反馈
* @param adNewsWechat
* @return
*/
Long
addAdNewsWechat
(
AdNewsWechat
adNewsWechat
);
/**
* 获取公众号列表
* @param currentPage
* @param numPerPage
* @return
*/
PageBeanNew
<
AdNewsWechat
>
getAdNewsWechatList
(
Integer
currentPage
,
Integer
numPerPage
);
/**
* 获取编辑已选择的公众号列表
* @param partyId
* @param currentPage
* @param numPerPage
*/
PageBeanNew
<
AdNewsWechat
>
getAdNewsWechatChooseList
(
Long
partyId
,
Integer
currentPage
,
Integer
numPerPage
);
/**
* 编辑添加选择的公众号
* @param adNewsWechatIds
* @param partyId
*/
void
createAdNewsWechatChooseBatch
(
List
<
Long
>
adNewsWechatIds
,
Long
partyId
);
/**
* 编辑移除选择的公众号
* @param adNewsWechatId
* @param partyId
*/
void
deleteAdNewsWechatChoose
(
Long
adNewsWechatId
,
Long
partyId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/biz/impl/AdNewsBizImpl.java
View file @
d87b70b1
...
...
@@ -54,6 +54,10 @@ public class AdNewsBizImpl implements AdNewsBiz {
@Autowired
private
AdNewsChooseDao
adNewsChooseDao
;
@Autowired
private
AdNewsWechatChooseDao
adNewsWechatChooseDao
;
@Autowired
private
AdNewsWechatDao
adNewsWechatDao
;
@Autowired
private
AdNewsDao
adNewsDao
;
@Autowired
private
AdNewsGroupRecordDao
adNewsGroupRecordDao
;
...
...
@@ -70,9 +74,9 @@ public class AdNewsBizImpl implements AdNewsBiz {
public
Long
createAdNewsSet
(
AdNewsSet
adNewsSet
)
{
adNewsCheck
.
createAdNewsSetCheck
(
adNewsSet
);
//新增之前判断是否有记录
AdNewsSet
adNewsSetOld
=
adNewsSetDao
.
getByPartyId
(
adNewsSet
.
getCreateUser
());
if
(
adNewsSetOld
!=
null
)
{
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"不可重复创建!"
);
AdNewsSet
adNewsSetOld
=
adNewsSetDao
.
getByPartyId
(
adNewsSet
.
getCreateUser
());
if
(
adNewsSetOld
!=
null
)
{
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"不可重复创建!"
);
}
adNewsSetDao
.
insert
(
adNewsSet
);
buildAdNewsGroups
(
adNewsSet
,
adNewsSet
.
getCreateUser
());
...
...
@@ -161,20 +165,20 @@ public class AdNewsBizImpl implements AdNewsBiz {
}
//查询关联
List
<
AdNewsGroup
>
adNewsGroups
=
adNewsGroupDao
.
getListByAdNewsSetId
(
adNewsSetId
);
if
(
ListUtils
.
isEmpty
(
adNewsGroups
)){
if
(
ListUtils
.
isEmpty
(
adNewsGroups
))
{
return
;
}
List
<
Long
>
classifyIds
=
adNewsGroups
.
stream
().
filter
(
s
->
s
.
getClassifyId
()
!=
null
).
map
(
AdNewsGroup:
:
getClassifyId
).
collect
(
Collectors
.
toList
());
//查询关联的群
List
<
GroupQrcodeFoAdDTO
>
groupQrcodeFoAdDTOS
=
groupQrcodeDao
.
GroupQrcodeFoAdDTOSByClassifyIds
(
classifyIds
);
if
(
ListUtils
.
isEmpty
(
groupQrcodeFoAdDTOS
)){
if
(
ListUtils
.
isEmpty
(
groupQrcodeFoAdDTOS
))
{
return
;
}
Integer
sendCount
=
adNewsSet
.
getSendCount
();
//查询要发的记录
Long
adviserId
=
adNewsSet
.
getCreateUser
();
List
<
AdNews
>
adNewsList
=
adNewsDao
.
getNewsToSendBySetIdAndAdviser
(
adNewsSetId
,
adviserId
,
sendCount
);
if
(
ListUtils
.
isEmpty
(
adNewsList
)){
if
(
ListUtils
.
isEmpty
(
adNewsList
))
{
return
;
}
//分成300一组
...
...
@@ -203,11 +207,11 @@ public class AdNewsBizImpl implements AdNewsBiz {
endContent
=
adNewsSet
.
getEndContent
();
}
//循环发送
for
(
GroupQrcodeFoAdDTO
groupQrcodeFoAdDTO
:
groupQrcodeFoAdDTOS
)
{
String
weixinGroupId
=
groupQrcodeFoAdDTO
.
getWeixinGroupId
();
String
robotId
=
wechatGroupConsr
.
getRobotIdByGroupId
(
weixinGroupId
);
if
(
StringUtil
.
isEmpty
(
robotId
)){
LOGGER
.
info
(
"发送编辑端早晚报未找到小号"
+
weixinGroupId
);
for
(
GroupQrcodeFoAdDTO
groupQrcodeFoAdDTO
:
groupQrcodeFoAdDTOS
)
{
String
weixinGroupId
=
groupQrcodeFoAdDTO
.
getWeixinGroupId
();
String
robotId
=
wechatGroupConsr
.
getRobotIdByGroupId
(
weixinGroupId
);
if
(
StringUtil
.
isEmpty
(
robotId
))
{
LOGGER
.
info
(
"发送编辑端早晚报未找到小号"
+
weixinGroupId
);
}
if
(!
StringUtil
.
isEmpty
(
startContent
))
{
//发送开场语
...
...
@@ -246,6 +250,7 @@ public class AdNewsBizImpl implements AdNewsBiz {
public
AdNewsSet
getAdNewsSet
(
Long
partyId
)
{
AdNewsSet
adNewsSet
=
adNewsSetDao
.
getByPartyId
(
partyId
);
if
(
adNewsSet
!=
null
)
{
// 获取勾选的社群
List
<
AdNewsGroup
>
adNewsGroups
=
adNewsGroupDao
.
getListByAdNewsSetId
(
adNewsSet
.
getId
());
adNewsSet
.
setAdNewsGroups
(
adNewsGroups
);
if
(!
ListUtils
.
isEmpty
(
adNewsGroups
))
{
...
...
@@ -260,9 +265,9 @@ public class AdNewsBizImpl implements AdNewsBiz {
@ParamLog
(
"编辑添加选择的早晚报素材"
)
@Override
public
void
createAdNewsChooseBatch
(
List
<
Long
>
adNewsIds
,
Long
partyId
)
{
List
<
AdNewsChoose
>
adNewsChooses
=
new
ArrayList
<>();
for
(
Long
adNewsId
:
adNewsIds
)
{
AdNewsChoose
adNewsChoose
=
new
AdNewsChoose
();
List
<
AdNewsChoose
>
adNewsChooses
=
new
ArrayList
<>();
for
(
Long
adNewsId
:
adNewsIds
)
{
AdNewsChoose
adNewsChoose
=
new
AdNewsChoose
();
adNewsChoose
.
setAdNewsId
(
adNewsId
);
adNewsChoose
.
setAdviserId
(
partyId
);
adNewsChoose
.
setCreateUser
(
partyId
);
...
...
@@ -281,7 +286,7 @@ public class AdNewsBizImpl implements AdNewsBiz {
@ParamLog
(
"编辑移除选择的早晚报素材"
)
@Override
public
void
deleteAdNewsChoose
(
Long
adNewsId
,
Long
partyId
)
{
adNewsChooseDao
.
deleteAdNewsChooseById
(
adNewsId
,
partyId
);
adNewsChooseDao
.
deleteAdNewsChooseById
(
adNewsId
,
partyId
);
}
@ParamLog
(
"获取素材库列表"
)
...
...
@@ -290,7 +295,7 @@ public class AdNewsBizImpl implements AdNewsBiz {
PageParam
pageParam
=
new
PageParam
(
currentPage
,
numPerPage
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"title"
,
title
);
map
.
put
(
"partyId"
,
partyId
);
map
.
put
(
"partyId"
,
partyId
);
PageBeanNew
<
AdNews
>
pageBeanNew
=
adNewsDao
.
listPageNew
(
pageParam
,
map
,
"getAdNewsList"
);
return
pageBeanNew
;
}
...
...
@@ -343,4 +348,57 @@ public class AdNewsBizImpl implements AdNewsBiz {
String
ip
=
Optional
.
ofNullable
(
groupVersion
.
get
(
wechatGroupId
)).
orElse
(
new
BookWxQrcodeDTO
()).
getWechatGroupIp
();
return
ip
;
}
@ParamLog
(
"增加公众号反馈"
)
@Override
public
Long
addAdNewsWechat
(
AdNewsWechat
adNewsWechat
){
return
adNewsWechatDao
.
insert
(
adNewsWechat
);
}
@ParamLog
(
"获取公众号列表"
)
@Override
public
PageBeanNew
<
AdNewsWechat
>
getAdNewsWechatList
(
Integer
currentPage
,
Integer
numPerPage
)
{
PageParam
pageParam
=
new
PageParam
(
currentPage
,
numPerPage
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
PageBeanNew
<
AdNewsWechat
>
pageBeanNew
=
adNewsWechatDao
.
listPageNew
(
pageParam
,
map
,
"getAdNewsWechatList"
);
return
pageBeanNew
;
}
@ParamLog
(
"获取编辑已选取的公众号列表"
)
@Override
public
PageBeanNew
<
AdNewsWechat
>
getAdNewsWechatChooseList
(
Long
partyId
,
Integer
currentPage
,
Integer
numPerPage
)
{
PageParam
pageParam
=
new
PageParam
(
currentPage
,
numPerPage
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"partyId"
,
partyId
);
PageBeanNew
<
AdNewsWechat
>
pageBeanNew
=
adNewsWechatDao
.
listPageNew
(
pageParam
,
map
,
"getAdNewsWechatChooseList"
);
return
pageBeanNew
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ParamLog
(
"编辑添加选择的公众号"
)
@Override
public
void
createAdNewsWechatChooseBatch
(
List
<
Long
>
adNewsWechatIds
,
Long
partyId
)
{
List
<
AdNewsWechatChoose
>
adNewsWechatChooses
=
new
ArrayList
<>();
for
(
Long
adNewsWechatId
:
adNewsWechatIds
)
{
AdNewsWechatChoose
adNewsWechatChoose
=
new
AdNewsWechatChoose
();
adNewsWechatChoose
.
setAdNewsWechatId
(
adNewsWechatId
);
adNewsWechatChoose
.
setAdviserId
(
partyId
);
adNewsWechatChoose
.
setCreateUser
(
partyId
);
adNewsWechatChoose
.
setUpdateUser
(
partyId
);
adNewsWechatChooses
.
add
(
adNewsWechatChoose
);
}
//校验重复添加
Integer
count
=
adNewsWechatChooseDao
.
getCountByAdNewsWechatIdsAndPartyId
(
adNewsWechatIds
,
partyId
);
if
(
count
>
0
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"请勿重复添加!"
);
}
adNewsWechatChooseDao
.
batchInsert
(
adNewsWechatChooses
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ParamLog
(
"编辑移除选择的公众号"
)
@Override
public
void
deleteAdNewsWechatChoose
(
Long
adNewsWechatId
,
Long
partyId
)
{
adNewsWechatChooseDao
.
deleteAdNewsWechatChooseById
(
adNewsWechatId
,
partyId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/check/AdNewsCheck.java
View file @
d87b70b1
package
com
.
pcloud
.
book
.
adnews
.
check
;
import
com.google.common.base.Enums
;
import
com.pcloud.book.adnews.entity.AdNewsGroup
;
import
com.pcloud.book.adnews.entity.AdNewsSet
;
import
com.pcloud.book.adnews.enums.AdContentFromEnum
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.NumberUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
org.springframework.stereotype.Component
;
...
...
@@ -16,49 +19,52 @@ import org.springframework.stereotype.Component;
public
class
AdNewsCheck
{
public
void
createAdNewsSetCheck
(
AdNewsSet
adNewsSet
){
if
(
adNewsSet
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误"
);
public
void
createAdNewsSetCheck
(
AdNewsSet
adNewsSet
)
{
if
(
adNewsSet
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误"
);
}
if
(
ListUtils
.
isEmpty
(
adNewsSet
.
getAdNewsGroups
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"发送群分类不能为空!"
);
if
(
ListUtils
.
isEmpty
(
adNewsSet
.
getAdNewsGroups
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"发送群分类不能为空!"
);
}
if
(
adNewsSet
.
getSendCount
()
==
null
||
adNewsSet
.
getSendCount
()<=
0
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"推送条数不能为空且必须大于0!"
);
if
(
adNewsSet
.
getSendCount
()
==
null
||
adNewsSet
.
getSendCount
()
<=
0
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"推送条数不能为空且必须大于0!"
);
}
if
(
adNewsSet
.
getHasMorningOpen
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"是否开启早报不能为空!"
);
if
(
adNewsSet
.
getHasMorningOpen
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"是否开启早报不能为空!"
);
}
if
(
adNewsSet
.
getHasEveningOpen
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"是否开启晚报不能为空!"
);
if
(
adNewsSet
.
getHasEveningOpen
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"是否开启晚报不能为空!"
);
}
if
(
adNewsSet
.
getHasStartContent
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"是否开启开场语不能为空!"
);
if
(
adNewsSet
.
getHasStartContent
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"是否开启开场语不能为空!"
);
}
if
(
adNewsSet
.
getHasEndContent
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"是否开启结束语不能为空!"
);
if
(
adNewsSet
.
getHasEndContent
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"是否开启结束语不能为空!"
);
}
if
(
adNewsSet
.
getHasMorningOpen
()
&&
StringUtil
.
isEmpty
(
adNewsSet
.
getMorningTime
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"早报时间不能为空!"
);
if
(
adNewsSet
.
getHasMorningOpen
()
&&
StringUtil
.
isEmpty
(
adNewsSet
.
getMorningTime
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"早报时间不能为空!"
);
}
if
(
adNewsSet
.
getHasEveningOpen
()
&&
StringUtil
.
isEmpty
(
adNewsSet
.
getEveningTime
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"晚报时间不能为空!"
);
if
(
adNewsSet
.
getHasEveningOpen
()
&&
StringUtil
.
isEmpty
(
adNewsSet
.
getEveningTime
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"晚报时间不能为空!"
);
}
if
(
adNewsSet
.
getHasStartContent
()
&&
StringUtil
.
isEmpty
(
adNewsSet
.
getStartContent
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"开场语不能为空!"
);
if
(
adNewsSet
.
getHasStartContent
()
&&
StringUtil
.
isEmpty
(
adNewsSet
.
getStartContent
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"开场语不能为空!"
);
}
if
(
adNewsSet
.
getHasEndContent
()
&&
StringUtil
.
isEmpty
(
adNewsSet
.
getEndContent
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"结束语不能为空!"
);
if
(
adNewsSet
.
getHasEndContent
()
&&
StringUtil
.
isEmpty
(
adNewsSet
.
getEndContent
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"结束语不能为空!"
);
}
for
(
AdNewsGroup
adNewsGroup:
adNewsSet
.
getAdNewsGroups
()){
if
(
adNewsGroup
==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"早晚报关联不能为空!"
);
if
(
adNewsSet
.
getContentFrom
()
!=
AdContentFromEnum
.
WECHAT
.
key
&&
adNewsSet
.
getContentFrom
()
!=
AdContentFromEnum
.
CUSTOM
.
key
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"请选择早晚报内容来源!"
);
}
for
(
AdNewsGroup
adNewsGroup
:
adNewsSet
.
getAdNewsGroups
())
{
if
(
adNewsGroup
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"早晚报关联不能为空!"
);
}
if
(
adNewsGroup
.
getClassifyId
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"群分类id不能为空!"
);
if
(
adNewsGroup
.
getClassifyId
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"群分类id不能为空!"
);
}
if
(
adNewsGroup
.
getBookGroupId
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"社群码id不能为空!"
);
if
(
adNewsGroup
.
getBookGroupId
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"社群码id不能为空!"
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/adnews/dao/AdNewsGroupDao.java
View file @
d87b70b1
...
...
@@ -6,9 +6,15 @@ import com.pcloud.common.core.dao.BaseDao;
import
java.util.List
;
public
interface
AdNewsGroupDao
extends
BaseDao
<
AdNewsGroup
>
{
Integer
batchInsert
(
List
<
AdNewsGroup
>
adNewsGroups
);
void
deleteByAdNewsSetId
(
Long
adNewsSetId
);
/**
* 获取勾选关联的社群
* @param adNewsSetId
* @return
*/
List
<
AdNewsGroup
>
getListByAdNewsSetId
(
Long
adNewsSetId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/dao/AdNewsWechatChooseDao.java
0 → 100644
View file @
d87b70b1
package
com
.
pcloud
.
book
.
adnews
.
dao
;
import
com.pcloud.book.adnews.entity.AdNewsChoose
;
import
com.pcloud.book.adnews.entity.AdNewsWechatChoose
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
/**
* @author zhengyongqiang
* @date 2019/8/7 11:47
*/
public
interface
AdNewsWechatChooseDao
extends
BaseDao
<
AdNewsWechatChoose
>
{
Integer
batchInsert
(
List
<
AdNewsWechatChoose
>
adNewsWechatChooses
);
void
deleteAdNewsWechatChooseById
(
Long
adNewsWechatId
,
Long
partyId
);
Integer
getCountByAdNewsWechatIdsAndPartyId
(
List
<
Long
>
adNewsIds
,
Long
partyId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/dao/AdNewsWechatDao.java
0 → 100644
View file @
d87b70b1
package
com
.
pcloud
.
book
.
adnews
.
dao
;
import
com.pcloud.book.adnews.entity.AdNewsWechat
;
import
com.pcloud.common.core.dao.BaseDao
;
/**
* @author zhengyongqiang
* @date 2019/8/7 11:46
*/
public
interface
AdNewsWechatDao
extends
BaseDao
<
AdNewsWechat
>
{
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/dao/impl/AdNewsWechatChooseDaoImpl.java
0 → 100644
View file @
d87b70b1
package
com
.
pcloud
.
book
.
adnews
.
dao
.
impl
;
import
com.pcloud.book.adnews.dao.AdNewsWechatChooseDao
;
import
com.pcloud.book.adnews.entity.AdNewsWechatChoose
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author zhengyongqiang
* @date 2019/8/7 11:52
*/
@Repository
(
"adNewsWechatChooseDao"
)
public
class
AdNewsWechatChooseDaoImpl
extends
BaseDaoImpl
<
AdNewsWechatChoose
>
implements
AdNewsWechatChooseDao
{
@Override
public
Integer
batchInsert
(
List
<
AdNewsWechatChoose
>
adNewsWechatChooses
)
{
return
super
.
getSqlSession
().
insert
(
getStatement
(
"batchInsert"
),
adNewsWechatChooses
);
}
@Override
public
void
deleteAdNewsWechatChooseById
(
Long
adNewsWechatId
,
Long
partyId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"adNewsWechatId"
,
adNewsWechatId
);
map
.
put
(
"partyId"
,
partyId
);
super
.
getSqlSession
().
delete
(
getStatement
(
"deleteAdNewsWechatChooseById"
),
map
);
}
@Override
public
Integer
getCountByAdNewsWechatIdsAndPartyId
(
List
<
Long
>
adNewsWechatIds
,
Long
partyId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"adNewsWechatIds"
,
adNewsWechatIds
);
map
.
put
(
"partyId"
,
partyId
);
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getCountByAdNewsWechatIdsAndPartyId"
),
map
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/dao/impl/AdNewsWechatDaoImpl.java
0 → 100644
View file @
d87b70b1
package
com
.
pcloud
.
book
.
adnews
.
dao
.
impl
;
import
com.pcloud.book.adnews.dao.AdNewsWechatDao
;
import
com.pcloud.book.adnews.entity.AdNewsWechat
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
/**
* @author zhengyongqiang
* @date 2019/8/7 11:52
*/
@Repository
(
"adNewsWechatDao"
)
public
class
AdNewsWechatDaoImpl
extends
BaseDaoImpl
<
AdNewsWechat
>
implements
AdNewsWechatDao
{
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/entity/AdNewsSet.java
View file @
d87b70b1
...
...
@@ -49,6 +49,15 @@ public class AdNewsSet extends BaseEntity {
@ApiModelProperty
(
"修改人"
)
private
Long
updateUser
;
@ApiModelProperty
(
"内容来源"
)
private
Integer
contentFrom
;
@ApiModelProperty
(
"早报内容"
)
private
String
morningContent
;
@ApiModelProperty
(
"晚报内容"
)
private
String
eveningContent
;
@ApiModelProperty
(
"分类关联集合"
)
private
List
<
AdNewsGroup
>
adNewsGroups
;
...
...
@@ -143,6 +152,30 @@ public class AdNewsSet extends BaseEntity {
this
.
updateUser
=
updateUser
;
}
public
Integer
getContentFrom
()
{
return
contentFrom
;
}
public
void
setContentFrom
(
Integer
contentFrom
)
{
this
.
contentFrom
=
contentFrom
;
}
public
String
getMorningContent
()
{
return
morningContent
;
}
public
void
setMorningContent
(
String
morningContent
)
{
this
.
morningContent
=
morningContent
;
}
public
String
getEveningContent
()
{
return
eveningContent
;
}
public
void
setEveningContent
(
String
eveningContent
)
{
this
.
eveningContent
=
eveningContent
;
}
public
List
<
AdNewsGroup
>
getAdNewsGroups
()
{
return
adNewsGroups
;
}
...
...
@@ -173,8 +206,11 @@ public class AdNewsSet extends BaseEntity {
", hasEndContent="
+
hasEndContent
+
", createUser="
+
createUser
+
", updateUser="
+
updateUser
+
", contentFrom="
+
contentFrom
+
", morningContent='"
+
morningContent
+
'\''
+
", eveningContent='"
+
eveningContent
+
'\''
+
", adNewsGroups="
+
adNewsGroups
+
", classifyIds="
+
classifyIds
+
"} "
+
super
.
toString
()
;
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/entity/AdNewsWechat.java
0 → 100644
View file @
d87b70b1
package
com
.
pcloud
.
book
.
adnews
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @author zhengyongqiang
* @date 2019/8/7 11:23
*/
@ApiModel
(
"新闻微信公众号"
)
public
class
AdNewsWechat
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
454065623001378319L
;
public
AdNewsWechat
()
{
}
public
AdNewsWechat
(
String
wechatId
,
String
wechatName
,
Long
adviserId
,
Boolean
isDelete
)
{
this
.
wechatId
=
wechatId
;
this
.
wechatName
=
wechatName
;
this
.
adviserId
=
adviserId
;
this
.
isDelete
=
isDelete
;
}
@ApiModelProperty
(
"微信公众号唯一标识"
)
private
String
wechatId
;
@ApiModelProperty
(
"微信公众号名称"
)
private
String
wechatName
;
@ApiModelProperty
(
"编辑id"
)
private
Long
adviserId
;
@ApiModelProperty
(
"是否删除"
)
private
Boolean
isDelete
;
public
static
long
getSerialVersionUID
()
{
return
serialVersionUID
;
}
public
String
getWechatId
()
{
return
wechatId
;
}
public
void
setWechatId
(
String
wechatId
)
{
this
.
wechatId
=
wechatId
;
}
public
String
getWechatName
()
{
return
wechatName
;
}
public
void
setWechatName
(
String
wechatName
)
{
this
.
wechatName
=
wechatName
;
}
public
Long
getAdviserId
()
{
return
adviserId
;
}
public
void
setAdviserId
(
Long
adviserId
)
{
this
.
adviserId
=
adviserId
;
}
public
Boolean
getDelete
()
{
return
isDelete
;
}
public
void
setDelete
(
Boolean
delete
)
{
isDelete
=
delete
;
}
@Override
public
String
toString
()
{
return
"AdNewsWechat{"
+
"wechatId='"
+
wechatId
+
'\''
+
", wechatName='"
+
wechatName
+
'\''
+
", adviserId="
+
adviserId
+
", isDelete="
+
isDelete
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/entity/AdNewsWechatChoose.java
0 → 100644
View file @
d87b70b1
package
com
.
pcloud
.
book
.
adnews
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @author zhengyongqiang
* @date 2019/8/7 11:32
*/
@ApiModel
(
"新闻公众号选择关联"
)
public
class
AdNewsWechatChoose
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
209558478794921448L
;
@ApiModelProperty
(
"编辑id"
)
private
Long
adviserId
;
@ApiModelProperty
(
"公众号id"
)
private
Long
adNewsWechatId
;
@ApiModelProperty
(
"是否删除"
)
private
Boolean
isDelete
;
@ApiModelProperty
(
"创建人"
)
private
Long
createUser
;
@ApiModelProperty
(
"修改人"
)
private
Long
updateUser
;
public
Long
getAdviserId
()
{
return
adviserId
;
}
public
void
setAdviserId
(
Long
adviserId
)
{
this
.
adviserId
=
adviserId
;
}
public
Long
getAdNewsWechatId
()
{
return
adNewsWechatId
;
}
public
void
setAdNewsWechatId
(
Long
adNewsWechatId
)
{
this
.
adNewsWechatId
=
adNewsWechatId
;
}
public
Boolean
getDelete
()
{
return
isDelete
;
}
public
void
setDelete
(
Boolean
delete
)
{
isDelete
=
delete
;
}
public
Long
getCreateUser
()
{
return
createUser
;
}
public
void
setCreateUser
(
Long
createUser
)
{
this
.
createUser
=
createUser
;
}
public
Long
getUpdateUser
()
{
return
updateUser
;
}
public
void
setUpdateUser
(
Long
updateUser
)
{
this
.
updateUser
=
updateUser
;
}
@Override
public
String
toString
()
{
return
"AdNewsWechatChoose{"
+
"adviserId="
+
adviserId
+
", adNewsWechatId="
+
adNewsWechatId
+
", isDelete="
+
isDelete
+
", createUser="
+
createUser
+
", updateUser="
+
updateUser
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/enums/AdContentFromEnum.java
0 → 100644
View file @
d87b70b1
package
com
.
pcloud
.
book
.
adnews
.
enums
;
import
com.pcloud.book.advertising.enums.AdDetailModeEnum
;
import
org.springframework.amqp.rabbit.support.PublisherCallbackChannelImpl
;
/**
* 早晚报内容来源
*
* @author zhengyongqiang
* @date 2019/8/6 17:50
*/
public
enum
AdContentFromEnum
{
WECHAT
(
0
,
"微信公众号"
),
CUSTOM
(
1
,
"自定义内容 "
);
public
final
Integer
key
;
public
final
String
name
;
AdContentFromEnum
(
Integer
key
,
String
name
)
{
this
.
key
=
key
;
this
.
name
=
name
;
}
public
static
String
getNameByKey
(
String
key
)
{
AdContentFromEnum
[]
var1
=
values
();
int
var2
=
var1
.
length
;
for
(
int
var3
=
0
;
var3
<
var2
;
++
var3
)
{
AdContentFromEnum
methodEnum
=
var1
[
var3
];
if
(
methodEnum
.
key
.
equals
(
key
))
{
return
methodEnum
.
name
;
}
}
return
null
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/enums/AdNewsWechatEnum.java
0 → 100644
View file @
d87b70b1
package
com
.
pcloud
.
book
.
adnews
.
enums
;
/**
* 公众号状态
* @author zhengyongqiang
* @date 2019/8/7 11:37
*/
public
enum
AdNewsWechatEnum
{
EXAMINING
(
0
),
// 审核中
ENABLE
(
1
);
// 已启用
public
final
Integer
key
;
AdNewsWechatEnum
(
Integer
key
){
this
.
key
=
key
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/facade/AdNewsFacade.java
View file @
d87b70b1
...
...
@@ -16,7 +16,6 @@ import java.util.List;
@Api
(
description
=
"推送群消息外部接口"
)
public
interface
AdNewsFacade
{
@ApiOperation
(
"新增编辑端早晚报设置"
)
@PostMapping
(
"/createAdNewsSet"
)
ResponseDto
<?>
createAdNewsSet
(
...
...
@@ -70,4 +69,12 @@ public interface AdNewsFacade {
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页条数"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"增加公众号反馈"
)
@PostMapping
(
"/addAdNewsWechat"
)
ResponseDto
<?>
addAdNewsWechat
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
value
=
"wechatName"
)
@ApiParam
(
"公众号id/微信号"
)
String
wechatName
)
throws
BizException
,
PermissionException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/facade/impl/AdNewsFacadeImpl.java
View file @
d87b70b1
...
...
@@ -2,6 +2,7 @@ package com.pcloud.book.adnews.facade.impl;
import
com.pcloud.book.adnews.biz.AdNewsBiz
;
import
com.pcloud.book.adnews.entity.AdNewsSet
;
import
com.pcloud.book.adnews.entity.AdNewsWechat
;
import
com.pcloud.book.adnews.facade.AdNewsFacade
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.common.dto.ResponseDto
;
...
...
@@ -14,6 +15,7 @@ import io.swagger.annotations.ApiParam;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -144,5 +146,15 @@ public class AdNewsFacadeImpl implements AdNewsFacade {
return
new
ResponseDto
<>(
adNewsBiz
.
getAdNewsChooseList
(
partyId
,
title
,
hasUsed
,
currentPage
,
numPerPage
));
}
@ApiOperation
(
"增加公众号反馈"
)
@PostMapping
(
"/addAdNewsWechat"
)
@Override
public
ResponseDto
<?>
addAdNewsWechat
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
value
=
"wechatName"
)
@ApiParam
(
"公众号id/微信号"
)
String
wechatName
)
throws
BizException
,
PermissionException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
AdNewsWechat
adNewsWechat
=
new
AdNewsWechat
(
null
,
wechatName
,
partyId
,
false
);
return
new
ResponseDto
<>(
adNewsBiz
.
addAdNewsWechat
(
adNewsWechat
));
}
}
pcloud-service-book/src/main/resources/mapper/adnews/AdNewsSetMapper.xml
View file @
d87b70b1
...
...
@@ -21,6 +21,7 @@
<sql
id=
"Base_Column_List"
>
id, morning_time, evening_time, has_morning_open, has_evening_open, send_count, start_content,
end_content, has_start_content, has_end_content, create_user, create_time, update_user, update_time
,content_from,morning_content,evening_content
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
...
...
@@ -45,7 +46,10 @@
create_user,
create_time,
update_user,
update_time
update_time,
content_from,
morning_content,
evening_content
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{morningTime,jdbcType=VARCHAR},
...
...
@@ -61,6 +65,9 @@
NOW(),
#{updateUser,jdbcType=BIGINT},
NOW(),
#{contentFrom,jdbcType=BIGINT},
#{morningContent,jdbcType=VARCHAR},
#{eveningContent,jdbcType=VARCHAR},
</trim>
</insert>
...
...
@@ -97,7 +104,16 @@
<if
test=
"updateUser != null"
>
update_user = #{updateUser,jdbcType=BIGINT},
</if>
update_time = NOW(),
<if
test=
"contentFrom != null"
>
content_from = #{contentFrom,jdbcType=BIGINT},
</if>
<if
test=
"morningContent != null"
>
morning_content = #{morningContent,jdbcType=VARCHAR},
</if>
<if
test=
"eveningContent != null"
>
evening_content = #{eveningContent,jdbcType=VARCHAR},
</if>
update_time = NOW()
</set>
where id = #{id,jdbcType=BIGINT}
</update>
...
...
pcloud-service-book/src/main/resources/mapper/adnews/AdNewsWechatChooseMapper.xml
0 → 100644
View file @
d87b70b1
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.adnews.dao.impl.AdNewsWechatChooseDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.adnews.entity.AdNewsWechatChoose"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"adviser_id"
property=
"adviserId"
jdbcType=
"BIGINT"
/>
<result
column=
"ad_news_wechat_id"
property=
"adNewsWechatId"
jdbcType=
"BIGINT"
/>
<result
column=
"is_delete"
property=
"isDelete"
jdbcType=
"BOOLEAN"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_user"
property=
"createUser"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_user"
property=
"updateUser"
jdbcType=
"BIGINT"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, adviser_id, ad_news_wechat_id, is_delete, create_time, create_user, update_time, update_user
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
select
<include
refid=
"Base_Column_List"
/>
from ad_news_wechat_choose
where id = #{id,jdbcType=BIGINT}
</select>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.adnews.entity.AdNewsWechatChoose"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into ad_news_wechat_choose
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
adviser_id,
ad_news_wechat_id,
is_delete,
create_user,
create_time,
update_user,
update_time
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{adviserId,jdbcType=BIGINT},
#{adNewsWechatId,jdbcType=BIGINT},
0,
#{createUser,jdbcType=BIGINT},
NOW(),
#{updateUser,jdbcType=BIGINT},
NOW(),
</trim>
</insert>
<update
id=
"update"
parameterType=
"com.pcloud.book.adnews.entity.AdNewsWechatChoose"
>
update ad_news_wechat_choose
<set>
<if
test=
"adviserId != null"
>
adviser_id = #{adviserId,jdbcType=BIGINT},
</if>
<if
test=
"adNewsWechatId != null"
>
ad_news_wechat_id = #{adNewsWechatId,jdbcType=BIGINT},
</if>
<if
test=
"isDelete != null"
>
is_delete = #{isDelete,jdbcType=BOOLEAN},
</if>
<if
test=
"updateUser != null"
>
update_user = #{updateUser,jdbcType=VARCHAR},
</if>
update_time=now()
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<!--批量新增-->
<insert
id=
"batchInsert"
useGeneratedKeys=
"true"
parameterType=
"java.util.List"
>
insert into ad_news_wechat_choose (
adviser_id,
ad_news_wechat_id,
is_delete,
create_user,
create_time,
update_user,
update_time
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.adviserId,jdbcType=BIGINT},
#{item.adNewsWechatId,jdbcType=BIGINT},
0,
#{item.createUser,jdbcType=BIGINT},
NOW(),
#{item.updateUser,jdbcType=BIGINT},
NOW()
)
</foreach>
</insert>
<!--根据id删除-->
<update
id=
"deleteAdNewsWechatChooseById"
parameterType=
"map"
>
update ad_news_wechat_choose set
is_delete=1,
update_user=#{partyId},
update_time=now()
where ad_news_wechat_id=#{adNewsWechatId}
</update>
<!--根据条件获取数量-->
<select
id=
"getCountByAdNewsWechatIdsAndPartyId"
parameterType=
"map"
resultType=
"Integer"
>
select count(1) from ad_news_wechat_choose where
is_delete=0
and adviser_id=#{partyId}
and ad_news_wechat_id in
<foreach
collection=
"adNewsWechatIds"
item=
"item"
index=
"index"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/adnews/AdNewsWechatMapper.xml
0 → 100644
View file @
d87b70b1
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.adnews.dao.impl.AdNewsWechatDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.adnews.entity.AdNewsWechat"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"wechat_id"
property=
"wechatId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wechat_name"
property=
"wechatName"
jdbcType=
"VARCHAR"
/>
<result
column=
"adviser_id"
property=
"adviserId"
jdbcType=
"BIGINT"
/>
<result
column=
"is_delete"
property=
"isDelete"
jdbcType=
"BOOLEAN"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, wechat_id, wechat_name, adviser_id, is_delete, create_time, update_time
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
select
<include
refid=
"Base_Column_List"
/>
from ad_news_wechat
where id = #{id,jdbcType=BIGINT}
</select>
<!--获取公众号列表-->
<select
id=
"getAdNewsWechatList"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ad_news_wechat
where
wechat_id IS NOT NULL
order by id desc
</select>
<!--获取编辑已选中的公众号列表-->
<select
id=
"getAdNewsWechatChooseList"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
SELECT
a.id,
a.wechat_id,
a.wechat_name,
a.adviser_id,
a.is_delete,
a.create_time,
a.update_time
FROM
ad_news_wechat a
LEFT JOIN ad_news_wechat_choose b ON b.ad_news_wechat_id = b.id
AND b.is_delete = 0
AND b.adviser_id = #{partyId}
WHERE
a.`wechat_id` IS NOT NULL
</select>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.adnews.entity.AdNewsWechat"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into ad_news_wechat
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
wechat_id, wechat_name, adviser_id, is_delete, create_time
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{wechatId,jdbcType=VARCHAR},
#{wechatName,jdbcType=VARCHAR},
#{adviserId,jdbcType=BIGINT},
#{isDelete,jdbcType=BOOLEAN},
NOW()
</trim>
</insert>
</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