dcs 1 年之前
父節點
當前提交
c737e180d6

+ 53 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/controller/ClauseController.java

@@ -0,0 +1,53 @@
+package com.bosshand.virgo.api.controller;
+
+import com.bosshand.virgo.api.model.Clause;
+import com.bosshand.virgo.api.service.ClauseService;
+import com.bosshand.virgo.core.response.Response;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping({"clause"})
+@Api(tags = {"服务条款"})
+public class ClauseController {
+
+    @Autowired
+    ClauseService clauseService;
+
+    @ApiOperation("保存")
+    @RequestMapping(value = "", method = RequestMethod.POST)
+    public Response insert(@RequestBody Clause clause) {
+        clauseService.insert(clause);
+        return Response.ok();
+    }
+
+    @ApiOperation("获取")
+    @RequestMapping(value = "/list", method = RequestMethod.POST)
+    public Response getList(@RequestBody Clause clause) {
+        return Response.ok(clauseService.getList(clause));
+    }
+
+    @ApiOperation("更新")
+    @RequestMapping(value = "/update", method = RequestMethod.PUT)
+    public Response update(@RequestBody Clause clause) {
+        clauseService.update(clause);
+        return Response.ok();
+    }
+
+    @ApiOperation("删除")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.DELETE)
+    public Response delete(@PathVariable long id) {
+        clauseService.delete(id);
+        return Response.ok();
+    }
+
+    @ApiOperation("详情")
+    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
+    public Response get(@PathVariable long id) {
+        return Response.ok(clauseService.get(id));
+    }
+
+}
+

+ 35 - 1
virgo.api/src/main/java/com/bosshand/virgo/api/controller/ContractController.java

@@ -2,13 +2,18 @@ package com.bosshand.virgo.api.controller;
 
 
 import com.bosshand.virgo.api.model.Contract;
+import com.bosshand.virgo.api.model.Tag;
 import com.bosshand.virgo.api.service.ContractService;
+import com.bosshand.virgo.api.service.ProjectItemTargetRoomService;
 import com.bosshand.virgo.core.response.Response;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
+import java.util.List;
+
 @RestController
 @RequestMapping({"contract"})
 @Api(tags = {"合同管理"})
