diff --git a/src/main/java/cn/chjyj/szwh/bean/AccountRatioDetail.java b/src/main/java/cn/chjyj/szwh/bean/AccountRatioDetail.java
new file mode 100644
index 0000000..6736315
--- /dev/null
+++ b/src/main/java/cn/chjyj/szwh/bean/AccountRatioDetail.java
@@ -0,0 +1,100 @@
+package cn.chjyj.szwh.bean;
+
+import java.math.BigDecimal;
+
+/**
+ * 分账细节
+ */
+public class AccountRatioDetail {
+ /**
+ * account_ratio_detail
+ * id,setting_id as settingId,role_type as roleType,cost_type as costType,calculate,amount,ratio
+ */
+ private Integer id;
+
+ /**
+ * 比例设置ID
+ */
+ private Integer settingId;
+
+ /**
+ * 角色类型;1:委托方;2:购买方;3:平台方
+ */
+ private Integer roleType;
+
+ /**
+ * 费用类型;1:平台服务费用
+ */
+ private Integer costType;
+
+ /**
+ * 计算方式;1:比例;2:固定
+ */
+ private Integer calculate;
+
+ /**
+ * 计算方式为固定时计算额度
+ */
+ private BigDecimal amount;
+
+ /**
+ * 计算方式为比例时计算额度
+ */
+ private BigDecimal ratio;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public Integer getSettingId() {
+ return settingId;
+ }
+
+ public void setSettingId(Integer settingId) {
+ this.settingId = settingId;
+ }
+
+ public Integer getRoleType() {
+ return roleType;
+ }
+
+ public void setRoleType(Integer roleType) {
+ this.roleType = roleType;
+ }
+
+ public Integer getCostType() {
+ return costType;
+ }
+
+ public void setCostType(Integer costType) {
+ this.costType = costType;
+ }
+
+ public Integer getCalculate() {
+ return calculate;
+ }
+
+ public void setCalculate(Integer calculate) {
+ this.calculate = calculate;
+ }
+
+ public BigDecimal getAmount() {
+ return amount;
+ }
+
+ public void setAmount(BigDecimal amount) {
+ this.amount = amount;
+ }
+
+ public BigDecimal getRatio() {
+ return ratio;
+ }
+
+ public void setRatio(BigDecimal ratio) {
+ this.ratio = ratio;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/chjyj/szwh/bean/AccountRatioSetting.java b/src/main/java/cn/chjyj/szwh/bean/AccountRatioSetting.java
new file mode 100644
index 0000000..1c949e4
--- /dev/null
+++ b/src/main/java/cn/chjyj/szwh/bean/AccountRatioSetting.java
@@ -0,0 +1,88 @@
+package cn.chjyj.szwh.bean;
+
+import java.util.Date;
+
+
+/**
+ * 分帐设置
+ */
+public class AccountRatioSetting {
+ /**
+ * account_ratio_setting
+ * id,user_id as userId,rule_name as ruleName,`status` ,is_deleted as isDeleted,createtime
+ */
+ private Integer id;
+
+ /**
+ * 用户ID
+ */
+ private Integer userId;
+
+ /**
+ * 规则名称
+ */
+ private String ruleName;
+
+ /**
+ * 状态;0:禁用;1:启用
+ */
+ private String status;
+
+ /**
+ * 删除;0:否;1:是
+ */
+ private Integer isDeleted;
+
+ /**
+ * 创建时间
+ */
+ private Date createtime;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public Integer getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Integer userId) {
+ this.userId = userId;
+ }
+
+ public String getRuleName() {
+ return ruleName;
+ }
+
+ public void setRuleName(String ruleName) {
+ this.ruleName = ruleName;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public Integer getIsDeleted() {
+ return isDeleted;
+ }
+
+ public void setIsDeleted(Integer isDeleted) {
+ this.isDeleted = isDeleted;
+ }
+
+ public Date getCreatetime() {
+ return createtime;
+ }
+
+ public void setCreatetime(Date createtime) {
+ this.createtime = createtime;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/chjyj/szwh/mapper/AccountRatioDetailMapper.java b/src/main/java/cn/chjyj/szwh/mapper/AccountRatioDetailMapper.java
new file mode 100644
index 0000000..aec0a35
--- /dev/null
+++ b/src/main/java/cn/chjyj/szwh/mapper/AccountRatioDetailMapper.java
@@ -0,0 +1,17 @@
+package cn.chjyj.szwh.mapper;
+
+import cn.chjyj.szwh.bean.AccountRatioDetail;
+import org.springframework.stereotype.Component;
+
+/**
+ * 分账细节
+ */
+@Component
+public interface AccountRatioDetailMapper {
+ /**
+ * 根据id查找
+ * @param id
+ * @return
+ */
+ AccountRatioDetail getAccountRationDetailById(Integer id);
+}
diff --git a/src/main/java/cn/chjyj/szwh/mapper/AccountRatioSettingMapper.java b/src/main/java/cn/chjyj/szwh/mapper/AccountRatioSettingMapper.java
new file mode 100644
index 0000000..084bd0f
--- /dev/null
+++ b/src/main/java/cn/chjyj/szwh/mapper/AccountRatioSettingMapper.java
@@ -0,0 +1,10 @@
+package cn.chjyj.szwh.mapper;
+
+import org.springframework.stereotype.Component;
+
+/**
+ * 分账比例设置
+ */
+@Component
+public interface AccountRatioSettingMapper {
+}
diff --git a/src/main/resources/mapper/szwh/AccountRatioDetailMapper.xml b/src/main/resources/mapper/szwh/AccountRatioDetailMapper.xml
new file mode 100644
index 0000000..ac818cf
--- /dev/null
+++ b/src/main/resources/mapper/szwh/AccountRatioDetailMapper.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+ id,setting_id as settingId,role_type as roleType,cost_type as costType,calculate,amount,ratio
+
+ account_ratio_detail
+
+
+
+
+
+
+
+
+
+
+
+
+ insert into
+
+ (account_name,account_id)
+ values (
+ #{accountName},
+ #{accountId}
+ )
+
+
+
+
+ update
+
+
+
+ account_name=#{accountName},
+
+
+ account_id=#{accountId},
+
+
+ where id=#{id};
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml b/src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml
new file mode 100644
index 0000000..f8fcb5e
--- /dev/null
+++ b/src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+ id,user_id as userId,rule_name as ruleName,`status` ,is_deleted as isDeleted,createtime
+
+ account_ratio_setting
+
+
+
+
+
+
+
+
+
+
+
+
+ insert into
+
+ (account_name,account_id)
+ values (
+ #{accountName},
+ #{accountId}
+ )
+
+
+
+
+ update
+
+
+
+ account_name=#{accountName},
+
+
+ account_id=#{accountId},
+
+
+ where id=#{id};
+
+
+
\ No newline at end of file
diff --git a/src/test/java/cn/chjyj/szwh/mapper/AccountRatioDetailMapperTest.java b/src/test/java/cn/chjyj/szwh/mapper/AccountRatioDetailMapperTest.java
new file mode 100644
index 0000000..c729c4d
--- /dev/null
+++ b/src/test/java/cn/chjyj/szwh/mapper/AccountRatioDetailMapperTest.java
@@ -0,0 +1,23 @@
+package cn.chjyj.szwh.mapper;
+
+import cn.chjyj.szwh.bean.AccountRatioDetail;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@SpringBootTest
+@RunWith(SpringRunner.class)
+public class AccountRatioDetailMapperTest {
+ @Autowired
+ private AccountRatioDetailMapper accountRatioDetailMapper;
+
+ @Test
+ public void getAccountRationDetailById() {
+ int id=1;
+ AccountRatioDetail acd = accountRatioDetailMapper.getAccountRationDetailById(id);
+ System.out.println(acd.getAmount());
+ }
+}
\ No newline at end of file