Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
e8344bb9
Commit
e8344bb9
authored
Mar 28, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 好办sharding 分表
parent
64758415
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
57 deletions
+14
-57
pom.xml
haoban-manage3-service/pom.xml
+1
-1
TabHaobanInteractRecordMapper.java
...ice/dao/mapper/content/TabHaobanInteractRecordMapper.java
+1
-1
TabHaobanInteractRecordServiceImpl.java
...vice/content/impl/TabHaobanInteractRecordServiceImpl.java
+1
-1
applicationContext-conf.xml
...e3-service/src/main/resources/applicationContext-conf.xml
+3
-2
jdbc-haoban-manage-service-sharding.xml
...rc/main/resources/jdbc-haoban-manage-service-sharding.xml
+1
-1
TabHaobanInteractRecordMapper.xml
...esources/mapper/content/TabHaobanInteractRecordMapper.xml
+1
-50
MaterialReportServiceTest.java
...age3-service/src/test/java/MaterialReportServiceTest.java
+6
-1
No files found.
haoban-manage3-service/pom.xml
View file @
e8344bb9
...
@@ -178,7 +178,7 @@
...
@@ -178,7 +178,7 @@
<dependency>
<dependency>
<groupId>
com.gic
</groupId>
<groupId>
com.gic
</groupId>
<artifactId>
gic-sharding-sdk
</artifactId>
<artifactId>
gic-sharding-sdk
</artifactId>
<version>
3
.0-SNAPSHOT
</version>
<version>
4
.0-SNAPSHOT
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/content/TabHaobanInteractRecordMapper.java
View file @
e8344bb9
...
@@ -29,7 +29,7 @@ public interface TabHaobanInteractRecordMapper {
...
@@ -29,7 +29,7 @@ public interface TabHaobanInteractRecordMapper {
* @param pageable 分页对象
* @param pageable 分页对象
* @return 对象列表
* @return 对象列表
*/
*/
List
<
TabHaobanInteractRecord
>
queryAllByLimit
(
TabHaobanInteractRecord
tabHaobanInteractRecord
,
@Param
(
"pageable"
)
Pageable
pageable
);
List
<
TabHaobanInteractRecord
>
queryAllByLimit
(
TabHaobanInteractRecord
tabHaobanInteractRecord
);
/**
/**
* 统计总行数
* 统计总行数
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/impl/TabHaobanInteractRecordServiceImpl.java
View file @
e8344bb9
...
@@ -42,7 +42,7 @@ public class TabHaobanInteractRecordServiceImpl implements TabHaobanInteractReco
...
@@ -42,7 +42,7 @@ public class TabHaobanInteractRecordServiceImpl implements TabHaobanInteractReco
@Override
@Override
public
Page
<
TabHaobanInteractRecord
>
queryByPage
(
TabHaobanInteractRecord
tabHaobanInteractRecord
,
PageRequest
pageRequest
)
{
public
Page
<
TabHaobanInteractRecord
>
queryByPage
(
TabHaobanInteractRecord
tabHaobanInteractRecord
,
PageRequest
pageRequest
)
{
long
total
=
this
.
tabHaobanInteractRecordMapper
.
count
(
tabHaobanInteractRecord
);
long
total
=
this
.
tabHaobanInteractRecordMapper
.
count
(
tabHaobanInteractRecord
);
return
new
PageImpl
<>(
this
.
tabHaobanInteractRecordMapper
.
queryAllByLimit
(
tabHaobanInteractRecord
,
pageRequest
),
pageRequest
,
total
);
return
new
PageImpl
<>(
this
.
tabHaobanInteractRecordMapper
.
queryAllByLimit
(
tabHaobanInteractRecord
),
pageRequest
,
total
);
}
}
/**
/**
...
...
haoban-manage3-service/src/main/resources/applicationContext-conf.xml
View file @
e8344bb9
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<import
resource=
"classpath*:kafka-setting.xml"
/>
<import
resource=
"classpath*:kafka-setting.xml"
/>
<import
resource=
"classpath:dubbo-haoban-manage-service.xml"
/>
<import
resource=
"classpath:dubbo-haoban-manage-service.xml"
/>
<import
resource=
"classpath:dubbo-setting-test.xml"
/>
<import
resource=
"classpath:dubbo-setting-test.xml"
/>
<import
resource=
"classpath:jdbc-haoban-manage-service.xml"
/
>
<!-- <import resource="classpath:jdbc-haoban-manage-service.xml" />--
>
<!-- <import resource="classpath*:jdbc-haoban-manage-service-sharding.xml" />--
>
<import
resource=
"classpath*:jdbc-haoban-manage-service-sharding.xml"
/
>
<import
resource=
"classpath*:log-record-init.xml"
/>
<import
resource=
"classpath*:log-record-init.xml"
/>
</beans>
</beans>
\ No newline at end of file
haoban-manage3-service/src/main/resources/jdbc-haoban-manage-service-sharding.xml
View file @
e8344bb9
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<context:annotation-config
/>
<context:annotation-config
/>
<!-- <import resource="classpath*:applicationContext-db-only-with-emoji.xml"/>-->
<!-- <import resource="classpath*:applicationContext-db-only-with-emoji.xml"/>-->
<import
resource=
"classpath*:applicationContext-sharding-db
-mybatis
.xml"
/>
<import
resource=
"classpath*:applicationContext-sharding-db.xml"
/>
<bean
class=
"com.gic.haoban.common.init.HaobanSqlSessionFactoryBean"
id=
"sqlSessionFactory"
>
<bean
class=
"com.gic.haoban.common.init.HaobanSqlSessionFactoryBean"
id=
"sqlSessionFactory"
>
<property
name=
"dataSource"
ref=
"dataSource"
/>
<property
name=
"dataSource"
ref=
"dataSource"
/>
...
...
haoban-manage3-service/src/main/resources/mapper/content/TabHaobanInteractRecordMapper.xml
View file @
e8344bb9
...
@@ -52,59 +52,10 @@
...
@@ -52,59 +52,10 @@
event_type, duration_time, times, delete_flag, extend_info, create_time, update_time
event_type, duration_time, times, delete_flag, extend_info, create_time, update_time
from tab_haoban_interact_record
from tab_haoban_interact_record
<where>
<where>
<if
test=
"id != null"
>
and id = #{id}
</if>
<if
test=
"enterpriseId != null and enterpriseId != ''"
>
and enterprise_id = #{enterpriseId}
</if>
<if
test=
"memberId != null and memberId != ''"
>
and member_id = #{memberId}
</if>
<if
test=
"unionId != null and unionId != ''"
>
and union_id = #{unionId}
</if>
<if
test=
"clerkId != null and clerkId != ''"
>
<if
test=
"clerkId != null and clerkId != ''"
>
and clerk_id = #{clerkId}
clerk_id = #{clerkId} or member_id = #{clerkId}
</if>
<if
test=
"traceId != null and traceId != ''"
>
and trace_id = #{traceId}
</if>
<if
test=
"bizId != null and bizId != ''"
>
and biz_id = #{bizId}
</if>
<if
test=
"bizType != null"
>
and biz_type = #{bizType}
</if>
<if
test=
"storeId != null and storeId != ''"
>
and store_id = #{storeId}
</if>
<if
test=
"channelSource != null"
>
and channel_source = #{channelSource}
</if>
<if
test=
"eventType != null"
>
and event_type = #{eventType}
</if>
<if
test=
"durationTime != null"
>
and duration_time = #{durationTime}
</if>
<if
test=
"times != null"
>
and times = #{times}
</if>
<if
test=
"deleteFlag != null"
>
and delete_flag = #{deleteFlag}
</if>
<if
test=
"extendInfo != null and extendInfo != ''"
>
and extend_info = #{extendInfo}
</if>
<if
test=
"createTime != null"
>
and create_time = #{createTime}
</if>
<if
test=
"updateTime != null"
>
and update_time = #{updateTime}
</if>
</if>
</where>
</where>
limit #{pageable.offset}, #{pageable.pageSize}
</select>
</select>
<!--统计总行数-->
<!--统计总行数-->
...
...
haoban-manage3-service/src/test/java/MaterialReportServiceTest.java
View file @
e8344bb9
import
com.alibaba.fastjson.JSON
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.manage.api.enums.content.MaterialReportType
;
import
com.gic.haoban.manage.api.enums.content.MaterialReportType
;
import
com.gic.haoban.manage.api.service.content.task.QywxGroupMsgTaskApiService
;
import
com.gic.haoban.manage.api.service.content.task.QywxGroupMsgTaskApiService
;
...
@@ -7,10 +8,12 @@ import com.gic.haoban.manage.service.service.content.MaterialReportService;
...
@@ -7,10 +8,12 @@ import com.gic.haoban.manage.service.service.content.MaterialReportService;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* @Author MUSI
* @Author MUSI
...
@@ -68,6 +71,8 @@ public class MaterialReportServiceTest {
...
@@ -68,6 +71,8 @@ public class MaterialReportServiceTest {
temp
.
setCreateTime
(
new
Date
());
temp
.
setCreateTime
(
new
Date
());
temp
.
setUpdateTime
(
new
Date
());
temp
.
setUpdateTime
(
new
Date
());
temp
.
setBizId
(
UniqueIdUtils
.
uniqueLong
()+
""
);
temp
.
setBizId
(
UniqueIdUtils
.
uniqueLong
()+
""
);
int
insert
=
interactRecordMapper
.
insert
(
temp
);
// int insert = interactRecordMapper.insert(temp);
List
<
TabHaobanInteractRecord
>
tabHaobanInteractRecords
=
interactRecordMapper
.
queryAllByLimit
(
temp
);
System
.
out
.
println
(
JSON
.
toJSONString
(
tabHaobanInteractRecords
));
}
}
}
}
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