@@ -17,6 +22,9 @@ public class ContractController {
     @Autowired
     ContractService contractService;
 
+    @Autowired
+    ProjectItemTargetRoomService projectItemTargetRoomService;
+
     @ApiOperation("保存")
     @RequestMapping(value = "", method = RequestMethod.POST)
     public Response insert(@RequestBody Contract contract) {
@@ -27,7 +35,18 @@ public class ContractController {
     @ApiOperation("获取")
     @RequestMapping(value = "/list", method = RequestMethod.POST)
     public Response getList(@RequestBody Contract contract) {
-        return Response.ok(contractService.getList(contract));
+        List<Contract> list = contractService.getList(contract);
+        List<Tag> tags = new ArrayList<>();
+        for (Contract ct : list) {
+            tags.clear();
+            if (ct.getTagIds() != null) {
+                for (String tagId : ct.getTagIds().split(",")) {
+                    tags.add(projectItemTargetRoomService.getTag(Long.parseLong(tagId)));
+                }
+            }
+            ct.setTagList(tags);
+        }
+        return Response.ok(list);
     }
 
     @ApiOperation("更新")
@@ -44,4 +63,19 @@ public class ContractController {
         return Response.ok();
     }
 
+    @ApiOperation("详情")
+    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
+    public Response get(@PathVariable long id) {
+        Contract contract = contractService.get(id);
+        List<Tag> tags = new ArrayList<>();
+        String tagIds = contract.getTagIds();
+        if (tagIds != null) {
+            for (String tagId : tagIds.split(",")) {
+                tags.add(projectItemTargetRoomService.getTag(Long.parseLong(tagId)));
+            }
+        }
+        contract.setTagList(tags);
+        return Response.ok(contract);
+    }
+
 }

+ 53 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/controller/MerchantController.java

@@ -0,0 +1,53 @@
+package com.bosshand.virgo.api.controller;
+
+
+import com.bosshand.virgo.api.model.Merchant;
+import com.bosshand.virgo.api.service.MerchantService;
+import com.bosshand.virgo.core.response.Response;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping({"Merchant"})
+@Api(tags = {"客商管理"})
+public class MerchantController {
+
+    @Autowired
+    MerchantService merchantService;
+
+    @ApiOperation("保存")
+    @RequestMapping(value = "", method = RequestMethod.POST)
+    public Response insert(@RequestBody Merchant merchant) {
+        merchantService.insert(merchant);
+        return Response.ok();
+    }
+
+    @ApiOperation("获取")
+    @RequestMapping(value = "/list", method = RequestMethod.POST)
+    public Response getList(@RequestBody Merchant merchant) {
+        return Response.ok(merchantService.getList(merchant));
+    }
+
+    @ApiOperation("更新")
+    @RequestMapping(value = "/update", method = RequestMethod.PUT)
+    public Response update(@RequestBody Merchant merchant) {
+        merchantService.update(merchant);
+        return Response.ok();
+    }
+
+    @ApiOperation("删除")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.DELETE)
+    public Response delete(@PathVariable long id) {
+        merchantService.delete(id);
+        return Response.ok();
+    }
+
+    @ApiOperation("详情")
+    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
+    public Response get(@PathVariable long id) {
+        return Response.ok(merchantService.get(id));
+    }
+
+}

+ 20 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/dao/ClauseDao.java

@@ -0,0 +1,20 @@
+package com.bosshand.virgo.api.dao;
+
+import com.bosshand.virgo.api.model.Clause;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface ClauseDao {
+
+    int insert (Clause clause);
+
+    int update(Clause clause);
+
+    int delete(long id);
+
+    List<Clause> getList(Clause clause);
+
+    Clause get(long id);
+}

+ 1 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/dao/ContractDao.java

@@ -16,4 +16,5 @@ public interface ContractDao {
 
     List<Contract> getList(Contract contract);
 
+    Contract get(long id);
 }

+ 21 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/dao/MerchantDao.java

@@ -0,0 +1,21 @@
+package com.bosshand.virgo.api.dao;
+
+import com.bosshand.virgo.api.model.Merchant;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface MerchantDao {
+
+    int insert(Merchant merchant);
+
+    int update(Merchant merchant);
+
+    int delete(long id);
+
+    List<Merchant> getList(Merchant merchant);
+
+    Merchant get(long id);
+
+}

+ 332 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/model/Clause.java

@@ -0,0 +1,332 @@
+package com.bosshand.virgo.api.model;
+
+/**
+ * 服务条款
+ */
+public class Clause {
+
+    private long id;
+
+    /**
+     * 合同id
+     */
+    private long contractId;
+
+    /**
+     * 条款类型
+     */
+    private Integer type;
+
+    /**
+     * 计租方式
+     */
+    private String rentWay;
+
+    /**
+     * 开始时间
+     */
+    private String startTime;
+
+    /**
+     * 结束时间
+     */
+    private String endTime;
+
+    /**
+     * 合同单价
+     */
+    private String unitPrice;
+
+    /**
+     * 付款时间
+     */
+    private String payTime;
+
+    /**
+     * 计费类型
+     */
+    private String chargingType;
+
+    /**
+     * 非整自然月计算方式
+     */
+    private String unnaturalMonthChargingWay;
+
+    /**
+     * 年天數
+     */
+    private String yearDays;
+
+    /**
+     * 付款周期(几月一付)
+     */
+    private String payCycle;
+
+    /**
+     * 租期划分方式
+     */
+    private String leaseTermWay;
+
+    // 保证金条款
+    /**
+     * 保证金类型
+     */
+    private String earnestMoneyType;
+
+    /**
+     * 保证金金额
+     */
+    private String earnestMoney;
+
+    /**
+     * 币种(单位)
+     */
+    private String currencyType;
+
+    //递增条款
+    /**
+     * 递增时间点
+     */
+    private String incrementalTime;
+
+    /**
+     * 单价递增
+     */
+    private String incrementalUnitPrice;
+
+    /**
+     * 保证金递增
+     */
+    private String incrementalEarnestMoney;
+
+    // 优惠条款
+    /**
+     * 优惠类型
+     */
+    private String preferentialType;
+
+    /**
+     * 优惠开始时间
+     */
+    private String preferentialStartTime;
+
+    /**
+     * 优惠结束时间
+     */
+    private String preferentialEndTime;
+
+    /**
+     * 优惠备注
+     */
+    private String preferentialRemark;
+
+    /**
+     * 免租期划分方式
+     */
+    private String preferentialRentFreeWay;
+
+    /**
+     * 自定义字段
+     */
+    private String data;
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public long getContractId() {
+        return contractId;
+    }
+
+    public void setContractId(long contractId) {
+        this.contractId = contractId;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getRentWay() {
+        return rentWay;
+    }
+
+    public void setRentWay(String rentWay) {
+        this.rentWay = rentWay;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getUnitPrice() {
+        return unitPrice;
+    }
+
+    public void setUnitPrice(String unitPrice) {
+        this.unitPrice = unitPrice;
+    }
+
+    public String getPayTime() {
+        return payTime;
+    }
+
+    public void setPayTime(String payTime) {
+        this.payTime = payTime;
+    }
+
+    public String getChargingType() {
+        return chargingType;
+    }
+
+    public void setChargingType(String chargingType) {
+        this.chargingType = chargingType;
+    }
+
+    public String getUnnaturalMonthChargingWay() {
+        return unnaturalMonthChargingWay;
+    }
+
+    public void setUnnaturalMonthChargingWay(String unnaturalMonthChargingWay) {
+        this.unnaturalMonthChargingWay = unnaturalMonthChargingWay;
+    }
+
+    public String getYearDays() {
+        return yearDays;
+    }
+
+    public void setYearDays(String yearDays) {
+        this.yearDays = yearDays;
+    }
+
+    public String getPayCycle() {
+        return payCycle;
+    }
+
+    public void setPayCycle(String payCycle) {
+        this.payCycle = payCycle;
+    }
+
+    public String getLeaseTermWay() {
+        return leaseTermWay;
+    }
+
+    public void setLeaseTermWay(String leaseTermWay) {
+        this.leaseTermWay = leaseTermWay;
+    }
+
+    public String getEarnestMoneyType() {
+        return earnestMoneyType;
+    }
+
+    public void setEarnestMoneyType(String earnestMoneyType) {
+        this.earnestMoneyType = earnestMoneyType;
+    }
+
+    public String getEarnestMoney() {
+        return earnestMoney;
+    }
+
+    public void setEarnestMoney(String earnestMoney) {
+        this.earnestMoney = earnestMoney;
+    }
+
+    public String getCurrencyType() {
+        return currencyType;
+    }
+
+    public void setCurrencyType(String currencyType) {
+        this.currencyType = currencyType;
+    }
+
+    public String getIncrementalTime() {
+        return incrementalTime;
+    }
+
+    public void setIncrementalTime(String incrementalTime) {
+        this.incrementalTime = incrementalTime;
+    }
+
+    public String getIncrementalUnitPrice() {
+        return incrementalUnitPrice;
+    }
+
+    public void setIncrementalUnitPrice(String incrementalUnitPrice) {
+        this.incrementalUnitPrice = incrementalUnitPrice;
+    }
+
+    public String getIncrementalEarnestMoney() {
+        return incrementalEarnestMoney;
+    }
+
+    public void setIncrementalEarnestMoney(String incrementalEarnestMoney) {
+        this.incrementalEarnestMoney = incrementalEarnestMoney;
+    }
+
+    public String getPreferentialType() {
+        return preferentialType;
+    }
+
+    public void setPreferentialType(String preferentialType) {
+        this.preferentialType = preferentialType;
+    }
+
+    public String getPreferentialStartTime() {
+        return preferentialStartTime;
+    }
+
+    public void setPreferentialStartTime(String preferentialStartTime) {
+        this.preferentialStartTime = preferentialStartTime;
+    }
+
+    public String getPreferentialEndTime() {
+        return preferentialEndTime;
+    }
+
+    public void setPreferentialEndTime(String preferentialEndTime) {
+        this.preferentialEndTime = preferentialEndTime;
+    }
+
+    public String getPreferentialRemark() {
+        return preferentialRemark;
+    }
+
+    public void setPreferentialRemark(String preferentialRemark) {
+        this.preferentialRemark = preferentialRemark;
+    }
+
+    public String getPreferentialRentFreeWay() {
+        return preferentialRentFreeWay;
+    }
+
+    public void setPreferentialRentFreeWay(String preferentialRentFreeWay) {
+        this.preferentialRentFreeWay = preferentialRentFreeWay;
+    }
+
+    public String getData() {
+        return data;
+    }
+
+    public void setData(String data) {
+        this.data = data;
+    }
+}

+ 314 - 5
virgo.api/src/main/java/com/bosshand/virgo/api/model/Contract.java

@@ -1,5 +1,10 @@
 package com.bosshand.virgo.api.model;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.util.Date;
+import java.util.List;
+
 /**
  * 合同管理
  */
@@ -7,7 +12,127 @@ public class Contract {
 
     private long id;
 
-    private long projectId;
+    /**
+     * 创建时间
+     */
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createDate;
+
+    // 所属公司信息
+    /**
+     * 组织id
+     */
+    private long organizationId;
+
+    /**
+     * 组织名称
+     */
+    private String organizationName;
+
+    /**
+     * 部门id
+     */
+    private long roleId;
+
+    /**
+     * 部门名称
+     */
+    private String  roleName;
+
+    /**
+     * 招商跟进人
+     */
+    private String investmentPromotion;
+
+    /**
+     * 运营跟进人
+     */
+    private String operator;
+
+    // 租客信息
+    /**
+     * 租客
+     */
+    private String tenant;
+
+    /**
+     * 行业
+     */
+    private String industry;
+
+    /**
+     * 法人
+     */
+    private String corporation;
+
+    /**
+     * 签订人
+     */
+    private String signatory;
+
+    /**
+     * 租客联系人
+     */
+    private String tenantContactPerson;
+
+    // 基本信息
+    /**
+     * 签订日
+     */
+    private String signingDate;
+
+    /**
+     * 开始日
+     */
+    private String startDate;
+
+    /**
+     * 结束日
+     */
+    private String endDate;
+
+    // 滞纳金
+    /**
+     * 起算天数 (天)
+     */
+    private String lateFeesStartingDays;
+
+    /**
+     * 滞纳金比例(%/天)
+     */
+    private String lateFeesProportion;
+
+    /**
+     * 滞纳金上限(%)
+     */
+    private String lateFeesCeiling;
+
+    /**
+     * 标签ids
+     */
+    private String tagIds;
+
+    private List<Tag> tagList;
+
+    /**
+     * 房源ids
+     */
+    private String projectItemTargetRoomIds;
+
+    /**
+     * 附件
+     */
+    private String attachment;
+
+    /**
+     * 文档id
+     */
+    private String documentId;
+
+    /**
+     * 自定义字段
+     */
+    private String data;
 
     public long getId() {
         return id;
@@ -17,11 +142,195 @@ public class Contract {
         this.id = id;
     }
 
-    public long getProjectId() {
-        return projectId;
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    public long getOrganizationId() {
+        return organizationId;
+    }
+
+    public void setOrganizationId(long organizationId) {
+        this.organizationId = organizationId;
+    }
+
+    public String getOrganizationName() {
+        return organizationName;
+    }
+
+    public void setOrganizationName(String organizationName) {
+        this.organizationName = organizationName;
+    }
+
+    public long getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(long roleId) {
+        this.roleId = roleId;
+    }
+
+    public String getRoleName() {
+        return roleName;
+    }
+
+    public void setRoleName(String roleName) {
+        this.roleName = roleName;
+    }
+
+    public String getInvestmentPromotion() {
+        return investmentPromotion;
+    }
+
+    public void setInvestmentPromotion(String investmentPromotion) {
+        this.investmentPromotion = investmentPromotion;
+    }
+
+    public String getOperator() {
+        return operator;
+    }
+
+    public void setOperator(String operator) {
+        this.operator = operator;
+    }
+
+    public String getTenant() {
+        return tenant;
+    }
+
+    public void setTenant(String tenant) {
+        this.tenant = tenant;
+    }
+
+    public String getIndustry() {
+        return industry;
+    }
+
+    public void setIndustry(String industry) {
+        this.industry = industry;
+    }
+
+    public String getCorporation() {
+        return corporation;
+    }
+
+    public void setCorporation(String corporation) {
+        this.corporation = corporation;
+    }
+
+    public String getSignatory() {
+        return signatory;
+    }
+
+    public void setSignatory(String signatory) {
+        this.signatory = signatory;
+    }
+
+    public String getTenantContactPerson() {
+        return tenantContactPerson;
+    }
+
+    public void setTenantContactPerson(String tenantContactPerson) {
+        this.tenantContactPerson = tenantContactPerson;
+    }
+
+    public String getSigningDate() {
+        return signingDate;
+    }
+
+    public void setSigningDate(String signingDate) {
+        this.signingDate = signingDate;
+    }
+
+    public String getStartDate() {
+        return startDate;
+    }
+
+    public void setStartDate(String startDate) {
+        this.startDate = startDate;
+    }
+
+    public String getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(String endDate) {
+        this.endDate = endDate;
+    }
+
+    public String getLateFeesStartingDays() {
+        return lateFeesStartingDays;
+    }
+
+    public void setLateFeesStartingDays(String lateFeesStartingDays) {
+        this.lateFeesStartingDays = lateFeesStartingDays;
+    }
+
+    public String getLateFeesProportion() {
+        return lateFeesProportion;
+    }
+
+    public void setLateFeesProportion(String lateFeesProportion) {
+        this.lateFeesProportion = lateFeesProportion;
+    }
+
+    public String getLateFeesCeiling() {
+        return lateFeesCeiling;
+    }
+
+    public void setLateFeesCeiling(String lateFeesCeiling) {
+        this.lateFeesCeiling = lateFeesCeiling;
+    }
+
+    public String getTagIds() {
+        return tagIds;
+    }
+
+    public void setTagIds(String tagIds) {
+        this.tagIds = tagIds;
+    }
+
+    public List<Tag> getTagList() {
+        return tagList;
+    }
+
+    public void setTagList(List<Tag> tagList) {
+        this.tagList = tagList;
+    }
+
+    public String getProjectItemTargetRoomIds() {
+        return projectItemTargetRoomIds;
+    }
+
+    public void setProjectItemTargetRoomIds(String projectItemTargetRoomIds) {
+        this.projectItemTargetRoomIds = projectItemTargetRoomIds;
+    }
+
+    public String getAttachment() {
+        return attachment;
+    }
+
+    public void setAttachment(String attachment) {
+        this.attachment = attachment;
+    }
+
+    public String getDocumentId() {
+        return documentId;
+    }
+
+    public void setDocumentId(String documentId) {
+        this.documentId = documentId;
+    }
+
+    public String getData() {
+        return data;
     }
 
-    public void setProjectId(long projectId) {
-        this.projectId = projectId;
+    public void setData(String data) {
+        this.data = data;
     }
 }

+ 121 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/model/Merchant.java

@@ -0,0 +1,121 @@
+package com.bosshand.virgo.api.model;
+
+/**
+ * 客商管理
+ */
+public class Merchant {
+
+    private long id;
+
+    /**
+     * 组织id
+     */
+    private long organizationId;
+
+    /**
+     * 行业分类
+     */
+    private String industryType;
+
+    /**
+     * 企业名称
+     */
+    private String name;
+
+    /**
+     * 法人
+     */
+    private String legalPerson;
+
+    /**
+     * 成立日期
+     */
+    private String establishDate;
+
+    /**
+     * 营业期限
+     */
+    private String businessTerm;
+
+    /**
+     * 注册资本
+     */
+    private String registeredCapital;
+
+    /**
+     * 自定义字段
+     */
+    private String data;
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public long getOrganizationId() {
+        return organizationId;
+    }
+
+    public void setOrganizationId(long organizationId) {
+        this.organizationId = organizationId;
+    }
+
+    public String getIndustryType() {
+        return industryType;
+    }
+
+    public void setIndustryType(String industryType) {
+        this.industryType = industryType;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getLegalPerson() {
+        return legalPerson;
+    }
+
+    public void setLegalPerson(String legalPerson) {
+        this.legalPerson = legalPerson;
+    }
+
+    public String getEstablishDate() {
+        return establishDate;
+    }
+
+    public void setEstablishDate(String establishDate) {
+        this.establishDate = establishDate;
+    }
+
+    public String getBusinessTerm() {
+        return businessTerm;
+    }
+
+    public void setBusinessTerm(String businessTerm) {
+        this.businessTerm = businessTerm;
+    }
+
+    public String getRegisteredCapital() {
+        return registeredCapital;
+    }
+
+    public void setRegisteredCapital(String registeredCapital) {
+        this.registeredCapital = registeredCapital;
+    }
+
+    public String getData() {
+        return data;
+    }
+
+    public void setData(String data) {
+        this.data = data;
+    }
+}

+ 36 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/service/ClauseService.java

@@ -0,0 +1,36 @@
+package com.bosshand.virgo.api.service;
+
+import com.bosshand.virgo.api.dao.ClauseDao;
+import com.bosshand.virgo.api.model.Clause;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class ClauseService {
+
+    @Autowired
+    private ClauseDao clauseDao;
+
+    public int insert (Clause clause){
+        return clauseDao.insert(clause);
+    }
+
+    public int update(Clause clause){
+        return clauseDao.update(clause);
+    }
+
+    public int delete(long id){
+        return clauseDao.delete(id);
+    }
+
+    public List<Clause> getList(Clause clause){
+        return clauseDao.getList(clause);
+    }
+
+    public Clause get(long id) {
+        return clauseDao.get(id);
+    }
+
+}

+ 3 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/service/ContractService.java

@@ -29,4 +29,7 @@ public class ContractService {
         return contractDao.getList(contract);
     }
 
+    public Contract get(long id) {
+        return contractDao.get(id);
+    }
 }

+ 36 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/service/MerchantService.java

@@ -0,0 +1,36 @@
+package com.bosshand.virgo.api.service;
+
+import com.bosshand.virgo.api.dao.MerchantDao;
+import com.bosshand.virgo.api.model.Merchant;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class MerchantService {
+
+    @Autowired
+    private MerchantDao merchantDao;
+
+    public int insert(Merchant merchant) {
+        return merchantDao.insert(merchant);
+    }
+
+    public int update(Merchant merchant) {
+        return merchantDao.update(merchant);
+    }
+
+    public int delete(long id) {
+        return merchantDao.delete(id);
+    }
+
+    public List<Merchant> getList(Merchant merchant) {
+        return merchantDao.getList(merchant);
+    }
+
+    public Merchant get(long id) {
+        return merchantDao.get(id);
+    }
+
+}

+ 113 - 0
virgo.api/src/main/resources/mapper/ClauseMapper.xml

@@ -0,0 +1,113 @@
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.bosshand.virgo.api.dao.ClauseDao">
+
+    <resultMap type="com.bosshand.virgo.api.model.Clause" id="clauseResult">
+        <id column="id" property="id"/>
+        <result column="contractId" property="contractId"/>
+        <result column="type" property="type"/>
+        <result column="rentWay" property="rentWay"/>
+        <result column="startTime" property="startTime"/>
+        <result column="endTime" property="endTime"/>
+        <result column="unitPrice" property="unitPrice"/>
+        <result column="payTime" property="payTime"/>
+        <result column="chargingType" property="chargingType"/>
+        <result column="unnaturalMonthChargingWay" property="unnaturalMonthChargingWay"/>
+        <result column="yearDays" property="yearDays"/>
+        <result column="payCycle" property="payCycle"/>
+        <result column="leaseTermWay" property="leaseTermWay"/>
+        <result column="earnestMoneyType" property="earnestMoneyType"/>
+        <result column="earnestMoney" property="earnestMoney"/>
+        <result column="currencyType" property="currencyType"/>
+        <result column="incrementalTime" property="incrementalTime"/>
+        <result column="incrementalUnitPrice" property="incrementalUnitPrice"/>
+        <result column="incrementalEarnestMoney" property="incrementalEarnestMoney"/>
+        <result column="preferentialType" property="preferentialType"/>
+        <result column="preferentialStartTime" property="preferentialStartTime"/>
+        <result column="preferentialEndTime" property="preferentialEndTime"/>
+        <result column="preferentialRemark" property="preferentialRemark"/>
+        <result column="preferentialRentFreeWay" property="preferentialRentFreeWay"/>
+        <result column="data" property="data"/>
+    </resultMap>
+
+    <insert id="insert" parameterType="com.bosshand.virgo.api.model.Clause" useGeneratedKeys="true" keyProperty="id">
+        INSERT INTO clause(`contractId`, `type`, `rentWay`, `startTime`, `endTime`, `unitPrice`, `payTime`, `chargingType`, `unnaturalMonthChargingWay`,
+                           `yearDays`, `payCycle`, `leaseTermWay`, `earnestMoneyType`, `earnestMoney`, `currencyType`, `incrementalTime`, `incrementalUnitPrice`,
+                           `incrementalEarnestMoney`, `preferentialType`, `preferentialStartTime`, `preferentialEndTime`, `preferentialRemark`, `preferentialRentFreeWay`, `data`)
+        VALUES (#{contractId}, #{type}, #{rentWay}, #{startTime}, #{endTime}, #{unitPrice}, #{payTime}, #{chargingType}, #{unnaturalMonthChargingWay},
+                #{yearDays}, #{payCycle}, #{leaseTermWay}, #{earnestMoneyType}, #{earnestMoney}, #{currencyType}, #{incrementalTime}, #{incrementalUnitPrice},
+                #{incrementalEarnestMoney}, #{preferentialType}, #{preferentialStartTime}, #{preferentialEndTime}, #{preferentialRemark}, #{preferentialRentFreeWay}, #{data})
+    </insert>
+
+    <delete id="delete">
+        DELETE from clause where id=#{id}
+    </delete>
+
+    <update id="update" parameterType="com.bosshand.virgo.api.model.Clause">
+        UPDATE clause
+        <trim prefix="set" suffixOverrides=",">
+            <if test="contractId!=0">contractId=#{contractId},</if>
+            <if test="type!=null">type=#{type},</if>
+            <if test="rentWay!=null">rentWay=#{rentWay},</if>
+            <if test="startTime!=null">startTime=#{startTime},</if>
+            <if test="endTime!=null">endTime=#{endTime},</if>
+            <if test="unitPrice!=null">unitPrice=#{unitPrice},</if>
+            <if test="payTime!=null">payTime=#{payTime},</if>
+            <if test="chargingType!=null">chargingType=#{chargingType},</if>
+            <if test="unnaturalMonthChargingWay!=null">unnaturalMonthChargingWay=#{unnaturalMonthChargingWay},</if>
+            <if test="yearDays!=null">yearDays=#{yearDays},</if>
+            <if test="payCycle!=null">payCycle=#{payCycle},</if>
+            <if test="leaseTermWay!=null">leaseTermWay=#{leaseTermWay},</if>
+            <if test="earnestMoneyType!=null">earnestMoneyType=#{earnestMoneyType},</if>
+            <if test="earnestMoney!=null">earnestMoney=#{earnestMoney},</if>
+            <if test="currencyType!=null">currencyType=#{currencyType},</if>
+            <if test="incrementalTime!=null">incrementalTime=#{incrementalTime},</if>
+            <if test="incrementalUnitPrice!=null">incrementalUnitPrice=#{incrementalUnitPrice},</if>
+            <if test="incrementalEarnestMoney!=null">incrementalEarnestMoney=#{incrementalEarnestMoney},</if>
+            <if test="preferentialType!=null">preferentialType=#{preferentialType},</if>
+            <if test="preferentialStartTime!=null">preferentialStartTime=#{preferentialStartTime},</if>
+            <if test="preferentialEndTime!=null">preferentialEndTime=#{preferentialEndTime},</if>
+            <if test="preferentialRemark!=null">preferentialRemark=#{preferentialRemark},</if>
+            <if test="preferentialRentFreeWay!=null">preferentialRentFreeWay=#{preferentialRentFreeWay},</if>
+            <if test="data!=null">data=#{data},</if>
+        </trim>
+        WHERE id=#{id}
+    </update>
+
+    <select id="get" resultMap="clauseResult">
+        SELECT * FROM clause where id = #{id}
+    </select>
+
+    <select id="getList" resultMap="clauseResult">
+        SELECT * FROM clause
+        <where>
+            <if test="contractId!=0">and contractId=#{contractId}</if>
+            <if test="type!=null">and type=#{type}</if>
+            <if test="rentWay!=null">and rentWay=#{rentWay}</if>
+            <if test="startTime!=null">and startTime=#{startTime}</if>
+            <if test="endTime!=null">and endTime=#{endTime}</if>
+            <if test="unitPrice!=null">and unitPrice=#{unitPrice}</if>
+            <if test="payTime!=null">and payTime=#{payTime}</if>
+            <if test="chargingType!=null">and chargingType=#{chargingType}</if>
+            <if test="unnaturalMonthChargingWay!=null">and unnaturalMonthChargingWay=#{unnaturalMonthChargingWay}</if>
+            <if test="yearDays!=null">and yearDays=#{yearDays}</if>
+            <if test="payCycle!=null">and payCycle=#{payCycle}</if>
+            <if test="leaseTermWay!=null">and leaseTermWay=#{leaseTermWay}</if>
+            <if test="earnestMoneyType!=null">and earnestMoneyType=#{earnestMoneyType}</if>
+            <if test="earnestMoney!=null">and earnestMoney=#{earnestMoney}</if>
+            <if test="currencyType!=null">and currencyType=#{currencyType}</if>
+            <if test="incrementalTime!=null">and incrementalTime=#{incrementalTime}</if>
+            <if test="incrementalUnitPrice!=null">and incrementalUnitPrice=#{incrementalUnitPrice}</if>
+            <if test="incrementalEarnestMoney!=null">and incrementalEarnestMoney=#{incrementalEarnestMoney}</if>
+            <if test="preferentialType!=null">and preferentialType=#{preferentialType}</if>
+            <if test="preferentialStartTime!=null">and preferentialStartTime=#{preferentialStartTime}</if>
+            <if test="preferentialEndTime!=null">and preferentialEndTime=#{preferentialEndTime}</if>
+            <if test="preferentialRemark!=null">and preferentialRemark=#{preferentialRemark}</if>
+            <if test="preferentialRentFreeWay!=null">and preferentialRentFreeWay=#{preferentialRentFreeWay}</if>
+            <if test="data!=null">and data=#{data}</if>
+        </where>
+    </select>
+
+</mapper>

+ 78 - 8
virgo.api/src/main/resources/mapper/ContractMapper.xml

@@ -6,11 +6,38 @@
 
     <resultMap type="com.bosshand.virgo.api.model.Contract" id="contractResult">
         <id column="id" property="id"/>
-        <result column="projectId" property="projectId"/>
+        <result column="createDate" property="createDate"/>
+        <result column="organizationId" property="organizationId"/>
+        <result column="organizationName" property="organizationName"/>
+        <result column="roleId" property="roleId"/>
+        <result column="roleName" property="roleName"/>
+        <result column="investmentPromotion" property="investmentPromotion"/>
+        <result column="operator" property="operator"/>
+        <result column="tenant" property="tenant"/>
+        <result column="industry" property="industry"/>
+        <result column="corporation" property="corporation"/>
+        <result column="signatory" property="signatory"/>
+        <result column="tenantContactPerson" property="tenantContactPerson"/>
+        <result column="signingDate" property="signingDate"/>
+        <result column="startDate" property="startDate"/>
+        <result column="endDate" property="endDate"/>
+        <result column="lateFeesStartingDays" property="lateFeesStartingDays"/>
+        <result column="lateFeesProportion" property="lateFeesProportion"/>
+        <result column="lateFeesCeiling" property="lateFeesCeiling"/>
+        <result column="tagIds" property="tagIds"/>
+        <result column="projectItemTargetRoomIds" property="projectItemTargetRoomIds"/>
+        <result column="attachment" property="attachment"/>
+        <result column="documentId" property="documentId"/>
+        <result column="data" property="data"/>
     </resultMap>
 
     <insert id="insert" parameterType="com.bosshand.virgo.api.model.Contract" useGeneratedKeys="true" keyProperty="id">
-        INSERT INTO contract(projectId) VALUES (#{projectId})
+        INSERT INTO contract(`createDate`, `organizationId`, `organizationName`, `roleId`, `roleName`, `investmentPromotion`, `operator`,
+                             `tenant`, `industry`, `corporation`, `signatory`, `tenantContactPerson`, `signingDate`, `startDate`, `endDate`,
+                             `lateFeesStartingDays`, `lateFeesProportion`, `lateFeesCeiling`, `tagIds`, `projectItemTargetRoomIds`, `attachment`, `documentId`, `data`)
+        VALUES (now(), #{organizationId}, #{organizationName}, #{roleId}, #{roleName}, #{investmentPromotion}, #{operator}, #{tenant},
+                #{industry}, #{corporation}, #{signatory}, #{tenantContactPerson}, #{signingDate}, #{startDate}, #{endDate}, #{lateFeesStartingDays},
+                #{lateFeesProportion}, #{lateFeesCeiling}, #{tagIds}, #{projectItemTargetRoomIds}, #{attachment}, #{documentId}, #{data})
     </insert>
 
     <delete id="delete">
@@ -20,20 +47,63 @@
     <update id="update" parameterType="com.bosshand.virgo.api.model.Contract">
         UPDATE contract
         <trim prefix="set" suffixOverrides=",">
-            <if test="projectId!=0">projectId=#{projectId},</if>
+            <if test="organizationId!=0">organizationId=#{organizationId},</if>
+            <if test="organizationName!=null">organizationName=#{organizationName},</if>
+            <if test="roleId!=0">roleId=#{roleId},</if>
+            <if test="investmentPromotion!=null">investmentPromotion=#{investmentPromotion},</if>
+            <if test="operator!=null">operator=#{operator},</if>
+            <if test="tenant!=null">tenant=#{tenant},</if>
+            <if test="industry!=null">industry=#{industry},</if>
+            <if test="corporation!=null">corporation=#{corporation},</if>
+            <if test="signatory!=null">signatory=#{signatory},</if>
+            <if test="tenantContactPerson!=null">tenantContactPerson=#{tenantContactPerson},</if>
+            <if test="signingDate!=null">signingDate=#{signingDate},</if>
+            <if test="startDate!=null">startDate=#{startDate},</if>
+            <if test="endDate!=null">endDate=#{endDate},</if>
+            <if test="lateFeesStartingDays!=null">lateFeesStartingDays=#{lateFeesStartingDays},</if>
+            <if test="lateFeesProportion!=null">lateFeesProportion=#{lateFeesProportion},</if>
+            <if test="lateFeesCeiling!=null">lateFeesCeiling=#{lateFeesCeiling},</if>
+            <if test="tagIds!=null">tagIds=#{tagIds},</if>
+            <if test="projectItemTargetRoomIds!=null">projectItemTargetRoomIds=#{projectItemTargetRoomIds},</if>
+            <if test="attachment!=null">attachment=#{attachment},</if>
+            <if test="documentId!=0">documentId=#{documentId},</if>
+            <if test="data!=null">data=#{data},</if>
         </trim>
         WHERE id=#{id}
     </update>
 
+    <select id="get" resultMap="contractResult">
+        SELECT * FROM contract where id = #{id}
+    </select>
+
     <select id="getList" resultMap="contractResult">
         SELECT * FROM contract
         <where>
-            <if test="id != 0">
-                and id = #{id}
-            </if>
-            <if test="projectId != 0">
-                and projectId = #{projectId}
+            <if test="organizationId!=0">and organizationId=#{organizationId}</if>
+            <if test="organizationName!=null">and organizationName=#{organizationName}</if>
+            <if test="roleId!=0">and roleId=#{roleId}</if>
+            <if test="investmentPromotion!=null">and investmentPromotion=#{investmentPromotion}</if>
+            <if test="operator!=null">and operator=#{operator}</if>
+            <if test="tenant!=null">and tenant=#{tenant}</if>
+            <if test="industry!=null">and industry=#{industry}</if>
+            <if test="corporation!=null">and corporation=#{corporation}</if>
+            <if test="signatory!=null">and signatory=#{signatory}</if>
+            <if test="tenantContactPerson!=null">and tenantContactPerson=#{tenantContactPerson}</if>
+            <if test="signingDate!=null">and signingDate=#{signingDate}</if>
+            <if test="startDate!=null">and startDate=#{startDate}</if>
+            <if test="endDate!=null">and endDate=#{endDate}</if>
+            <if test="lateFeesStartingDays!=null">and lateFeesStartingDays=#{lateFeesStartingDays}</if>
+            <if test="lateFeesProportion!=null">and lateFeesProportion=#{lateFeesProportion}</if>
+            <if test="lateFeesCeiling!=null">and lateFeesCeiling=#{lateFeesCeiling}</if>
+            <if test="tagIds != null">and
+                <foreach item="tagId" collection="tagIds.split(',')" open="(" separator=" and " close=")">
+                    FIND_IN_SET (#{tagId}, tagIds)
+                </foreach>
             </if>
+            <if test="projectItemTargetRoomIds!=null">and projectItemTargetRoomIds=#{projectItemTargetRoomIds}</if>
+            <if test="attachment!=null">and attachment=#{attachment}</if>
+            <if test="documentId!=0">and documentId=#{documentId}</if>
+            <if test="data!=null">and data=#{data}</if>
         </where>
     </select>
 

+ 61 - 0
virgo.api/src/main/resources/mapper/MerchantMapper.xml

@@ -0,0 +1,61 @@
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.bosshand.virgo.api.dao.MerchantDao">
+
+    <resultMap type="com.bosshand.virgo.api.model.Merchant" id="merchantResult">
+        <id column="id" property="id"/>
+        <result column="organizationId" property="organizationId"/>
+        <result column="industryType" property="industryType"/>
+        <result column="name" property="name"/>
+        <result column="legalPerson" property="legalPerson"/>
+        <result column="establishDate" property="establishDate"/>
+        <result column="businessTerm" property="businessTerm"/>
+        <result column="registeredCapital" property="registeredCapital"/>
+        <result column="data" property="data"/>
+    </resultMap>
+
+    <insert id="insert" parameterType="com.bosshand.virgo.api.model.Merchant" useGeneratedKeys="true" keyProperty="id">
+        INSERT INTO merchant(`organizationId`, `industryType`, `name`, `legalPerson`, `establishDate`, `businessTerm`, `registeredCapital`, `data`)
+        VALUES (#{organizationId}, #{industryType}, #{name}, #{legalPerson}, #{establishDate}, #{businessTerm}, #{registeredCapital}, #{data})
+    </insert>
+
+    <delete id="delete">
+        DELETE from merchant where id=#{id}
+    </delete>
+
+    <update id="update" parameterType="com.bosshand.virgo.api.model.Merchant">
+        UPDATE merchant
+        <trim prefix="set" suffixOverrides=",">
+            <if test="organizationId!=0">organizationId=#{organizationId},</if>
+            <if test="industryType!=null">industryType=#{industryType},</if>
+            <if test="name!=null">name=#{name},</if>
+            <if test="legalPerson!=null">legalPerson=#{legalPerson},</if>
+            <if test="establishDate!=null">establishDate=#{establishDate},</if>
+            <if test="businessTerm!=null">businessTerm=#{businessTerm},</if>
+            <if test="registeredCapital!=null">registeredCapital=#{registeredCapital},</if>
+            <if test="data!=null">data=#{data},</if>
+        </trim>
+        WHERE id=#{id}
+    </update>
+
+    <select id="get" resultMap="merchantResult">
+        SELECT * FROM merchant where id = #{id}
+    </select>
+
+    <select id="getList" resultMap="merchantResult">
+        SELECT * FROM merchant
+        <where>
+            <if test="organizationId!=0">and organizationId=#{organizationId}</if>
+            <if test="industryType!=null">and industryType=#{industryType}</if>
+            <if test="name!=null">and name=#{name},</if>
+            <if test="legalPerson!=null">and legalPerson=#{legalPerson}</if>
+            <if test="establishDate!=null">and establishDate=#{establishDate}</if>
+            <if test="businessTerm!=null">and businessTerm=#{businessTerm}</if>
+            <if test="registeredCapital!=null">and registeredCapital=#{registeredCapital}</if>
+            <if test="data!=null">and data=#{data},</if>
+        </where>
+    </select>
+
+</mapper>