Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-demo-project
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
gic_demo
gic-demo-project
Commits
b8993768
Commit
b8993768
authored
Jun 21, 2019
by
朱瑞泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码调整
parent
ce495f72
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
1 deletions
+45
-1
DemoEnterpriseMapper.java
...com/gic/demo/project/dao/mapper/DemoEnterpriseMapper.java
+5
-0
TabGicDemoEnterprise.java
...ava/com/gic/demo/project/entity/TabGicDemoEnterprise.java
+1
-1
DemoEnterpriseMapper.xml
...ervice/src/main/resources/mapper/DemoEnterpriseMapper.xml
+19
-0
AppTest.java
gic-demo-project-service/src/test/java/com/gic/AppTest.java
+20
-0
No files found.
gic-demo-project-service/src/main/java/com/gic/demo/project/dao/mapper/DemoEnterpriseMapper.java
View file @
b8993768
package
com
.
gic
.
demo
.
project
.
dao
.
mapper
;
package
com
.
gic
.
demo
.
project
.
dao
.
mapper
;
import
com.gic.demo.project.entity.TabGicDemoEnterprise
;
import
com.gic.demo.project.entity.TabGicDemoEnterprise
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
DemoEnterpriseMapper
{
public
interface
DemoEnterpriseMapper
{
int
deleteByPrimaryKey
(
String
enterpriseId
);
int
deleteByPrimaryKey
(
String
enterpriseId
);
int
insert
(
TabGicDemoEnterprise
record
);
int
insert
(
TabGicDemoEnterprise
record
);
int
insertList
(
@Param
(
"recordList"
)
List
<
TabGicDemoEnterprise
>
recordList
);
int
insertSelective
(
TabGicDemoEnterprise
record
);
int
insertSelective
(
TabGicDemoEnterprise
record
);
TabGicDemoEnterprise
selectByPrimaryKey
(
String
enterpriseId
);
TabGicDemoEnterprise
selectByPrimaryKey
(
String
enterpriseId
);
...
...
gic-demo-project-service/src/main/java/com/gic/demo/project/entity/TabGicDemoEnterprise.java
View file @
b8993768
...
@@ -12,7 +12,7 @@ public class TabGicDemoEnterprise {
...
@@ -12,7 +12,7 @@ public class TabGicDemoEnterprise {
/**
/**
* 企业id
* 企业id
*/
*/
@InjectId
(
InjectId
.
IdType
.
UUID
)
@InjectId
(
InjectId
.
IdType
.
SNOWFLAKE
)
private
String
enterpriseId
;
private
String
enterpriseId
;
/**
/**
...
...
gic-demo-project-service/src/main/resources/mapper/DemoEnterpriseMapper.xml
View file @
b8993768
...
@@ -47,6 +47,25 @@
...
@@ -47,6 +47,25 @@
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}
)
)
</insert>
</insert>
<insert
id=
"insertList"
parameterType=
"list"
>
insert into tab_gic_demo_enterprise (enterprise_id, enterprise_name, enterprise_code,
brand_name, logo_url, enterprise_description,
license_number, country_id, province_id,
city_id, area_id, register_address,
create_time, update_time, status
)
values
<foreach
collection=
"recordList"
item=
"record"
separator=
","
>
(#{record.enterpriseId,jdbcType=CHAR}, #{record.enterpriseName,jdbcType=VARCHAR}, #{record.enterpriseCode,jdbcType=VARCHAR},
#{record.brandName,jdbcType=VARCHAR}, #{record.logoUrl,jdbcType=VARCHAR}, #{record.enterpriseDescription,jdbcType=VARCHAR},
#{record.licenseNumber,jdbcType=VARCHAR}, #{record.countryId,jdbcType=VARCHAR}, #{record.provinceId,jdbcType=VARCHAR},
#{record.cityId,jdbcType=VARCHAR}, #{record.areaId,jdbcType=VARCHAR}, #{record.registerAddress,jdbcType=VARCHAR},
#{record.createTime,jdbcType=TIMESTAMP}, #{record.updateTime,jdbcType=TIMESTAMP}, #{record.status,jdbcType=INTEGER}
)
</foreach>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.demo.project.entity.TabGicDemoEnterprise"
>
<insert
id=
"insertSelective"
parameterType=
"com.gic.demo.project.entity.TabGicDemoEnterprise"
>
insert into tab_gic_demo_enterprise
insert into tab_gic_demo_enterprise
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
gic-demo-project-service/src/test/java/com/gic/AppTest.java
View file @
b8993768
...
@@ -13,6 +13,9 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -13,6 +13,9 @@ import org.springframework.beans.factory.annotation.Autowired;
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.ArrayList
;
import
java.util.List
;
/**
/**
* Unit test for simple App.
* Unit test for simple App.
*/
*/
...
@@ -52,4 +55,21 @@ public class AppTest {
...
@@ -52,4 +55,21 @@ public class AppTest {
}
}
}
}
@Test
public
void
test4
()
{
List
<
TabGicDemoEnterprise
>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
System
.
out
.
println
(
"insert >> "
+
i
);
TabGicDemoEnterprise
enterprise
=
new
TabGicDemoEnterprise
();
list
.
add
(
enterprise
);
if
(
i
%
2
==
0
)
{
enterprise
.
setEnterpriseId
(
RandomStringUtils
.
random
(
20
,
"abcdefghigklmn0123456789"
));
}
enterprise
.
setEnterpriseName
(
RandomStringUtils
.
random
(
10
,
"abcdefghigklmn0123456789"
));
enterprise
.
setStatus
(
1
);
}
enterpriseMapper
.
insertList
(
list
);
System
.
out
.
println
(
JSON
.
toJSONString
(
list
,
true
));
}
}
}
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