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
1c61f4ee
Commit
1c61f4ee
authored
Aug 13, 2019
by
郑永强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
早晚报发送记录
parent
3fcf97af
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
215 additions
and
90 deletions
+215
-90
AdNewsBizImpl.java
...n/java/com/pcloud/book/adnews/biz/impl/AdNewsBizImpl.java
+40
-8
AdNewsMessageStatisticDao.java
...com/pcloud/book/adnews/dao/AdNewsMessageStatisticDao.java
+14
-0
AdNewsMessageStatisticDaoImpl.java
...d/book/adnews/dao/impl/AdNewsMessageStatisticDaoImpl.java
+21
-0
AdNewsGroupRecord.java
...java/com/pcloud/book/adnews/entity/AdNewsGroupRecord.java
+7
-79
AdNewsMessageStatistic.java
...com/pcloud/book/adnews/entity/AdNewsMessageStatistic.java
+40
-0
AdNewsGroupRecordMapper.xml
.../main/resources/mapper/adnews/AdNewsGroupRecordMapper.xml
+10
-2
AdNewsMapper.xml
...ce-book/src/main/resources/mapper/adnews/AdNewsMapper.xml
+1
-1
AdNewsMessageStatisticMapper.xml
.../resources/mapper/adnews/AdNewsMessageStatisticMapper.xml
+79
-0
AdNewsSetMapper.xml
...book/src/main/resources/mapper/adnews/AdNewsSetMapper.xml
+3
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/adnews/biz/impl/AdNewsBizImpl.java
View file @
1c61f4ee
...
@@ -58,6 +58,8 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -58,6 +58,8 @@ public class AdNewsBizImpl implements AdNewsBiz {
@Autowired
@Autowired
private
AdNewsGroupRecordDao
adNewsGroupRecordDao
;
private
AdNewsGroupRecordDao
adNewsGroupRecordDao
;
@Autowired
@Autowired
private
AdNewsMessageStatisticDao
adNewsMessageStatisticDao
;
@Autowired
private
AdNewsBanDao
adNewsBanDao
;
private
AdNewsBanDao
adNewsBanDao
;
@Autowired
@Autowired
private
ScheduleService
scheduleService
;
private
ScheduleService
scheduleService
;
...
@@ -186,8 +188,15 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -186,8 +188,15 @@ public class AdNewsBizImpl implements AdNewsBiz {
// 需要发送的早晚报内容
// 需要发送的早晚报内容
List
<
String
>
contents
=
new
ArrayList
<>();
List
<
String
>
contents
=
new
ArrayList
<>();
// 插入发送记录
List
<
AdNewsGroupRecord
>
adNewsGroupRecords
=
new
ArrayList
<>();
// 插入消息统计信息
List
<
AdNewsMessageStatistic
>
adNewsMessageStatistics
=
new
ArrayList
<>();
// for循环内的临时变量
// for循环内的临时变量
AdNewsGroupRecord
adNewsGroupRecord
;
AdNewsGroupRecord
adNewsGroupRecord
;
AdNewsMessageStatistic
adNewsMessageStatistic
;
if
(
adNewsSet
.
getContentFrom
()
==
AdContentFromEnum
.
WECHAT
.
key
)
{
if
(
adNewsSet
.
getContentFrom
()
==
AdContentFromEnum
.
WECHAT
.
key
)
{
...
@@ -200,8 +209,6 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -200,8 +209,6 @@ public class AdNewsBizImpl implements AdNewsBiz {
contents
=
this
.
concatContent
(
adNewsList
);
contents
=
this
.
concatContent
(
adNewsList
);
// 通过机器人小号发送消息到微信群
// 通过机器人小号发送消息到微信群
this
.
sendAdNewsToWechatGroup
(
adNewsSet
,
groupQrcodeFoAdDTOS
,
contents
);
this
.
sendAdNewsToWechatGroup
(
adNewsSet
,
groupQrcodeFoAdDTOS
,
contents
);
//插入发送记录
List
<
AdNewsGroupRecord
>
adNewsGroupRecords
=
new
ArrayList
<>();
for
(
GroupQrcodeFoAdDTO
groupQrcodeFoAdDTO
:
groupQrcodeFoAdDTOS
)
{
for
(
GroupQrcodeFoAdDTO
groupQrcodeFoAdDTO
:
groupQrcodeFoAdDTOS
)
{
for
(
AdNews
adNews
:
adNewsList
)
{
for
(
AdNews
adNews
:
adNewsList
)
{
adNewsGroupRecord
=
new
AdNewsGroupRecord
();
adNewsGroupRecord
=
new
AdNewsGroupRecord
();
...
@@ -212,11 +219,21 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -212,11 +219,21 @@ public class AdNewsBizImpl implements AdNewsBiz {
adNewsGroupRecord
.
setQrcodeId
(
groupQrcodeFoAdDTO
.
getQrcodeId
());
adNewsGroupRecord
.
setQrcodeId
(
groupQrcodeFoAdDTO
.
getQrcodeId
());
adNewsGroupRecord
.
setCreateUser
(
adNewsSet
.
getCreateUser
());
adNewsGroupRecord
.
setCreateUser
(
adNewsSet
.
getCreateUser
());
adNewsGroupRecord
.
setUpdateUser
(
adNewsSet
.
getCreateUser
());
adNewsGroupRecord
.
setUpdateUser
(
adNewsSet
.
getCreateUser
());
adNewsGroupRecord
.
setInsertMark
(
groupQrcodeFoAdDTOS
.
indexOf
(
groupQrcodeFoAdDTO
));
adNewsGroupRecords
.
add
(
adNewsGroupRecord
);
adNewsGroupRecords
.
add
(
adNewsGroupRecord
);
}
}
// 统计记录
adNewsMessageStatistic
=
new
AdNewsMessageStatistic
();
adNewsMessageStatistic
.
setAdNewsSetId
(
adNewsSetId
);
adNewsMessageStatistic
.
setBookGroupId
(
groupQrcodeFoAdDTO
.
getBookGroupId
());
adNewsMessageStatistic
.
setClassifyId
(
groupQrcodeFoAdDTO
.
getClassifyId
());
adNewsMessageStatistic
.
setQrcodeId
(
groupQrcodeFoAdDTO
.
getQrcodeId
());
adNewsMessageStatistic
.
setCreateUser
(
adNewsSet
.
getCreateUser
());
adNewsMessageStatistic
.
setContentFrom
(
adNewsSet
.
getContentFrom
());
adNewsMessageStatistic
.
setMessageCount
(
adNewsList
.
size
());
adNewsMessageStatistic
.
setInsertMark
(
groupQrcodeFoAdDTOS
.
indexOf
(
groupQrcodeFoAdDTO
));
adNewsMessageStatistics
.
add
(
adNewsMessageStatistic
);
}
}
adNewsGroupRecordDao
.
batchInsert
(
adNewsGroupRecords
);
}
else
if
(
adNewsSet
.
getContentFrom
()
==
AdContentFromEnum
.
CUSTOM
.
key
)
{
}
else
if
(
adNewsSet
.
getContentFrom
()
==
AdContentFromEnum
.
CUSTOM
.
key
)
{
if
(
StringUtil
.
isEmpty
(
adNewsSet
.
getMorningContent
()))
{
if
(
StringUtil
.
isEmpty
(
adNewsSet
.
getMorningContent
()))
{
...
@@ -232,8 +249,6 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -232,8 +249,6 @@ public class AdNewsBizImpl implements AdNewsBiz {
contents
.
add
(
customContent
);
contents
.
add
(
customContent
);
// 通过机器人小号发送消息到微信群
// 通过机器人小号发送消息到微信群
this
.
sendAdNewsToWechatGroup
(
adNewsSet
,
groupQrcodeFoAdDTOS
,
contents
);
this
.
sendAdNewsToWechatGroup
(
adNewsSet
,
groupQrcodeFoAdDTOS
,
contents
);
//插入发送记录
List
<
AdNewsGroupRecord
>
adNewsGroupRecords
=
new
ArrayList
<>();
for
(
GroupQrcodeFoAdDTO
groupQrcodeFoAdDTO
:
groupQrcodeFoAdDTOS
)
{
for
(
GroupQrcodeFoAdDTO
groupQrcodeFoAdDTO
:
groupQrcodeFoAdDTOS
)
{
adNewsGroupRecord
=
new
AdNewsGroupRecord
();
adNewsGroupRecord
=
new
AdNewsGroupRecord
();
adNewsGroupRecord
.
setAdNewsSetId
(
adNewsSetId
);
adNewsGroupRecord
.
setAdNewsSetId
(
adNewsSetId
);
...
@@ -243,10 +258,27 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -243,10 +258,27 @@ public class AdNewsBizImpl implements AdNewsBiz {
adNewsGroupRecord
.
setCreateUser
(
adNewsSet
.
getCreateUser
());
adNewsGroupRecord
.
setCreateUser
(
adNewsSet
.
getCreateUser
());
adNewsGroupRecord
.
setUpdateUser
(
adNewsSet
.
getCreateUser
());
adNewsGroupRecord
.
setUpdateUser
(
adNewsSet
.
getCreateUser
());
adNewsGroupRecord
.
setCustomContent
(
customContent
);
adNewsGroupRecord
.
setCustomContent
(
customContent
);
adNewsGroupRecord
.
setInsertMark
(
groupQrcodeFoAdDTOS
.
indexOf
(
groupQrcodeFoAdDTO
));
adNewsGroupRecords
.
add
(
adNewsGroupRecord
);
adNewsGroupRecords
.
add
(
adNewsGroupRecord
);
// 统计记录
adNewsMessageStatistic
=
new
AdNewsMessageStatistic
();
adNewsMessageStatistic
.
setAdNewsSetId
(
adNewsSetId
);
adNewsMessageStatistic
.
setBookGroupId
(
groupQrcodeFoAdDTO
.
getBookGroupId
());
adNewsMessageStatistic
.
setClassifyId
(
groupQrcodeFoAdDTO
.
getClassifyId
());
adNewsMessageStatistic
.
setQrcodeId
(
groupQrcodeFoAdDTO
.
getQrcodeId
());
adNewsMessageStatistic
.
setCreateUser
(
adNewsSet
.
getCreateUser
());
adNewsMessageStatistic
.
setContentFrom
(
adNewsSet
.
getContentFrom
());
adNewsMessageStatistic
.
setMessageCount
(
1
);
adNewsMessageStatistic
.
setInsertMark
(
groupQrcodeFoAdDTOS
.
indexOf
(
groupQrcodeFoAdDTO
));
adNewsMessageStatistics
.
add
(
adNewsMessageStatistic
);
}
}
adNewsGroupRecordDao
.
batchInsert
(
adNewsGroupRecords
);
}
}
adNewsMessageStatisticDao
.
batchInsert
(
adNewsMessageStatistics
);
// 不会mybatis的主从表批量插入,所以只能这么做
for
(
AdNewsMessageStatistic
item
:
adNewsMessageStatistics
){
adNewsGroupRecords
.
stream
().
filter
(
x
->
x
.
getInsertMark
()==
item
.
getInsertMark
()).
forEach
(
x
->
x
.
setMessageStatisticId
(
item
.
getId
()));
}
adNewsGroupRecordDao
.
batchInsert
(
adNewsGroupRecords
);
}
}
/**
/**
...
@@ -425,7 +457,7 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -425,7 +457,7 @@ public class AdNewsBizImpl implements AdNewsBiz {
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
sendTextMessageVO
.
setContent
(
content
);
sendTextMessageVO
.
setContent
(
content
);
sendTextMessageVO
.
setAltId
(
robotId
);
sendTextMessageVO
.
setAltId
(
robotId
);
sendTextMessageVO
.
setGroupId
(
weixinGroupId
);
sendTextMessageVO
.
set
Wx
GroupId
(
weixinGroupId
);
sendTextMessageVO
.
setIp
(
findIp
(
weixinGroupId
));
sendTextMessageVO
.
setIp
(
findIp
(
weixinGroupId
));
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
LOGGER
.
info
(
"发送编辑端早晚报"
+
sendTextMessageVO
.
toString
());
LOGGER
.
info
(
"发送编辑端早晚报"
+
sendTextMessageVO
.
toString
());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/adnews/dao/AdNewsMessageStatisticDao.java
0 → 100644
View file @
1c61f4ee
package
com
.
pcloud
.
book
.
adnews
.
dao
;
import
com.pcloud.book.adnews.entity.AdNewsMessageStatistic
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
/**
* @author zhengyongqiang
* @date 2019/8/13 19:05
*/
public
interface
AdNewsMessageStatisticDao
extends
BaseDao
<
AdNewsMessageStatistic
>
{
Integer
batchInsert
(
List
<
AdNewsMessageStatistic
>
list
);
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/dao/impl/AdNewsMessageStatisticDaoImpl.java
0 → 100644
View file @
1c61f4ee
package
com
.
pcloud
.
book
.
adnews
.
dao
.
impl
;
import
com.pcloud.book.adnews.dao.AdNewsMessageStatisticDao
;
import
com.pcloud.book.adnews.entity.AdNewsGroupRecord
;
import
com.pcloud.book.adnews.entity.AdNewsMessageStatistic
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* @author zhengyongqiang
* @date 2019/8/13 19:05
*/
@Repository
(
"adNewsMessageStatisticDao"
)
public
class
AdNewsMessageStatisticDaoImpl
extends
BaseDaoImpl
<
AdNewsMessageStatistic
>
implements
AdNewsMessageStatisticDao
{
@Override
public
Integer
batchInsert
(
List
<
AdNewsMessageStatistic
>
list
)
{
return
super
.
getSqlSession
().
insert
(
getStatement
(
"batchInsert"
),
list
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/entity/AdNewsGroupRecord.java
View file @
1c61f4ee
...
@@ -3,6 +3,7 @@ package com.pcloud.book.adnews.entity;
...
@@ -3,6 +3,7 @@ package com.pcloud.book.adnews.entity;
import
com.pcloud.common.entity.BaseEntity
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
/**
* @Description
* @Description
...
@@ -10,10 +11,14 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -10,10 +11,14 @@ import io.swagger.annotations.ApiModelProperty;
* @Date 2019/7/17 15:55
* @Date 2019/7/17 15:55
**/
**/
@ApiModel
(
"编辑新闻发送记录"
)
@ApiModel
(
"编辑新闻发送记录"
)
@Data
public
class
AdNewsGroupRecord
extends
BaseEntity
{
public
class
AdNewsGroupRecord
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
-
3271071194854381077L
;
private
static
final
long
serialVersionUID
=
-
3271071194854381077L
;
@ApiModelProperty
(
"消息统计表id"
)
private
Long
messageStatisticId
;
@ApiModelProperty
(
"群id"
)
@ApiModelProperty
(
"群id"
)
private
Long
qrcodeId
;
private
Long
qrcodeId
;
...
@@ -38,83 +43,6 @@ public class AdNewsGroupRecord extends BaseEntity{
...
@@ -38,83 +43,6 @@ public class AdNewsGroupRecord extends BaseEntity{
@ApiModelProperty
(
"自定义内容"
)
@ApiModelProperty
(
"自定义内容"
)
private
String
customContent
;
private
String
customContent
;
public
Long
getQrcodeId
()
{
@ApiModelProperty
(
"insert时父子表标识"
)
return
qrcodeId
;
Integer
insertMark
;
}
public
void
setQrcodeId
(
Long
qrcodeId
)
{
this
.
qrcodeId
=
qrcodeId
;
}
public
Long
getClassifyId
()
{
return
classifyId
;
}
public
void
setClassifyId
(
Long
classifyId
)
{
this
.
classifyId
=
classifyId
;
}
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
public
Long
getAdNewsId
()
{
return
adNewsId
;
}
public
void
setAdNewsId
(
Long
adNewsId
)
{
this
.
adNewsId
=
adNewsId
;
}
public
Long
getAdNewsSetId
()
{
return
adNewsSetId
;
}
public
void
setAdNewsSetId
(
Long
adNewsSetId
)
{
this
.
adNewsSetId
=
adNewsSetId
;
}
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
;
}
public
String
getCustomContent
()
{
return
customContent
;
}
public
void
setCustomContent
(
String
customContent
)
{
this
.
customContent
=
customContent
;
}
@Override
public
String
toString
()
{
return
"AdNewsGroupRecord{"
+
"qrcodeId="
+
qrcodeId
+
", classifyId="
+
classifyId
+
", bookGroupId="
+
bookGroupId
+
", adNewsId="
+
adNewsId
+
", adNewsSetId="
+
adNewsSetId
+
", createUser="
+
createUser
+
", updateUser="
+
updateUser
+
", customContent='"
+
customContent
+
'\''
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
'}'
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/entity/AdNewsMessageStatistic.java
0 → 100644
View file @
1c61f4ee
package
com
.
pcloud
.
book
.
adnews
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author zhengyongqiang
* @date 2019/8/13 18:51
*/
@ApiModel
(
"消息记录统计表"
)
@Data
public
class
AdNewsMessageStatistic
extends
BaseEntity
{
@ApiModelProperty
(
"群id"
)
private
Long
qrcodeId
;
@ApiModelProperty
(
"分类id"
)
private
Long
classifyId
;
@ApiModelProperty
(
"社群码id"
)
private
Long
bookGroupId
;
@ApiModelProperty
(
"编辑新闻设置id"
)
private
Long
adNewsSetId
;
@ApiModelProperty
(
"内容来源"
)
private
Integer
contentFrom
;
@ApiModelProperty
(
"发送消息数"
)
private
Integer
messageCount
;
@ApiModelProperty
(
"创建人"
)
private
Long
createUser
;
@ApiModelProperty
(
"insert时父子表标识"
)
Integer
insertMark
;
}
pcloud-service-book/src/main/resources/mapper/adnews/AdNewsGroupRecordMapper.xml
View file @
1c61f4ee
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<mapper
namespace=
"com.pcloud.book.adnews.dao.impl.AdNewsGroupRecordDaoImpl"
>
<mapper
namespace=
"com.pcloud.book.adnews.dao.impl.AdNewsGroupRecordDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.adnews.entity.AdNewsGroupRecord"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.adnews.entity.AdNewsGroupRecord"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"message_statistic_id"
property=
"messageStatisticId"
jdbcType=
"BIGINT"
/>
<result
column=
"qrcode_id"
property=
"qrcodeId"
jdbcType=
"BIGINT"
/>
<result
column=
"qrcode_id"
property=
"qrcodeId"
jdbcType=
"BIGINT"
/>
<result
column=
"classify_id"
property=
"classifyId"
jdbcType=
"BIGINT"
/>
<result
column=
"classify_id"
property=
"classifyId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_group_id"
property=
"bookGroupId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_group_id"
property=
"bookGroupId"
jdbcType=
"BIGINT"
/>
...
@@ -16,7 +17,7 @@
...
@@ -16,7 +17,7 @@
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, qrcode_id, classify_id, book_group_id, ad_news_id, ad_news_set_id, create_user, create_time, update_user, update_time, custom_content
id,
message_statistic_id,
qrcode_id, classify_id, book_group_id, ad_news_id, ad_news_set_id, create_user, create_time, update_user, update_time, custom_content
</sql>
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
...
@@ -29,6 +30,7 @@
...
@@ -29,6 +30,7 @@
<insert
id=
"insert"
parameterType=
"com.pcloud.book.adnews.entity.AdNewsGroupRecord"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.adnews.entity.AdNewsGroupRecord"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into ad_news_group_record
insert into ad_news_group_record
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
message_statistic_id,
qrcode_id,
qrcode_id,
classify_id,
classify_id,
book_group_id,
book_group_id,
...
@@ -41,6 +43,7 @@
...
@@ -41,6 +43,7 @@
custom_content
custom_content
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{messageStatisticId,jdbcType=BIGINT},
#{qrcodeId,jdbcType=BIGINT},
#{qrcodeId,jdbcType=BIGINT},
#{classifyId,jdbcType=BIGINT},
#{classifyId,jdbcType=BIGINT},
#{bookGroupId,jdbcType=BIGINT},
#{bookGroupId,jdbcType=BIGINT},
...
@@ -57,6 +60,9 @@
...
@@ -57,6 +60,9 @@
<update
id=
"update"
parameterType=
"com.pcloud.book.adnews.entity.AdNewsGroupRecord"
>
<update
id=
"update"
parameterType=
"com.pcloud.book.adnews.entity.AdNewsGroupRecord"
>
update ad_news_group_record
update ad_news_group_record
<set>
<set>
<if
test=
"messageStatisticId != null"
>
message_statistic_id = #{messageStatisticId,jdbcType=BIGINT},
</if>
<if
test=
"qrcodeId != null"
>
<if
test=
"qrcodeId != null"
>
qrcode_id = #{qrcodeId,jdbcType=BIGINT},
qrcode_id = #{qrcodeId,jdbcType=BIGINT},
</if>
</if>
...
@@ -86,6 +92,7 @@
...
@@ -86,6 +92,7 @@
<!--批量新增-->
<!--批量新增-->
<insert
id=
"batchInsert"
useGeneratedKeys=
"true"
parameterType=
"java.util.List"
>
<insert
id=
"batchInsert"
useGeneratedKeys=
"true"
parameterType=
"java.util.List"
>
insert into ad_news_group_record (
insert into ad_news_group_record (
message_statistic_id,
qrcode_id,
qrcode_id,
classify_id,
classify_id,
book_group_id,
book_group_id,
...
@@ -100,6 +107,7 @@
...
@@ -100,6 +107,7 @@
values
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
(
#{item.messageStatisticId,jdbcType=BIGINT},
#{item.qrcodeId,jdbcType=BIGINT},
#{item.qrcodeId,jdbcType=BIGINT},
#{item.classifyId,jdbcType=BIGINT},
#{item.classifyId,jdbcType=BIGINT},
#{item.bookGroupId,jdbcType=BIGINT},
#{item.bookGroupId,jdbcType=BIGINT},
...
@@ -109,7 +117,7 @@
...
@@ -109,7 +117,7 @@
NOW(),
NOW(),
#{item.updateUser,jdbcType=BIGINT},
#{item.updateUser,jdbcType=BIGINT},
NOW(),
NOW(),
#{customContent,jdbcType=VARCHAR}
#{
item.
customContent,jdbcType=VARCHAR}
)
)
</foreach>
</foreach>
</insert>
</insert>
...
...
pcloud-service-book/src/main/resources/mapper/adnews/AdNewsMapper.xml
View file @
1c61f4ee
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
-->
-->
<select
id=
"getNewsToSendBySetIdAndAdviser"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
<select
id=
"getNewsToSendBySetIdAndAdviser"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
SELECT
SELECT
<include
refid=
"Base_Column_List"
/>
a.id, a.type, a.news_from, a.title, a.publisher, a.url, a.short_url, a.news_date, a.create_time
FROM
FROM
ad_news a
ad_news a
INNER JOIN ad_news_wechat b ON a.news_from = b.news_from AND b.is_delete = 0
INNER JOIN ad_news_wechat b ON a.news_from = b.news_from AND b.is_delete = 0
...
...
pcloud-service-book/src/main/resources/mapper/adnews/AdNewsMessageStatisticMapper.xml
0 → 100644
View file @
1c61f4ee
<?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.AdNewsMessageStatisticDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.adnews.entity.AdNewsMessageStatistic"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"qrcode_id"
property=
"qrcodeId"
jdbcType=
"BIGINT"
/>
<result
column=
"classify_id"
property=
"classifyId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_group_id"
property=
"bookGroupId"
jdbcType=
"BIGINT"
/>
<result
column=
"ad_news_set_id"
property=
"adNewsSetId"
jdbcType=
"BIGINT"
/>
<result
column=
"content_from"
property=
"contentFrom"
jdbcType=
"INTEGER"
/>
<result
column=
"message_count"
property=
"messageCount"
jdbcType=
"INTEGER"
/>
<result
column=
"create_user"
property=
"createUser"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, qrcode_id, classify_id, book_group_id, ad_news_set_id, content_from, message_count, create_user, create_time
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
select
<include
refid=
"Base_Column_List"
/>
from ad_news_group_record
where id = #{id,jdbcType=BIGINT}
</select>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.adnews.entity.AdNewsMessageStatistic"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into ad_news_message_statistic
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
qrcode_id,
classify_id,
book_group_id,
ad_news_set_id,
content_from,
message_count,
create_user,
create_time
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{qrcodeId,jdbcType=BIGINT},
#{classifyId,jdbcType=BIGINT},
#{bookGroupId,jdbcType=BIGINT},
#{adNewsSetId,jdbcType=BIGINT},
#{contentFrom,jdbcType=INTEGER},
#{messageCount,jdbcType=INTEGER},
#{createUser,jdbcType=BIGINT},
NOW()
</trim>
</insert>
<!--批量新增-->
<insert
id=
"batchInsert"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"java.util.List"
>
insert into ad_news_message_statistic (
qrcode_id,
classify_id,
book_group_id,
ad_news_set_id,
content_from,
message_count,
create_user,
create_time
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.qrcodeId,jdbcType=BIGINT},
#{item.classifyId,jdbcType=BIGINT},
#{item.bookGroupId,jdbcType=BIGINT},
#{item.adNewsSetId,jdbcType=BIGINT},
#{item.contentFrom,jdbcType=INTEGER},
#{item.messageCount,jdbcType=INTEGER},
#{item.createUser,jdbcType=BIGINT},
NOW()
)
</foreach>
</insert>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/adnews/AdNewsSetMapper.xml
View file @
1c61f4ee
...
@@ -16,6 +16,9 @@
...
@@ -16,6 +16,9 @@
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_user"
property=
"updateUser"
jdbcType=
"BIGINT"
/>
<result
column=
"update_user"
property=
"updateUser"
jdbcType=
"BIGINT"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"content_from"
property=
"contentFrom"
jdbcType=
"INTEGER"
/>
<result
column=
"morning_content"
property=
"morningContent"
jdbcType=
"VARCHAR"
/>
<result
column=
"evening_content"
property=
"eveningContent"
jdbcType=
"VARCHAR"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
...
...
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