Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
KnowledgePlanet
road-map
xfg-frame-archetype-lite
提交
8f7e1057
xfg-frame-archetype-lite
项目概览
KnowledgePlanet
/
road-map
/
xfg-frame-archetype-lite
通知
1355
Star
69
Fork
81
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
xfg-frame-archetype-lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8f7e1057
编写于
3月 11, 2024
作者:
9
90-nk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成Mybatis配置以及Dao层Po层代码编写,完成数据库连接
上级
151bfda1
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
131 addition
and
2 deletion
+131
-2
xfg-frame-archetype-lite-app/src/main/resources/application-dev.yml
...archetype-lite-app/src/main/resources/application-dev.yml
+2
-2
xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/award_mapper.xml
...te-app/src/main/resources/mybatis/mapper/award_mapper.xml
+21
-0
xfg-frame-archetype-lite-app/src/test/java/cn/bugstack/test/AwardDaoTest.java
...lite-app/src/test/java/cn/bugstack/test/AwardDaoTest.java
+29
-0
xfg-frame-archetype-lite-infrastructure/pom.xml
xfg-frame-archetype-lite-infrastructure/pom.xml
+12
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/Strategy.java
...va/cn/bugstack/infrastructure/persistent/po/Strategy.java
+27
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/StrategyAward.java
.../bugstack/infrastructure/persistent/po/StrategyAward.java
+40
-0
未找到文件。
xfg-frame-archetype-lite-app/src/main/resources/application-dev.yml
浏览文件 @
8f7e1057
...
...
@@ -16,8 +16,8 @@ thread:
spring
:
datasource
:
username
:
root
password
:
123456
url
:
jdbc:mysql://1
27.0.0.1:3306/xfg_frame_archetype
?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC&useSSL=true
password
:
root
url
:
jdbc:mysql://1
92.168.119.130/big_market
?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC&useSSL=true
driver-class-name
:
com.mysql.cj.jdbc.Driver
hikari
:
pool-name
:
Retail_HikariCP
...
...
xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/
frame_case
_mapper.xml
→
xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/
award
_mapper.xml
浏览文件 @
8f7e1057
<?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=
"cn.bugstack.infrastructure.persistent.dao.
Xxx
"
>
<mapper
namespace=
"cn.bugstack.infrastructure.persistent.dao.
IAwardDao
"
>
<resultMap
id=
"
CaseMap"
type=
"cn.bugstack.infrastructure.persistent.po.A
"
>
<resultMap
id=
"
dataMap"
type=
"cn.bugstack.infrastructure.persistent.po.Award
"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"award_id"
property=
"awardId"
/>
<result
column=
"award_key"
property=
"awardKey"
/>
<result
column=
"award_config"
property=
"awardConfig"
/>
<result
column=
"award_desc"
property=
"awardDesc"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
</resultMap>
<insert
id=
"insert"
parameterType=
"cn.bugstack.infrastructure.persistent.po.A"
>
INSERT INTO table(a,b,c) VALUES(#{a}, #{b}, #{c})
</insert>
<update
id=
"update"
parameterType=
"cn.bugstack.infrastructure.persistent.po.A"
>
UPDATE table SET a = #{a} WHERE b = #{b}
</update>
<select
id=
"queryEmployeeByEmployNumber"
parameterType=
"java.lang.String"
resultMap=
"CaseMap"
>
SELECT a, b, c
FROM table
WHERE a = #{a}
<select
id=
"queryAwardList"
resultMap=
"dataMap"
>
select award_id, award_key, award_config, award_desc
from award
limit 10
</select>
</mapper>
xfg-frame-archetype-lite-app/src/test/java/cn/bugstack/test/AwardDaoTest.java
0 → 100644
浏览文件 @
8f7e1057
package
cn.bugstack.test
;
import
cn.bugstack.infrastructure.persistent.dao.IAwardDao
;
import
cn.bugstack.infrastructure.persistent.po.Award
;
import
com.alibaba.fastjson2.JSON
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Slf4j
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
AwardDaoTest
{
@Resource
private
IAwardDao
awardDao
;
@Test
public
void
test_queryAwardList
()
{
List
<
Award
>
awards
=
awardDao
.
queryAwardList
();
log
.
info
(
"测试结果:{}"
,
JSON
.
toJSONString
(
awards
));
}
}
\ No newline at end of file
xfg-frame-archetype-lite-infrastructure/pom.xml
浏览文件 @
8f7e1057
...
...
@@ -23,6 +23,18 @@
<groupId>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite-domain
</artifactId>
</dependency>
<dependency>
<groupId>
org.mybatis
</groupId>
<artifactId>
mybatis
</artifactId>
<version>
3.4.6
</version>
</dependency>
<dependency>
<groupId>
org.mybatis
</groupId>
<artifactId>
mybatis-spring
</artifactId>
<version>
1.3.2
</version>
</dependency>
</dependencies>
<build>
...
...
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/Strategy.java
0 → 100644
浏览文件 @
8f7e1057
package
cn.bugstack.infrastructure.persistent.po
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @author Hugohimself
* @description 抽奖策略
*/
@Data
public
class
Strategy
{
/** 自增ID */
private
Long
id
;
/** 抽奖策略ID */
private
Long
strategyId
;
/** 抽奖策略描述 */
private
String
strategyDesc
;
/** 抽奖规则模型 */
private
String
ruleModels
;
/** 创建时间 */
private
Date
createTime
;
/** 更新时间 */
private
Date
updateTime
;
}
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/StrategyAward.java
0 → 100644
浏览文件 @
8f7e1057
package
cn.bugstack.infrastructure.persistent.po
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* @author Hugohimself
* @description 抽奖策略奖品明细配置 - 概率、规则
*/
@Data
public
class
StrategyAward
{
/** 自增ID */
private
Long
id
;
/** 抽奖策略ID */
private
Long
strategyId
;
/** 抽奖奖品ID - 内部流转使用 */
private
Integer
awardId
;
/** 抽奖奖品标题 */
private
String
awardTitle
;
/** 抽奖奖品副标题 */
private
String
awardSubtitle
;
/** 奖品库存总量 */
private
Integer
awardCount
;
/** 奖品库存剩余 */
private
Integer
awardCountSurplus
;
/** 奖品中奖概率 */
private
BigDecimal
awardRate
;
/** 规则模型,rule配置的模型同步到此表,便于使用 */
private
String
ruleModels
;
/** 排序 */
private
Integer
sort
;
/** 创建时间 */
private
Date
createTime
;
/** 修改时间 */
private
Date
updateTime
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录